Hello everybody I am working on an application that needs to render the scene from multiple points of view. I notice that if I render once, even if the frag shader is long and complicated (writing to multiple 3D textures) it runs at 65 FPS. As soon as I add another rendering pass before that (simply rendering to 2 targets, colour and normals+depth) the framerate drops to 40. If I add a shadowmap pass it drops even further to 25-30 FPS. What is the best way to cope with multiple renderings and still retain a high framerate?
This is what I have right now:
1 - a shader that computes the normal+depth and colors, 2 targets on the same FBO
2 - the same shader gets called again for the shadowmap (different uniform parameters) but renders to a different FBO target
3 - a shader that writes values on a 3D texture using imageStore, new FBO
4 - a last shader that performs ray marching through the 3D texture and, at the same time, reads from the 2 maps created before
if i just run step 3 and 4 i get 65 FPS, if i add the 2 steps above the performance drops and the only explanation I have is that I am doing something useless in the middle cause the shaders in 3 and 4 are way more complicated (1000+ lines)