Skip to content

Commit

Permalink
Turbulence fix mouse direction (#64)
Browse files Browse the repository at this point in the history
* Fixed direction of mouse offset in turbulence

* Updated CHANGELOG

* 0.14.8
  • Loading branch information
ydaniv authored Dec 24, 2024
1 parent da57c45 commit 5b77688
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 9 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
### 0.14.8 (2024-12-24)

_Fixed:_

- Fixed direction of `u_mouse` offsets in `turbulence` effect.

### 0.14.7 (2024-12-19)

_New:_
Expand Down
4 changes: 2 additions & 2 deletions dist/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2059,9 +2059,9 @@ const INPUT_TYPES = {
'vec3 turbulenceSeed = vec3(gl_FragCoord.xy, u_time * 0.0001);',
FRAGCOORD_XYZ: 'vec3 turbulenceSeed = vec3(gl_FragCoord.xyz);',
FRAGCOORD_XY_MOUSE_TIME:
'vec3 turbulenceSeed = vec3(gl_FragCoord.xy + u_mouse * u_resolution * vec2(-1.0, 1.0), u_time * 0.0001);',
'vec3 turbulenceSeed = vec3(gl_FragCoord.xy - u_mouse * u_resolution, u_time * 0.0001);',
FRAGCOORD_XY_MOUSE_Z:
'vec3 turbulenceSeed = vec3(gl_FragCoord.xy + u_mouse * u_resolution * vec2(-1.0, 1.0), gl_FragCoord.z);',
'vec3 turbulenceSeed = vec3(gl_FragCoord.xy - u_mouse * u_resolution, gl_FragCoord.z);',
};

turbulence.COLOR = OUTPUT_TYPES.COLOR;
Expand Down
4 changes: 2 additions & 2 deletions index.umd.js
Original file line number Diff line number Diff line change
Expand Up @@ -2063,9 +2063,9 @@ float turbulence (vec3 seed, vec2 frequency, int numOctaves, bool isFractal) {
'vec3 turbulenceSeed = vec3(gl_FragCoord.xy, u_time * 0.0001);',
FRAGCOORD_XYZ: 'vec3 turbulenceSeed = vec3(gl_FragCoord.xyz);',
FRAGCOORD_XY_MOUSE_TIME:
'vec3 turbulenceSeed = vec3(gl_FragCoord.xy + u_mouse * u_resolution * vec2(-1.0, 1.0), u_time * 0.0001);',
'vec3 turbulenceSeed = vec3(gl_FragCoord.xy - u_mouse * u_resolution, u_time * 0.0001);',
FRAGCOORD_XY_MOUSE_Z:
'vec3 turbulenceSeed = vec3(gl_FragCoord.xy + u_mouse * u_resolution * vec2(-1.0, 1.0), gl_FragCoord.z);',
'vec3 turbulenceSeed = vec3(gl_FragCoord.xy - u_mouse * u_resolution, gl_FragCoord.z);',
};

turbulence.COLOR = OUTPUT_TYPES.COLOR;
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kampos",
"version": "0.14.7",
"version": "0.14.8",
"description": "Tiny and fast effects compositor on WebGL",
"registry": "https://registry.npmjs.org/",
"main": "dist/index.cjs",
Expand Down
4 changes: 2 additions & 2 deletions src/effects/turbulence.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,9 @@ const INPUT_TYPES = {
'vec3 turbulenceSeed = vec3(gl_FragCoord.xy, u_time * 0.0001);',
FRAGCOORD_XYZ: 'vec3 turbulenceSeed = vec3(gl_FragCoord.xyz);',
FRAGCOORD_XY_MOUSE_TIME:
'vec3 turbulenceSeed = vec3(gl_FragCoord.xy + u_mouse * u_resolution * vec2(-1.0, 1.0), u_time * 0.0001);',
'vec3 turbulenceSeed = vec3(gl_FragCoord.xy - u_mouse * u_resolution, u_time * 0.0001);',
FRAGCOORD_XY_MOUSE_Z:
'vec3 turbulenceSeed = vec3(gl_FragCoord.xy + u_mouse * u_resolution * vec2(-1.0, 1.0), gl_FragCoord.z);',
'vec3 turbulenceSeed = vec3(gl_FragCoord.xy - u_mouse * u_resolution, gl_FragCoord.z);',
};

turbulence.COLOR = OUTPUT_TYPES.COLOR;
Expand Down

0 comments on commit 5b77688

Please sign in to comment.