refactor(render): unify model and player rendering with single shader pipeline

This commit is contained in:
2026-07-25 13:29:52 +08:00
parent 2e3b4f4f0f
commit 2568eb7d18
11 changed files with 67 additions and 117 deletions

View File

@@ -6,17 +6,21 @@ layout (location = 2) in vec3 aNormal;
uniform mat4 mv_matrix;
uniform mat4 proj_matrix;
uniform mat4 norm_matrix;
uniform mat4 lightSpaceMatrix;
uniform mat4 modelMatrix;
out vec4 FragPosLightSpace;
out vec3 normal;
out vec2 tc;
out vec3 vert_pos;
void main() {
//vec4 worldPos = modelMatrix * vec4(pos, 1.0);
vec4 worldPos = modelMatrix * vec4(pos, 1.0);
FragPosLightSpace = lightSpaceMatrix * worldPos;
vec4 viewPos = mv_matrix * vec4(pos, 1.0);
tc = texCoord;
vert_pos = pos;
//normal = normalize(mat3(norm_matrix) * aNormal);
normal = normalize(mat3(norm_matrix) * aNormal);
gl_Position = proj_matrix * viewPos;
}