Alberto,

Firstly, you need to prevent the CullVisitor from considering your skydome
in it's autonear/far calculation. You can do this with
skydome->setComputeNearFarMode(osg::CullSettings::DO_NOT_COMPUTE_NEAR_FAR).

You will also need to "mimic" being a long way away via, most simply by
drawing first (e.g. via a pre draw camera, or good control of your render
bins) with depth checking/writing disabled.

If you have expensive shaders on your skydome, you might want to draw last
to z depth = 1 (via stateset->setAttributeAndModes(new
osg::Depth(osg::Depth::ALWAYS, 1.0,1.0))). NB - you might need LEQUAL,
depending on how you cleared your zbuffer. Depending on what you are dong,
you might still also run into a problem in which your skydome is clipped, so
you'll need to control the projective camera; look at the DepthPartition
example if you need a way forward.

Hope that helps,

David
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to