diff --git a/src/graphics/render/MainBatch.cpp b/src/graphics/render/MainBatch.cpp index 34976819..f05b715d 100644 --- a/src/graphics/render/MainBatch.cpp +++ b/src/graphics/render/MainBatch.cpp @@ -94,39 +94,39 @@ void MainBatch::cube( const glm::vec3 Z(0.0f, 0.0f, 1.0f); quad( - coord + Z * size.z * 0.5f, - X, Y, glm::vec2(size.x, size.y), - (shading ? do_tint(0.8) * tint : tint), - glm::vec3(1.0f), texfaces[5] + coord + Z * size.z * 0.5f, + X, Y, Z, glm::vec2(size.x, size.y), + (shading ? do_tint(0.8) * tint : tint), + glm::vec3(1.0f), texfaces[5] ); quad( - coord - Z * size.z * 0.5f, - -X, Y, glm::vec2(size.x, size.y), - (shading ? do_tint(0.9f) * tint : tint), - glm::vec3(1.0f), texfaces[4] + coord - Z * size.z * 0.5f, + -X, Y, -Z, glm::vec2(size.x, size.y), + (shading ? do_tint(0.9f) * tint : tint), + glm::vec3(1.0f), texfaces[4] ); quad( - coord + Y * size.y * 0.5f, - -X, Z, glm::vec2(size.x, size.z), - (shading ? do_tint(1.0f) * tint : tint), - glm::vec3(1.0f), texfaces[3] + coord + Y * size.y * 0.5f, + -X, Z, Y, glm::vec2(size.x, size.z), + (shading ? do_tint(1.0f) * tint : tint), + glm::vec3(1.0f), texfaces[3] ); quad( - coord - Y * size.y * 0.5f, - X, Z, glm::vec2(size.x, size.z), - (shading ? do_tint(0.7f) * tint : tint), - glm::vec3(1.0f), texfaces[2] + coord - Y * size.y * 0.5f, + X, Z, -Y, glm::vec2(size.x, size.z), + (shading ? do_tint(0.7f) * tint : tint), + glm::vec3(1.0f), texfaces[2] ); quad( - coord + X * size.x * 0.5f, - -Z, Y, glm::vec2(size.z, size.y), - (shading ? do_tint(0.8f) * tint : tint), - glm::vec3(1.0f), texfaces[1] + coord + X * size.x * 0.5f, + -Z, Y, X, glm::vec2(size.z, size.y), + (shading ? do_tint(0.8f) * tint : tint), + glm::vec3(1.0f), texfaces[1] ); quad( - coord - X * size.x * 0.5f, - Z, Y, glm::vec2(size.z, size.y), - (shading ? do_tint(0.9f) * tint : tint), - glm::vec3(1.0f), texfaces[1] + coord - X * size.x * 0.5f, + Z, Y, -X, glm::vec2(size.z, size.y), + (shading ? do_tint(0.9f) * tint : tint), + glm::vec3(1.0f), texfaces[1] ); } diff --git a/src/graphics/render/MainBatch.hpp b/src/graphics/render/MainBatch.hpp index bafecd80..2c22412e 100644 --- a/src/graphics/render/MainBatch.hpp +++ b/src/graphics/render/MainBatch.hpp @@ -86,6 +86,7 @@ public: const glm::vec3& pos, const glm::vec3& right, const glm::vec3& up, + const glm::vec3& normal, const glm::vec2& size, const glm::vec4& light, const glm::vec3& tint, @@ -97,21 +98,21 @@ public: {subregion.u1, subregion.v1}, light, tint, - glm::cross(up, right) + normal ); vertex( pos + right * size.x * 0.5f - up * size.y * 0.5f, {subregion.u2, subregion.v1}, light, tint, - glm::cross(up, right) + normal ); vertex( pos + right * size.x * 0.5f + up * size.y * 0.5f, {subregion.u2, subregion.v2}, light, tint, - glm::cross(up, right) + normal ); vertex( @@ -119,21 +120,21 @@ public: {subregion.u1, subregion.v1}, light, tint, - glm::cross(up, right) + normal ); vertex( pos + right * size.x * 0.5f + up * size.y * 0.5f, {subregion.u2, subregion.v2}, light, tint, - glm::cross(up, right) + normal ); vertex( pos - right * size.x * 0.5f + up * size.y * 0.5f, {subregion.u1, subregion.v2}, light, tint, - glm::cross(up, right) + normal ); } diff --git a/src/graphics/render/ParticlesRenderer.cpp b/src/graphics/render/ParticlesRenderer.cpp index 4c6a913e..23b7a857 100644 --- a/src/graphics/render/ParticlesRenderer.cpp +++ b/src/graphics/render/ParticlesRenderer.cpp @@ -134,6 +134,7 @@ void ParticlesRenderer::renderParticles(const Camera& camera, float delta) { particle.position, localRight, localUp, + -camera.front, preset.size * scale, light, glm::vec3(1.0f), diff --git a/src/graphics/render/PrecipitationRenderer.cpp b/src/graphics/render/PrecipitationRenderer.cpp index 60f2c026..42dc3115 100644 --- a/src/graphics/render/PrecipitationRenderer.cpp +++ b/src/graphics/render/PrecipitationRenderer.cpp @@ -146,6 +146,7 @@ void PrecipitationRenderer::render( pos, face.right, {0, 1, 0}, + glm::cross(glm::vec3(0, 1, 0), face.right), FACE_SIZE, light_at(chunks, pos.x, y, pos.z), glm::vec3(1.0f),