summaryrefslogtreecommitdiffstats
path: root/pbr.cginc
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2026-04-13 23:13:16 -0700
committeryum <yum.food.vr@gmail.com>2026-04-13 23:13:16 -0700
commit07f8f3db17354c3e77aa9cb67338d451de6572d3 (patch)
treed526eef93d3091ace08fd12d5a3a0b9737cad0c6 /pbr.cginc
parent2791567370385c9c8d7a5aeaa64c4588346e1779 (diff)
zebra: pull in phacelle noiseHEADmaster
Diffstat (limited to 'pbr.cginc')
-rwxr-xr-xpbr.cginc14
1 files changed, 12 insertions, 2 deletions
diff --git a/pbr.cginc b/pbr.cginc
index facb8f5..29bcedb 100755
--- a/pbr.cginc
+++ b/pbr.cginc
@@ -228,8 +228,18 @@ void apply_burley_tiling(inout Pbr pbr, inout float3 normal_tangent) {
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);
+ //float theta = 0.25 * PI;
+ //float theta = _Time[1];
+ float theta = _Zebra_Angle * TAU;
+ uv.x *= _Zebra_X_Scale;
+ float st, ct;
+ sincos(theta, st, ct);
+ float4 phacelle = phacelle_noise_2d(uv * _Zebra_Scale, float2(ct, st));
+ float2 dir = phacelle.xy;
+ float2 ortho_dir = phacelle.zw;
+ float mask = dot(dir, float2(0, 1));
+ float mask_fw = fwidth(mask);
+ albedo = smoothstep(-mask_fw * 0.5, mask_fw * 0.5, mask);
#endif
}