@react-three/postprocessing 3.0.3 → 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 +28 -0
  4. package/dist/Selection.d.ts +17 -0
  5. package/dist/effects/ASCII.d.ts +19 -0
  6. package/dist/effects/Autofocus.d.ts +23 -0
  7. package/dist/effects/Bloom.d.ts +2 -0
  8. package/dist/effects/BrightnessContrast.d.ts +2 -0
  9. package/dist/effects/ChromaticAberration.d.ts +8 -0
  10. package/dist/effects/ColorAverage.d.ts +7 -0
  11. package/dist/effects/ColorDepth.d.ts +2 -0
  12. package/dist/effects/Depth.d.ts +2 -0
  13. package/dist/effects/DepthOfField.d.ts +14 -0
  14. package/dist/effects/DotScreen.d.ts +2 -0
  15. package/dist/effects/FXAA.d.ts +2 -0
  16. package/dist/effects/Glitch.d.ts +13 -0
  17. package/dist/effects/GodRays.d.ts +9 -0
  18. package/dist/effects/Grid.d.ts +11 -0
  19. package/dist/effects/HueSaturation.d.ts +2 -0
  20. package/dist/effects/LUT.d.ts +10 -0
  21. package/dist/effects/LensFlare.d.ts +54 -0
  22. package/dist/effects/N8AO.d.ts +19 -0
  23. package/dist/effects/Noise.d.ts +2 -0
  24. package/dist/effects/Outline.d.ts +11 -0
  25. package/dist/effects/Pixelation.d.ts +7 -0
  26. package/dist/effects/Ramp.d.ts +74 -0
  27. package/dist/effects/SMAA.d.ts +2 -0
  28. package/dist/effects/SSAO.d.ts +7 -0
  29. package/dist/effects/ScanlineEffect.d.ts +2 -0
  30. package/dist/effects/SelectiveBloom.d.ts +15 -0
  31. package/dist/effects/Sepia.d.ts +2 -0
  32. package/dist/effects/ShockWave.d.ts +2 -0
  33. package/dist/effects/Texture.d.ts +10 -0
  34. package/dist/effects/TiltShift.d.ts +2 -0
  35. package/dist/effects/TiltShift2.d.ts +18 -0
  36. package/dist/effects/ToneMapping.d.ts +4 -0
  37. package/dist/effects/Vignette.d.ts +2 -0
  38. package/dist/effects/Water.d.ts +8 -0
  39. package/dist/index.d.ts +38 -1
  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 -0
  44. package/dist/wrapEffect.d.ts +12 -0
  45. package/package.json +73 -66
  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/)
