Comparing version 0.14.6 to 0.14.7
@@ -0,1 +1,7 @@ | ||
### 0.14.7 (2024-12-19) | ||
_New:_ | ||
- Added `offsetInput` property to `slitScan` effect for allowing exposing an offset variable. | ||
### 0.14.6 (2024-12-18) | ||
@@ -2,0 +8,0 @@ |
{ | ||
"name": "kampos", | ||
"version": "0.14.6", | ||
"version": "0.14.7", | ||
"description": "Tiny and fast effects compositor on WebGL", | ||
@@ -5,0 +5,0 @@ "registry": "https://registry.npmjs.org/", |
@@ -10,2 +10,3 @@ /** | ||
* @param {string} [params.direction='x'] direction to apply the slit scan effect. | ||
* @param {string} [params.offsetInput] code to use as input for adding offset. Defaults to empty. | ||
* @returns {slitScanEffect} | ||
@@ -21,2 +22,3 @@ * | ||
direction = 'x', | ||
offsetInput = '', | ||
}) { | ||
@@ -35,3 +37,3 @@ /** | ||
const isHorizontal = direction === 'x'; | ||
const noiseFragPart = `gl_FragCoord.${direction} / u_resolution.${direction} * u_frequency`; | ||
const noiseFragPart = `(gl_FragCoord.${direction} / u_resolution.${direction}${offsetInput ? `+ ${offsetInput}` : ''}) * u_frequency`; | ||
const noiseTimePart = 'u_time * 0.0001'; | ||
@@ -38,0 +40,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
10548220
29968