Deferred shading rendering system is what the system that I integrated and used as the main building block for my “RealKo Engine”.
Okay, just go straight to what I want to say now.
I have found the problem of lighting when I used deferred shading as the rendering system. I knew that all the geometry information is written to the rendertarget before any lighting calculation can take place. This concern didn’t not come to be realized when that time I am doing this, haha.
For what I want to say is that, when that time comes, the time that you want to lit the object, and select some objects not to be lit as well, how can we do it in the deferred shading, as the lighting calculation is the last pass.
Ohh, as I said above, it just comes to be relized at very late. You also need to store the information in the pre-pass, that tell the deferred shading about what pixel gonna be lit, and not to be lit => I called it “LightOcclusion”.
At very first my GBuffer layout has only 3 render targets (the same approach as Catalin Zima provided in http://www.ziggyware.com/readarticle.php?article_id=155), when I found this problem, that forces me to add in another render target. Also I have designed my each of rendertarget to contain 32 bit (RGBA), when combined all the 4, with the resolution of 1280 * 1024, I come across at exactly 20 MB (in fact should be added with another related issue too, such as Depth Buffer). That’s not quite high so far, because I have seen the one implemented in KillZone, it’s about 36 MB, so I think to myself, okay as long as we are low enough on size, we might get the speed with some close enough quality of graphics (as far as I concern, I think I come to the right track).
So by adding another rendertarget into use, I have increased it more 5 MB. The overhead of buffer need to be transfer and read/write is the big problem in deferred shading, but as long as your graphics card has enough bandwidth, that’s not gonna be a problem, as for me, GTX 275 is the beast!!!
Okay, enough for now, I will updated along when I have done some important component of the engine in the upcoming week.
Last word for today, do not forget about lightOcclusion in deferred shading. (I can’t think of other solution to not lit some objects in the world by not use lightOcclusion, if you know some alternative just let me know here, it will be appreciated.)


If you want an object to be unlit in a deferred shading system, you can write zeros to the diffuse and specular channels. The object will appear black, as if it reflected no light at all (or being in an environment with no lights).
If you want an object to use a lighting system separately from everything else, you can then render it again in the same pass as your lights, before enabling the additive blending. This essentially means that the object is producing its own light.
Thanks for your solution Matt,
in my case, i also want to show the final color of the object’s own diffuse texture, but it must not be affected by any other light, so only its own color is the final result. If I change the diffuse to black, my skydome will appear with no color.
In fact I separate all the lights affect to the objects in the world.
But you know that, you are triggerring me up about change the object to completely black, as I have completely unaware of the direct way to do it with diffuse, how can I forget that!!. Maybe I focus too much about light source.
Anyway thanks for your coming by my blog.
Thanks much for article. It’s very good read.
I enjoy to browse haxpor.org.
apple valley teeth whitening
Damn, that sound’s so easy if you think about it.