diff --git a/CHANGELOG.md b/CHANGELOG.md index 670141c..cef5b4a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +### 0.14.5 (2024-12-18) + +_Fixed:_ + +- Fixed mirroring of source coordinates in `kaleidoscope` and `slitScan` effects. + ### 0.14.4 (2024-12-17) _New:_ diff --git a/dist/index.cjs b/dist/index.cjs index 152c2d2..e1887d5 100644 --- a/dist/index.cjs +++ b/dist/index.cjs @@ -1275,7 +1275,7 @@ function kaleidoscope ({ segments = 6, offset, rotation = 0 } = {}) { vec2 newCoords = r * vec2(cos(theta), sin(theta)) + 0.5; sourceCoord = newCoords - u_offset; // mirrored repeat - sourceCoord = mod(-sourceCoord, 1.0) * (mod(sourceCoord - 1.0, 2.0) - mod(sourceCoord, 1.0)) + mod(sourceCoord, 1.0) * (mod(sourceCoord, 2.0) - mod(sourceCoord, 1.0)); + sourceCoord = mod(sourceCoord, 1.0) * (mod(sourceCoord - 1.0, 2.0) - mod(sourceCoord, 1.0)) + mod(-sourceCoord, 1.0) * (mod(sourceCoord, 2.0) - mod(sourceCoord, 1.0)); }`, }, get segments() { @@ -1378,7 +1378,7 @@ function slitScan ({ if (u_slitScanEnabled) { float noiseValue = noise(vec2(${isHorizontal ? noiseFragPart : noiseTimePart}, ${isHorizontal ? noiseTimePart : noiseFragPart})); float source_ = sourceCoord.${direction} + noiseValue * u_intensity; - float mirrored_ = mod(-source_, 1.0) * (mod(source_ - 1.0, 2.0) - mod(source_, 1.0)) + mod(source_, 1.0) * (mod(source_, 2.0) - mod(source_, 1.0)); + float mirrored_ = mod(source_, 1.0) * (mod(source_ - 1.0, 2.0) - mod(source_, 1.0)) + mod(-source_, 1.0) * (mod(source_, 2.0) - mod(source_, 1.0)); sourceCoord = ${isHorizontal ? 'vec2(mirrored_, sourceCoord.y)' : 'vec2(sourceCoord.x, mirrored_)'}; }`, }, diff --git a/docs/index.html b/docs/index.html index dcff18e..952f9e2 100644 --- a/docs/index.html +++ b/docs/index.html @@ -2,7 +2,7 @@
-