There's a quick summary of deferred renderers here: http://developer.amd.com/gpu_assets/Deferred Shading Optimizations.pps
I disagree that "light pre-pass" allows more material variety - in fact it's just the opposite. The "pre-pass" requires refactoring your BRDFs into separate diffuse and specular components and although you can vary how you combine these, that's rarely useful; all useful variation happens in the computation of those two components themselves, or not even splitting up the BRDF like that at all.You can always choose deferred light pre-pass rendering as an alternative which would also allow for more material variety.
You can always choose deferred light pre-pass rendering as an alternative which would also allow for more material variety. Can anyone point out the pro/con features of going fully deferred vs. light pre-pass?). I personally get the impression that light pre-pass is easier to implement across multiple platforms (GTA4/RDR, Dead Space 2, Crysis 2) or even on the 360 (Halo Reach) - but there must be some disadvantages too.
There's a quick summary of deferred renderers here: http://developer.amd.com/gpu_assets/Deferred Shading Optimizations.pps
So basically light pre-pass is actually more expensive than fully deferred (due to the second geometry pass), but fully deferred shading requires more memory for the buffers?
Right. Simply put, LPP adds an extra big constant cost (retransforming/rasterizing the scene) but pays a slightly smaller incremental bandwidth cost per light. Thus if you have enough overlapping lights, LPP will win by a small constant factor, but they both scale the same. In reality, LPP is mostly to work around hardware constraints like slow MRT, etc.For scenes with few overlapping lights, yeah. Once you ramp up the number of lights in the scene, LPP or fully deferred may even end up with similar frame times as the bottleneck shifts.
I disagree that "light pre-pass" allows more material variety - in fact it's just the opposite. The "pre-pass" requires refactoring your BRDFs into separate diffuse and specular components and although you can vary how you combine these, that's rarely useful; all useful variation happens in the computation of those two components themselves, or not even splitting up the BRDF like that at all.
You can also do single pass light prepass (I thought Crysis 2 also does this). Just render all your MRTs in your geometry pass. This pass is basically the same as the fully deferred pass, but after the first pass, you need to sample one texture less in your lighting shader (color is not needed). So you will gain a bit performance if you have high light overlap. The only downside is that you need to sample the lighting buffer after you have rendered all your (local) light sources and do the rest of the light equation. Usually this doesn't add any draw calls or full screen passes, since you'll likely apply full screen sunlight and ambient at some point. So the extra cost in really minimal (just one extra tfetch basically).Right. Simply put, LPP adds an extra big constant cost (retransforming/rasterizing the scene) but pays a slightly smaller incremental bandwidth cost per light. Thus if you have enough overlapping lights, LPP will win by a small constant factor, but they both scale the same. In reality, LPP is mostly to work around hardware constraints like slow MRT, etc.
And again, tiled like BF3 is doing is far better than both.
On 360 I could certainly see more G-buffer parameters being impractical, but moving forward I don't think there's going to be a significant issue. Particularly with tiled techniques you touch your G-buffer a very small number of times (even once), so storing quite a lot of parameters in there is not a big deal.We're about to ship a Xbox 360 titles with a light pre-pass renderer. We use it to have significantly different shading on characters, with more texture maps (e.g. a fake SSS map, a material map switching between skin/cloth/metal shading, a separate environment map mask), and a significantly heavier shader (said skin/cloth/metal splitting, more physically correct specular, custom character lighting etc.). Deferring all this additional attributes to G-buffer channels, and running the heavier shader over the entire screen would be impractical, and now that we're trying to go towards fully deferred (TBH, we're first trying the single-pass LPP variation), we have trouble replicating that functionality.
Yup that's the variant that I showed in my Beyond Programmable Shading slides - indeed it can be slightly faster for lots of overlapping lights, but it scales similarly. Given that if anything it restricts your options a little bit on BRDFs as I argued above, I'm not sure it's really worth it, but to each his own.You can also do single pass light prepass (I thought Crysis 2 also does this). Just render all your MRTs in your geometry pass.
If you have uniquely mapped virtual texturing everywhere and world space normals stored in the virtual texture, your g-buffer can just save the uv to the VT cache. A single 16-16 integer g-buffer is enough for that (in addition to your z-buffer), since caches are no larger than 4096x4096 (in all current virtual textured engines).Depending on the particular parameters you can sometimes just store a material index for indirection into a parameter buffer, or if they really are all interpolated vertex params or similar you can just pay the cost and store them with the knowledge that you'll only sample them for pixels that actually use the "heavy" material (assuming decent branching, which is admittedly not guaranteed on current gen consoles).