auto-clear depth between eyes by default for stereo

This commit is contained in:
David Rose 2012-02-08 20:34:26 +00:00
parent 9d83449006
commit 6d630e2cf1
2 changed files with 10 additions and 4 deletions

View File

@ -1324,10 +1324,6 @@ class ShowBase(DirectObject.DirectObject):
# we will if clearDepth is specified.
if clearDepth:
dr.setClearDepthActive(1)
elif dr.isStereo():
# If it's a stereo DisplayRegion, we clear the right
# channel by default.
dr.getRightEye().setClearDepthActive(1)
if clearColor:
dr.setClearColorActive(1)

View File

@ -725,6 +725,16 @@ make_stereo_display_region(const LVecBase4 &dimensions) {
// eyes are the same region: the region specified.
left = new DisplayRegion(this, dimensions);
right = new DisplayRegion(this, dimensions);
// In this case, we assume that the two eyes will share the same
// depth buffer, which means the right eye should clear the depth
// buffer by default.
if (get_clear_depth_active()) {
right->set_clear_depth_active(true);
}
if (get_clear_stencil_active()) {
right->set_clear_stencil_active(true);
}
}
PT(StereoDisplayRegion) stereo = new StereoDisplayRegion(this, dimensions,