diff options
| author | yum <yum.food.vr@gmail.com> | 2026-04-12 19:39:39 -0700 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2026-04-12 19:39:39 -0700 |
| commit | 2791567370385c9c8d7a5aeaa64c4588346e1779 (patch) | |
| tree | 4376c9145e38b2e3c547746cf051210f7101c024 /pbr.cginc | |
| parent | 4a3c970bf665feafcd6cb211f804e89d44a9085f (diff) | |
add 2d voronoi noise
Diffstat (limited to 'pbr.cginc')
| -rwxr-xr-x | pbr.cginc | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -162,7 +162,7 @@ void apply_kintsugi(float3 world_pos, inout float3 albedo, inout float smoothnes uvw += warp; #endif - float mask = voronoi_edge_distance(uvw) + 0.5f; + float mask = 1.0f - voronoi_d_3d(uvw); float width = max(fwidth(mask) * 0.5f, _Kintsugi_Width); float threshold = _Kintsugi_Threshold; mask = smoothstep(threshold - width, threshold + width, mask); @@ -226,6 +226,13 @@ void apply_burley_tiling(inout Pbr pbr, inout float3 normal_tangent) { #endif // _BURLEY_TILING } +void apply_zebra(float2 uv, inout float3 albedo) { +#if defined(_ZEBRA) + float mask = 2.0f * voronoi_d_2d(uv * _Zebra_Scale); + albedo = lerp(albedo, 0, mask); +#endif +} + Pbr getPbr(v2f i) { Pbr pbr = (Pbr) 0; @@ -288,6 +295,7 @@ Pbr getPbr(v2f i) { apply_triplanar_layers(i.worldPos, i.normal, pbr, normal_tangent); apply_custom31_world(i, pbr, normal_tangent); apply_aperiodic_tiling(i.uv01.xy, pbr.albedo.xyz, pbr.smoothness, normal_tangent); + apply_zebra(i.uv01.xy, pbr.albedo.xyz); applyDecals(i, pbr, normal_tangent); |
