diff --git a/tests/cpp-tests/Classes/NodeTest/NodeTest.cpp b/tests/cpp-tests/Classes/NodeTest/NodeTest.cpp index 7102ec175e..d5f19383d4 100644 --- a/tests/cpp-tests/Classes/NodeTest/NodeTest.cpp +++ b/tests/cpp-tests/Classes/NodeTest/NodeTest.cpp @@ -565,12 +565,14 @@ void CameraOrbitTest::onEnter() TestCocosNodeDemo::onEnter(); _preProjection = Director::getInstance()->getProjection(); Director::getInstance()->getRenderer()->setDepthTest(true); + Director::getInstance()->getRenderer()->setDepthWrite(true); Director::getInstance()->setProjection(Director::Projection::_3D); } void CameraOrbitTest::onExit() { Director::getInstance()->getRenderer()->setDepthTest(false); + Director::getInstance()->getRenderer()->setDepthWrite(false); Director::getInstance()->setProjection(_preProjection); TestCocosNodeDemo::onExit(); } @@ -1035,12 +1037,14 @@ void CameraTest1::onEnter() _preProjection = Director::getInstance()->getProjection(); Director::getInstance()->setProjection(Director::Projection::_3D); Director::getInstance()->getRenderer()->setDepthTest(true); + Director::getInstance()->getRenderer()->setDepthWrite(true); } void CameraTest1::onExit() { Director::getInstance()->setProjection(_preProjection); Director::getInstance()->getRenderer()->setDepthTest(false); + Director::getInstance()->getRenderer()->setDepthWrite(false); TestCocosNodeDemo::onExit(); } @@ -1084,12 +1088,14 @@ void CameraTest2::onEnter() _preProjection = Director::getInstance()->getProjection(); Director::getInstance()->setProjection(Director::Projection::_3D); Director::getInstance()->getRenderer()->setDepthTest(true); + Director::getInstance()->getRenderer()->setDepthWrite(true); } void CameraTest2::onExit() { Director::getInstance()->setProjection(_preProjection); Director::getInstance()->getRenderer()->setDepthTest(false); + Director::getInstance()->getRenderer()->setDepthWrite(false); TestCocosNodeDemo::onExit(); }