Fixed weird handling of one sided faces
This commit is contained in:
parent
60db6f4bdb
commit
ddf187d9f6
@ -185,8 +185,10 @@ void Mesh::draw(Shader* shader)
|
|||||||
glStencilOp(GL_KEEP, GL_KEEP, GL_ZERO);
|
glStencilOp(GL_KEEP, GL_KEEP, GL_ZERO);
|
||||||
else
|
else
|
||||||
glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE);
|
glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE);
|
||||||
if(m_isDoubleSided)
|
if(m_isDoubleSided || m_positions2D.size() > 0)
|
||||||
glDisable(GL_CULL_FACE);
|
glDisable(GL_CULL_FACE);
|
||||||
|
else
|
||||||
|
glEnable(GL_CULL_FACE);
|
||||||
if(m_material != NULL)
|
if(m_material != NULL)
|
||||||
m_material->bindAttributes(shader);
|
m_material->bindAttributes(shader);
|
||||||
glBindVertexArray(m_vao);
|
glBindVertexArray(m_vao);
|
||||||
@ -219,8 +221,7 @@ void Mesh::draw(Shader* shader)
|
|||||||
}
|
}
|
||||||
|
|
||||||
glBindVertexArray(0);
|
glBindVertexArray(0);
|
||||||
if(m_isDoubleSided)
|
glDisable(GL_CULL_FACE);
|
||||||
glEnable(GL_CULL_FACE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Mesh::destroyGL()
|
void Mesh::destroyGL()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user