diff --git a/direct/src/showbase/ShowBase.py b/direct/src/showbase/ShowBase.py index 68e8b7599a..967cefb63f 100644 --- a/direct/src/showbase/ShowBase.py +++ b/direct/src/showbase/ShowBase.py @@ -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) diff --git a/panda/src/display/graphicsOutput.cxx b/panda/src/display/graphicsOutput.cxx index 1a6de4216e..679e0adb7d 100644 --- a/panda/src/display/graphicsOutput.cxx +++ b/panda/src/display/graphicsOutput.cxx @@ -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,