Sun light direction fix

This commit is contained in:
MihailRis 2023-12-19 20:35:17 +03:00
parent c9db1acd91
commit bcfdc55277
2 changed files with 4 additions and 3 deletions

View File

@ -126,7 +126,7 @@ void BlocksRenderer::face(const ivec3& coord,
return;
}
const vec3 sunVector = vec3(0.411934f, 0.863868f, 0.279161f);
const vec3 sunVector = vec3(0.411934f, 0.863868f, -0.279161f);
float d = glm::dot(vec3(axisZ.x, axisZ.y, axisZ.z), sunVector);
d = 0.7f + d*0.3f;
@ -159,7 +159,7 @@ void BlocksRenderer::face(const vec3& coord,
const vec3 Z(axisZ);
if (lights) {
const vec3 sunVector = vec3(0.431934f, 0.863868f, 0.259161f);
const vec3 sunVector = vec3(0.431934f, 0.863868f, -0.259161f);
float d = glm::dot(Z, sunVector);
d = 0.75f + d*0.25f;
vec4 tint(d);

View File

@ -44,7 +44,8 @@ class BlocksRenderer {
const glm::ivec3& axisY,
const glm::ivec3& axisZ);
void vertex(const glm::vec3& coord, float u, float v,
void vertex(const glm::vec3& coord,
float u, float v,
const glm::vec4& brightness,
const glm::ivec3& axisX,
const glm::ivec3& axisY,