Hi,
I have a problem trying to combine osgoit (depth peeling) with a non-trivial
arrangement of groups and RTT cameras. The current set-up I have (as simplified
as possible) is:
Composite Camera
[Not RTT]
Depth Camera
[0] [RTT]
Group "Scene"
Group "Processed Layer"
[0]
Layer Camera
[RTT]
Node "Layer
[0]" Layer Quad
[Texture from Layer Camera] Group "Processed Layer"
[1]
Layer Camera
[RTT]
Node "Layer
[1]" Layer Quad
[Texture from Layer Camera] ...
Depth Camera
[1] [RTT]
Same "Scene" Group as above
...
Depth Quad
[0] [Texture from Depth Camera[0]]
Depth Quad
[1] [Texture from Depth Camera[1]]
...
The layer cameras have inheritance mask ALL_VARIABLES, and are set to
DO_NOT_COMPUTE_NEAR_FAR (and have to stay as such, as I need all layers to have
the same near/far z range). The Depth Cameras have inheritance mask
ALL_VARIABLES. Each "Layer Quad" has a custom bounding box callback to give it
the same BB as its "Layer" node, and in its fragment shader, I manipulate each
fragment's depth to get a 'fake' depth (which is used when rendering all the
layers in the "Scene" group).
When using this set-up, I get near far clamping as expected, depending on what
I set my viewer's camera's projection matrix to (presumably this gets
inherited). However, if I render the "Scene" group directly, suddenly OSG
starts recalculating my near/far planes. Similarly, if I make the "Layer" nodes
direct descendants of the corresponding "Processed Layer" groups and skip the
scene camera's RTT, then OSG again recalculates my near/far planes.
This latter strange behaviour is actually what I'd like to happen; ideally, I'd
have each Depth Camera's projection matrix be used for all its child Layer
Cameras (to force all the layers to have the same z range), and have the Depth
Cameras set to COMPUTE_NEAR_FAR_USING_BOUNDING_VOLUMES, but this doesn't seem
trivial.
I'm still pretty new to OSG, so if I've made any incorrect assumptions above,
I'd be very grateful if you could point them out.
Thank you!
Leszek[/list][/code]
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=33557#33557
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org