i have some additional early-z questions for ogre 13 / direct11. starting a new thread rather than hijack paul's viewtopic.php?t=96658 thread.
goal: i'd like to have early-z and have access to the depth texture for my transparent shaders (ocean surface, particles, etc) and post processing (ssao, etc). my shaders and materials are all dynamically generated so i can build non-lit early-z vertex and fragment shaders.
how do i make this happen? i believe the following approaches are available but i'd like to get confirmation:
option 1: use a compositor that renders the scene using a material-scheme that overrides the lit shaders with the simple non-lit early-z shaders.
a. how do you determine the renderable requirements for a material in handleSchemeNotFound ()? for example, does this renderable/material require instancing support or not? i could embed the requirements in the material name. is there a better approach?
b. how do you ensure the depth buffer is filled before the compositor or transparent passes? using a later render queue?
c. how do i reference the depth texture in a material? use the name declared in the compositor script? is this an alias to the depth buffer or a RTT texture created by the compositor script?
d. does this prevent me from using anti aliasing or is that only when using multiple render targets (MRTs)?
e. sub-option is to use the same lit shaders with a potential performance impact per-paroj in the previous thread.
option 2: create a manual render-to-texture and reference this texture via material-scheme (aka rpgplayerrobin's sample?). shaders then report depth via colour output of the non-lit shaders.
a. how do i ensure the RTT early-z scene is rendered before my transparent materials and compositors are rendered? render queues?
b. i assume there is no way to access the depth buffer (for read only) vs creating a separate RTT?
c. is the performance in this approach better than using compositors (aka option 1)? i mention this after reading dark_sylinc's 2.0 proposal slides, see page 47: https://stuff.lanowen.com/Ogre/2.0/OGRE ... Slides.pdf
option 3: add an additional early-z / ambient pass (pass 0) to all my materials. pass 0 would reference the non-lit vertex and fragment shaders.
a. this will provide early-z but (probably) not access to a depth texture in later passes of the same material? or is it possible to attach the depth written in pass 0 to passes 1+ for a material? or can i use render queues / render queue priority to render the early-z first to an RTT and then refer to this texture in later render queues?
b. render queue sub question: does each render queue completely finish all passes before going to the next level in the render queue?
option 4: any other approaches???