From f0405af30e023017ec8d1f141e8625e77f92f961 Mon Sep 17 00:00:00 2001 From: quou Date: Wed, 1 Jan 2025 18:49:02 +1100 Subject: correct tbn --- intermediate/surface.glsl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'intermediate') diff --git a/intermediate/surface.glsl b/intermediate/surface.glsl index 7988502..8afc657 100644 --- a/intermediate/surface.glsl +++ b/intermediate/surface.glsl @@ -99,8 +99,8 @@ type: vec4 void main() { vec4 pos = c_mvp.model * vec4(position, 1.0); vec3 t = normalize((c_mvp.model * vec4(tangent, 0.0)).xyz); - vec3 b = normalize((c_mvp.model * vec4(normal, 0.0)).xyz); - vec3 n = normalize((c_mvp.model * vec4(cross(normal, tangent), 0.0)).xyz); + vec3 n = normalize((c_mvp.model * vec4(normal, 0.0)).xyz); + vec3 b = cross(t, n); interpolator.normal = n; interpolator.tbn = mat3(t, b, n); interpolator.uv = uv; -- cgit v1.2.3-54-g00ecf