[basic.f.glsl] Small tweaks on InventoryCube shading.

This commit is contained in:
Quentin Bazin 2020-03-05 18:59:26 +01:00
parent 33760af0fb
commit 64ee268129
2 changed files with 4 additions and 8 deletions

View File

@ -152,8 +152,8 @@ void InventoryCube::draw(gk::RenderTarget &target, gk::RenderStates states) cons
states.texture = &m_textureAtlas.texture(); states.texture = &m_textureAtlas.texture();
states.vertexAttributes = gk::VertexAttribute::Only2d; states.vertexAttributes = gk::VertexAttribute::Only2d;
glCheck(glDisable(GL_CULL_FACE)); glCheck(glEnable(GL_CULL_FACE));
glCheck(glDisable(GL_DEPTH_TEST)); glCheck(glEnable(GL_DEPTH_TEST));
target.draw(m_vbo, GL_QUADS, 4 * BlockFace::Top, 4, states); target.draw(m_vbo, GL_QUADS, 4 * BlockFace::Top, 4, states);
// target.draw(m_vbo, GL_QUADS, 4 * 1, 4, states); // target.draw(m_vbo, GL_QUADS, 4 * 1, 4, states);
@ -161,8 +161,4 @@ void InventoryCube::draw(gk::RenderTarget &target, gk::RenderStates states) cons
// target.draw(m_vbo, GL_QUADS, 4 * 3, 4, states); // target.draw(m_vbo, GL_QUADS, 4 * 3, 4, states);
target.draw(m_vbo, GL_QUADS, 4 * BlockFace::North, 4, states); target.draw(m_vbo, GL_QUADS, 4 * BlockFace::North, 4, states);
// target.draw(m_vbo, GL_QUADS, 4 * 5, 4, states); // target.draw(m_vbo, GL_QUADS, 4 * 5, 4, states);
glCheck(glEnable(GL_DEPTH_TEST));
glCheck(glEnable(GL_CULL_FACE));
} }

View File

@ -29,12 +29,12 @@ void main() {
if (v_faceValue == 2) { if (v_faceValue == 2) {
// color -= vec4(0.25, 0.25, 0.25, 0.0); // color -= vec4(0.25, 0.25, 0.25, 0.0);
color /= 2; color.rgb /= 2.3;
color.a = v_color.a; color.a = v_color.a;
} }
else if (v_faceValue == 4) { else if (v_faceValue == 4) {
// color -= vec4(0.15, 0.15, 0.15, 0.0); // color -= vec4(0.15, 0.15, 0.15, 0.0);
color /= 1.5; color.rgb /= 1.6;
color.a = v_color.a; color.a = v_color.a;
} }