summaryrefslogtreecommitdiffstats
path: root/burley.cginc
diff options
context:
space:
mode:
Diffstat (limited to 'burley.cginc')
-rw-r--r--burley.cginc10
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);