1
0
Fork 0

improve rendering, fix lightmap

This commit is contained in:
Sen 2025-08-31 00:30:48 +02:00
parent 82b57873c2
commit ec9173433e
Signed by: sen
GPG key ID: 3AC50A6F47D1B722
12 changed files with 186 additions and 102 deletions

View file

@ -22,7 +22,7 @@ uniform bool shade;
void main() {
vec3 nvertex = vec3(model * vec4(pos, 1.0));
vertex = vec3(float(chunk_x) + pos.x, float(chunk_y) + pos.y, float(chunk_z) + pos.z);
shading = shade ? (norm.x != 0.0 ? 0.6 : (norm.z != 0.0 ? 0.8 : (norm.y > 0.0 ? 0.5 : 1.0))) : 1.0;
shading = shade ? (norm.x != 0.0 ? 0.6 : (norm.z != 0.0 ? 0.8 : (norm.y < 0.0 ? 0.5 : 1.0))) : 1.0;
normal = mat3(transpose(inverse(model))) * norm.xyz;
shine = norm.a * 32.0;
tex_coord = coord;