Open BielBdeLuna opened 8 years ago
I still don't know how these things work, but can the shader(assuming screen-space) be composited to the world-space or z-depth?
maybe a render to texture feature can be setup, render to texture the screenspace of every instance, and keep rendering an area for as much as shaders is subjected to.
Then destroy when it is not needed anymore.
imagine the common situation where a window with deformation shader is behind an explosion with another deformation shader, only one deformation is displayed (the one closer)
I wonder if this issue could be resolved with some JIT magic on a per frame basis, so the first step would be to identify the shaders every pixel is subjected to, then on those pixels subjected to more than one shader dos some JIT adding the shaders together creating a new shader (just for that pixel!) in order to render the pixel correcly
maybe there could be a way to simplify the process and identify what pixels would benefit from the same shader?
do you think that it could be possible?