improve shadows

This commit is contained in:
MihailRis
2025-05-21 21:41:01 +03:00
parent 44f7051a94
commit ed5efd9c3a
5 changed files with 68 additions and 65 deletions
+5 -10
View File
@@ -203,21 +203,16 @@ void BlocksRenderer::blockXSprite(
const float w = size.x / 1.41f;
const glm::vec4 tint (0.8f);
glm::vec3 n;
float bias = 0.05f;
glm::vec3 n(0.0f, 1.0f, 0.0f);
n = glm::vec3(-0.7f, 0, -0.7f);
face(glm::vec3(x + xs, y, z + zs) + n * bias, w, size.y, 0, {-1, 0, 1}, {0, 1, 0}, n,
face({x + xs, y, z + zs}, w, size.y, 0, {-1, 0, 1}, {0, 1, 0}, n,
texface1, lights2, tint);
n = glm::vec3(-0.7f, 0, 0.7f);
face(glm::vec3(x + xs, y, z + zs) + n * bias, w, size.y, 0, {1, 0, 1}, {0, 1, 0}, n,
face({x + xs, y, z + zs}, w, size.y, 0, {1, 0, 1}, {0, 1, 0}, n,
texface1, lights1, tint);
n = glm::vec3(0.7f, 0, -0.7f);
face(glm::vec3(x + xs, y, z + zs) + n * bias, w, size.y, 0, {-1, 0, -1}, {0, 1, 0}, n,
face({x + xs, y, z + zs}, w, size.y, 0, {-1, 0, -1}, {0, 1, 0}, n,
texface2, lights2, tint);
n = glm::vec3(0.7f, 0, 0.7f);
face(glm::vec3(x + xs, y, z + zs) + n * bias, w, size.y, 0, {1, 0, -1}, {0, 1, 0}, n,
face({x + xs, y, z + zs}, w, size.y, 0, {1, 0, -1}, {0, 1, 0}, n,
texface2, lights1, tint);
}