summaryrefslogtreecommitdiffstats
path: root/yum_pbr.cginc
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2025-07-30 20:21:51 -0700
committeryum <yum.food.vr@gmail.com>2025-07-30 20:21:51 -0700
commit5172e2eb9216b876b5b2719fad64b83e0d3a2a9f (patch)
treea900fc7e303cd2dd136a898b1dfa87c97c1f06b3 /yum_pbr.cginc
parentbe4c8a8ee8eaf892d008835225dfd897d259d793 (diff)
consolidate XZ displacement normal math
Diffstat (limited to 'yum_pbr.cginc')
-rw-r--r--yum_pbr.cginc7
1 files changed, 3 insertions, 4 deletions
diff --git a/yum_pbr.cginc b/yum_pbr.cginc
index 08bc8e2..cbcac8f 100644
--- a/yum_pbr.cginc
+++ b/yum_pbr.cginc
@@ -29,11 +29,10 @@ void applyGradientNormals(v2f i, inout YumPbr pbr) {
float2 g0_dfy = _Gradient_Normals_0_Vertical.SampleLevel(bilinear_repeat_s, g0_uv, 0).rg;
float2 g0 = g0_dfy;
#if defined(_GRADIENT_NORMALS_0_HORIZONTAL)
- float2 g0_dfx = _Gradient_Normals_0_X.SampleLevel(bilinear_repeat_s, g0_uv, 0).rg;
- float2 g0_dfz = _Gradient_Normals_0_Z.SampleLevel(bilinear_repeat_s, g0_uv, 0).rg;
+ float2 g0_dfxz = _Gradient_Normals_0_Horizontal.SampleLevel(bilinear_repeat_s, g0_uv, 0).rg;
g0 = float2(
- g0_dfy[0] / (1 + g0_dfx[0]),
- g0_dfy[1] / (1 + g0_dfz[1])
+ g0_dfy[0] / (1 + g0_dfxz[0]),
+ g0_dfy[1] / (1 + g0_dfxz[1])
);
#endif // _GRADIENT_NORMALS_0_HORIZONTAL
gradient += g0;