In Minecraft, for example, you can place torches anywhere, and each of them affects the level of light in the world, and there are no restrictions on the number of torches / light sources that you can suppress in the world. I am 99% sure that the torch lighting will take care of the CPU and is saved for each block, and therefore, when visualizing the light value in this particular block, you just need to transfer the shader, but the light sources cannot move for this reason. If you had a game in which you could place light sources that could move (an arrow on fire, a minimap illuminated on it, a luminous ball of energy), and the lighting was not so simple (the color was turned on), which is The most effective ways to calculate lighting effects.
From my research, I found different rendering, different lighting, dynamically creating shaders with different amounts of lights available and using the for loop (cannot use uniforms due to unfolding) and static light maps (this would probably be used for fixed lights). Are there any other ways to calculate the lighting, such as doing what minecraft does, other than allowing moving lights, or can you take an infinite number of lights and mathematically combine them into an approximation that includes only a few light sources (this is an idea I came up with, but I can not understand how this can be done)?
If this helps, I am a programmer with decent experience in OpenGL (outdated and modern), so you can give me some code snippets, although I haven’t done too much with highlighting, so it would be useful to get brief explanations. I also wish to do some research if you can point me in the right direction!
source
share