Hello,
Has anyone here been successful in creating a reverse z buffer for OSG?
I have done the following:
- Created osg::Depth global state attribute to be GREATER and 1.0 to 0.0.
- Created osg::ClipControl global state attribute to be LOWER_LEFT, ZER0_TO_ONE
- Set camera's clear depth to be 0.
I can render a scene and view the depth buffer and it's "reversed". That is, close objects are white and distance objects are black. But I'm also supposed to modify the projection matrix, which is where I'm stuck. The result is either nothing rendering or some very circus mirror looking objects.
Thanks,
DC