how do you tell ogre to render only opaque objects in a pass? i'm looking through the WBOIT code in ogre 13 and curious.
the reason i'm asking is:
1) so i can use WBOIT outside of RTSS and
2) i'm curious if an early-z pass would improve performance and create a scene depth map for lighting and post processing purposes. is there an example of this anywhere? is the deferred sample's GBUFFER compositor / shaders the closest? and then just use the same depth pool so later stages can "early out"?
thanks!
[ogre 13] WBOIT / early-z / rendering opaque objects only?
-
- Platinum Sponsor
- Posts: 290
- Joined: Tue Jan 17, 2012 5:18 am
- x 67
-
- OGRE Team Member
- Posts: 1994
- Joined: Sun Mar 30, 2014 2:51 pm
- x 1075
- Contact:
Re: [ogre 13] WBOIT / early-z / rendering opaque objects only?
the WBOIT sample puts the transparent objects on a non-standard render-queue manually:
https://github.com/OGRECave/ogre/blob/f ... ency.h#L58
and then explicitly triggers that in the compositor using the same depth pool.
You can certainly do early-z the same way. The "PSSM/shadow_caster" material does exactly what you want as it "just writes depth".
https://github.com/OGRECave/ogre/blob/f ... ency.h#L58
and then explicitly triggers that in the compositor using the same depth pool.
You can certainly do early-z the same way. The "PSSM/shadow_caster" material does exactly what you want as it "just writes depth".
-
- Platinum Sponsor
- Posts: 290
- Joined: Tue Jan 17, 2012 5:18 am
- x 67
Re: [ogre 13] WBOIT / early-z / rendering opaque objects only?
great, thanks!You can certainly do early-z the same way. The "PSSM/shadow_caster" material does exactly what you want as it "just writes depth".
oh ok that makes sense. am i correctly understanding how render queues and compositors work?the WBOIT sample puts the transparent objects on a non-standard render-queue manually:
render queues:
1. each render queue is executed and drawn into the render target in order.
2. compositors first_render_queue / last_render_queue default to essentially "all queues" (except overlays etc) so this is why compositors are typically run at the end. (ex. for post processing)
3. you can override first_render_queue / last_render_queue to run a compositor between a specific set of render queues.
WBOIT example:
1. render queues from 0 to 95 are drawn into the "default" render target.
2. the WBOIT compositor is triggered for render queues 96 and 97
- a. WBOIT compositor copies the "default" RT into "opaque" RT.
- b. WBOIT renders queues 96 and 97 into "accum" RT.
- c. "opaque" RT is copied back into the original render target.
- d. a WBOIT fragment shader takes "accum" RT and using the WBOIT algorithm writes the transparent pixels into the "default" RT.
4. any other "default" compositors may be executed. (ex. post processing)
5. overlay render queues executed.
final question:
does this copy from the "default" RT to "opaque" RT or is "opaque" just an alias? (from "compositor WBOIT" in ogre samples)
Code: Select all
target opaque
{
input previous
}
-
- OGRE Team Member
- Posts: 1994
- Joined: Sun Mar 30, 2014 2:51 pm
- x 1075
- Contact:
Re: [ogre 13] WBOIT / early-z / rendering opaque objects only?
all is correct except that there is no implicitly copy: for the first compositor "input previous" is just a special alias for "pass render_scene", where the viewport parameters are used instead of overriding them.
also, internally there is only one "pass render_scene" per target section, so first_render_queue / last_render_queue simply set which renderqueues are executed.
also, internally there is only one "pass render_scene" per target section, so first_render_queue / last_render_queue simply set which renderqueues are executed.
-
- Platinum Sponsor
- Posts: 290
- Joined: Tue Jan 17, 2012 5:18 am
- x 67
Re: [ogre 13] WBOIT / early-z / rendering opaque objects only?
thanks! i had no idea this is how it worked.