Thanks for your responses.
I'm coming from a DX Effect framworks background, I want to get rid of that dependency and focus more on Vertex/Pixel shaders. So, lets say I have an effect with a simple two-pass blur (vertical pass/horizontal pass)... in the Effects system you would do this:
Render Scene - Setup Effect (bind) - Render BOX1 pass 0 - Render BOX1 pass 1 - Render BOX2 pass 0 - Render BOX2 pass 1//because code would be similar to this: (psuedo code)for( each pass in effect.passCount) { pass.Begin(); Draw( geomtry ); pass.End(); }
However, because now I have two seperate Vertex/Pixel Shaders for each pass my logic turns into this:
Render Scene - Setup ShaderPass0 (bind) - Render BOX1 pass 0 - Setup ShaderPass1 (bind) - Render BOX1 pass 1 - Setup ShaderPass0 (bind) - Render BOX2 pass 0 - Setup ShaderPass1 (bind) - Render BOX2 pass 1
As you can see, more shader binds (which I don't want)... however, looking into sample engines online and browsing tutorials, everyone seems to do it like this:
Render Scene - Draw Child - Setup Shader - loop through passes - Draw Geometry
Which this way will incur more shader binds if each pass is it's own seperate shader. So my thinking is why do people do it that way... lazy?... Then I thought, well, are there multi-pass effects that require you to render pass 0, then pass 1 before moving to another peiece of geometry???
Can passes mean two different things? One being apart of an effect per object (2 passes for each object), and one being independent of eachother (2 passes, but can do 1 pass for all objects and pass 2 for all objects again)?
Thanks in advance,
Jeff.