I am following this great tutorial but I have many questions.

Let's see if I understand the basic idea.

1. I must create the same number of FBOs that lights (maximum 8).
2. I must create the same number of depth textures (shadow maps) that FBOs.
3. For every FBO I must perform offscreen render (render to texture, drawing the scene from the point of view of each of the lights, maximum 8 times).

Is this correct or can I use just a texture with multiple FBOs, or fbo with various textures or how?

Assuming you use the idea above, how should the final render of the scene?

  //Draw Escene?

  //Draw Escene?

  //Draw Escene?


Is this okay? I think not, because it uses a lot of resources and the scene would have to be drawn up to 7 times. (One per light source and shadow mapping).

Well but then how should the render scene with multiple light sources and shadows?

  • \$\begingroup\$ It would be clearer to limit questions to one at a time. \$\endgroup\$ – Anko Mar 23 '14 at 13:00

In a forward a rendering approach (aka the built-in simple methods like you describe), it is correct to say that the scene must be rendered once per light.

To achieve better performance with multiple lights, you need to use specialized rendering approaches via shaders that can accumulate multiple lights in one pass. The most popular of these techniques is Deferred Rendering, but there are some other less popular approaches as well.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.