summaryrefslogtreecommitdiffstats
path: root/ssfd.cginc
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2026-03-24 18:23:53 -0700
committeryum <yum.food.vr@gmail.com>2026-03-24 18:23:53 -0700
commit58a8ad92f766baddb2c832597a43088def456d82 (patch)
tree5a8b6868847ecd7234e7b52992be002abef6b281 /ssfd.cginc
parent81637c1a3fab4f92e6da7517dd118d5bb4526865 (diff)
Refactor ssdf and matcaps/rl into "late pbr" stage; implement ssdf shadows
Diffstat (limited to 'ssfd.cginc')
-rw-r--r--ssfd.cginc3
1 files changed, 2 insertions, 1 deletions
diff --git a/ssfd.cginc b/ssfd.cginc
index 1eec6d7..cc7d304 100644
--- a/ssfd.cginc
+++ b/ssfd.cginc
@@ -3,6 +3,7 @@
#include "globals.cginc"
+#if defined(_SSFD)
float ssfd(float2 uv, float scale, float max_fwidth, float2 uv_offset, texture3D noise)
{
//float uv_fw = fwidth(uv.x) + fwidth(uv.y);
@@ -32,7 +33,6 @@ float ssfd(float2 uv, float scale, float max_fwidth, float2 uv_offset, texture3D
// log_2(factor) is 4.
// Divide original by 16.
float fw_factor = uv_fw / max_fwidth;
- // log_b(x) = log_a(x) / log_a(b)
float fractal_level = log2(fw_factor) / log2(bayer_res);
float fractal_level_floor = floor(fractal_level);
float fractal_remainder = fractal_level - fractal_level_floor;
@@ -52,6 +52,7 @@ float ssfd(float2 uv, float scale, float max_fwidth, float2 uv_offset, texture3D
return dither;
}
+#endif // _SSFD
#endif // __SSFD_INC