@react-three/postprocessing 3.0.5 → 3.1.0
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/README.md +6 -7
- package/dist/EffectComposer.d.ts +9 -2
- package/dist/EffectGroup.d.ts +9 -0
- package/dist/createEffectComponent.d.ts +30 -0
- package/dist/effects/ASCII.d.ts +28 -7
- package/dist/effects/Autofocus.d.ts +1 -1
- package/dist/effects/Bloom.d.ts +9 -1
- package/dist/effects/BrightnessContrast.d.ts +14 -1
- package/dist/effects/ChromaticAberration.d.ts +26 -3
- package/dist/effects/ColorAverage.d.ts +7 -7
- package/dist/effects/ColorDepth.d.ts +7 -1
- package/dist/effects/Depth.d.ts +12 -1
- package/dist/effects/DotScreen.d.ts +14 -1
- package/dist/effects/FXAA.d.ts +10 -1
- package/dist/effects/Glitch.d.ts +16 -11
- package/dist/effects/GodRays.d.ts +1 -1
- package/dist/effects/Grid.d.ts +7 -6
- package/dist/effects/HueSaturation.d.ts +14 -1
- package/dist/effects/LUT.d.ts +1 -1
- package/dist/effects/LensFlare.d.ts +46 -5
- package/dist/effects/Noise.d.ts +7 -1
- package/dist/effects/Outline.d.ts +6 -3
- package/dist/effects/Pixelation.d.ts +1 -1
- package/dist/effects/Ramp.d.ts +58 -6
- package/dist/effects/SMAA.d.ts +9 -1
- package/dist/effects/SSAO.d.ts +1 -1
- package/dist/effects/ScanlineEffect.d.ts +12 -1
- package/dist/effects/SelectiveBloom.d.ts +1 -1
- package/dist/effects/Sepia.d.ts +12 -1
- package/dist/effects/ShockWave.d.ts +11 -1
- package/dist/effects/Texture.d.ts +4 -4
- package/dist/effects/TiltShift.d.ts +9 -1
- package/dist/effects/TiltShift2.d.ts +44 -4
- package/dist/effects/ToneMapping.d.ts +9 -3
- package/dist/effects/Vignette.d.ts +18 -1
- package/dist/effects/Water.d.ts +17 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +2205 -713
- package/dist/index.js.map +1 -1
- package/dist/passes/DepthPicking.d.ts +11 -0
- package/dist/{effects → passes}/N8AO.d.ts +2 -1
- package/dist/util.d.ts +9 -15
- package/dist/wrapEffect.d.ts +3 -3
- package/package.json +4 -3
- package/src/EffectComposer.tsx +143 -42
- package/src/EffectGroup.tsx +74 -0
- package/src/createEffectComponent.tsx +71 -0
- package/src/effects/ASCII.tsx +75 -28
- package/src/effects/Autofocus.tsx +24 -77
- package/src/effects/Bloom.tsx +32 -4
- package/src/effects/BrightnessContrast.tsx +5 -2
- package/src/effects/ChromaticAberration.tsx +13 -21
- package/src/effects/ColorAverage.tsx +3 -16
- package/src/effects/ColorDepth.tsx +23 -2
- package/src/effects/Depth.tsx +4 -2
- package/src/effects/DepthOfField.tsx +48 -26
- package/src/effects/DotScreen.tsx +5 -2
- package/src/effects/FXAA.tsx +4 -2
- package/src/effects/Glitch.tsx +26 -31
- package/src/effects/GodRays.tsx +90 -6
- package/src/effects/Grid.tsx +17 -18
- package/src/effects/HueSaturation.tsx +5 -2
- package/src/effects/LUT.tsx +9 -11
- package/src/effects/LensFlare.tsx +209 -55
- package/src/effects/Noise.tsx +14 -2
- package/src/effects/Outline.tsx +55 -56
- package/src/effects/Pixelation.tsx +11 -8
- package/src/effects/Ramp.tsx +96 -7
- package/src/effects/SMAA.tsx +18 -2
- package/src/effects/SSAO.tsx +130 -22
- package/src/effects/ScanlineEffect.tsx +6 -6
- package/src/effects/SelectiveBloom.tsx +26 -44
- package/src/effects/Sepia.tsx +4 -2
- package/src/effects/ShockWave.tsx +30 -2
- package/src/effects/Texture.tsx +10 -9
- package/src/effects/TiltShift.tsx +30 -2
- package/src/effects/TiltShift2.tsx +72 -6
- package/src/effects/ToneMapping.tsx +16 -3
- package/src/effects/Vignette.tsx +5 -2
- package/src/effects/Water.tsx +21 -6
- package/src/index.ts +4 -2
- package/src/passes/DepthPicking.tsx +63 -0
- package/src/{effects → passes}/N8AO.tsx +28 -4
- package/src/tests/Autofocus.test.tsx +38 -0
- package/src/tests/Bloom.test.tsx +76 -0
- package/src/tests/ChromaticAberration.test.tsx +50 -0
- package/src/tests/ColorDepth.test.tsx +71 -0
- package/src/tests/DepthOfField.test.tsx +130 -0
- package/src/tests/DepthPicking.test.tsx +250 -0
- package/src/tests/EffectComposer.test.tsx +501 -8
- package/src/tests/EffectGroup.test.tsx +337 -0
- package/src/tests/Glitch.test.tsx +56 -0
- package/src/tests/GodRays.test.tsx +101 -0
- package/src/tests/Grid.test.tsx +34 -0
- package/src/tests/LUT.test.tsx +64 -0
- package/src/tests/N8AO.test.tsx +92 -0
- package/src/tests/Outline.test.tsx +122 -0
- package/src/tests/SSAO.test.tsx +140 -0
- package/src/tests/SelectiveBloom.test.tsx +48 -0
- package/src/tests/ShockWave.test.tsx +95 -0
- package/src/tests/TiltShift.test.tsx +76 -0
- package/src/tests/createEffectComponent.test.tsx +286 -0
- package/src/tests/effects.smoke.test.tsx +46 -42
- package/src/util.tsx +148 -23
- package/src/wrapEffect.tsx +3 -2
- package/dist/tests/test-utils.d.ts +0 -12
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# react-postprocessing
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@react-three/postprocessing)
|
|
4
|
-
[](https://pmndrs.github.io/react-postprocessing)
|
|
5
5
|
[](https://www.npmjs.com/package/@react-three/postprocessing)
|
|
6
6
|
[](https://discord.gg/ZZjjNvJ)
|
|
7
7
|
[](https://github.com/codespaces/new?template_repository=pmndrs%2Freact-postprocessing)
|
|
@@ -18,8 +18,8 @@ npm install @react-three/postprocessing
|
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
<p align="center">
|
|
21
|
-
<a href="https://
|
|
22
|
-
<a href="https://
|
|
21
|
+
<a href="https://pmndrs.github.io/examples/bubbles" target="_blank"><img width="274" src="https://pmndrs.github.io/examples/bubbles/thumbnail.webp" alt="Bubbles" /></a>
|
|
22
|
+
<a href="https://pmndrs.github.io/examples/take-control" target="_blank"><img width="274" src="https://pmndrs.github.io/examples/take-control/thumbnail.webp" alt="Take Control" /></a>
|
|
23
23
|
</p>
|
|
24
24
|
<p align="middle">
|
|
25
25
|
<i>These demos are real, you can click them! They contain the full code, too. 📦</i>
|
|
@@ -49,14 +49,13 @@ get high performance crisp results w/o jagged edges.
|
|
|
49
49
|
#### What does it look like?
|
|
50
50
|
|
|
51
51
|
Here's an example combining a couple of effects
|
|
52
|
-
([live demo](https://
|
|
52
|
+
([live demo](https://pmndrs.github.io/examples/bubbles)).
|
|
53
53
|
|
|
54
|
-
<a href="https://
|
|
55
|
-
<img src="bubbles.
|
|
54
|
+
<a href="https://pmndrs.github.io/examples/bubbles" target="_blank" rel="noopener">
|
|
55
|
+
<img src="https://pmndrs.github.io/examples/bubbles/thumbnail.webp" alt="Bubbles Demo" />
|
|
56
56
|
</a>
|
|
57
57
|
|
|
58
58
|
```jsx
|
|
59
|
-
import React from 'react'
|
|
60
59
|
import { Bloom, DepthOfField, EffectComposer, Noise, Vignette } from '@react-three/postprocessing'
|
|
61
60
|
import { Canvas } from '@react-three/fiber'
|
|
62
61
|
|
package/dist/EffectComposer.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DepthDownsamplingPass, EffectComposer as EffectComposerImpl, NormalPass } from 'postprocessing';
|
|
1
|
+
import { DepthDownsamplingPass, EffectComposer as EffectComposerImpl, NormalPass, Pass } from 'postprocessing';
|
|
2
2
|
import { type ReactNode, type Ref } from 'react';
|
|
3
3
|
import type { Camera, Scene, TextureDataType } from 'three';
|
|
4
4
|
export declare const EffectComposerContext: import("react").Context<{
|
|
@@ -8,6 +8,8 @@ export declare const EffectComposerContext: import("react").Context<{
|
|
|
8
8
|
camera: Camera;
|
|
9
9
|
scene: Scene;
|
|
10
10
|
resolutionScale?: number;
|
|
11
|
+
requestRebuild: () => void;
|
|
12
|
+
autoClear: boolean;
|
|
11
13
|
}>;
|
|
12
14
|
export type EffectComposerProps = {
|
|
13
15
|
enabled?: boolean;
|
|
@@ -17,12 +19,17 @@ export type EffectComposerProps = {
|
|
|
17
19
|
enableNormalPass?: boolean;
|
|
18
20
|
stencilBuffer?: boolean;
|
|
19
21
|
autoClear?: boolean;
|
|
22
|
+
autoRenderToScreen?: boolean;
|
|
20
23
|
resolutionScale?: number;
|
|
21
24
|
multisampling?: number;
|
|
22
25
|
frameBufferType?: TextureDataType;
|
|
23
26
|
renderPriority?: number;
|
|
24
27
|
camera?: Camera;
|
|
25
28
|
scene?: Scene;
|
|
29
|
+
renderPass?: (scene: Scene, camera: Camera) => Pass;
|
|
30
|
+
mergeMode?: 'auto' | 'all' | 'none';
|
|
26
31
|
ref?: Ref<EffectComposerImpl>;
|
|
27
32
|
};
|
|
28
|
-
export declare const
|
|
33
|
+
export declare const groupPasses: WeakSet<Pass>;
|
|
34
|
+
export declare function disposePassWithoutEffects(pass: Pass): void;
|
|
35
|
+
export declare const EffectComposer: import("react").MemoExoticComponent<({ children, camera: _camera, scene: _scene, resolutionScale, enabled, renderPriority, autoClear, autoRenderToScreen, depthBuffer, enableNormalPass, stencilBuffer, multisampling, frameBufferType, renderPass, mergeMode, ref, }: EffectComposerProps) => import("react").JSX.Element | null>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { EffectPass } from 'postprocessing';
|
|
2
|
+
import { type ReactNode, type Ref } from 'react';
|
|
3
|
+
export type EffectGroupProps = {
|
|
4
|
+
/** Toggles the whole pass, like Pass.enabled in vanilla postprocessing - cheap, no reconstruction. */
|
|
5
|
+
enabled?: boolean;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
ref?: Ref<EffectPass>;
|
|
8
|
+
};
|
|
9
|
+
export declare function EffectGroup({ enabled, children, ref }: EffectGroupProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { BlendFunction, Effect, Pass } from 'postprocessing';
|
|
2
|
+
import type { JSX, Ref } from 'react';
|
|
3
|
+
export type EffectConstructor = new (...args: any[]) => Effect | Pass;
|
|
4
|
+
export type EffectOptions<T extends EffectConstructor> = NonNullable<ConstructorParameters<T>[0]>;
|
|
5
|
+
/**
|
|
6
|
+
* Registers `effect` as a JSX intrinsic once per class and returns a
|
|
7
|
+
* component that renders it. Everything else - construction from `args`,
|
|
8
|
+
* live prop application (with the same Color/Vector coercion and reset-
|
|
9
|
+
* to-default on removal any r3f element gets), disposal - is r3f's own
|
|
10
|
+
* reconciler, same rules as `<mesh>`/`<meshStandardMaterial>`. Only fits
|
|
11
|
+
* effects whose constructor works with zero arguments (`new Effect()`) -
|
|
12
|
+
* r3f's own reset-on-removal falls back to `0` otherwise, which is wrong
|
|
13
|
+
* for anything non-numeric. Effects that require e.g. scene/camera stay
|
|
14
|
+
* hand-rolled (see Outline.tsx, SelectiveBloom.tsx, ShockWave.tsx).
|
|
15
|
+
*
|
|
16
|
+
* `blendFunction`/`opacity` are pierced through to `blendMode-*` - every
|
|
17
|
+
* `Effect` has them on a nested `blendMode`, not on the effect itself, so a
|
|
18
|
+
* plain top-level prop would silently land on a stray, unread property.
|
|
19
|
+
* Applied via useLiveDefaults, not as plain JSX props: BlendMode's own
|
|
20
|
+
* constructor requires `blendFunction` (no default), so its constructor
|
|
21
|
+
* length isn't 0 either, and r3f's native reset-on-removal falls back to
|
|
22
|
+
* `changedProps[prop] = 0` - which is BlendFunction.SKIP, not a merely
|
|
23
|
+
* "wrong" blend function but one that hides the effect entirely.
|
|
24
|
+
*/
|
|
25
|
+
export declare function createEffectComponent<T extends EffectConstructor, P extends object>(effect: T): (props: P & {
|
|
26
|
+
blendFunction?: BlendFunction;
|
|
27
|
+
opacity?: number;
|
|
28
|
+
args?: ConstructorParameters<T>;
|
|
29
|
+
ref?: Ref<InstanceType<T>>;
|
|
30
|
+
}) => JSX.Element;
|
package/dist/effects/ASCII.d.ts
CHANGED
|
@@ -1,19 +1,40 @@
|
|
|
1
1
|
import { Effect } from 'postprocessing';
|
|
2
|
-
import { Ref } from 'react';
|
|
3
|
-
import { Texture } from 'three';
|
|
4
|
-
|
|
2
|
+
import type { Ref } from 'react';
|
|
3
|
+
import { Color, type ColorRepresentation, Texture } from 'three';
|
|
4
|
+
export type ASCIIProps = {
|
|
5
5
|
font?: string;
|
|
6
6
|
characters?: string;
|
|
7
7
|
fontSize?: number;
|
|
8
8
|
cellSize?: number;
|
|
9
|
-
color?:
|
|
9
|
+
color?: ColorRepresentation;
|
|
10
10
|
invert?: boolean;
|
|
11
11
|
ref?: Ref<ASCIIEffect>;
|
|
12
|
-
}
|
|
12
|
+
};
|
|
13
13
|
declare class ASCIIEffect extends Effect {
|
|
14
|
-
|
|
14
|
+
private _font;
|
|
15
|
+
private _characters;
|
|
16
|
+
private _fontSize;
|
|
17
|
+
constructor({ font, characters, fontSize, cellSize, color, invert, }?: Omit<ASCIIProps, 'ref'>);
|
|
18
|
+
get cellSize(): number;
|
|
19
|
+
set cellSize(value: number);
|
|
20
|
+
get invert(): boolean;
|
|
21
|
+
set invert(value: boolean);
|
|
22
|
+
get color(): Color;
|
|
23
|
+
set color(value: ColorRepresentation);
|
|
24
|
+
get font(): string;
|
|
25
|
+
set font(value: string);
|
|
26
|
+
get characters(): string;
|
|
27
|
+
set characters(value: string);
|
|
28
|
+
get fontSize(): number;
|
|
29
|
+
set fontSize(value: number);
|
|
30
|
+
private updateCharactersTexture;
|
|
15
31
|
/** Draws the characters on a Canvas and returns a texture */
|
|
16
32
|
createCharactersTexture(characters: string, font: string, fontSize: number): Texture;
|
|
17
33
|
}
|
|
18
|
-
export declare
|
|
34
|
+
export declare const ASCII: (props: ASCIIProps & {
|
|
35
|
+
blendFunction?: import("postprocessing").BlendFunction;
|
|
36
|
+
opacity?: number;
|
|
37
|
+
args?: [(Omit<ASCIIProps, "ref"> | undefined)?] | undefined;
|
|
38
|
+
ref?: Ref<ASCIIEffect> | undefined;
|
|
39
|
+
}) => import("react").JSX.Element;
|
|
19
40
|
export {};
|
|
@@ -3,7 +3,7 @@ import { DepthOfFieldEffect } from 'postprocessing';
|
|
|
3
3
|
import { Ref, type ComponentProps, type RefObject } from 'react';
|
|
4
4
|
import { Vector3 } from 'three';
|
|
5
5
|
import { DepthOfField } from './DepthOfField';
|
|
6
|
-
export type AutofocusProps = ComponentProps<typeof DepthOfField> & {
|
|
6
|
+
export type AutofocusProps = Omit<ComponentProps<typeof DepthOfField>, 'ref'> & {
|
|
7
7
|
target?: R3FVector3;
|
|
8
8
|
/** should the target follow the pointer */
|
|
9
9
|
mouse?: boolean;
|
package/dist/effects/Bloom.d.ts
CHANGED
|
@@ -1,2 +1,10 @@
|
|
|
1
1
|
import { BloomEffect } from 'postprocessing';
|
|
2
|
-
|
|
2
|
+
import type { Ref } from 'react';
|
|
3
|
+
import { type EffectOptions } from '../createEffectComponent';
|
|
4
|
+
type BloomOptions = EffectOptions<typeof BloomEffect>;
|
|
5
|
+
export type BloomProps = BloomOptions & {
|
|
6
|
+
opacity?: number;
|
|
7
|
+
ref?: Ref<BloomEffect>;
|
|
8
|
+
};
|
|
9
|
+
export declare function Bloom({ blendFunction, luminanceThreshold, luminanceSmoothing, mipmapBlur, radius, levels, resolutionScale, resolutionX, resolutionY, ...liveProps }: BloomProps): import("react").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -1,2 +1,15 @@
|
|
|
1
1
|
import { BrightnessContrastEffect } from 'postprocessing';
|
|
2
|
-
export declare const BrightnessContrast: (props:
|
|
2
|
+
export declare const BrightnessContrast: (props: {
|
|
3
|
+
blendFunction?: import("postprocessing").BlendFunction;
|
|
4
|
+
brightness?: number;
|
|
5
|
+
contrast?: number;
|
|
6
|
+
} & {
|
|
7
|
+
blendFunction?: import("postprocessing").BlendFunction;
|
|
8
|
+
opacity?: number;
|
|
9
|
+
args?: [({
|
|
10
|
+
blendFunction?: import("postprocessing").BlendFunction;
|
|
11
|
+
brightness?: number;
|
|
12
|
+
contrast?: number;
|
|
13
|
+
} | undefined)?] | undefined;
|
|
14
|
+
ref?: import("react").Ref<BrightnessContrastEffect> | undefined;
|
|
15
|
+
}) => import("react").JSX.Element;
|
|
@@ -1,8 +1,31 @@
|
|
|
1
1
|
import type { ReactThreeFiber } from '@react-three/fiber';
|
|
2
2
|
import { ChromaticAberrationEffect } from 'postprocessing';
|
|
3
3
|
import type { Ref } from 'react';
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
import { type EffectOptions } from '../createEffectComponent';
|
|
5
|
+
export type ChromaticAberrationProps = Omit<EffectOptions<typeof ChromaticAberrationEffect>, 'offset' | 'radialModulation' | 'modulationOffset'> & {
|
|
6
6
|
offset?: ReactThreeFiber.Vector2;
|
|
7
|
+
radialModulation?: boolean;
|
|
8
|
+
modulationOffset?: number;
|
|
9
|
+
ref?: Ref<ChromaticAberrationEffect>;
|
|
7
10
|
};
|
|
8
|
-
export declare
|
|
11
|
+
export declare const ChromaticAberration: (props: Omit<{
|
|
12
|
+
blendFunction?: import("postprocessing").BlendFunction;
|
|
13
|
+
offset?: import("three").Vector2;
|
|
14
|
+
radialModulation: boolean;
|
|
15
|
+
modulationOffset: number;
|
|
16
|
+
}, "offset" | "radialModulation" | "modulationOffset"> & {
|
|
17
|
+
offset?: ReactThreeFiber.Vector2;
|
|
18
|
+
radialModulation?: boolean;
|
|
19
|
+
modulationOffset?: number;
|
|
20
|
+
ref?: Ref<ChromaticAberrationEffect>;
|
|
21
|
+
} & {
|
|
22
|
+
blendFunction?: import("postprocessing").BlendFunction;
|
|
23
|
+
opacity?: number;
|
|
24
|
+
args?: [({
|
|
25
|
+
blendFunction?: import("postprocessing").BlendFunction;
|
|
26
|
+
offset?: import("three").Vector2;
|
|
27
|
+
radialModulation: boolean;
|
|
28
|
+
modulationOffset: number;
|
|
29
|
+
} | undefined)?] | undefined;
|
|
30
|
+
ref?: Ref<ChromaticAberrationEffect> | undefined;
|
|
31
|
+
}) => import("react").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { ColorAverageEffect } from 'postprocessing';
|
|
2
|
+
export declare const ColorAverage: (props: object & {
|
|
3
|
+
blendFunction?: import("postprocessing").BlendFunction;
|
|
4
|
+
opacity?: number;
|
|
5
|
+
args?: [blendFunction?: import("postprocessing").BlendFunction | undefined] | undefined;
|
|
6
|
+
ref?: import("react").Ref<ColorAverageEffect> | undefined;
|
|
7
|
+
}) => import("react").JSX.Element;
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
import { ColorDepthEffect } from 'postprocessing';
|
|
2
|
-
|
|
2
|
+
import type { Ref } from 'react';
|
|
3
|
+
import { type EffectOptions } from '../createEffectComponent';
|
|
4
|
+
export type ColorDepthProps = EffectOptions<typeof ColorDepthEffect> & {
|
|
5
|
+
opacity?: number;
|
|
6
|
+
ref?: Ref<ColorDepthEffect>;
|
|
7
|
+
};
|
|
8
|
+
export declare function ColorDepth({ bits, ...props }: ColorDepthProps): import("react").JSX.Element;
|
package/dist/effects/Depth.d.ts
CHANGED
|
@@ -1,2 +1,13 @@
|
|
|
1
1
|
import { DepthEffect } from 'postprocessing';
|
|
2
|
-
export declare const Depth: (props:
|
|
2
|
+
export declare const Depth: (props: {
|
|
3
|
+
blendFunction?: import("postprocessing").BlendFunction;
|
|
4
|
+
inverted?: boolean;
|
|
5
|
+
} & {
|
|
6
|
+
blendFunction?: import("postprocessing").BlendFunction;
|
|
7
|
+
opacity?: number;
|
|
8
|
+
args?: [({
|
|
9
|
+
blendFunction?: import("postprocessing").BlendFunction;
|
|
10
|
+
inverted?: boolean;
|
|
11
|
+
} | undefined)?] | undefined;
|
|
12
|
+
ref?: import("react").Ref<DepthEffect> | undefined;
|
|
13
|
+
}) => import("react").JSX.Element;
|
|
@@ -1,2 +1,15 @@
|
|
|
1
1
|
import { DotScreenEffect } from 'postprocessing';
|
|
2
|
-
export declare const DotScreen: (props:
|
|
2
|
+
export declare const DotScreen: (props: {
|
|
3
|
+
blendFunction?: import("postprocessing").BlendFunction;
|
|
4
|
+
angle?: number;
|
|
5
|
+
scale?: number;
|
|
6
|
+
} & {
|
|
7
|
+
blendFunction?: import("postprocessing").BlendFunction;
|
|
8
|
+
opacity?: number;
|
|
9
|
+
args?: [({
|
|
10
|
+
blendFunction?: import("postprocessing").BlendFunction;
|
|
11
|
+
angle?: number;
|
|
12
|
+
scale?: number;
|
|
13
|
+
} | undefined)?] | undefined;
|
|
14
|
+
ref?: import("react").Ref<DotScreenEffect> | undefined;
|
|
15
|
+
}) => import("react").JSX.Element;
|
package/dist/effects/FXAA.d.ts
CHANGED
|
@@ -1,2 +1,11 @@
|
|
|
1
1
|
import { FXAAEffect } from 'postprocessing';
|
|
2
|
-
export declare const FXAA: (props:
|
|
2
|
+
export declare const FXAA: (props: {
|
|
3
|
+
blendFunction?: import("postprocessing").BlendFunction;
|
|
4
|
+
} & {
|
|
5
|
+
blendFunction?: import("postprocessing").BlendFunction;
|
|
6
|
+
opacity?: number;
|
|
7
|
+
args?: [({
|
|
8
|
+
blendFunction?: import("postprocessing").BlendFunction;
|
|
9
|
+
} | undefined)?] | undefined;
|
|
10
|
+
ref?: import("react").Ref<FXAAEffect> | undefined;
|
|
11
|
+
}) => import("react").JSX.Element;
|
package/dist/effects/Glitch.d.ts
CHANGED
|
@@ -1,13 +1,18 @@
|
|
|
1
|
-
import { ReactThreeFiber } from '@react-three/fiber';
|
|
1
|
+
import type { ReactThreeFiber } from '@react-three/fiber';
|
|
2
2
|
import { GlitchEffect, GlitchMode } from 'postprocessing';
|
|
3
|
-
import { Ref } from 'react';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
chromaticAberrationOffset
|
|
10
|
-
|
|
3
|
+
import type { Ref } from 'react';
|
|
4
|
+
import { type EffectOptions } from '../createEffectComponent';
|
|
5
|
+
type GlitchOptions = Omit<EffectOptions<typeof GlitchEffect>, 'delay' | 'duration' | 'strength' | 'chromaticAberrationOffset'> & {
|
|
6
|
+
delay?: ReactThreeFiber.Vector2;
|
|
7
|
+
duration?: ReactThreeFiber.Vector2;
|
|
8
|
+
strength?: ReactThreeFiber.Vector2;
|
|
9
|
+
chromaticAberrationOffset?: ReactThreeFiber.Vector2;
|
|
10
|
+
mode?: GlitchMode;
|
|
11
|
+
};
|
|
12
|
+
export type GlitchProps = GlitchOptions & {
|
|
13
|
+
active?: boolean;
|
|
14
|
+
opacity?: number;
|
|
11
15
|
ref?: Ref<GlitchEffect>;
|
|
12
|
-
}
|
|
13
|
-
export declare function Glitch({ active,
|
|
16
|
+
};
|
|
17
|
+
export declare function Glitch({ active, mode, dtSize, ...props }: GlitchProps): import("react").JSX.Element;
|
|
18
|
+
export {};
|
|
@@ -5,5 +5,5 @@ type GodRaysProps = ConstructorParameters<typeof GodRaysEffect>[2] & {
|
|
|
5
5
|
sun: Mesh | Points | RefObject<Mesh | Points>;
|
|
6
6
|
ref?: Ref<GodRaysEffect>;
|
|
7
7
|
};
|
|
8
|
-
export declare function GodRays({ ref,
|
|
8
|
+
export declare function GodRays({ sun, blendFunction, density, decay, weight, exposure, clampMax, blur, kernelSize, samples, width, height, resolutionScale, resolutionX, resolutionY, ref, }: GodRaysProps): import("react").JSX.Element;
|
|
9
9
|
export {};
|
package/dist/effects/Grid.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { GridEffect } from 'postprocessing';
|
|
2
|
-
import { Ref } from 'react';
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { type Ref } from 'react';
|
|
3
|
+
import { type EffectOptions } from '../createEffectComponent';
|
|
4
|
+
export type GridProps = EffectOptions<typeof GridEffect> & {
|
|
5
|
+
size?: {
|
|
5
6
|
width: number;
|
|
6
7
|
height: number;
|
|
7
8
|
};
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
opacity?: number;
|
|
10
|
+
ref?: Ref<GridEffect>;
|
|
11
|
+
};
|
|
10
12
|
export declare function Grid({ size, ref, ...props }: GridProps): import("react").JSX.Element;
|
|
11
|
-
export {};
|
|
@@ -1,2 +1,15 @@
|
|
|
1
1
|
import { HueSaturationEffect } from 'postprocessing';
|
|
2
|
-
export declare const HueSaturation: (props:
|
|
2
|
+
export declare const HueSaturation: (props: {
|
|
3
|
+
blendFunction?: import("postprocessing").BlendFunction;
|
|
4
|
+
hue?: number;
|
|
5
|
+
saturation?: number;
|
|
6
|
+
} & {
|
|
7
|
+
blendFunction?: import("postprocessing").BlendFunction;
|
|
8
|
+
opacity?: number;
|
|
9
|
+
args?: [({
|
|
10
|
+
blendFunction?: import("postprocessing").BlendFunction;
|
|
11
|
+
hue?: number;
|
|
12
|
+
saturation?: number;
|
|
13
|
+
} | undefined)?] | undefined;
|
|
14
|
+
ref?: import("react").Ref<HueSaturationEffect> | undefined;
|
|
15
|
+
}) => import("react").JSX.Element;
|
package/dist/effects/LUT.d.ts
CHANGED
|
@@ -7,4 +7,4 @@ export type LUTProps = {
|
|
|
7
7
|
tetrahedralInterpolation?: boolean;
|
|
8
8
|
ref?: Ref<LUT3DEffect>;
|
|
9
9
|
};
|
|
10
|
-
export declare function LUT({ lut, tetrahedralInterpolation, ref
|
|
10
|
+
export declare function LUT({ lut, blendFunction, tetrahedralInterpolation, ref }: LUTProps): import("react").JSX.Element;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { type ReactThreeFiber } from '@react-three/fiber';
|
|
1
2
|
import { BlendFunction, Effect } from 'postprocessing';
|
|
3
|
+
import { type Ref } from 'react';
|
|
2
4
|
import { Color, Texture, Vector2, Vector3 } from 'three';
|
|
3
5
|
type LensFlareEffectOptions = {
|
|
4
6
|
/** The blend function of this effect */
|
|
@@ -41,14 +43,53 @@ type LensFlareEffectOptions = {
|
|
|
41
43
|
starBurst: boolean;
|
|
42
44
|
};
|
|
43
45
|
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, }
|
|
46
|
+
constructor({ blendFunction, enabled, glareSize, lensPosition, screenRes, starPoints, flareSize, flareSpeed, flareShape, animated, anamorphic, colorGain, lensDirtTexture, haloScale, secondaryGhosts, aditionalStreaks, ghostScale, opacity, starBurst, }?: Partial<LensFlareEffectOptions>);
|
|
45
47
|
update(_renderer: any, _inputBuffer: any, deltaTime: number): void;
|
|
48
|
+
private u;
|
|
49
|
+
private setU;
|
|
50
|
+
get enabled(): boolean;
|
|
51
|
+
set enabled(value: boolean);
|
|
52
|
+
get glareSize(): number;
|
|
53
|
+
set glareSize(value: number);
|
|
54
|
+
get lensPosition(): Vector3;
|
|
55
|
+
set lensPosition(value: Vector3);
|
|
56
|
+
get screenRes(): Vector2;
|
|
57
|
+
set screenRes(value: Vector2);
|
|
58
|
+
get starPoints(): number;
|
|
59
|
+
set starPoints(value: number);
|
|
60
|
+
get flareSize(): number;
|
|
61
|
+
set flareSize(value: number);
|
|
62
|
+
get flareSpeed(): number;
|
|
63
|
+
set flareSpeed(value: number);
|
|
64
|
+
get flareShape(): number;
|
|
65
|
+
set flareShape(value: number);
|
|
66
|
+
get animated(): boolean;
|
|
67
|
+
set animated(value: boolean);
|
|
68
|
+
get anamorphic(): boolean;
|
|
69
|
+
set anamorphic(value: boolean);
|
|
70
|
+
get colorGain(): Color;
|
|
71
|
+
set colorGain(value: Color);
|
|
72
|
+
get lensDirtTexture(): Texture | null;
|
|
73
|
+
set lensDirtTexture(value: Texture | null);
|
|
74
|
+
get haloScale(): number;
|
|
75
|
+
set haloScale(value: number);
|
|
76
|
+
get secondaryGhosts(): boolean;
|
|
77
|
+
set secondaryGhosts(value: boolean);
|
|
78
|
+
get aditionalStreaks(): boolean;
|
|
79
|
+
set aditionalStreaks(value: boolean);
|
|
80
|
+
get ghostScale(): number;
|
|
81
|
+
set ghostScale(value: number);
|
|
82
|
+
get starBurst(): boolean;
|
|
83
|
+
set starBurst(value: boolean);
|
|
84
|
+
get opacity(): number;
|
|
85
|
+
set opacity(value: number);
|
|
46
86
|
}
|
|
47
|
-
type LensFlareProps = {
|
|
87
|
+
type LensFlareProps = Omit<Partial<LensFlareEffectOptions>, 'lensPosition'> & {
|
|
48
88
|
/** Position of the effect */
|
|
49
|
-
lensPosition?: Vector3;
|
|
89
|
+
lensPosition?: ReactThreeFiber.Vector3;
|
|
50
90
|
/** The time that it takes to fade the occlusion */
|
|
51
91
|
smoothTime?: number;
|
|
52
|
-
|
|
53
|
-
|
|
92
|
+
ref?: Ref<LensFlareEffect>;
|
|
93
|
+
};
|
|
94
|
+
export declare const LensFlare: (props: LensFlareProps) => import("react").JSX.Element;
|
|
54
95
|
export {};
|
package/dist/effects/Noise.d.ts
CHANGED
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
import { NoiseEffect } from 'postprocessing';
|
|
2
|
-
|
|
2
|
+
import type { Ref } from 'react';
|
|
3
|
+
import { type EffectOptions } from '../createEffectComponent';
|
|
4
|
+
export type NoiseProps = EffectOptions<typeof NoiseEffect> & {
|
|
5
|
+
opacity?: number;
|
|
6
|
+
ref?: Ref<NoiseEffect>;
|
|
7
|
+
};
|
|
8
|
+
export declare function Noise({ blendFunction, ...props }: NoiseProps): import("react").JSX.Element;
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { OutlineEffect } from 'postprocessing';
|
|
2
2
|
import { Ref, RefObject } from 'react';
|
|
3
|
-
import { Object3D } from 'three';
|
|
3
|
+
import { Object3D, type ColorRepresentation } from 'three';
|
|
4
4
|
type ObjectRef = RefObject<Object3D | null>;
|
|
5
|
-
|
|
5
|
+
type OutlineEffectOptions = NonNullable<ConstructorParameters<typeof OutlineEffect>[2]>;
|
|
6
|
+
export type OutlineProps = Omit<OutlineEffectOptions, 'visibleEdgeColor' | 'hiddenEdgeColor'> & Partial<{
|
|
6
7
|
selection: Object3D | Object3D[] | ObjectRef | ObjectRef[];
|
|
7
8
|
selectionLayer: number;
|
|
9
|
+
visibleEdgeColor: ColorRepresentation;
|
|
10
|
+
hiddenEdgeColor: ColorRepresentation;
|
|
8
11
|
ref?: Ref<OutlineEffect>;
|
|
9
12
|
}>;
|
|
10
|
-
export declare function Outline({ selection, selectionLayer, blendFunction,
|
|
13
|
+
export declare function Outline({ selection, selectionLayer, blendFunction, resolutionScale, resolutionX, resolutionY, ref, ...liveProps }: OutlineProps): import("react").JSX.Element;
|
|
11
14
|
export {};
|
package/dist/effects/Ramp.d.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import { Effect } from 'postprocessing';
|
|
1
|
+
import { BlendFunction, Effect } from 'postprocessing';
|
|
2
|
+
import type { Ref } from 'react';
|
|
2
3
|
export declare enum RampType {
|
|
3
4
|
Linear = 0,
|
|
4
5
|
Radial = 1,
|
|
5
6
|
MirroredLinear = 2
|
|
6
7
|
}
|
|
8
|
+
type RampTuple2 = [number, number];
|
|
9
|
+
type RampTuple4 = [number, number, number, number];
|
|
7
10
|
export declare class RampEffect extends Effect {
|
|
8
11
|
constructor({
|
|
9
12
|
/**
|
|
@@ -61,14 +64,63 @@ export declare class RampEffect extends Effect {
|
|
|
61
64
|
*/
|
|
62
65
|
rampInvert, ...params }?: {
|
|
63
66
|
rampType?: RampType | undefined;
|
|
64
|
-
rampStart?:
|
|
65
|
-
rampEnd?:
|
|
66
|
-
startColor?:
|
|
67
|
-
endColor?:
|
|
67
|
+
rampStart?: RampTuple2 | undefined;
|
|
68
|
+
rampEnd?: RampTuple2 | undefined;
|
|
69
|
+
startColor?: RampTuple4 | undefined;
|
|
70
|
+
endColor?: RampTuple4 | undefined;
|
|
68
71
|
rampBias?: number | undefined;
|
|
69
72
|
rampGain?: number | undefined;
|
|
70
73
|
rampMask?: boolean | undefined;
|
|
71
74
|
rampInvert?: boolean | undefined;
|
|
72
75
|
});
|
|
76
|
+
private u;
|
|
77
|
+
private setU;
|
|
78
|
+
get rampType(): RampType;
|
|
79
|
+
set rampType(value: RampType);
|
|
80
|
+
get rampStart(): RampTuple2;
|
|
81
|
+
set rampStart(value: RampTuple2);
|
|
82
|
+
get rampEnd(): RampTuple2;
|
|
83
|
+
set rampEnd(value: RampTuple2);
|
|
84
|
+
get startColor(): RampTuple4;
|
|
85
|
+
set startColor(value: RampTuple4);
|
|
86
|
+
get endColor(): RampTuple4;
|
|
87
|
+
set endColor(value: RampTuple4);
|
|
88
|
+
get rampBias(): number;
|
|
89
|
+
set rampBias(value: number);
|
|
90
|
+
get rampGain(): number;
|
|
91
|
+
set rampGain(value: number);
|
|
92
|
+
get rampMask(): boolean;
|
|
93
|
+
set rampMask(value: boolean);
|
|
94
|
+
get rampInvert(): boolean;
|
|
95
|
+
set rampInvert(value: boolean);
|
|
73
96
|
}
|
|
74
|
-
export
|
|
97
|
+
export type RampProps = {
|
|
98
|
+
blendFunction?: BlendFunction;
|
|
99
|
+
rampType?: RampType;
|
|
100
|
+
rampStart?: RampTuple2;
|
|
101
|
+
rampEnd?: RampTuple2;
|
|
102
|
+
startColor?: RampTuple4;
|
|
103
|
+
endColor?: RampTuple4;
|
|
104
|
+
rampBias?: number;
|
|
105
|
+
rampGain?: number;
|
|
106
|
+
rampMask?: boolean;
|
|
107
|
+
rampInvert?: boolean;
|
|
108
|
+
ref?: Ref<RampEffect>;
|
|
109
|
+
};
|
|
110
|
+
export declare const Ramp: (props: RampProps & {
|
|
111
|
+
blendFunction?: BlendFunction;
|
|
112
|
+
opacity?: number;
|
|
113
|
+
args?: [({
|
|
114
|
+
rampType?: RampType | undefined;
|
|
115
|
+
rampStart?: RampTuple2 | undefined;
|
|
116
|
+
rampEnd?: RampTuple2 | undefined;
|
|
117
|
+
startColor?: RampTuple4 | undefined;
|
|
118
|
+
endColor?: RampTuple4 | undefined;
|
|
119
|
+
rampBias?: number | undefined;
|
|
120
|
+
rampGain?: number | undefined;
|
|
121
|
+
rampMask?: boolean | undefined;
|
|
122
|
+
rampInvert?: boolean | undefined;
|
|
123
|
+
} | undefined)?] | undefined;
|
|
124
|
+
ref?: Ref<RampEffect> | undefined;
|
|
125
|
+
}) => import("react").JSX.Element;
|
|
126
|
+
export {};
|
package/dist/effects/SMAA.d.ts
CHANGED
|
@@ -1,2 +1,10 @@
|
|
|
1
1
|
import { SMAAEffect } from 'postprocessing';
|
|
2
|
-
|
|
2
|
+
import type { Ref } from 'react';
|
|
3
|
+
import { type EffectOptions } from '../createEffectComponent';
|
|
4
|
+
type SMAAOptions = EffectOptions<typeof SMAAEffect>;
|
|
5
|
+
export type SMAAProps = SMAAOptions & {
|
|
6
|
+
opacity?: number;
|
|
7
|
+
ref?: Ref<SMAAEffect>;
|
|
8
|
+
};
|
|
9
|
+
export declare function SMAA({ preset, edgeDetectionMode, predicationMode, ...liveProps }: SMAAProps): import("react").JSX.Element;
|
|
10
|
+
export {};
|
package/dist/effects/SSAO.d.ts
CHANGED
|
@@ -3,5 +3,5 @@ import { Ref } from 'react';
|
|
|
3
3
|
type SSAOProps = ConstructorParameters<typeof SSAOEffect>[2] & {
|
|
4
4
|
ref?: Ref<SSAOEffect>;
|
|
5
5
|
};
|
|
6
|
-
export declare function SSAO({ ref,
|
|
6
|
+
export declare function SSAO({ blendFunction, samples, rings, distanceThreshold, distanceFalloff, rangeThreshold, rangeFalloff, luminanceInfluence, radius, bias, intensity, color, worldDistanceThreshold, worldDistanceFalloff, worldProximityThreshold, worldProximityFalloff, minRadiusScale, fade, depthAwareUpsampling, resolutionScale, resolutionX, resolutionY, width, height, ref, }: SSAOProps): import("react").JSX.Element;
|
|
7
7
|
export {};
|
|
@@ -1,2 +1,13 @@
|
|
|
1
1
|
import { ScanlineEffect } from 'postprocessing';
|
|
2
|
-
export declare const Scanline: (props:
|
|
2
|
+
export declare const Scanline: (props: {
|
|
3
|
+
blendFunction?: import("postprocessing").BlendFunction;
|
|
4
|
+
density?: number;
|
|
5
|
+
} & {
|
|
6
|
+
blendFunction?: import("postprocessing").BlendFunction;
|
|
7
|
+
opacity?: number;
|
|
8
|
+
args?: [({
|
|
9
|
+
blendFunction?: import("postprocessing").BlendFunction;
|
|
10
|
+
density?: number;
|
|
11
|
+
} | undefined)?] | undefined;
|
|
12
|
+
ref?: import("react").Ref<ScanlineEffect> | undefined;
|
|
13
|
+
}) => import("react").JSX.Element;
|
|
@@ -11,5 +11,5 @@ export type SelectiveBloomProps = BloomEffectOptions & Partial<{
|
|
|
11
11
|
ignoreBackground: boolean;
|
|
12
12
|
ref?: Ref<SelectiveBloomEffect>;
|
|
13
13
|
}>;
|
|
14
|
-
export declare function SelectiveBloom({ selection, selectionLayer, lights,
|
|
14
|
+
export declare function SelectiveBloom({ selection, selectionLayer, lights, luminanceThreshold, luminanceSmoothing, mipmapBlur, radius, levels, resolutionScale, resolutionX, resolutionY, ref, ...liveProps }: SelectiveBloomProps): import("react").JSX.Element;
|
|
15
15
|
export {};
|