summaryrefslogtreecommitdiffstats
path: root/pbr.cginc
diff options
context:
space:
mode:
Diffstat (limited to 'pbr.cginc')
-rwxr-xr-xpbr.cginc4
1 files changed, 2 insertions, 2 deletions
diff --git a/pbr.cginc b/pbr.cginc
index f6000b8..f3c46a5 100755
--- a/pbr.cginc
+++ b/pbr.cginc
@@ -180,8 +180,8 @@ void apply_kintsugi(float3 world_pos, inout float3 albedo, inout float smoothnes
Pbr getPbr(v2f i) {
Pbr pbr = (Pbr) 0;
- float3 n = normalize(i.normal);
- float3 t = normalize(i.tangent.xyz);
+ float3 n = i.normal;
+ float3 t = i.tangent.xyz;
t = normalize(t - n * dot(n, t)); // Gram-Schmidt to avoid skew
float3 b = normalize(cross(n, t)) * i.tangent.w;
pbr.tbn = float3x3(t, b, n);