@react-three/postprocessing 2.14.3 → 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.
@@ -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?: import("three").Vector2 | undefined;
15
- delay?: import("three").Vector2 | undefined;
16
- duration?: import("three").Vector2 | undefined;
17
- strength?: import("three").Vector2 | undefined;
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 effect = React.useMemo(() => new postprocessing.GlitchEffect({ ...props, delay, duration, strength }), [delay, duration, props, strength]);
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 effect = useMemo(() => new GlitchEffect({ ...props, delay, duration, strength }), [delay, duration, props, strength]);
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();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-three/postprocessing",
3
- "version": "2.14.3",
3
+ "version": "2.14.5",
4
4
  "description": "postprocessing wrapper for React and @react-three/fiber",
5
5
  "keywords": [
6
6
  "postprocessing",
@@ -48,7 +48,7 @@
48
48
  },
49
49
  "dependencies": {
50
50
  "maath": "^0.5.3",
51
- "n8ao": "^1.4.1",
51
+ "n8ao": "^1.4.2",
52
52
  "postprocessing": "^6.31.0",
53
53
  "screen-space-reflections": "2.5.0",
54
54
  "three-stdlib": "^2.21.10"