I want to render a volume(VERSION combined with programmable pipeline and fixed pipeline)
using only programmable pipeline (no fixed pipeline) which using glsl. To achieve this, I need multipass the renderer which means render different scene with different shaders in a sequential order.
There are three methods
come to my mind:
- using one shader program and detach shader -> attach shader -> recompile program whenever rendering new scene.
- using one shader program per pass, then there exits multiple shader programs.
- using subroutines in glsl to choose different subroutines when render different pass.
I wonder when should I use the 1st method? 2ed method? etc. can any experienced developer help?