summaryrefslogtreecommitdiffstats
path: root/pbr.cginc
diff options
context:
space:
mode:
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
}