feat(renderer): add roughness-based specular lighting to blocks

This commit is contained in:
2026-06-18 18:40:24 +08:00
parent 8bba170984
commit 83f1077ecd
21 changed files with 105 additions and 20 deletions

View File

@@ -4,11 +4,14 @@ layout (location = 0) in vec3 pos;
layout (location = 1) in vec2 texCoord;
layout (location = 2) in float layer;
layout (location = 3) in vec3 aNormal;
layout (location = 4) in float Roughness;
out vec2 tc;
out vec3 normal;
out vec3 vert_pos;
flat out int tex_layer;
out vec4 FragPosLightSpace;
out float roughness;
mat4 buildRotateX(float rad);
mat4 buildRotateY(float rad);
@@ -28,7 +31,7 @@ void main(void) {
tc = texCoord;
tex_layer = int(layer);
roughness = Roughness;
normal = mat3(norm_matrix) * aNormal;
FragPosLightSpace = lightSpaceMatrix * vec4(pos, 1.0);
gl_Position = proj_matrix * viewPos;