shaders 2.3.62 → 2.3.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/{WaveDistortion-DzwdX6Wj.js → WaveDistortion-D8LOc-Dc.js} +11 -4
- package/dist/core/registry.js +1 -1
- package/dist/core/shaders/WaveDistortion/index.d.ts +1 -1
- package/dist/core/shaders/WaveDistortion/index.d.ts.map +1 -1
- package/dist/core/shaders/WaveDistortion/index.js +1 -1
- package/dist/core/telemetry/index.js +1 -1
- package/dist/registry.js +10 -2
- package/package.json +1 -1
|
@@ -17,7 +17,7 @@ const componentDefinition = {
|
|
|
17
17
|
type: "range",
|
|
18
18
|
min: 0,
|
|
19
19
|
max: 1,
|
|
20
|
-
step: .
|
|
20
|
+
step: .05,
|
|
21
21
|
label: "Strength",
|
|
22
22
|
group: "Effect"
|
|
23
23
|
}
|
|
@@ -66,7 +66,8 @@ const componentDefinition = {
|
|
|
66
66
|
"sine": 0,
|
|
67
67
|
"triangle": 1,
|
|
68
68
|
"square": 2,
|
|
69
|
-
"sawtooth": 3
|
|
69
|
+
"sawtooth": 3,
|
|
70
|
+
"bounce": 4
|
|
70
71
|
}[value] ?? 0;
|
|
71
72
|
},
|
|
72
73
|
ui: {
|
|
@@ -87,6 +88,10 @@ const componentDefinition = {
|
|
|
87
88
|
{
|
|
88
89
|
label: "Sawtooth",
|
|
89
90
|
value: "sawtooth"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
label: "Bounce",
|
|
94
|
+
value: "bounce"
|
|
90
95
|
}
|
|
91
96
|
],
|
|
92
97
|
label: "Wave Type",
|
|
@@ -139,12 +144,14 @@ const componentDefinition = {
|
|
|
139
144
|
const triangleWave = abs(normalizedPhase.mul(2).sub(1)).mul(2).sub(1);
|
|
140
145
|
const squareWave = step(float(.5), normalizedPhase).mul(2).sub(1);
|
|
141
146
|
const sawtoothWave = normalizedPhase.mul(2).sub(1);
|
|
147
|
+
const bounceWave = abs(sin(phase));
|
|
142
148
|
const waveTypeValue = uniforms.waveType.uniform;
|
|
143
149
|
const isSine = step(waveTypeValue, float(.5));
|
|
144
150
|
const isTriangle = step(float(.5), waveTypeValue).mul(step(waveTypeValue, float(1.5)));
|
|
145
151
|
const isSquare = step(float(1.5), waveTypeValue).mul(step(waveTypeValue, float(2.5)));
|
|
146
|
-
const isSawtooth = step(float(2.5), waveTypeValue);
|
|
147
|
-
const
|
|
152
|
+
const isSawtooth = step(float(2.5), waveTypeValue).mul(step(waveTypeValue, float(3.5)));
|
|
153
|
+
const isBounce = step(float(3.5), waveTypeValue);
|
|
154
|
+
const displacement = sineWave.mul(isSine).add(triangleWave.mul(isTriangle)).add(squareWave.mul(isSquare)).add(sawtoothWave.mul(isSawtooth)).add(bounceWave.mul(isBounce)).mul(uniforms.strength.uniform).mul(.5);
|
|
148
155
|
const displacementX = displacement.mul(cosAngle).div(aspect);
|
|
149
156
|
const displacementY = displacement.mul(sinAngle);
|
|
150
157
|
const distortedUV = vec2(uvCoord.x.add(displacementX), uvCoord.y.add(displacementY));
|
package/dist/core/registry.js
CHANGED
|
@@ -75,7 +75,7 @@ import { n as componentDefinition$68 } from "./Twirl-BUlMUymT.js";
|
|
|
75
75
|
import { n as componentDefinition$69 } from "./Vibrance-CWMwA5S-.js";
|
|
76
76
|
import "./browser-C7ZSkE-t.js";
|
|
77
77
|
import { n as componentDefinition$70 } from "./VideoTexture-DUk9pA_6.js";
|
|
78
|
-
import { n as componentDefinition$71 } from "./WaveDistortion-
|
|
78
|
+
import { n as componentDefinition$71 } from "./WaveDistortion-D8LOc-Dc.js";
|
|
79
79
|
import { n as componentDefinition$72 } from "./WebcamTexture-BmeO4qY-.js";
|
|
80
80
|
import { n as componentDefinition$73 } from "./ZoomBlur-BE1vT38D.js";
|
|
81
81
|
var createShaderRegistry = () => {
|
|
@@ -32,7 +32,7 @@ export interface ComponentProps {
|
|
|
32
32
|
/**
|
|
33
33
|
* Shape of the distortion wave
|
|
34
34
|
*
|
|
35
|
-
* Accepts one of: `"sine"`, `"triangle"`, `"square"`, `"sawtooth"`.
|
|
35
|
+
* Accepts one of: `"sine"`, `"triangle"`, `"square"`, `"sawtooth"`, `"bounce"`.
|
|
36
36
|
* @default "sine"
|
|
37
37
|
*/
|
|
38
38
|
waveType: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shaders/WaveDistortion/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAqB,MAAM,iBAAiB,CAAA;AASvE,MAAM,WAAW,cAAc;IAC3B,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;CAChB;AAED,eAAO,MAAM,mBAAmB,EAAE,mBAAmB,CAAC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shaders/WaveDistortion/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAqB,MAAM,iBAAiB,CAAA;AASvE,MAAM,WAAW,cAAc;IAC3B,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;CAChB;AAED,eAAO,MAAM,mBAAmB,EAAE,mBAAmB,CAAC,cAAc,CAuMnE,CAAA;AAED,eAAe,mBAAmB,CAAA"}
|
|
@@ -2,5 +2,5 @@ import "../../edges-Bd7GP4s2.js";
|
|
|
2
2
|
import "../../transformations-B5lM6fYX.js";
|
|
3
3
|
import "../../time-BZqyVJXt.js";
|
|
4
4
|
import "../../alpha-Byel9eTg.js";
|
|
5
|
-
import { n as componentDefinition, t as WaveDistortion_default } from "../../WaveDistortion-
|
|
5
|
+
import { n as componentDefinition, t as WaveDistortion_default } from "../../WaveDistortion-D8LOc-Dc.js";
|
|
6
6
|
export { componentDefinition, WaveDistortion_default as default };
|
package/dist/registry.js
CHANGED
|
@@ -11369,7 +11369,7 @@ export const shaderRegistry = [
|
|
|
11369
11369
|
"type": "range",
|
|
11370
11370
|
"min": 0,
|
|
11371
11371
|
"max": 1,
|
|
11372
|
-
"step": 0.
|
|
11372
|
+
"step": 0.05,
|
|
11373
11373
|
"label": "Strength",
|
|
11374
11374
|
"group": "Effect"
|
|
11375
11375
|
}
|
|
@@ -11431,6 +11431,10 @@ export const shaderRegistry = [
|
|
|
11431
11431
|
{
|
|
11432
11432
|
"label": "Sawtooth",
|
|
11433
11433
|
"value": "sawtooth"
|
|
11434
|
+
},
|
|
11435
|
+
{
|
|
11436
|
+
"label": "Bounce",
|
|
11437
|
+
"value": "bounce"
|
|
11434
11438
|
}
|
|
11435
11439
|
],
|
|
11436
11440
|
"label": "Wave Type",
|
|
@@ -11472,7 +11476,7 @@ export const shaderRegistry = [
|
|
|
11472
11476
|
"type": "range",
|
|
11473
11477
|
"min": 0,
|
|
11474
11478
|
"max": 1,
|
|
11475
|
-
"step": 0.
|
|
11479
|
+
"step": 0.05,
|
|
11476
11480
|
"label": "Strength",
|
|
11477
11481
|
"group": "Effect"
|
|
11478
11482
|
},
|
|
@@ -11534,6 +11538,10 @@ export const shaderRegistry = [
|
|
|
11534
11538
|
{
|
|
11535
11539
|
"label": "Sawtooth",
|
|
11536
11540
|
"value": "sawtooth"
|
|
11541
|
+
},
|
|
11542
|
+
{
|
|
11543
|
+
"label": "Bounce",
|
|
11544
|
+
"value": "bounce"
|
|
11537
11545
|
}
|
|
11538
11546
|
],
|
|
11539
11547
|
"label": "Wave Type",
|