diff options
| author | yum <yum.food.vr@gmail.com> | 2025-11-11 21:33:18 -0800 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2025-11-11 21:33:18 -0800 |
| commit | 44b4cf78b7ac9607159d1aba6c08591f79d04944 (patch) | |
| tree | f9793a69947496a9522f16ccc93475552e0a597e | |
| parent | 92c6798e701299154f382aeb2262e81928a2fb13 (diff) | |
fix reflection directions
| -rw-r--r-- | lighting.cginc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lighting.cginc b/lighting.cginc index 23cdd09..0aacdc9 100644 --- a/lighting.cginc +++ b/lighting.cginc @@ -159,7 +159,7 @@ void GetLighting(v2f i, Pbr pbr, out LightData data) { float3 view_dir = normalize(i.eyeVec.xyz); - data.common.V = -view_dir; + data.common.V = view_dir; data.common.N = pbr.normal; data.common.NoV = saturate(dot(pbr.normal, data.common.V)); #if defined(_CLEARCOAT) @@ -192,7 +192,7 @@ void GetLighting(v2f i, Pbr pbr, out LightData data) { data.indirect.NoL = saturate(dot(pbr.normal, data.indirect.dir)); data.indirect.NoH = saturate(dot(pbr.normal, data.indirect.H)); #if defined(_CLEARCOAT) - float3 dir_cc = reflect(-data.common.V, i.normal); + float3 dir_cc = reflect(data.common.V, i.normal); float3 H_cc = normalize(data.common.V + dir_cc); data.indirect.LoH_cc = saturate(dot(dir_cc, H_cc)); #endif |
