feat: add pbr support

This commit is contained in:
2026-10-13 00:57:35 +02:00
parent ce55f75ac3
commit 21621001c2
34 changed files with 968 additions and 135 deletions
+2 -7
View File
@@ -8,7 +8,6 @@ layout (location = 0) out vec3 outPos;
layout (location = 1) out vec2 outUV;
layout (location = 2) out vec3 outNormal;
layout (location = 3) out vec4 outTangent;
layout (location = 4) out mat3 outTBN;
// The depth pre-pass reuses this shader, positions have to match bit for bit
// so the main pass can depth test against it with LESS_OR_EQUAL
@@ -29,10 +28,6 @@ void main()
// outNormal = (pcs.transform * vec4(v.normal, 0.0)).xyz;
outNormal = mat3(transpose(inverse(pcs.transform))) * v.normal;
outTangent = v.tangent;
vec3 T = normalize(vec3(pcs.transform * v.tangent));
vec3 N = normalize(outNormal);
vec3 B = cross(N, T) * v.tangent.w;
outTBN = mat3(T, B, N);
// w is the bitangent sign, the fragment shader builds the TBN from the interpolated vectors
outTangent = vec4(mat3(pcs.transform) * v.tangent.xyz, v.tangent.w);
}