Here’s another neat rendering technique. This one is called Deferred shading. The idea with this one is that instead of rendering and calculating lights while you rendering your geometry; instead, you render out relevant spacial information about the geometry to the Render TOP. For example you output the position, the normal, the UV, the shininess of the material, the diffuse color of the material to the Render TOP instead. You do this using floating point color buffers, and multiple render targets. (since a single color buffer can’t hold all of this information)
Then using this information you can apply a light to the scene as a post process. The benefits of this are:
- There is no limitation (except for speed) of the number of lights you can use. In a normal render you’d be limited to 3-7 lights (depending if they are point or spot lights).
- Greatly increasing the geometry in the scene will still result in the exact same lighting cost as simple geometry. This is because the light cost is calculated by ((widthheightcomplexity of light shader) in this technique. Adding more geometry to the scene doesn’t change any of those values. The technique is particularly useful in scenes with a large amount of overdraw (look into the wiki for an article on overdraw).
It’s use is of course situational, but a useful idea to have in your pocket in case the need arises.
DeferredShading.toe (6.15 KB)