From e595ed41ef130d9883a9f9a4b9566c285f0abde3 Mon Sep 17 00:00:00 2001 From: yum Date: Tue, 31 Mar 2026 14:51:18 -0700 Subject: Put maintex burley tiling into optional branch; add optional rotation feature --- burley.cginc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'burley.cginc') 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); -- cgit v1.2.3