I programmed a bump mapping shader after the tutorial in this site. My Problem now is that it only supports a defined number oft light sources ,but becauae the user can place them this is no option.
My question is if there is a solution to this Algorithmen vor if I need to use another Algorithmen.
EDIT:
sry forgot to link the tutorial I used:https://github.com/mattdesl/lwjgl-basics/wiki/ShaderLesson6
how did you implement multiple lithing at all? With arrays?
Then you just need a constant MAX_LIGHTS. Then you create the array
with the size of it. Iterating the lights you go from 0 to numLights. This could be a uniform and
should increase every time the user adds a new light.
This also needs the lights to be structs.
Yes I used Arrays like you said.
But I am talking about something like 1000 light sources and ifigured it would be pretty slow in I had an Array with 100 entries.
So I thought maybe there would be a better way to do this.
Deferred rendering would solve this perfectly. Render normals and albedo(diffuse textures) to framebuffer. Then render each light as quad using albedo buffer as input and output to backbuffer with addditive blending.