diff options
author | quou <quou@disroot.org> | 2025-01-01 18:49:02 +1100 |
---|---|---|
committer | quou <quou@disroot.org> | 2025-01-01 18:49:02 +1100 |
commit | f0405af30e023017ec8d1f141e8625e77f92f961 (patch) | |
tree | 4423ed94d12ce3c9ffe615a371612859178b969f /intermediate | |
parent | d26100734623f37063206b9b144c2a29fd71d414 (diff) |
correct tbn
Diffstat (limited to 'intermediate')
-rw-r--r-- | intermediate/surface.glsl | 4 |
1 files changed, 2 insertions, 2 deletions
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; |