mirror of https://github.com/axmolengine/axmol.git
set depth write (#20071)
This commit is contained in:
parent
4d04b64a3a
commit
469fc61d5a
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue