diff options
| author | yum <yum.food.vr@gmail.com> | 2026-03-31 14:51:18 -0700 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2026-03-31 14:51:28 -0700 |
| commit | e595ed41ef130d9883a9f9a4b9566c285f0abde3 (patch) | |
| tree | 66422cffc796e937ec322aa328151cb5f788df84 /burley.cginc | |
| parent | 38c22e393570433bf343c74cf69a1b5542de6c57 (diff) | |
Put maintex burley tiling into optional branch; add optional rotation feature
Diffstat (limited to 'burley.cginc')
| -rw-r--r-- | burley.cginc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/burley.cginc b/burley.cginc index ac225d7..1ca870f 100644 --- a/burley.cginc +++ b/burley.cginc @@ -80,8 +80,14 @@ BurleyPatchTransform burley_make_patch_transform(float2 uv, float2 uv_dx, float2 float2 sample_dx = uv_dx * (0.5f * input_scale); float2 sample_dy = uv_dy * (0.5f * input_scale); // Rotate. - float theta = hash31_ff(tile_rand3) * TAU; - float2x2 rot = float2x2(cos(theta), -sin(theta), sin(theta), cos(theta)); + float theta = hash31_ff(tile_rand3) * TAU - PI; +#if defined(_BURLEY_TILING_ROTATION_CONSTRAINT) + theta *= _Burley_Tiling_Rotation_Constraint; +#endif // _BURLEY_TILING_ROTATION_CONSTRAINT + float s; + float c; + sincos(theta, s, c); + float2x2 rot = float2x2(c, -s, s, c); local_uv = mul(rot, local_uv); sample_dx = mul(rot, sample_dx); sample_dy = mul(rot, sample_dy); |
