Skip to content

Commit

Permalink
Merge branch 'fixForceDepth' into forceDepthTest
Browse files Browse the repository at this point in the history
  • Loading branch information
darkdukey committed Jan 29, 2015
2 parents 995b722 + f914297 commit 893cd06
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion cocos/renderer/CCMeshCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ MeshCommand::MeshCommand()
, _cullFace(GL_BACK)
, _depthTestEnabled(false)
, _depthWriteEnabled(false)
, _forceDepthWrite(false)
, _renderStateCullFace(false)
, _renderStateDepthTest(false)
, _renderStateDepthWrite(GL_FALSE)
, _lightMask(-1)
{
_type = RenderCommand::Type::MESH_COMMAND;
Expand Down Expand Up @@ -168,7 +172,11 @@ void MeshCommand::setTransparent(bool value)
//Skip batching for transparent mesh
_skipBatching = value;

if (!_forceDepthWrite)
if (_isTransparent && !_forceDepthWrite)
{
_depthWriteEnabled = false;
}
else
{
_depthWriteEnabled = true;
}
Expand Down

0 comments on commit 893cd06

Please sign in to comment.