fix cull face for render queue

This commit is contained in:
yangxiao 2015-11-09 10:42:12 +08:00
parent 3016bf696a
commit 9d2fca6d34
1 changed files with 12 additions and 0 deletions

View File

@ -557,6 +557,9 @@ void Renderer::visitRenderQueue(RenderQueue& queue)
RenderState::StateBlock::_defaultState->setDepthWrite(false);
RenderState::StateBlock::_defaultState->setBlend(true);
}
glDisable(GL_CULL_FACE);
RenderState::StateBlock::_defaultState->setCullFace(false);
for (auto it = zNegQueue.cbegin(); it != zNegQueue.cend(); ++it)
{
processRenderCommand(*it);
@ -574,9 +577,11 @@ void Renderer::visitRenderQueue(RenderQueue& queue)
glEnable(GL_DEPTH_TEST);
glDepthMask(true);
glDisable(GL_BLEND);
glEnable(GL_CULL_FACE);
RenderState::StateBlock::_defaultState->setDepthTest(true);
RenderState::StateBlock::_defaultState->setDepthWrite(true);
RenderState::StateBlock::_defaultState->setBlend(false);
RenderState::StateBlock::_defaultState->setCullFace(true);
for (auto it = opaqueQueue.cbegin(); it != opaqueQueue.cend(); ++it)
@ -595,10 +600,12 @@ void Renderer::visitRenderQueue(RenderQueue& queue)
glEnable(GL_DEPTH_TEST);
glDepthMask(false);
glEnable(GL_BLEND);
glEnable(GL_CULL_FACE);
RenderState::StateBlock::_defaultState->setDepthTest(true);
RenderState::StateBlock::_defaultState->setDepthWrite(false);
RenderState::StateBlock::_defaultState->setBlend(true);
RenderState::StateBlock::_defaultState->setCullFace(true);
for (auto it = transQueue.cbegin(); it != transQueue.cend(); ++it)
@ -636,6 +643,9 @@ void Renderer::visitRenderQueue(RenderQueue& queue)
RenderState::StateBlock::_defaultState->setBlend(true);
}
glDisable(GL_CULL_FACE);
RenderState::StateBlock::_defaultState->setCullFace(false);
for (auto it = zZeroQueue.cbegin(); it != zZeroQueue.cend(); ++it)
{
processRenderCommand(*it);
@ -671,6 +681,8 @@ void Renderer::visitRenderQueue(RenderQueue& queue)
RenderState::StateBlock::_defaultState->setBlend(true);
}
glDisable(GL_CULL_FACE);
RenderState::StateBlock::_defaultState->setCullFace(false);
for (auto it = zPosQueue.cbegin(); it != zPosQueue.cend(); ++it)
{