@d3p1/img2pxl 1.18.1 → 1.18.3
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/app.d.ts +0 -4
- package/dist/core/lib/renderer-manager.d.ts +7 -0
- package/dist/img2pxl.js +62 -53
- package/dist/img2pxl.js.map +1 -1
- package/dist/img2pxl.umd.cjs +3 -3
- package/dist/img2pxl.umd.cjs.map +1 -1
- package/package.json +1 -1
package/dist/core/app.d.ts
CHANGED
|
@@ -23,10 +23,6 @@ export default class App {
|
|
|
23
23
|
*
|
|
24
24
|
* @param {number} elapsed
|
|
25
25
|
* @returns {void}
|
|
26
|
-
* @note It is required to validate if `uTime` is set
|
|
27
|
-
* because the `beforeCompile` image material shader logic
|
|
28
|
-
* (which adds this uniform)
|
|
29
|
-
* only runs after the first render of the scene
|
|
30
26
|
*/
|
|
31
27
|
update(elapsed: number): void;
|
|
32
28
|
/**
|
package/dist/img2pxl.js
CHANGED
|
@@ -69,7 +69,7 @@ float disFactor = texture(uDisTexture, uv).r;
|
|
|
69
69
|
float displacementX = cos(aDisAngle) * disFactor;
|
|
70
70
|
float displacementY = sin(aDisAngle) * disFactor;
|
|
71
71
|
vec2 displacement = vec2(displacementX, displacementY);
|
|
72
|
-
vertexPosition.xy += displacement;`, p, W,
|
|
72
|
+
vertexPosition.xy += displacement;`, p, W, K, N, X, ue, me, ve, he;
|
|
73
73
|
class De {
|
|
74
74
|
/**
|
|
75
75
|
* Constructor
|
|
@@ -84,8 +84,8 @@ class De {
|
|
|
84
84
|
* @param {number} displacementFrequency
|
|
85
85
|
* @param {number} displacementAmplitude
|
|
86
86
|
*/
|
|
87
|
-
constructor(e, t, s, r, m, h = 0.1,
|
|
88
|
-
a(this,
|
|
87
|
+
constructor(e, t, s, r, m, h = 0.1, Z = 5, v = 5, Y = 50) {
|
|
88
|
+
a(this, X);
|
|
89
89
|
/**
|
|
90
90
|
* @type {Image}
|
|
91
91
|
*/
|
|
@@ -97,25 +97,21 @@ class De {
|
|
|
97
97
|
/**
|
|
98
98
|
* @type {RendererManager}
|
|
99
99
|
*/
|
|
100
|
-
a(this,
|
|
100
|
+
a(this, K);
|
|
101
101
|
/**
|
|
102
102
|
* @type {Pane}
|
|
103
103
|
*/
|
|
104
104
|
a(this, N);
|
|
105
|
-
l(this, p, e), l(this, W, t), l(this,
|
|
105
|
+
l(this, p, e), l(this, W, t), l(this, K, s), l(this, N, r), n(this, X, ue).call(this, m, h, Z, v, Y), n(this, X, me).call(this);
|
|
106
106
|
}
|
|
107
107
|
/**
|
|
108
108
|
* Update
|
|
109
109
|
*
|
|
110
110
|
* @param {number} elapsed
|
|
111
111
|
* @returns {void}
|
|
112
|
-
* @note It is required to validate if `uTime` is set
|
|
113
|
-
* because the `beforeCompile` image material shader logic
|
|
114
|
-
* (which adds this uniform)
|
|
115
|
-
* only runs after the first render of the scene
|
|
116
112
|
*/
|
|
117
113
|
update(e) {
|
|
118
|
-
i(this, p).points.material.uniforms.uTime
|
|
114
|
+
i(this, p).points.material.uniforms.uTime.value = e, i(this, W).update(), i(this, K).update();
|
|
119
115
|
}
|
|
120
116
|
/**
|
|
121
117
|
* Enable debug mode
|
|
@@ -141,7 +137,7 @@ class De {
|
|
|
141
137
|
amplitude: i(this, p).points.material.uniforms.uDisAmplitude.value
|
|
142
138
|
},
|
|
143
139
|
"amplitude",
|
|
144
|
-
{ min: 0, max: i(this,
|
|
140
|
+
{ min: 0, max: i(this, K).width, step: 1 }
|
|
145
141
|
).on(
|
|
146
142
|
"change",
|
|
147
143
|
(s) => i(this, p).points.material.uniforms.uDisAmplitude.value = s.value
|
|
@@ -163,7 +159,7 @@ class De {
|
|
|
163
159
|
amplitude: i(this, p).points.material.uniforms.uNoiseAmplitude.value
|
|
164
160
|
},
|
|
165
161
|
"amplitude",
|
|
166
|
-
{ min: 0, max: i(this,
|
|
162
|
+
{ min: 0, max: i(this, K).width, step: 1 }
|
|
167
163
|
).on(
|
|
168
164
|
"change",
|
|
169
165
|
(s) => i(this, p).points.material.uniforms.uNoiseAmplitude.value = s.value
|
|
@@ -178,7 +174,7 @@ class De {
|
|
|
178
174
|
i(this, p).dispose(), i(this, W).dispose();
|
|
179
175
|
}
|
|
180
176
|
}
|
|
181
|
-
p = new WeakMap(), W = new WeakMap(),
|
|
177
|
+
p = new WeakMap(), W = new WeakMap(), K = new WeakMap(), N = new WeakMap(), X = new WeakSet(), /**
|
|
182
178
|
* Init image
|
|
183
179
|
*
|
|
184
180
|
* @param {string} noiseImageSrc
|
|
@@ -189,14 +185,14 @@ p = new WeakMap(), W = new WeakMap(), Z = new WeakMap(), N = new WeakMap(), K =
|
|
|
189
185
|
* @returns {void}
|
|
190
186
|
*/
|
|
191
187
|
ue = function(e, t, s, r, m) {
|
|
192
|
-
|
|
188
|
+
i(this, K).scene.add(i(this, p).points), n(this, X, he).call(this), n(this, X, ve).call(this, e, t, s, r, m);
|
|
193
189
|
}, /**
|
|
194
190
|
* Init pointer
|
|
195
191
|
*
|
|
196
192
|
* @returns {void}
|
|
197
193
|
*/
|
|
198
194
|
me = function() {
|
|
199
|
-
i(this, W).raycasterPlane.position.copy(i(this, p).points.position), i(this, W).raycasterPlane.position.z += 0.01, i(this,
|
|
195
|
+
i(this, W).raycasterPlane.position.copy(i(this, p).points.position), i(this, W).raycasterPlane.position.z += 0.01, i(this, K).scene.add(i(this, W).raycasterPlane);
|
|
200
196
|
}, /**
|
|
201
197
|
* Add logic that handles vertex/point/pixel displacement to image
|
|
202
198
|
*
|
|
@@ -210,24 +206,28 @@ me = function() {
|
|
|
210
206
|
* is called `uDisTexture` inside the shader because
|
|
211
207
|
* it is considered that the shader does not need to know
|
|
212
208
|
* that this texture is related to a pointer
|
|
209
|
+
* @note Force shader compilation with `compile()`.
|
|
210
|
+
* If it is not forced the shader compilation, then
|
|
211
|
+
* uniforms will be undefined until first render of the scene
|
|
212
|
+
* {@link https://github.com/mrdoob/three.js/pull/10960}
|
|
213
213
|
*/
|
|
214
214
|
ve = function(e, t, s, r, m) {
|
|
215
|
-
const
|
|
216
|
-
|
|
215
|
+
const Z = new V.TextureLoader().load(e);
|
|
216
|
+
Z.wrapS = V.RepeatWrapping, i(this, p).points.material.onBeforeCompile = (v) => {
|
|
217
217
|
v.uniforms.uTime = new V.Uniform(0), v.uniforms.uDisFrequency = new V.Uniform(
|
|
218
218
|
r
|
|
219
219
|
), v.uniforms.uDisAmplitude = new V.Uniform(
|
|
220
220
|
m
|
|
221
221
|
), v.uniforms.uDisTexture = new V.Uniform(
|
|
222
222
|
i(this, W).canvas.texture
|
|
223
|
-
), v.uniforms.uNoiseFrequency = new V.Uniform(t), v.uniforms.uNoiseAmplitude = new V.Uniform(s), v.uniforms.uNoiseTexture = new V.Uniform(
|
|
223
|
+
), v.uniforms.uNoiseFrequency = new V.Uniform(t), v.uniforms.uNoiseAmplitude = new V.Uniform(s), v.uniforms.uNoiseTexture = new V.Uniform(Z), v.vertexShader = v.vertexShader.replace(
|
|
224
224
|
"varying vec4 vColor;",
|
|
225
225
|
Ie
|
|
226
226
|
), v.vertexShader = v.vertexShader.replace(
|
|
227
227
|
"vec3 vertexPosition = position;",
|
|
228
228
|
Ce
|
|
229
229
|
);
|
|
230
|
-
};
|
|
230
|
+
}, i(this, K).compile();
|
|
231
231
|
}, /**
|
|
232
232
|
* Add attributes that handle displacement to image
|
|
233
233
|
*
|
|
@@ -245,7 +245,7 @@ he = function() {
|
|
|
245
245
|
new V.BufferAttribute(s, 1)
|
|
246
246
|
);
|
|
247
247
|
};
|
|
248
|
-
var U,
|
|
248
|
+
var U, ce, fe, Ue, We, Re;
|
|
249
249
|
class Ee {
|
|
250
250
|
/**
|
|
251
251
|
* Constructor
|
|
@@ -282,7 +282,7 @@ class Ee {
|
|
|
282
282
|
* @note Device pixel ratio
|
|
283
283
|
*/
|
|
284
284
|
q(this, "dpr");
|
|
285
|
-
this.width = e, this.height = t, n(this, U,
|
|
285
|
+
this.width = e, this.height = t, n(this, U, ce).call(this), n(this, U, Ue).call(this), n(this, U, fe).call(this);
|
|
286
286
|
}
|
|
287
287
|
/**
|
|
288
288
|
* Update
|
|
@@ -292,6 +292,15 @@ class Ee {
|
|
|
292
292
|
update() {
|
|
293
293
|
this.renderer.render(this.scene, this.camera);
|
|
294
294
|
}
|
|
295
|
+
/**
|
|
296
|
+
* Compile shaders
|
|
297
|
+
*
|
|
298
|
+
* @returns {void}
|
|
299
|
+
* {@link https://github.com/mrdoob/three.js/pull/10960}
|
|
300
|
+
*/
|
|
301
|
+
compile() {
|
|
302
|
+
this.renderer.compile(this.scene, this.camera);
|
|
303
|
+
}
|
|
295
304
|
/**
|
|
296
305
|
* Dispose
|
|
297
306
|
*
|
|
@@ -310,7 +319,7 @@ U = new WeakSet(), /**
|
|
|
310
319
|
* devices with `2` or more as pixel ratio
|
|
311
320
|
* do not require this feature
|
|
312
321
|
*/
|
|
313
|
-
|
|
322
|
+
ce = function() {
|
|
314
323
|
const e = document.createElement("canvas");
|
|
315
324
|
document.body.append(e), this.dpr = Math.min(window.devicePixelRatio, 2);
|
|
316
325
|
let t = !1;
|
|
@@ -332,7 +341,7 @@ fe = function() {
|
|
|
332
341
|
* `1` world unit is `1` pixel, making it easy to position things
|
|
333
342
|
* @link https://discourse.threejs.org/t/mapping-orthographiccamera-world-units-to-pixels/10142
|
|
334
343
|
*/
|
|
335
|
-
|
|
344
|
+
fe = function() {
|
|
336
345
|
const e = -this.renderer.domElement.width / 2, t = this.renderer.domElement.width / 2, s = this.renderer.domElement.height / 2, r = -this.renderer.domElement.height / 2, m = 0.1, h = 1;
|
|
337
346
|
this.camera = new V.OrthographicCamera(
|
|
338
347
|
e,
|
|
@@ -388,7 +397,7 @@ void main() {
|
|
|
388
397
|
|
|
389
398
|
#include <tonemapping_fragment>
|
|
390
399
|
#include <colorspace_fragment>
|
|
391
|
-
}`, x, L, O,
|
|
400
|
+
}`, x, L, O, F, Ke, H, A, qe;
|
|
392
401
|
let Ge = (qe = class {
|
|
393
402
|
/**
|
|
394
403
|
* Constructor
|
|
@@ -401,7 +410,7 @@ let Ge = (qe = class {
|
|
|
401
410
|
* @param {number} pointSize
|
|
402
411
|
*/
|
|
403
412
|
constructor(e, t, s, r, m, h = 1) {
|
|
404
|
-
a(this,
|
|
413
|
+
a(this, F);
|
|
405
414
|
/**
|
|
406
415
|
* @type {THREE.Points}
|
|
407
416
|
*/
|
|
@@ -418,7 +427,7 @@ let Ge = (qe = class {
|
|
|
418
427
|
* @type {Pane}
|
|
419
428
|
*/
|
|
420
429
|
a(this, O);
|
|
421
|
-
l(this, L, e), l(this, O, t), n(this,
|
|
430
|
+
l(this, L, e), l(this, O, t), n(this, F, Ke).call(this, s, r, m, h);
|
|
422
431
|
}
|
|
423
432
|
/**
|
|
424
433
|
* Enable debug mode
|
|
@@ -434,13 +443,13 @@ let Ge = (qe = class {
|
|
|
434
443
|
"width",
|
|
435
444
|
{ min: 0, max: this.points.geometry.parameters.width, step: 1 }
|
|
436
445
|
).on("change", (s) => {
|
|
437
|
-
s.last && n(this,
|
|
446
|
+
s.last && n(this, F, H).call(this, s.value, this.points.geometry.parameters.heightSegments);
|
|
438
447
|
}), e.addBinding(
|
|
439
448
|
{ height: this.points.geometry.parameters.heightSegments },
|
|
440
449
|
"height",
|
|
441
450
|
{ min: 0, max: this.points.geometry.parameters.height, step: 1 }
|
|
442
451
|
).on("change", (s) => {
|
|
443
|
-
s.last && n(this,
|
|
452
|
+
s.last && n(this, F, H).call(this, this.points.geometry.parameters.widthSegments, s.value);
|
|
444
453
|
}), i(this, O).addFolder({ title: "Image Pixel" }).addBinding(
|
|
445
454
|
{ size: this.points.material.uniforms.uPointSize.value },
|
|
446
455
|
"size",
|
|
@@ -457,7 +466,7 @@ let Ge = (qe = class {
|
|
|
457
466
|
dispose() {
|
|
458
467
|
this.points.geometry.dispose(), this.points.material.dispose(), i(this, x).dispose();
|
|
459
468
|
}
|
|
460
|
-
}, x = new WeakMap(), L = new WeakMap(), O = new WeakMap(),
|
|
469
|
+
}, x = new WeakMap(), L = new WeakMap(), O = new WeakMap(), F = new WeakSet(), /**
|
|
461
470
|
* Init points
|
|
462
471
|
*
|
|
463
472
|
* @param {string} imageSrc
|
|
@@ -469,7 +478,7 @@ let Ge = (qe = class {
|
|
|
469
478
|
Ke = function(e, t, s, r) {
|
|
470
479
|
const m = new V.TextureLoader();
|
|
471
480
|
l(this, x, m.load(e));
|
|
472
|
-
const h = n(this,
|
|
481
|
+
const h = n(this, F, A).call(this, t, s), Z = new V.ShaderMaterial({
|
|
473
482
|
vertexShader: Ye,
|
|
474
483
|
fragmentShader: Qe,
|
|
475
484
|
uniforms: {
|
|
@@ -479,7 +488,7 @@ Ke = function(e, t, s, r) {
|
|
|
479
488
|
transparent: !0,
|
|
480
489
|
depthWrite: !1
|
|
481
490
|
});
|
|
482
|
-
this.points = new V.Points(h,
|
|
491
|
+
this.points = new V.Points(h, Z);
|
|
483
492
|
}, /**
|
|
484
493
|
* Replace image geometry
|
|
485
494
|
*
|
|
@@ -492,7 +501,7 @@ Ke = function(e, t, s, r) {
|
|
|
492
501
|
*/
|
|
493
502
|
H = function(e, t) {
|
|
494
503
|
const s = this.points.geometry.attributes;
|
|
495
|
-
this.points.geometry.dispose(), this.points.geometry = n(this,
|
|
504
|
+
this.points.geometry.dispose(), this.points.geometry = n(this, F, A).call(this, e, t, s);
|
|
496
505
|
}, /**
|
|
497
506
|
* Create image geometry
|
|
498
507
|
*
|
|
@@ -515,7 +524,7 @@ A = function(e, t, s = null) {
|
|
|
515
524
|
);
|
|
516
525
|
return r.setIndex(null), r.deleteAttribute("normal"), s && (r.attributes = { ...s, ...r.attributes }), r;
|
|
517
526
|
}, qe);
|
|
518
|
-
var R, T, g,
|
|
527
|
+
var R, T, g, b, Xe, Fe, be, Ze;
|
|
519
528
|
class Be {
|
|
520
529
|
/**
|
|
521
530
|
* Constructor
|
|
@@ -524,7 +533,7 @@ class Be {
|
|
|
524
533
|
* @param {Canvas} canvas
|
|
525
534
|
*/
|
|
526
535
|
constructor(e, t) {
|
|
527
|
-
a(this,
|
|
536
|
+
a(this, b);
|
|
528
537
|
/**
|
|
529
538
|
* @type {THREE.Vector2 | {x: number | undefined, y: number | undefined}}
|
|
530
539
|
*/
|
|
@@ -553,7 +562,7 @@ class Be {
|
|
|
553
562
|
* @type {Function}
|
|
554
563
|
*/
|
|
555
564
|
a(this, g);
|
|
556
|
-
this.canvas = t, this.coord = new V.Vector2(void 0, void 0), l(this, R, e), n(this,
|
|
565
|
+
this.canvas = t, this.coord = new V.Vector2(void 0, void 0), l(this, R, e), n(this, b, be).call(this);
|
|
557
566
|
}
|
|
558
567
|
/**
|
|
559
568
|
* Update
|
|
@@ -589,10 +598,10 @@ class Be {
|
|
|
589
598
|
* @returns {void}
|
|
590
599
|
*/
|
|
591
600
|
dispose() {
|
|
592
|
-
this.canvas.dispose(), n(this,
|
|
601
|
+
this.canvas.dispose(), n(this, b, Ze).call(this);
|
|
593
602
|
}
|
|
594
603
|
}
|
|
595
|
-
R = new WeakMap(), T = new WeakMap(), g = new WeakMap(),
|
|
604
|
+
R = new WeakMap(), T = new WeakMap(), g = new WeakMap(), b = new WeakSet(), /**
|
|
596
605
|
* Process pointer move
|
|
597
606
|
*
|
|
598
607
|
* @param {PointerEvent} e
|
|
@@ -620,10 +629,10 @@ Fe = function() {
|
|
|
620
629
|
* working between the raycaster and image points
|
|
621
630
|
*/
|
|
622
631
|
be = function() {
|
|
623
|
-
this.raycaster = new V.Raycaster(), l(this, T, n(this,
|
|
632
|
+
this.raycaster = new V.Raycaster(), l(this, T, n(this, b, Xe).bind(this)), i(this, R).renderer.domElement.addEventListener(
|
|
624
633
|
"pointermove",
|
|
625
634
|
i(this, T)
|
|
626
|
-
), l(this, g, n(this,
|
|
635
|
+
), l(this, g, n(this, b, Fe).bind(this)), i(this, R).renderer.domElement.addEventListener(
|
|
627
636
|
"pointerleave",
|
|
628
637
|
i(this, g)
|
|
629
638
|
), this.raycasterPlane = new V.Mesh(
|
|
@@ -647,7 +656,7 @@ Ze = function() {
|
|
|
647
656
|
i(this, g)
|
|
648
657
|
), this.raycasterPlane.geometry.dispose(), this.raycasterPlane.material.dispose();
|
|
649
658
|
};
|
|
650
|
-
var M,
|
|
659
|
+
var M, c, j, S, k, f, Se, ye, Pe, ze, _;
|
|
651
660
|
class He {
|
|
652
661
|
/**
|
|
653
662
|
* Constructor
|
|
@@ -660,7 +669,7 @@ class He {
|
|
|
660
669
|
* @param {number} pointerTrailingFactor
|
|
661
670
|
*/
|
|
662
671
|
constructor(e, t, s, r, m = 0.1, h = 0.05) {
|
|
663
|
-
a(this,
|
|
672
|
+
a(this, f);
|
|
664
673
|
/**
|
|
665
674
|
* @type {Pane}
|
|
666
675
|
*/
|
|
@@ -676,7 +685,7 @@ class He {
|
|
|
676
685
|
/**
|
|
677
686
|
* @type {CanvasRenderingContext2D}
|
|
678
687
|
*/
|
|
679
|
-
a(this,
|
|
688
|
+
a(this, c);
|
|
680
689
|
/**
|
|
681
690
|
* @type {HTMLImageElement}
|
|
682
691
|
* @note Image that will represent the pointer.
|
|
@@ -699,7 +708,7 @@ class He {
|
|
|
699
708
|
* pixels' displacement
|
|
700
709
|
*/
|
|
701
710
|
a(this, k);
|
|
702
|
-
l(this, M, e), l(this, k, h), n(this,
|
|
711
|
+
l(this, M, e), l(this, k, h), n(this, f, Pe).call(this, t, s), n(this, f, ze).call(this, r, m);
|
|
703
712
|
}
|
|
704
713
|
/**
|
|
705
714
|
* Update
|
|
@@ -709,7 +718,7 @@ class He {
|
|
|
709
718
|
* @returns {void}
|
|
710
719
|
*/
|
|
711
720
|
update(e, t) {
|
|
712
|
-
n(this,
|
|
721
|
+
n(this, f, ye).call(this), e && t && n(this, f, Se).call(this, e, t), this.texture.needsUpdate = !0;
|
|
713
722
|
}
|
|
714
723
|
/**
|
|
715
724
|
* Enable debug mode
|
|
@@ -724,7 +733,7 @@ class He {
|
|
|
724
733
|
min: 0,
|
|
725
734
|
max: 1,
|
|
726
735
|
step: 0.01
|
|
727
|
-
}).on("change", (s) => n(this,
|
|
736
|
+
}).on("change", (s) => n(this, f, _).call(this, s.value)), e.addBinding(
|
|
728
737
|
{ trailing: i(this, k) },
|
|
729
738
|
"trailing",
|
|
730
739
|
{
|
|
@@ -747,7 +756,7 @@ class He {
|
|
|
747
756
|
this.texture.dispose();
|
|
748
757
|
}
|
|
749
758
|
}
|
|
750
|
-
M = new WeakMap(),
|
|
759
|
+
M = new WeakMap(), c = new WeakMap(), j = new WeakMap(), S = new WeakMap(), k = new WeakMap(), f = new WeakSet(), /**
|
|
751
760
|
* Draw
|
|
752
761
|
*
|
|
753
762
|
* @param {number} dx
|
|
@@ -757,13 +766,13 @@ M = new WeakMap(), f = new WeakMap(), j = new WeakMap(), S = new WeakMap(), k =
|
|
|
757
766
|
* so it is drawn at the center of the destination position
|
|
758
767
|
*/
|
|
759
768
|
Se = function(e, t) {
|
|
760
|
-
e -= i(this, S) / 2, t -= i(this, S) / 2, i(this,
|
|
769
|
+
e -= i(this, S) / 2, t -= i(this, S) / 2, i(this, c).save(), i(this, c).globalCompositeOperation = "lighten", i(this, c).drawImage(
|
|
761
770
|
i(this, j),
|
|
762
771
|
e,
|
|
763
772
|
t,
|
|
764
773
|
i(this, S),
|
|
765
774
|
i(this, S)
|
|
766
|
-
), i(this,
|
|
775
|
+
), i(this, c).restore();
|
|
767
776
|
}, /**
|
|
768
777
|
* Clear
|
|
769
778
|
*
|
|
@@ -773,7 +782,7 @@ Se = function(e, t) {
|
|
|
773
782
|
* That is why it is required to clear the canvas with black color
|
|
774
783
|
*/
|
|
775
784
|
ye = function() {
|
|
776
|
-
i(this,
|
|
785
|
+
i(this, c).save(), i(this, c).globalAlpha = i(this, k), i(this, c).fillStyle = "#000", i(this, c).fillRect(0, 0, this.element.width, this.element.height), i(this, c).restore();
|
|
777
786
|
}, /**
|
|
778
787
|
* Init canvas texture used to detect pointer location and
|
|
779
788
|
* displace points
|
|
@@ -786,7 +795,7 @@ ye = function() {
|
|
|
786
795
|
* That is why it is used the image resolution as its dimensions
|
|
787
796
|
*/
|
|
788
797
|
Pe = function(e, t) {
|
|
789
|
-
this.element = document.createElement("canvas"), this.element.width = e, this.element.height = t, this.texture = new V.CanvasTexture(this.element), l(this,
|
|
798
|
+
this.element = document.createElement("canvas"), this.element.width = e, this.element.height = t, this.texture = new V.CanvasTexture(this.element), l(this, c, this.element.getContext("2d"));
|
|
790
799
|
}, /**
|
|
791
800
|
* Init pointer image
|
|
792
801
|
*
|
|
@@ -797,7 +806,7 @@ Pe = function(e, t) {
|
|
|
797
806
|
* a white image that will indicate which pixels should be displaced
|
|
798
807
|
*/
|
|
799
808
|
ze = function(e, t) {
|
|
800
|
-
l(this, j, new Image()), i(this, j).src = e, n(this,
|
|
809
|
+
l(this, j, new Image()), i(this, j).src = e, n(this, f, _).call(this, t);
|
|
801
810
|
}, /**
|
|
802
811
|
* Process pointer image size
|
|
803
812
|
*
|
|
@@ -1135,7 +1144,7 @@ xe = function() {
|
|
|
1135
1144
|
* @returns {void}
|
|
1136
1145
|
*/
|
|
1137
1146
|
Le = function() {
|
|
1138
|
-
var e, t, s, r, m, h,
|
|
1147
|
+
var e, t, s, r, m, h, Z, v, Y, te, se, ne, re, ae, oe, le, Ve;
|
|
1139
1148
|
l(this, P, new De(
|
|
1140
1149
|
new Ge(
|
|
1141
1150
|
this.rendererManager,
|
|
@@ -1158,7 +1167,7 @@ Le = function() {
|
|
|
1158
1167
|
),
|
|
1159
1168
|
this.rendererManager,
|
|
1160
1169
|
this.debugManager,
|
|
1161
|
-
((
|
|
1170
|
+
((Z = (h = i(this, u).currentImage.motion) == null ? void 0 : h.noise) == null ? void 0 : Z.src) ?? _e,
|
|
1162
1171
|
((Y = (v = i(this, u).currentImage.motion) == null ? void 0 : v.noise) == null ? void 0 : Y.frequency) ?? 0.05,
|
|
1163
1172
|
((se = (te = i(this, u).currentImage.motion) == null ? void 0 : te.noise) == null ? void 0 : se.amplitude) ?? 3,
|
|
1164
1173
|
((ae = (re = (ne = i(this, u).currentImage.pixel) == null ? void 0 : ne.motion) == null ? void 0 : re.displacement) == null ? void 0 : ae.frequency) ?? 5,
|