I am presently taking part in with writing a rendering engine and implementing a ahead rendering pipeline.
I’ve few doubts on how issues ought to be applied relating to the render passes as-well because the rendering of a number of lights.
So I am questioning what’s the higher method right here:
- Uber shader that’s generated dynamically to regulate for the variety of lights that presently have an effect on the energetic scene.
This have the good advantages of just one render move for the lighting shader a lot much less binding happens which is a plus.
- have separate lighting shader for every sort of sunshine and have a render move for every mesh with every sort of sunshine, combining in the long run the results of (presumably 2 render goal that we ping-pong between) with additive mixing. This have the good advantages of separation and extra modular and maintainable shader code, however within the different hand the’re extra render passes and extra binding happening and to not point out the ping-pong of additive mixing between the render targets.
- Different Concepts that I did not heard/thought of and would love to listen to
Ofcourse there’s at all times room for optimization of each methods reminiscent of ocllusion check, check which level/spot gentle have an effect on which mesh (related to the second approach).
So I am questioning what’s the tackle it of contemporary rendering/sport engine and perhaps I did not listing what their method is and would love to listen to about it.
Additionally should you facet for one approach or one other wish to have your ideas on the professionals and cons.