@@ -0,0 +1,28 @@
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
+ export declare const EffectComposerContext: import("react").Context<{
5
+ composer: EffectComposerImpl;
6
+ normalPass: NormalPass | null;
7
+ downSamplingPass: DepthDownsamplingPass | null;
8
+ camera: Camera;
9
+ scene: Scene;
10
+ resolutionScale?: number;
11
+ }>;
12
+ export type EffectComposerProps = {
13
+ enabled?: boolean;
14
+ children: ReactNode;
15
+ depthBuffer?: boolean;
16
+ /** Only used for SSGI currently, leave it disabled for everything else unless it's needed */
17
+ enableNormalPass?: boolean;
18
+ stencilBuffer?: boolean;
19
+ autoClear?: boolean;
20
+ resolutionScale?: number;
21
+ multisampling?: number;
22
+ frameBufferType?: TextureDataType;
23
+ renderPriority?: number;
24
+ camera?: Camera;
25
+ scene?: Scene;
26
+ ref?: Ref<EffectComposerImpl>;
27
+ };
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>;
@@ -0,0 +1,17 @@
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
+ export type Api = {
5
+ selected: Object3D[];
6
+ select: Dispatch<SetStateAction<Object3D[]>>;
7
+ enabled: boolean;
8
+ };
9
+ export type SelectApi = Omit<ThreeElements['group'], 'ref'> & {
10
+ enabled?: boolean;
11
+ };
12
+ export declare const selectionContext: import("react").Context<Api | null>;
13
+ export declare function Selection({ children, enabled }: {
14
+ enabled?: boolean;
15
+ children: ReactNode;
16
+ }): import("react").JSX.Element;
17
+ export declare function Select({ enabled, children, ...props }: SelectApi): import("react").JSX.Element;
@@ -0,0 +1,19 @@
1
+ import { Effect } from 'postprocessing';
2
+ import { Ref } from 'react';
3
+ import { Texture } from 'three';
4
+ interface IASCIIEffectProps {
5
+ font?: string;
6
+ characters?: string;
7
+ fontSize?: number;
8
+ cellSize?: number;
9
+ color?: string;
10
+ invert?: boolean;
11
+ ref?: Ref<ASCIIEffect>;
12
+ }
13
+ declare class ASCIIEffect extends Effect {
14
+ constructor({ font, characters, fontSize, cellSize, color, invert, }?: Omit<IASCIIEffectProps, 'ref'>);
15
+ /** Draws the characters on a Canvas and returns a texture */
16
+ createCharactersTexture(characters: string, font: string, fontSize: number): Texture;
17
+ }
18
+ export declare function ASCII({ font, characters, fontSize, cellSize, color, invert, ref, }: IASCIIEffectProps): import("react").JSX.Element;
19
+ export {};
@@ -0,0 +1,23 @@
1
+ import { type Vector3 as R3FVector3 } from '@react-three/fiber';
2
+ import { DepthOfFieldEffect } from 'postprocessing';
3
+ import { Ref, type ComponentProps, type RefObject } from 'react';
4
+ import { Vector3 } from 'three';
5
+ import { DepthOfField } from './DepthOfField';
6
+ export type AutofocusProps = ComponentProps<typeof DepthOfField> & {
7
+ target?: R3FVector3;
8
+ /** should the target follow the pointer */
9
+ mouse?: boolean;
10
+ /** size of the debug green point */
11
+ debug?: number;
12
+ /** manual update */
13
+ manual?: boolean;
14
+ /** approximate time to reach the target */
15
+ smoothTime?: number;
16
+ ref?: Ref<AutofocusApi>;
17
+ };
18
+ export type AutofocusApi = {
19
+ dofRef: RefObject<DepthOfFieldEffect | null>;
20
+ hitpoint: Vector3;
21
+ update: (delta: number, updateTarget: boolean) => void;
22
+ };
23
+ export declare function Autofocus({ target, mouse: followMouse, debug, manual, smoothTime, ref, ...props }: AutofocusProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { BloomEffect } from 'postprocessing';
2
+ export declare const Bloom: (props: import("..").EffectProps<typeof BloomEffect>) => import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { BrightnessContrastEffect } from 'postprocessing';
2
+ export declare const BrightnessContrast: (props: import("..").EffectProps<typeof BrightnessContrastEffect>) => import("react").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import type { ReactThreeFiber } from '@react-three/fiber';
2
+ import { ChromaticAberrationEffect } from 'postprocessing';
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;
@@ -0,0 +1,7 @@
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;
@@ -0,0 +1,2 @@
1
+ import { ColorDepthEffect } from 'postprocessing';
2
+ export declare const ColorDepth: (props: import("..").EffectProps<typeof ColorDepthEffect>) => import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { DepthEffect } from 'postprocessing';
2
+ export declare const Depth: (props: import("..").EffectProps<typeof DepthEffect>) => import("react").JSX.Element;
@@ -0,0 +1,14 @@
1
+ import type { ReactThreeFiber } from '@react-three/fiber';
2
+ import { DepthOfFieldEffect } from 'postprocessing';
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>;
7
+ target: ReactThreeFiber.Vector3;
8
+ depthTexture: {
9
+ texture: Texture;
10
+ packing: number;
11
+ };
12
+ blur: number;
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;
@@ -0,0 +1,2 @@
1
+ import { DotScreenEffect } from 'postprocessing';
2
+ export declare const DotScreen: (props: import("..").EffectProps<typeof DotScreenEffect>) => import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { FXAAEffect } from 'postprocessing';
2
+ export declare const FXAA: (props: import("..").EffectProps<typeof FXAAEffect>) => import("react").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import { ReactThreeFiber } from '@react-three/fiber';
2
+ import { GlitchEffect, GlitchMode } from 'postprocessing';
3
+ import { Ref } from 'react';
4
+ export type GlitchProps = ConstructorParameters<typeof GlitchEffect>[0] & Partial<{
5
+ mode: GlitchMode;
6
+ active: boolean;
7
+ delay: ReactThreeFiber.Vector2;
8
+ duration: ReactThreeFiber.Vector2;
9
+ chromaticAberrationOffset: ReactThreeFiber.Vector2;
10
+ strength: ReactThreeFiber.Vector2;
11
+ ref?: Ref<GlitchEffect>;
12
+ }>;
13
+ export declare function Glitch({ active, ref, ...props }: GlitchProps): import("react").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { GodRaysEffect } from 'postprocessing';
2
+ import { Ref, RefObject } from 'react';
3
+ import { Mesh, Points } from 'three';
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 {};
@@ -0,0 +1,11 @@
1
+ import { GridEffect } from 'postprocessing';
2
+ import { Ref } from 'react';
3
+ type GridProps = ConstructorParameters<typeof GridEffect>[0] & Partial<{
4
+ size: {
5
+ width: number;
6
+ height: number;
7
+ };
8
+ ref: Ref<GridEffect>;
9
+ }>;
10
+ export declare function Grid({ size, ref, ...props }: GridProps): import("react").JSX.Element;
11
+ export {};
@@ -0,0 +1,2 @@
1
+ import { HueSaturationEffect } from 'postprocessing';
2
+ export declare const HueSaturation: (props: import("..").EffectProps<typeof HueSaturationEffect>) => import("react").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { BlendFunction, LUT3DEffect } from 'postprocessing';
2
+ import { Ref } from 'react';
3
+ import type { Texture } from 'three';
4
+ export type LUTProps = {
5
+ lut: Texture;
6
+ blendFunction?: BlendFunction;
7
+ tetrahedralInterpolation?: boolean;
8
+ ref?: Ref<LUT3DEffect>;
9
+ };
10
+ export declare function LUT({ lut, tetrahedralInterpolation, ref, ...props }: LUTProps): import("react").JSX.Element;
@@ -0,0 +1,54 @@
1
+ import { BlendFunction, Effect } from 'postprocessing';
2
+ import { Color, Texture, Vector2, Vector3 } from 'three';
3
+ type LensFlareEffectOptions = {
4
+ /** The blend function of this effect */
5
+ blendFunction: BlendFunction;
6
+ /** Boolean to enable/disable the effect */
7
+ enabled: boolean;
8
+ /** The glare size */
9
+ glareSize: number;
10
+ /** The position of the lens flare in 3d space */
11
+ lensPosition: Vector3;
12
+ /** Effect resolution */
13
+ screenRes: Vector2;
14
+ /** The number of points for the star */
15
+ starPoints: number;
16
+ /** The flare side */
17
+ flareSize: number;
18
+ /** The flare animation speed */
19
+ flareSpeed: number;
20
+ /** Changes the appearance to anamorphic */
21
+ flareShape: number;
22
+ /** Animated flare */
23
+ animated: boolean;
24
+ /** Set the appearance to full anamorphic */
25
+ anamorphic: boolean;
26
+ /** Set the color gain for the lens flare. Must be a Color in RBG format */
27
+ colorGain: Color;
28
+ /** Texture to be used as color dirt for starburst effect */
29
+ lensDirtTexture: Texture | null;
30
+ /** The halo scale */
31
+ haloScale: number;
32
+ /** Option to enable/disable secondary ghosts */
33
+ secondaryGhosts: boolean;
34
+ /** Option to enable/disable aditional streaks */
35
+ aditionalStreaks: boolean;
36
+ /** Option to enable/disable secondary ghosts */
37
+ ghostScale: number;
38
+ /** TODO The opacity for this effect */
39
+ opacity: number;
40
+ /** Boolean to enable/disable the start burst effect. Can be disabled to improve performance */
41
+ starBurst: boolean;
42
+ };
43
+ export declare class LensFlareEffect extends Effect {
44
+ constructor({ blendFunction, enabled, glareSize, lensPosition, screenRes, starPoints, flareSize, flareSpeed, flareShape, animated, anamorphic, colorGain, lensDirtTexture, haloScale, secondaryGhosts, aditionalStreaks, ghostScale, opacity, starBurst, }: LensFlareEffectOptions);
45
+ update(_renderer: any, _inputBuffer: any, deltaTime: number): void;
46
+ }
47
+ type LensFlareProps = {
48
+ /** Position of the effect */
49
+ lensPosition?: Vector3;
50
+ /** The time that it takes to fade the occlusion */
51
+ smoothTime?: number;
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.Element;
54
+ export {};
@@ -0,0 +1,19 @@
1
+ import { ReactThreeFiber } from '@react-three/fiber';
2
+ import { Ref } from 'react';
3
+ import { N8AOPostPass } from 'n8ao';
4
+ export type N8AOProps = {
5
+ aoRadius?: number;
6
+ distanceFalloff?: number;
7
+ intensity?: number;
8
+ quality?: 'performance' | 'low' | 'medium' | 'high' | 'ultra';
9
+ aoSamples?: number;
10
+ denoiseSamples?: number;
11
+ denoiseRadius?: number;
12
+ color?: ReactThreeFiber.Color;
13
+ halfRes?: boolean;
14
+ depthAwareUpsampling?: boolean;
15
+ screenSpaceRadius?: boolean;
16
+ renderMode?: 0 | 1 | 2 | 3 | 4;
17
+ ref?: Ref<N8AOPostPass>;
18
+ };
19
+ export declare function N8AO({ halfRes, screenSpaceRadius, quality, depthAwareUpsampling, aoRadius, aoSamples, denoiseSamples, denoiseRadius, distanceFalloff, intensity, color, renderMode, ref, }: N8AOProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { NoiseEffect } from 'postprocessing';
2
+ export declare const Noise: (props: import("..").EffectProps<typeof NoiseEffect>) => import("react").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { OutlineEffect } from 'postprocessing';
2
+ import { Ref, RefObject } from 'react';
3
+ import { Object3D } from 'three';
4
+ type ObjectRef = RefObject<Object3D | null>;
5
+ export type OutlineProps = ConstructorParameters<typeof OutlineEffect>[2] & Partial<{
6
+ selection: Object3D | Object3D[] | ObjectRef | ObjectRef[];
7
+ selectionLayer: number;
8
+ ref?: Ref<OutlineEffect>;
9
+ }>;
10
+ export declare function Outline({ selection, selectionLayer, blendFunction, patternTexture, patternScale, edgeStrength, pulseSpeed, visibleEdgeColor, hiddenEdgeColor, multisampling, resolutionScale, resolutionX, resolutionY, width, height, kernelSize, blur, xRay, ref, }: OutlineProps): import("react").JSX.Element;
11
+ export {};
@@ -0,0 +1,7 @@
1
+ import { PixelationEffect } from 'postprocessing';
2
+ import { Ref } from 'react';
3
+ export type PixelationProps = {
4
+ granularity?: number;
5
+ ref?: Ref<PixelationEffect>;
6
+ };
7
+ export declare function Pixelation({ granularity, ref }: PixelationProps): import("react").JSX.Element;
@@ -0,0 +1,74 @@
1
+ import { Effect } from 'postprocessing';
2
+ export declare enum RampType {
3
+ Linear = 0,
4
+ Radial = 1,
5
+ MirroredLinear = 2
6
+ }
7
+ export declare class RampEffect extends Effect {
8
+ constructor({
9
+ /**
10
+ * Type of ramp gradient.
11
+ */
12
+ rampType,
13
+ /**
14
+ * Starting point of the ramp gradient in normalized coordinates.
15
+ *
16
+ * Ranges from `[0 - 1]` as `[x, y]`. Default is `[0.5, 0.5]`.
17
+ */
18
+ rampStart,
19
+ /**
20
+ * Ending point of the ramp gradient in normalized coordinates.
21
+ *
22
+ * Ranges from `[0 - 1]` as `[x, y]`. Default is `[1, 1]`
23
+ */
24
+ rampEnd,
25
+ /**
26
+ * Color at the starting point of the gradient.
27
+ *
28
+ * Default is black: `[0, 0, 0, 1]`
29
+ */
30
+ startColor,
31
+ /**
32
+ * Color at the ending point of the gradient.
33
+ *
34
+ * Default is white: `[1, 1, 1, 1]`
35
+ */
36
+ endColor,
37
+ /**
38
+ * Bias for the interpolation curve when both bias and gain are 0.5.
39
+ *
40
+ * Ranges from `[0 - 1]`. Default is `0.5`.
41
+ */
42
+ rampBias,
43
+ /**
44
+ * Gain for the interpolation curve when both bias and gain are 0.5.
45
+ *
46
+ * Ranges from `[0 - 1]`. Default is `0.5`.
47
+ */
48
+ rampGain,
49
+ /**
50
+ * When enabled, the ramp gradient is used as an effect mask, and colors are ignored.
51
+ *
52
+ * Default is `false`.
53
+ */
54
+ rampMask,
55
+ /**
56
+ * Controls whether the ramp gradient is inverted.
57
+ *
58
+ * When disabled, rampStart is transparent and rampEnd is opaque.
59
+ *
60
+ * Default is `false`.
61
+ */
62
+ rampInvert, ...params }?: {
63
+ rampType?: RampType | undefined;
64
+ rampStart?: number[] | undefined;
65
+ rampEnd?: number[] | undefined;
66
+ startColor?: number[] | undefined;
67
+ endColor?: number[] | undefined;
68
+ rampBias?: number | undefined;
69
+ rampGain?: number | undefined;
70
+ rampMask?: boolean | undefined;
71
+ rampInvert?: boolean | undefined;
72
+ });
73
+ }
74
+ export declare const Ramp: (props: import("..").EffectProps<typeof RampEffect>) => import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { SMAAEffect } from 'postprocessing';
2
+ export declare const SMAA: (props: import("..").EffectProps<typeof SMAAEffect>) => import("react").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { SSAOEffect } from 'postprocessing';
2
+ import { Ref } from 'react';
3
+ type SSAOProps = ConstructorParameters<typeof SSAOEffect>[2] & {
4
+ ref?: Ref<SSAOEffect>;
5
+ };
6
+ export declare function SSAO({ ref, ...props }: SSAOProps): import("react").JSX.Element;
7
+ export {};
@@ -0,0 +1,2 @@
1
+ import { ScanlineEffect } from 'postprocessing';
2
+ export declare const Scanline: (props: import("..").EffectProps<typeof ScanlineEffect>) => import("react").JSX.Element;
@@ -0,0 +1,15 @@
1
+ import type { BloomEffectOptions } from 'postprocessing';
2
+ import { SelectiveBloomEffect } from 'postprocessing';
3
+ import { Ref, RefObject } from 'react';
4
+ import { Object3D } from 'three';
5
+ type ObjectRef = RefObject<Object3D | null>;
6
+ export type SelectiveBloomProps = BloomEffectOptions & Partial<{
7
+ lights: Object3D[] | ObjectRef[];
8
+ selection: Object3D | Object3D[] | ObjectRef | ObjectRef[];
9
+ selectionLayer: number;
10
+ inverted: boolean;
11
+ ignoreBackground: boolean;
12
+ ref?: Ref<SelectiveBloomEffect>;
13
+ }>;
14
+ export declare function SelectiveBloom({ selection, selectionLayer, lights, inverted, ignoreBackground, luminanceThreshold, luminanceSmoothing, mipmapBlur, intensity, radius, levels, kernelSize, resolutionScale, width, height, resolutionX, resolutionY, ref, }: SelectiveBloomProps): import("react").JSX.Element;
15
+ export {};
@@ -0,0 +1,2 @@
1
+ import { SepiaEffect } from 'postprocessing';
2
+ export declare const Sepia: (props: import("..").EffectProps<typeof SepiaEffect>) => import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { ShockWaveEffect } from 'postprocessing';
2
+ export declare const ShockWave: (props: import("..").EffectProps<typeof ShockWaveEffect>) => import("react").JSX.Element;