@react-three/postprocessing 2.14.4 → 2.14.5
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/effects/Glitch.d.ts +5 -4
- package/dist/index.cjs +2 -1
- package/dist/index.js +2 -1
- package/package.json +1 -1
package/dist/effects/Glitch.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { Vector2 } from 'three';
|
|
2
3
|
import { GlitchEffect, GlitchMode } from 'postprocessing';
|
|
3
4
|
import { ReactThreeFiber } from '@react-three/fiber';
|
|
4
5
|
export type GlitchProps = ConstructorParameters<typeof GlitchEffect>[0] & Partial<{
|
|
@@ -11,10 +12,10 @@ export type GlitchProps = ConstructorParameters<typeof GlitchEffect>[0] & Partia
|
|
|
11
12
|
}>;
|
|
12
13
|
export declare const Glitch: import("react").ForwardRefExoticComponent<{
|
|
13
14
|
blendFunction?: import("postprocessing").BlendFunction | undefined;
|
|
14
|
-
chromaticAberrationOffset?:
|
|
15
|
-
delay?:
|
|
16
|
-
duration?:
|
|
17
|
-
strength?:
|
|
15
|
+
chromaticAberrationOffset?: Vector2 | undefined;
|
|
16
|
+
delay?: Vector2 | undefined;
|
|
17
|
+
duration?: Vector2 | undefined;
|
|
18
|
+
strength?: Vector2 | undefined;
|
|
18
19
|
perturbationMap?: import("three").Texture | undefined;
|
|
19
20
|
dtSize?: number | undefined;
|
|
20
21
|
columns?: number | undefined;
|
package/dist/index.cjs
CHANGED
|
@@ -315,7 +315,8 @@ const Glitch = React.forwardRef(function Glitch({ active = true, ...props }, ref
|
|
|
315
315
|
const delay = useVector2(props, 'delay');
|
|
316
316
|
const duration = useVector2(props, 'duration');
|
|
317
317
|
const strength = useVector2(props, 'strength');
|
|
318
|
-
const
|
|
318
|
+
const chromaticAberrationOffset = useVector2(props, 'chromaticAberrationOffset');
|
|
319
|
+
const effect = React.useMemo(() => new postprocessing.GlitchEffect({ ...props, delay, duration, strength, chromaticAberrationOffset }), [delay, duration, props, strength, chromaticAberrationOffset]);
|
|
319
320
|
React.useLayoutEffect(() => {
|
|
320
321
|
effect.mode = active ? props.mode || postprocessing.GlitchMode.SPORADIC : postprocessing.GlitchMode.DISABLED;
|
|
321
322
|
invalidate();
|
package/dist/index.js
CHANGED
|
@@ -295,7 +295,8 @@ const Glitch = forwardRef(function Glitch({ active = true, ...props }, ref) {
|
|
|
295
295
|
const delay = useVector2(props, 'delay');
|
|
296
296
|
const duration = useVector2(props, 'duration');
|
|
297
297
|
const strength = useVector2(props, 'strength');
|
|
298
|
-
const
|
|
298
|
+
const chromaticAberrationOffset = useVector2(props, 'chromaticAberrationOffset');
|
|
299
|
+
const effect = useMemo(() => new GlitchEffect({ ...props, delay, duration, strength, chromaticAberrationOffset }), [delay, duration, props, strength, chromaticAberrationOffset]);
|
|
299
300
|
useLayoutEffect(() => {
|
|
300
301
|
effect.mode = active ? props.mode || GlitchMode.SPORADIC : GlitchMode.DISABLED;
|
|
301
302
|
invalidate();
|