소스 검색

Fix sprite rendering

Daniele Bartolini 11 년 전
부모
커밋
96a8f0307b
1개의 변경된 파일7개의 추가작업 그리고 1개의 파일을 삭제
  1. 7 1
      engine/renderers/sprite.cpp

+ 7 - 1
engine/renderers/sprite.cpp

@@ -120,7 +120,13 @@ void Sprite::render()
 	if (m_material.id != INVALID_ID)
 	if (m_material.id != INVALID_ID)
 		material_manager::get()->lookup_material(m_material)->bind();
 		material_manager::get()->lookup_material(m_material)->bind();
 
 
-	bgfx::setState(BGFX_STATE_DEFAULT | BGFX_STATE_BLEND_ALPHA);
+	bgfx::setState(BGFX_STATE_RGB_WRITE
+		| BGFX_STATE_ALPHA_WRITE
+		| BGFX_STATE_DEPTH_TEST_LEQUAL
+		| BGFX_STATE_DEPTH_WRITE
+		| BGFX_STATE_CULL_CW
+		| BGFX_STATE_MSAA
+		| BGFX_STATE_BLEND_ALPHA);
 	bgfx::setVertexBuffer(m_resource->vb);
 	bgfx::setVertexBuffer(m_resource->vb);
 	bgfx::setIndexBuffer(m_resource->ib, m_frame * 6, 6);
 	bgfx::setIndexBuffer(m_resource->ib, m_frame * 6, 6);
 	bgfx::setTransform(matrix4x4::to_float_ptr(world_pose()));
 	bgfx::setTransform(matrix4x4::to_float_ptr(world_pose()));