Jump to content
  • Advertisement

OpenGL FrameBuffer / Multi light

Recommended Posts

On 12/2/2018 at 6:18 AM, ccel said:


The tutorial can be tweaked to greatly increase the number of lights.
Set NR_LIGHTS to some high value like 512, this is now your "maximum number" of lights on screen.

Then pass in a uniform for the number of active lights, the shader will exit the for loop. There's no need to render geometry per light, that makes it more complicated. This does a single pass that loops over all of your lights per pixel. 

Hello CCEL. Thank u for reply.

But i would like to know how to render contless light using geometry.
I'm following several tutorials, but I can not get this result. I do not know if any "LearnOpenGL" settings prevent the result.

This is a personal goal, I have no interest in using engines, this is a goal for knowledge.

If u can follow:

Share this post

Link to post
Share on other sites

Ah sorry I misunderstood, I answered your question on stackexchange.


The point about doing it in a single pass still stands since you have more control over the loops and you can have any number of lights still (especially if you use a https://www.khronos.org/opengl/wiki/Shader_Storage_Buffer_Object). The 512 suggestion was just a suggestion for a max limit... you can't really render an infinite number of lights per frame anyway, it won't be real time anymore XD 

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!