forward rendering and multiple shadow maps

Posted by Irbis on Game Development See other posts from Game Development or by Irbis
Published on 2012-10-26T15:40:04Z Indexed on 2012/10/26 17:21 UTC
Read the original article Hit count: 202

Filed under:
|
|

I have two light sources on my scene. I created two fbo's which store depth textures for these lights. A render loop looks like this:

bind fbo1
save depth values for first light 
unbind fbo1

bind fbo2
save depth values for second light
unbind fbo2

enable additive blending

bind first depth texture
render scene
bind second depth texture
render scene

disable additive blending

For one light source the program works fine. For many light sources I use an additive blending to acumulate lighting results but then some objects become transparent (for example when an object which is further away from the camera is drawn before an object which is closer to the camera). How to resolve that problem ? How should I accumulate lighting effects for many light sources (many shadow maps) ? P.S. I use OpenGL/GLSL 3.3+

© Game Development or respective owner

Related posts about opengl

Related posts about lighting