@react-three/postprocessing 3.0.4 → 3.0.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.
Files changed (93) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +81 -81
  3. package/dist/EffectComposer.d.ts +7 -6
  4. package/dist/Selection.d.ts +8 -8
  5. package/dist/effects/ASCII.d.ts +5 -4
  6. package/dist/effects/Autofocus.d.ts +8 -7
  7. package/dist/effects/Bloom.d.ts +2 -5
  8. package/dist/effects/BrightnessContrast.d.ts +2 -5
  9. package/dist/effects/ChromaticAberration.d.ts +7 -7
  10. package/dist/effects/ColorAverage.d.ts +7 -8
  11. package/dist/effects/ColorDepth.d.ts +2 -5
  12. package/dist/effects/Depth.d.ts +2 -5
  13. package/dist/effects/DepthOfField.d.ts +7 -18
  14. package/dist/effects/DotScreen.d.ts +2 -5
  15. package/dist/effects/FXAA.d.ts +2 -5
  16. package/dist/effects/Glitch.d.ts +4 -21
  17. package/dist/effects/GodRays.d.ts +7 -19
  18. package/dist/effects/Grid.d.ts +6 -7
  19. package/dist/effects/HueSaturation.d.ts +2 -5
  20. package/dist/effects/LUT.d.ts +4 -3
  21. package/dist/effects/LensFlare.d.ts +8 -8
  22. package/dist/effects/N8AO.d.ts +4 -2
  23. package/dist/effects/Noise.d.ts +2 -5
  24. package/dist/effects/Outline.d.ts +4 -23
  25. package/dist/effects/Pixelation.d.ts +3 -2
  26. package/dist/effects/Ramp.d.ts +1 -5
  27. package/dist/effects/SMAA.d.ts +2 -5
  28. package/dist/effects/SSAO.d.ts +7 -30
  29. package/dist/effects/ScanlineEffect.d.ts +2 -5
  30. package/dist/effects/SelectiveBloom.d.ts +5 -10
  31. package/dist/effects/Sepia.d.ts +2 -5
  32. package/dist/effects/ShockWave.d.ts +2 -5
  33. package/dist/effects/Texture.d.ts +7 -8
  34. package/dist/effects/TiltShift.d.ts +2 -5
  35. package/dist/effects/TiltShift2.d.ts +1 -5
  36. package/dist/effects/ToneMapping.d.ts +2 -6
  37. package/dist/effects/Vignette.d.ts +2 -5
  38. package/dist/effects/Water.d.ts +1 -5
  39. package/dist/index.d.ts +11 -10
  40. package/dist/index.js +855 -551
  41. package/dist/index.js.map +1 -1
  42. package/dist/tests/test-utils.d.ts +12 -0
  43. package/dist/util.d.ts +25 -17
  44. package/dist/wrapEffect.d.ts +12 -0
  45. package/package.json +73 -67
  46. package/src/EffectComposer.tsx +278 -200
  47. package/src/Selection.tsx +86 -46
  48. package/src/effects/ASCII.tsx +136 -135
  49. package/src/effects/Autofocus.tsx +175 -153
  50. package/src/effects/Bloom.tsx +6 -6
  51. package/src/effects/BrightnessContrast.tsx +4 -4
  52. package/src/effects/ChromaticAberration.tsx +30 -5
  53. package/src/effects/ColorAverage.tsx +17 -15
  54. package/src/effects/ColorDepth.tsx +4 -4
  55. package/src/effects/Depth.tsx +4 -4
  56. package/src/effects/DepthOfField.tsx +87 -89
  57. package/src/effects/DotScreen.tsx +4 -4
  58. package/src/effects/FXAA.tsx +4 -4
  59. package/src/effects/Glitch.tsx +37 -40
  60. package/src/effects/GodRays.tsx +20 -16
  61. package/src/effects/Grid.tsx +28 -21
  62. package/src/effects/HueSaturation.tsx +4 -4
  63. package/src/effects/LUT.tsx +27 -26
  64. package/src/effects/LensFlare.tsx +611 -611
  65. package/src/effects/N8AO.tsx +81 -81
  66. package/src/effects/Noise.tsx +4 -4
  67. package/src/effects/Outline.tsx +85 -117
  68. package/src/effects/Pixelation.tsx +17 -15
  69. package/src/effects/Ramp.tsx +150 -150
  70. package/src/effects/SMAA.tsx +4 -4
  71. package/src/effects/SSAO.tsx +44 -41
  72. package/src/effects/ScanlineEffect.tsx +7 -7
  73. package/src/effects/SelectiveBloom.tsx +116 -126
  74. package/src/effects/Sepia.tsx +4 -4
  75. package/src/effects/ShockWave.tsx +4 -4
  76. package/src/effects/Texture.tsx +27 -23
  77. package/src/effects/TiltShift.tsx +4 -4
  78. package/src/effects/TiltShift2.tsx +90 -90
  79. package/src/effects/ToneMapping.tsx +6 -6
  80. package/src/effects/Vignette.tsx +4 -4
  81. package/src/effects/Water.tsx +35 -35
  82. package/src/index.ts +41 -40
  83. package/src/tests/ChromaticAberration.test.tsx +31 -0
  84. package/src/tests/EffectComposer.test.tsx +911 -0
  85. package/src/tests/Outline.test.tsx +89 -0
  86. package/src/tests/Selection.test.tsx +324 -0
  87. package/src/tests/SelectiveBloom.test.tsx +118 -0
  88. package/src/tests/effects.smoke.test.tsx +234 -0
  89. package/src/tests/test-utils.tsx +96 -0
  90. package/src/tests/wrapEffect.test.tsx +209 -0
  91. package/src/util.tsx +96 -55
  92. package/src/wrapEffect.tsx +122 -0
  93. package/src/EffectComposer.test.tsx +0 -126
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2020 react-spring
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2020 react-spring
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,81 +1,81 @@
1
- # react-postprocessing
2
-
3
- [![Version](https://img.shields.io/npm/v/@react-three/postprocessing?style=flat&colorA=000000&colorB=000000)](https://www.npmjs.com/package/@react-three/postprocessing)
4
- [![Storybook](https://img.shields.io/static/v1?message=Storybook&style=flat&colorA=000000&colorB=000000&label=&logo=storybook&logoColor=ffffff)](https://pmndrs.github.io/react-postprocessing)
5
- [![Downloads](https://img.shields.io/npm/dt/@react-three/postprocessing.svg?style=flat&colorA=000000&colorB=000000)](https://www.npmjs.com/package/@react-three/postprocessing)
6
- [![Discord Shield](https://img.shields.io/discord/740090768164651008?style=flat&colorA=000000&colorB=000000&label=discord&logo=discord&logoColor=ffffff)](https://discord.gg/ZZjjNvJ)
7
- [![Open in GitHub Codespaces](https://img.shields.io/static/v1?&message=Open%20in%20%20Codespaces&style=flat&colorA=000000&colorB=000000&label=GitHub&logo=github&logoColor=ffffff)](https://github.com/codespaces/new?template_repository=pmndrs%2Freact-postprocessing)
8
-
9
- `react-postprocessing` is a
10
- [postprocessing](https://github.com/pmndrs/postprocessing) wrapper for
11
- [@react-three/fiber](https://github.com/pmndrs/react-three-fiber). This is not
12
- (yet) meant for complex orchestration of effects, but can save you
13
- [hundreds of LOC](https://twitter.com/0xca0a/status/1289501594698960897) for a
14
- straight forward effects-chain.
15
-
16
- ```bash
17
- npm install @react-three/postprocessing
18
- ```
19
-
20
- <p align="center">
21
- <a href="https://pqrpl.csb.app" target="_blank"><img width="274" src="bubbles.jpg" alt="Bubbles" /></a>
22
- <a href="https://5jgjz.csb.app" target="_blank"><img width="274" src="control.jpg" alt="Take Control" /></a>
23
- </p>
24
- <p align="middle">
25
- <i>These demos are real, you can click them! They contain the full code, too. 📦</i>
26
- </p>
27
-
28
- #### Why postprocessing and not three/examples/jsm/postprocessing?
29
-
30
- From
31
- [https://github.com/pmndrs/postprocessing](https://github.com/pmndrs/postprocessing#performance)
32
-
33
- > This library provides an EffectPass which automatically organizes and merges
34
- > any given combination of effects. This minimizes the amount of render
35
- > operations and makes it possible to combine many effects without the
36
- > performance penalties of traditional pass chaining. Additionally, every effect
37
- > can choose its own blend function.
38
- >
39
- > All fullscreen render operations also use a single triangle that fills the
40
- > screen. Compared to using a quad, this approach harmonizes with modern GPU
41
- > rasterization patterns and eliminates unnecessary fragment calculations along
42
- > the screen diagonal. This is especially beneficial for GPGPU passes and
43
- > effects that use complex fragment shaders.
44
-
45
- Postprocessing also supports gamma correction out of the box, as well as WebGL2
46
- MSAA (multi sample anti aliasing), which is react-postprocessing's default, you
47
- get high performance crisp results w/o jagged edges.
48
-
49
- #### What does it look like?
50
-
51
- Here's an example combining a couple of effects
52
- ([live demo](https://codesandbox.io/s/react-postprocessing-dof-blob-pqrpl?)).
53
-
54
- <a href="https://codesandbox.io/s/react-postprocessing-dof-blob-pqrpl?" target="_blank" rel="noopener">
55
- <img src="bubbles.jpg" alt="Bubbles Demo" />
56
- </a>
57
-
58
- ```jsx
59
- import React from 'react'
60
- import { Bloom, DepthOfField, EffectComposer, Noise, Vignette } from '@react-three/postprocessing'
61
- import { Canvas } from '@react-three/fiber'
62
-
63
- function App() {
64
- return (
65
- <Canvas>
66
- {/* Your regular scene contents go here, like always ... */}
67
- <EffectComposer>
68
- <DepthOfField focusDistance={0} focalLength={0.02} bokehScale={2} height={480} />
69
- <Bloom luminanceThreshold={0} luminanceSmoothing={0.9} height={300} />
70
- <Noise opacity={0.02} />
71
- <Vignette eskil={false} offset={0.1} darkness={1.1} />
72
- </EffectComposer>
73
- </Canvas>
74
- )
75
- }
76
- ```
77
-
78
- ## Documentation
79
-
80
- - [react-postprocessing docs](https://docs.pmnd.rs/react-postprocessing)
81
- - [postprocessing docs](https://pmndrs.github.io/postprocessing/public/docs/)
1
+ # react-postprocessing
2
+
3
+ [![Version](https://img.shields.io/npm/v/@react-three/postprocessing?style=flat&colorA=000000&colorB=000000)](https://www.npmjs.com/package/@react-three/postprocessing)
4
+ [![Storybook](https://img.shields.io/static/v1?message=Storybook&style=flat&colorA=000000&colorB=000000&label=&logo=storybook&logoColor=ffffff)](https://pmndrs.github.io/react-postprocessing)
5
+ [![Downloads](https://img.shields.io/npm/dt/@react-three/postprocessing.svg?style=flat&colorA=000000&colorB=000000)](https://www.npmjs.com/package/@react-three/postprocessing)
6
+ [![Discord Shield](https://img.shields.io/discord/740090768164651008?style=flat&colorA=000000&colorB=000000&label=discord&logo=discord&logoColor=ffffff)](https://discord.gg/ZZjjNvJ)
7
+ [![Open in GitHub Codespaces](https://img.shields.io/static/v1?&message=Open%20in%20%20Codespaces&style=flat&colorA=000000&colorB=000000&label=GitHub&logo=github&logoColor=ffffff)](https://github.com/codespaces/new?template_repository=pmndrs%2Freact-postprocessing)
8
+
9
+ `react-postprocessing` is a
10
+ [postprocessing](https://github.com/pmndrs/postprocessing) wrapper for
11
+ [@react-three/fiber](https://github.com/pmndrs/react-three-fiber). This is not
12
+ (yet) meant for complex orchestration of effects, but can save you
13
+ [hundreds of LOC](https://twitter.com/0xca0a/status/1289501594698960897) for a
14
+ straight forward effects-chain.
15
+
16
+ ```bash
17
+ npm install @react-three/postprocessing
18
+ ```
19
+
20
+ <p align="center">
21
+ <a href="https://pqrpl.csb.app" target="_blank"><img width="274" src="bubbles.jpg" alt="Bubbles" /></a>
22
+ <a href="https://5jgjz.csb.app" target="_blank"><img width="274" src="control.jpg" alt="Take Control" /></a>
23
+ </p>
24
+ <p align="middle">
25
+ <i>These demos are real, you can click them! They contain the full code, too. 📦</i>
26
+ </p>
27
+
28
+ #### Why postprocessing and not three/examples/jsm/postprocessing?
29
+
30
+ From
31
+ [https://github.com/pmndrs/postprocessing](https://github.com/pmndrs/postprocessing#performance)
32
+
33
+ > This library provides an EffectPass which automatically organizes and merges
34
+ > any given combination of effects. This minimizes the amount of render
35
+ > operations and makes it possible to combine many effects without the
36
+ > performance penalties of traditional pass chaining. Additionally, every effect
37
+ > can choose its own blend function.
38
+ >
39
+ > All fullscreen render operations also use a single triangle that fills the
40
+ > screen. Compared to using a quad, this approach harmonizes with modern GPU
41
+ > rasterization patterns and eliminates unnecessary fragment calculations along
42
+ > the screen diagonal. This is especially beneficial for GPGPU passes and
43
+ > effects that use complex fragment shaders.
44
+
45
+ Postprocessing also supports gamma correction out of the box, as well as WebGL2
46
+ MSAA (multi sample anti aliasing), which is react-postprocessing's default, you
47
+ get high performance crisp results w/o jagged edges.
48
+
49
+ #### What does it look like?
50
+
51
+ Here's an example combining a couple of effects
52
+ ([live demo](https://codesandbox.io/s/react-postprocessing-dof-blob-pqrpl?)).
53
+
54
+ <a href="https://codesandbox.io/s/react-postprocessing-dof-blob-pqrpl?" target="_blank" rel="noopener">
55
+ <img src="bubbles.jpg" alt="Bubbles Demo" />
56
+ </a>
57
+
58
+ ```jsx
59
+ import React from 'react'
60
+ import { Bloom, DepthOfField, EffectComposer, Noise, Vignette } from '@react-three/postprocessing'
61
+ import { Canvas } from '@react-three/fiber'
62
+
63
+ function App() {
64
+ return (
65
+ <Canvas>
66
+ {/* Your regular scene contents go here, like always ... */}
67
+ <EffectComposer>
68
+ <DepthOfField focusDistance={0} focalLength={0.02} bokehScale={2} height={480} />
69
+ <Bloom luminanceThreshold={0} luminanceSmoothing={0.9} height={300} />
70
+ <Noise opacity={0.02} />
71
+ <Vignette eskil={false} offset={0.1} darkness={1.1} />
72
+ </EffectComposer>
73
+ </Canvas>
74
+ )
75
+ }
76
+ ```
77
+
78
+ ## Documentation
79
+
80
+ - [react-postprocessing docs](https://docs.pmnd.rs/react-postprocessing)
81
+ - [postprocessing docs](https://pmndrs.github.io/postprocessing/public/docs/)
@@ -1,17 +1,17 @@
1
- import type { TextureDataType, Camera, Scene } from 'three';
2
- import { type JSX } from 'react';
3
- import { EffectComposer as EffectComposerImpl, NormalPass, DepthDownsamplingPass } from 'postprocessing';
1
+ import { DepthDownsamplingPass, EffectComposer as EffectComposerImpl, NormalPass } from 'postprocessing';
2
+ import { type ReactNode, type Ref } from 'react';
3
+ import type { Camera, Scene, TextureDataType } from 'three';
4
4
  export declare const EffectComposerContext: import("react").Context<{
5
5
  composer: EffectComposerImpl;
6
6
  normalPass: NormalPass | null;
7
7
  downSamplingPass: DepthDownsamplingPass | null;
8
8
  camera: Camera;
9
9
  scene: Scene;
10
- resolutionScale?: number | undefined;
10
+ resolutionScale?: number;
11
11
  }>;
12
12
  export type EffectComposerProps = {
13
13
  enabled?: boolean;
14
- children: JSX.Element | JSX.Element[];
14
+ children: ReactNode;
15
15
  depthBuffer?: boolean;
16
16
  /** Only used for SSGI currently, leave it disabled for everything else unless it's needed */
17
17
  enableNormalPass?: boolean;
@@ -23,5 +23,6 @@ export type EffectComposerProps = {
23
23
  renderPriority?: number;
24
24
  camera?: Camera;
25
25
  scene?: Scene;
26
+ ref?: Ref<EffectComposerImpl>;
26
27
  };
27
- export declare const EffectComposer: import("react").NamedExoticComponent<EffectComposerProps & import("react").RefAttributes<EffectComposerImpl>>;
28
+ export declare const EffectComposer: import("react").MemoExoticComponent<({ children, camera: _camera, scene: _scene, resolutionScale, enabled, renderPriority, autoClear, depthBuffer, enableNormalPass, stencilBuffer, multisampling, frameBufferType, ref, }: EffectComposerProps) => import("react").JSX.Element | null>;
@@ -1,17 +1,17 @@
1
- import * as THREE from 'three';
2
- import React from 'react';
3
1
  import { type ThreeElements } from '@react-three/fiber';
2
+ import { type Dispatch, type ReactNode, type SetStateAction } from 'react';
3
+ import { type Object3D } from 'three';
4
4
  export type Api = {
5
- selected: THREE.Object3D[];
6
- select: React.Dispatch<React.SetStateAction<THREE.Object3D[]>>;
5
+ selected: Object3D[];
6
+ select: Dispatch<SetStateAction<Object3D[]>>;
7
7
  enabled: boolean;
8
8
  };
9
9
  export type SelectApi = Omit<ThreeElements['group'], 'ref'> & {
10
10
  enabled?: boolean;
11
11
  };
12
- export declare const selectionContext: React.Context<Api | null>;
12
+ export declare const selectionContext: import("react").Context<Api | null>;
13
13
  export declare function Selection({ children, enabled }: {
14
14
  enabled?: boolean;
15
- children: React.ReactNode;
16
- }): import("react/jsx-runtime").JSX.Element;
17
- export declare function Select({ enabled, children, ...props }: SelectApi): import("react/jsx-runtime").JSX.Element;
15
+ children: ReactNode;
16
+ }): import("react").JSX.Element;
17
+ export declare function Select({ enabled, children, ...props }: SelectApi): import("react").JSX.Element;
@@ -1,6 +1,6 @@
1
- /// <reference types="react" />
2
- import { Texture } from 'three';
3
1
  import { Effect } from 'postprocessing';
2
+ import { Ref } from 'react';
3
+ import { Texture } from 'three';
4
4
  interface IASCIIEffectProps {
5
5
  font?: string;
6
6
  characters?: string;
@@ -8,11 +8,12 @@ interface IASCIIEffectProps {
8
8
  cellSize?: number;
9
9
  color?: string;
10
10
  invert?: boolean;
11
+ ref?: Ref<ASCIIEffect>;
11
12
  }
12
13
  declare class ASCIIEffect extends Effect {
13
- constructor({ font, characters, fontSize, cellSize, color, invert, }?: IASCIIEffectProps);
14
+ constructor({ font, characters, fontSize, cellSize, color, invert, }?: Omit<IASCIIEffectProps, 'ref'>);
14
15
  /** Draws the characters on a Canvas and returns a texture */
15
16
  createCharactersTexture(characters: string, font: string, fontSize: number): Texture;
16
17
  }
17
- export declare const ASCII: import("react").ForwardRefExoticComponent<IASCIIEffectProps & import("react").RefAttributes<ASCIIEffect>>;
18
+ export declare function ASCII({ font, characters, fontSize, cellSize, color, invert, ref, }: IASCIIEffectProps): import("react").JSX.Element;
18
19
  export {};
@@ -1,10 +1,10 @@
1
- import * as THREE from 'three';
2
- import React, { RefObject } from 'react';
3
- import { type Vector3 } from '@react-three/fiber';
1
+ import { type Vector3 as R3FVector3 } from '@react-three/fiber';
4
2
  import { DepthOfFieldEffect } from 'postprocessing';
3
+ import { Ref, type ComponentProps, type RefObject } from 'react';
4
+ import { Vector3 } from 'three';
5
5
  import { DepthOfField } from './DepthOfField';
6
- export type AutofocusProps = React.ComponentProps<typeof DepthOfField> & {
7
- target?: Vector3;
6
+ export type AutofocusProps = ComponentProps<typeof DepthOfField> & {
7
+ target?: R3FVector3;
8
8
  /** should the target follow the pointer */
9
9
  mouse?: boolean;
10
10
  /** size of the debug green point */
@@ -13,10 +13,11 @@ export type AutofocusProps = React.ComponentProps<typeof DepthOfField> & {
13
13
  manual?: boolean;
14
14
  /** approximate time to reach the target */
15
15
  smoothTime?: number;
16
+ ref?: Ref<AutofocusApi>;
16
17
  };
17
18
  export type AutofocusApi = {
18
19
  dofRef: RefObject<DepthOfFieldEffect | null>;
19
- hitpoint: THREE.Vector3;
20
+ hitpoint: Vector3;
20
21
  update: (delta: number, updateTarget: boolean) => void;
21
22
  };
22
- export declare const Autofocus: React.ForwardRefExoticComponent<Omit<AutofocusProps, "ref"> & React.RefAttributes<AutofocusApi>>;
23
+ export declare function Autofocus({ target, mouse: followMouse, debug, manual, smoothTime, ref, ...props }: AutofocusProps): import("react").JSX.Element;
@@ -1,5 +1,2 @@
1
- export declare const Bloom: ({ blendFunction, opacity, ...props }: {
2
- [x: string]: any;
3
- blendFunction?: any;
4
- opacity?: any;
5
- }) => import("react/jsx-runtime").JSX.Element;
1
+ import { BloomEffect } from 'postprocessing';
2
+ export declare const Bloom: (props: import("..").EffectProps<typeof BloomEffect>) => import("react").JSX.Element;
@@ -1,5 +1,2 @@
1
- export declare const BrightnessContrast: ({ blendFunction, opacity, ...props }: {
2
- [x: string]: any;
3
- blendFunction?: any;
4
- opacity?: any;
5
- }) => import("react/jsx-runtime").JSX.Element;
1
+ import { BrightnessContrastEffect } from 'postprocessing';
2
+ export declare const BrightnessContrast: (props: import("..").EffectProps<typeof BrightnessContrastEffect>) => import("react").JSX.Element;
@@ -1,8 +1,8 @@
1
+ import type { ReactThreeFiber } from '@react-three/fiber';
1
2
  import { ChromaticAberrationEffect } from 'postprocessing';
2
- import { type EffectProps } from '../util';
3
- export type ChromaticAberrationProps = EffectProps<typeof ChromaticAberrationEffect>;
4
- export declare const ChromaticAberration: ({ blendFunction, opacity, ...props }: {
5
- [x: string]: any;
6
- blendFunction?: any;
7
- opacity?: any;
8
- }) => import("react/jsx-runtime").JSX.Element;
3
+ import type { Ref } from 'react';
4
+ export type ChromaticAberrationProps = Omit<Partial<ConstructorParameters<typeof ChromaticAberrationEffect>[0]>, 'offset'> & {
5
+ ref?: Ref<ChromaticAberrationEffect>;
6
+ offset?: ReactThreeFiber.Vector2;
7
+ };
8
+ export declare function ChromaticAberration({ ref, ...props }: ChromaticAberrationProps): import("react").JSX.Element;
@@ -1,8 +1,7 @@
1
- import { ColorAverageEffect, BlendFunction } from 'postprocessing';
2
- import React from 'react';
3
- export type ColorAverageProps = Partial<{
4
- blendFunction: BlendFunction;
5
- }>;
6
- export declare const ColorAverage: React.ForwardRefExoticComponent<Partial<{
7
- blendFunction: BlendFunction;
8
- }> & React.RefAttributes<ColorAverageEffect>>;
1
+ import { BlendFunction, ColorAverageEffect } from 'postprocessing';
2
+ import type { Ref } from 'react';
3
+ export type ColorAverageProps = {
4
+ blendFunction?: BlendFunction;
5
+ ref?: Ref<ColorAverageEffect>;
6
+ };
7
+ export declare function ColorAverage({ blendFunction, ref }: ColorAverageProps): import("react").JSX.Element;
@@ -1,5 +1,2 @@
1
- export declare const ColorDepth: ({ blendFunction, opacity, ...props }: {
2
- [x: string]: any;
3
- blendFunction?: any;
4
- opacity?: any;
5
- }) => import("react/jsx-runtime").JSX.Element;
1
+ import { ColorDepthEffect } from 'postprocessing';
2
+ export declare const ColorDepth: (props: import("..").EffectProps<typeof ColorDepthEffect>) => import("react").JSX.Element;
@@ -1,5 +1,2 @@
1
- export declare const Depth: ({ blendFunction, opacity, ...props }: {
2
- [x: string]: any;
3
- blendFunction?: any;
4
- opacity?: any;
5
- }) => import("react/jsx-runtime").JSX.Element;
1
+ import { DepthEffect } from 'postprocessing';
2
+ export declare const Depth: (props: import("..").EffectProps<typeof DepthEffect>) => import("react").JSX.Element;
@@ -1,25 +1,14 @@
1
- /// <reference types="react" />
1
+ import type { ReactThreeFiber } from '@react-three/fiber';
2
2
  import { DepthOfFieldEffect } from 'postprocessing';
3
- import { ReactThreeFiber } from '@react-three/fiber';
4
- import { type Texture, Vector3 } from 'three';
5
- export declare const DepthOfField: import("react").ForwardRefExoticComponent<{
6
- blendFunction?: import("postprocessing").BlendFunction | undefined;
7
- worldFocusDistance?: number | undefined;
8
- worldFocusRange?: number | undefined;
9
- focusDistance?: number | undefined;
10
- focalLength?: number | undefined;
11
- focusRange?: number | undefined;
12
- bokehScale?: number | undefined;
13
- resolutionScale?: number | undefined;
14
- resolutionX?: number | undefined;
15
- resolutionY?: number | undefined;
16
- width?: number | undefined;
17
- height?: number | undefined;
18
- } & Partial<{
3
+ import type { Ref } from 'react';
4
+ import { type Texture } from 'three';
5
+ export type DepthOfFieldProps = ConstructorParameters<typeof DepthOfFieldEffect>[1] & Partial<{
6
+ ref: Ref<DepthOfFieldEffect>;
19
7
  target: ReactThreeFiber.Vector3;
20
8
  depthTexture: {
21
9
  texture: Texture;
22
10
  packing: number;
23
11
  };
24
12
  blur: number;
25
- }> & import("react").RefAttributes<DepthOfFieldEffect>>;
13
+ }>;
14
+ export declare function DepthOfField({ ref, blendFunction, worldFocusDistance, worldFocusRange, focusDistance, focusRange, focalLength, bokehScale, resolutionScale, resolutionX, resolutionY, width, height, target, depthTexture, ...props }: DepthOfFieldProps): import("react").JSX.Element;
@@ -1,5 +1,2 @@
1
- export declare const DotScreen: ({ blendFunction, opacity, ...props }: {
2
- [x: string]: any;
3
- blendFunction?: any;
4
- opacity?: any;
5
- }) => import("react/jsx-runtime").JSX.Element;
1
+ import { DotScreenEffect } from 'postprocessing';
2
+ export declare const DotScreen: (props: import("..").EffectProps<typeof DotScreenEffect>) => import("react").JSX.Element;
@@ -1,5 +1,2 @@
1
- export declare const FXAA: ({ blendFunction, opacity, ...props }: {
2
- [x: string]: any;
3
- blendFunction?: any;
4
- opacity?: any;
5
- }) => import("react/jsx-runtime").JSX.Element;
1
+ import { FXAAEffect } from 'postprocessing';
2
+ export declare const FXAA: (props: import("..").EffectProps<typeof FXAAEffect>) => import("react").JSX.Element;
@@ -1,7 +1,6 @@
1
- /// <reference types="react" />
2
- import { Vector2 } from 'three';
3
- import { GlitchEffect, GlitchMode } from 'postprocessing';
4
1
  import { ReactThreeFiber } from '@react-three/fiber';
2
+ import { GlitchEffect, GlitchMode } from 'postprocessing';
3
+ import { Ref } from 'react';
5
4
  export type GlitchProps = ConstructorParameters<typeof GlitchEffect>[0] & Partial<{
6
5
  mode: GlitchMode;
7
6
  active: boolean;
@@ -9,22 +8,6 @@ export type GlitchProps = ConstructorParameters<typeof GlitchEffect>[0] & Partia
9
8
  duration: ReactThreeFiber.Vector2;
10
9
  chromaticAberrationOffset: ReactThreeFiber.Vector2;
11
10
  strength: ReactThreeFiber.Vector2;
11
+ ref?: Ref<GlitchEffect>;
12
12
  }>;
13
- export declare const Glitch: import("react").ForwardRefExoticComponent<{
14
- blendFunction?: import("postprocessing").BlendFunction | undefined;
15
- chromaticAberrationOffset?: Vector2 | undefined;
16
- delay?: Vector2 | undefined;
17
- duration?: Vector2 | undefined;
18
- strength?: Vector2 | undefined;
19
- perturbationMap?: import("three").Texture | undefined;
20
- dtSize?: number | undefined;
21
- columns?: number | undefined;
22
- ratio?: number | undefined;
23
- } & Partial<{
24
- mode: GlitchMode;
25
- active: boolean;
26
- delay: ReactThreeFiber.Vector2;
27
- duration: ReactThreeFiber.Vector2;
28
- chromaticAberrationOffset: ReactThreeFiber.Vector2;
29
- strength: ReactThreeFiber.Vector2;
30
- }> & import("react").RefAttributes<GlitchEffect>>;
13
+ export declare function Glitch({ active, ref, ...props }: GlitchProps): import("react").JSX.Element;
@@ -1,21 +1,9 @@
1
1
  import { GodRaysEffect } from 'postprocessing';
2
- import React from 'react';
2
+ import { Ref, RefObject } from 'react';
3
3
  import { Mesh, Points } from 'three';
4
- export declare const GodRays: React.ForwardRefExoticComponent<{
5
- blendFunction?: import("postprocessing").BlendFunction | undefined;
6
- samples?: number | undefined;
7
- density?: number | undefined;
8
- decay?: number | undefined;
9
- weight?: number | undefined;
10
- exposure?: number | undefined;
11
- clampMax?: number | undefined;
12
- resolutionScale?: number | undefined;
13
- resolutionX?: number | undefined;
14
- resolutionY?: number | undefined;
15
- width?: number | undefined;
16
- height?: number | undefined;
17
- kernelSize?: import("postprocessing").KernelSize | undefined;
18
- blur?: boolean | undefined;
19
- } & {
20
- sun: Mesh | Points | React.RefObject<Mesh | Points>;
21
- } & React.RefAttributes<GodRaysEffect>>;
4
+ type GodRaysProps = ConstructorParameters<typeof GodRaysEffect>[2] & {
5
+ sun: Mesh | Points | RefObject<Mesh | Points>;
6
+ ref?: Ref<GodRaysEffect>;
7
+ };
8
+ export declare function GodRays({ ref, ...props }: GodRaysProps): import("react").JSX.Element;
9
+ export {};
@@ -1,12 +1,11 @@
1
- import React from 'react';
2
1
  import { GridEffect } from 'postprocessing';
3
- export declare const Grid: React.ForwardRefExoticComponent<{
4
- blendFunction?: import("postprocessing").BlendFunction | undefined;
5
- scale?: number | undefined;
6
- lineWidth?: number | undefined;
7
- } & Partial<{
2
+ import { Ref } from 'react';
3
+ type GridProps = ConstructorParameters<typeof GridEffect>[0] & Partial<{
8
4
  size: {
9
5
  width: number;
10
6
  height: number;
11
7
  };
12
- }> & React.RefAttributes<GridEffect>>;
8
+ ref: Ref<GridEffect>;
9
+ }>;
10
+ export declare function Grid({ size, ref, ...props }: GridProps): import("react").JSX.Element;
11
+ export {};
@@ -1,5 +1,2 @@
1
- export declare const HueSaturation: ({ blendFunction, opacity, ...props }: {
2
- [x: string]: any;
3
- blendFunction?: any;
4
- opacity?: any;
5
- }) => import("react/jsx-runtime").JSX.Element;
1
+ import { HueSaturationEffect } from 'postprocessing';
2
+ export declare const HueSaturation: (props: import("..").EffectProps<typeof HueSaturationEffect>) => import("react").JSX.Element;
@@ -1,9 +1,10 @@
1
- import { LUT3DEffect, BlendFunction } from 'postprocessing';
2
- import React from 'react';
1
+ import { BlendFunction, LUT3DEffect } from 'postprocessing';
2
+ import { Ref } from 'react';
3
3
  import type { Texture } from 'three';
4
4
  export type LUTProps = {
5
5
  lut: Texture;
6
6
  blendFunction?: BlendFunction;
7
7
  tetrahedralInterpolation?: boolean;
8
+ ref?: Ref<LUT3DEffect>;
8
9
  };
9
- export declare const LUT: React.ForwardRefExoticComponent<LUTProps & React.RefAttributes<LUT3DEffect>>;
10
+ export declare function LUT({ lut, tetrahedralInterpolation, ref, ...props }: LUTProps): import("react").JSX.Element;
@@ -1,5 +1,5 @@
1
- import * as THREE from 'three';
2
1
  import { BlendFunction, Effect } from 'postprocessing';
2
+ import { Color, Texture, Vector2, Vector3 } from 'three';
3
3
  type LensFlareEffectOptions = {
4
4
  /** The blend function of this effect */
5
5
  blendFunction: BlendFunction;
@@ -8,9 +8,9 @@ type LensFlareEffectOptions = {
8
8
  /** The glare size */
9
9
  glareSize: number;
10
10
  /** The position of the lens flare in 3d space */
11
- lensPosition: THREE.Vector3;
11
+ lensPosition: Vector3;
12
12
  /** Effect resolution */
13
- screenRes: THREE.Vector2;
13
+ screenRes: Vector2;
14
14
  /** The number of points for the star */
15
15
  starPoints: number;
16
16
  /** The flare side */
@@ -23,10 +23,10 @@ type LensFlareEffectOptions = {
23
23
  animated: boolean;
24
24
  /** Set the appearance to full anamorphic */
25
25
  anamorphic: boolean;
26
- /** Set the color gain for the lens flare. Must be a THREE.Color in RBG format */
27
- colorGain: THREE.Color;
26
+ /** Set the color gain for the lens flare. Must be a Color in RBG format */
27
+ colorGain: Color;
28
28
  /** Texture to be used as color dirt for starburst effect */
29
- lensDirtTexture: THREE.Texture | null;
29
+ lensDirtTexture: Texture | null;
30
30
  /** The halo scale */
31
31
  haloScale: number;
32
32
  /** Option to enable/disable secondary ghosts */
@@ -46,9 +46,9 @@ export declare class LensFlareEffect extends Effect {
46
46
  }
47
47
  type LensFlareProps = {
48
48
  /** Position of the effect */
49
- lensPosition?: THREE.Vector3;
49
+ lensPosition?: Vector3;
50
50
  /** The time that it takes to fade the occlusion */
51
51
  smoothTime?: number;
52
52
  } & Partial<LensFlareEffectOptions>;
53
- export declare const LensFlare: ({ smoothTime, blendFunction, enabled, glareSize, lensPosition, screenRes, starPoints, flareSize, flareSpeed, flareShape, animated, anamorphic, colorGain, lensDirtTexture, haloScale, secondaryGhosts, aditionalStreaks, ghostScale, opacity, starBurst, }: LensFlareProps) => import("react/jsx-runtime").JSX.Element;
53
+ export declare const LensFlare: ({ smoothTime, blendFunction, enabled, glareSize, lensPosition, screenRes, starPoints, flareSize, flareSpeed, flareShape, animated, anamorphic, colorGain, lensDirtTexture, haloScale, secondaryGhosts, aditionalStreaks, ghostScale, opacity, starBurst, }: LensFlareProps) => import("react").JSX.Element;
54
54
  export {};
@@ -1,5 +1,6 @@
1
- /// <reference types="react" />
2
1
  import { ReactThreeFiber } from '@react-three/fiber';
2
+ import { Ref } from 'react';
3
+ import { N8AOPostPass } from 'n8ao';
3
4
  export type N8AOProps = {
4
5
  aoRadius?: number;
5
6
  distanceFalloff?: number;
@@ -13,5 +14,6 @@ export type N8AOProps = {
13
14
  depthAwareUpsampling?: boolean;
14
15
  screenSpaceRadius?: boolean;
15
16
  renderMode?: 0 | 1 | 2 | 3 | 4;
17
+ ref?: Ref<N8AOPostPass>;
16
18
  };
17
- export declare const N8AO: import("react").ForwardRefExoticComponent<N8AOProps & import("react").RefAttributes<N8AOPostPass>>;
19
+ export declare function N8AO({ halfRes, screenSpaceRadius, quality, depthAwareUpsampling, aoRadius, aoSamples, denoiseSamples, denoiseRadius, distanceFalloff, intensity, color, renderMode, ref, }: N8AOProps): import("react").JSX.Element;
@@ -1,5 +1,2 @@
1
- export declare const Noise: ({ blendFunction, opacity, ...props }: {
2
- [x: string]: any;
3
- blendFunction?: any;
4
- opacity?: any;
5
- }) => import("react/jsx-runtime").JSX.Element;
1
+ import { NoiseEffect } from 'postprocessing';
2
+ export declare const Noise: (props: import("..").EffectProps<typeof NoiseEffect>) => import("react").JSX.Element;