From 29443dfbd4b3ecbe5d0cae654e9cb72555b17220 Mon Sep 17 00:00:00 2001 From: yum Date: Tue, 17 Mar 2026 16:40:05 -0700 Subject: Clean up marble code --- math.cginc | 3 ++- pbr.cginc | 11 ----------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/math.cginc b/math.cginc index 5803be5..fa38553 100755 --- a/math.cginc +++ b/math.cginc @@ -166,7 +166,8 @@ float3 domain_warp_procedural(float3 uvw, float strength, float g = 1; for (uint ii = 0; ii < octaves; ++ii) { - noise += value_noise3(uvw + noise * strength) * g; + float3 vnoise = value_noise3(uvw + (noise * 2.0 - 1.0) * strength); + noise += vnoise * g; uvw *= lacunarity; g *= gain; } diff --git a/pbr.cginc b/pbr.cginc index dac9e1f..47ef00c 100755 --- a/pbr.cginc +++ b/pbr.cginc @@ -132,19 +132,8 @@ void apply_marble(float3 world_pos, inout float3 albedo) { uvw += offset; -#if 1 float3 noise = domain_warp_procedural(uvw, _Marble_Strength, _Marble_Octaves, _Marble_Lacunarity, _Marble_Gain); -#elif 1 - float3 noise = hash31_fast(uvw*32); -#elif 0 - float3 noise = value_noise3(uvw); -#elif 0 - float3 noise = value_noise_3d_tex(_Marble_Noise, trilinear_repeat_s, uvw); -#else - float3 noise = domain_warp_3d_tex(_Marble_Noise, trilinear_repeat_s, uvw, - _Marble_Strength, _Marble_Octaves, _Marble_Lacunarity, _Marble_Gain); -#endif noise = _Marble_Post_Ramp.Sample(linear_clamp_s, float2(noise.x, 0)); -- cgit v1.2.3