@react-three/postprocessing 3.0.3 → 3.0.4

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 (39) hide show
  1. package/dist/EffectComposer.d.ts +27 -0
  2. package/dist/Selection.d.ts +17 -0
  3. package/dist/effects/ASCII.d.ts +18 -0
  4. package/dist/effects/Autofocus.d.ts +22 -0
  5. package/dist/effects/Bloom.d.ts +5 -0
  6. package/dist/effects/BrightnessContrast.d.ts +5 -0
  7. package/dist/effects/ChromaticAberration.d.ts +8 -0
  8. package/dist/effects/ColorAverage.d.ts +8 -0
  9. package/dist/effects/ColorDepth.d.ts +5 -0
  10. package/dist/effects/Depth.d.ts +5 -0
  11. package/dist/effects/DepthOfField.d.ts +25 -0
  12. package/dist/effects/DotScreen.d.ts +5 -0
  13. package/dist/effects/FXAA.d.ts +5 -0
  14. package/dist/effects/Glitch.d.ts +30 -0
  15. package/dist/effects/GodRays.d.ts +21 -0
  16. package/dist/effects/Grid.d.ts +12 -0
  17. package/dist/effects/HueSaturation.d.ts +5 -0
  18. package/dist/effects/LUT.d.ts +9 -0
  19. package/dist/effects/LensFlare.d.ts +54 -0
  20. package/dist/effects/N8AO.d.ts +17 -0
  21. package/dist/effects/Noise.d.ts +5 -0
  22. package/dist/effects/Outline.d.ts +30 -0
  23. package/dist/effects/Pixelation.d.ts +6 -0
  24. package/dist/effects/Ramp.d.ts +78 -0
  25. package/dist/effects/SMAA.d.ts +5 -0
  26. package/dist/effects/SSAO.d.ts +30 -0
  27. package/dist/effects/ScanlineEffect.d.ts +5 -0
  28. package/dist/effects/SelectiveBloom.d.ts +20 -0
  29. package/dist/effects/Sepia.d.ts +5 -0
  30. package/dist/effects/ShockWave.d.ts +5 -0
  31. package/dist/effects/Texture.d.ts +11 -0
  32. package/dist/effects/TiltShift.d.ts +5 -0
  33. package/dist/effects/TiltShift2.d.ts +22 -0
  34. package/dist/effects/ToneMapping.d.ts +8 -0
  35. package/dist/effects/Vignette.d.ts +5 -0
  36. package/dist/effects/Water.d.ts +12 -0
  37. package/dist/index.d.ts +37 -1
  38. package/dist/util.d.ts +17 -0
  39. package/package.json +5 -4
@@ -0,0 +1,27 @@
1
+ import type { TextureDataType, Camera, Scene } from 'three';
2
+ import { type JSX } from 'react';
3
+ import { EffectComposer as EffectComposerImpl, NormalPass, DepthDownsamplingPass } from 'postprocessing';
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 | undefined;
11
+ }>;
12
+ export type EffectComposerProps = {
13
+ enabled?: boolean;
14
+ children: JSX.Element | JSX.Element[];
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
+ };
27
+ export declare const EffectComposer: import("react").NamedExoticComponent<EffectComposerProps & import("react").RefAttributes<EffectComposerImpl>>;
@@ -0,0 +1,17 @@
1
+ import * as THREE from 'three';
2
+ import React from 'react';
3
+ import { type ThreeElements } from '@react-three/fiber';
4
+ export type Api = {
5
+ selected: THREE.Object3D[];
6
+ select: React.Dispatch<React.SetStateAction<THREE.Object3D[]>>;
7
+ enabled: boolean;
8
+ };
9
+ export type SelectApi = Omit<ThreeElements['group'], 'ref'> & {
10
+ enabled?: boolean;
11
+ };
12
+ export declare const selectionContext: React.Context<Api | null>;
13
+ export declare function Selection({ children, enabled }: {
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;
@@ -0,0 +1,18 @@
1
+ /// <reference types="react" />
2
+ import { Texture } from 'three';
3
+ import { Effect } from 'postprocessing';
4
+ interface IASCIIEffectProps {
5
+ font?: string;
6
+ characters?: string;
7
+ fontSize?: number;
8
+ cellSize?: number;
9
+ color?: string;
10
+ invert?: boolean;
11
+ }
12
+ declare class ASCIIEffect extends Effect {
13
+ constructor({ font, characters, fontSize, cellSize, color, invert, }?: IASCIIEffectProps);
14
+ /** Draws the characters on a Canvas and returns a texture */
15
+ createCharactersTexture(characters: string, font: string, fontSize: number): Texture;
16
+ }
17
+ export declare const ASCII: import("react").ForwardRefExoticComponent<IASCIIEffectProps & import("react").RefAttributes<ASCIIEffect>>;
18
+ export {};
@@ -0,0 +1,22 @@
1
+ import * as THREE from 'three';
2
+ import React, { RefObject } from 'react';
3
+ import { type Vector3 } from '@react-three/fiber';
4
+ import { DepthOfFieldEffect } from 'postprocessing';
5
+ import { DepthOfField } from './DepthOfField';
6
+ export type AutofocusProps = React.ComponentProps<typeof DepthOfField> & {
7
+ target?: Vector3;
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
+ };
17
+ export type AutofocusApi = {
18
+ dofRef: RefObject<DepthOfFieldEffect | null>;
19
+ hitpoint: THREE.Vector3;
20
+ update: (delta: number, updateTarget: boolean) => void;
21
+ };
22
+ export declare const Autofocus: React.ForwardRefExoticComponent<Omit<AutofocusProps, "ref"> & React.RefAttributes<AutofocusApi>>;
@@ -0,0 +1,5 @@
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;
@@ -0,0 +1,5 @@
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;
@@ -0,0 +1,8 @@
1
+ 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;
@@ -0,0 +1,8 @@
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>>;
@@ -0,0 +1,5 @@
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;
@@ -0,0 +1,5 @@
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;
@@ -0,0 +1,25 @@
1
+ /// <reference types="react" />
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<{
19
+ target: ReactThreeFiber.Vector3;
20
+ depthTexture: {
21
+ texture: Texture;
22
+ packing: number;
23
+ };
24
+ blur: number;
25
+ }> & import("react").RefAttributes<DepthOfFieldEffect>>;
@@ -0,0 +1,5 @@
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;
@@ -0,0 +1,5 @@
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;
@@ -0,0 +1,30 @@
1
+ /// <reference types="react" />
2
+ import { Vector2 } from 'three';
3
+ import { GlitchEffect, GlitchMode } from 'postprocessing';
4
+ import { ReactThreeFiber } from '@react-three/fiber';
5
+ export type GlitchProps = ConstructorParameters<typeof GlitchEffect>[0] & Partial<{
6
+ mode: GlitchMode;
7
+ active: boolean;
8
+ delay: ReactThreeFiber.Vector2;
9
+ duration: ReactThreeFiber.Vector2;
10
+ chromaticAberrationOffset: ReactThreeFiber.Vector2;
11
+ strength: ReactThreeFiber.Vector2;
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>>;
@@ -0,0 +1,21 @@
1
+ import { GodRaysEffect } from 'postprocessing';
2
+ import React from 'react';
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>>;
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ 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<{
8
+ size: {
9
+ width: number;
10
+ height: number;
11
+ };
12
+ }> & React.RefAttributes<GridEffect>>;
@@ -0,0 +1,5 @@
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;
@@ -0,0 +1,9 @@
1
+ import { LUT3DEffect, BlendFunction } from 'postprocessing';
2
+ import React from 'react';
3
+ import type { Texture } from 'three';
4
+ export type LUTProps = {
5
+ lut: Texture;
6
+ blendFunction?: BlendFunction;
7
+ tetrahedralInterpolation?: boolean;
8
+ };
9
+ export declare const LUT: React.ForwardRefExoticComponent<LUTProps & React.RefAttributes<LUT3DEffect>>;
@@ -0,0 +1,54 @@
1
+ import * as THREE from 'three';
2
+ import { BlendFunction, Effect } from 'postprocessing';
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: THREE.Vector3;
12
+ /** Effect resolution */
13
+ screenRes: THREE.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 THREE.Color in RBG format */
27
+ colorGain: THREE.Color;
28
+ /** Texture to be used as color dirt for starburst effect */
29
+ lensDirtTexture: THREE.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?: THREE.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-runtime").JSX.Element;
54
+ export {};
@@ -0,0 +1,17 @@
1
+ /// <reference types="react" />
2
+ import { ReactThreeFiber } from '@react-three/fiber';
3
+ export type N8AOProps = {
4
+ aoRadius?: number;
5
+ distanceFalloff?: number;
6
+ intensity?: number;
7
+ quality?: 'performance' | 'low' | 'medium' | 'high' | 'ultra';
8
+ aoSamples?: number;
9
+ denoiseSamples?: number;
10
+ denoiseRadius?: number;
11
+ color?: ReactThreeFiber.Color;
12
+ halfRes?: boolean;
13
+ depthAwareUpsampling?: boolean;
14
+ screenSpaceRadius?: boolean;
15
+ renderMode?: 0 | 1 | 2 | 3 | 4;
16
+ };
17
+ export declare const N8AO: import("react").ForwardRefExoticComponent<N8AOProps & import("react").RefAttributes<N8AOPostPass>>;
@@ -0,0 +1,5 @@
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;
@@ -0,0 +1,30 @@
1
+ import { OutlineEffect } from 'postprocessing';
2
+ import { RefObject } from 'react';
3
+ import { Object3D } from 'three';
4
+ type ObjectRef = RefObject<Object3D>;
5
+ export type OutlineProps = ConstructorParameters<typeof OutlineEffect>[2] & Partial<{
6
+ selection: Object3D | Object3D[] | ObjectRef | ObjectRef[];
7
+ selectionLayer: number;
8
+ }>;
9
+ export declare const Outline: import("react").ForwardRefExoticComponent<{
10
+ blendFunction?: import("postprocessing").BlendFunction | undefined;
11
+ patternTexture?: import("three").Texture | undefined;
12
+ patternScale?: number | undefined;
13
+ edgeStrength?: number | undefined;
14
+ pulseSpeed?: number | undefined;
15
+ visibleEdgeColor?: number | undefined;
16
+ hiddenEdgeColor?: number | undefined;
17
+ multisampling?: number | undefined;
18
+ resolutionScale?: number | undefined;
19
+ resolutionX?: number | undefined;
20
+ resolutionY?: number | undefined;
21
+ width?: number | undefined;
22
+ height?: number | undefined;
23
+ kernelSize?: import("postprocessing").KernelSize | undefined;
24
+ blur?: boolean | undefined;
25
+ xRay?: boolean | undefined;
26
+ } & Partial<{
27
+ selection: Object3D | Object3D[] | ObjectRef | ObjectRef[];
28
+ selectionLayer: number;
29
+ }> & import("react").RefAttributes<OutlineEffect>>;
30
+ export {};
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ import { PixelationEffect } from 'postprocessing';
3
+ export type PixelationProps = {
4
+ granularity?: number;
5
+ };
6
+ export declare const Pixelation: import("react").ForwardRefExoticComponent<PixelationProps & import("react").RefAttributes<PixelationEffect>>;
@@ -0,0 +1,78 @@
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: ({ blendFunction, opacity, ...props }: {
75
+ [x: string]: any;
76
+ blendFunction?: any;
77
+ opacity?: any;
78
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ export declare const SMAA: ({ blendFunction, opacity, ...props }: {
2
+ [x: string]: any;
3
+ blendFunction?: any;
4
+ opacity?: any;
5
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,30 @@
1
+ /// <reference types="react" />
2
+ import { SSAOEffect, BlendFunction } from 'postprocessing';
3
+ export declare const SSAO: import("react").ForwardRefExoticComponent<{
4
+ blendFunction?: BlendFunction | undefined;
5
+ distanceScaling?: boolean | undefined;
6
+ depthAwareUpsampling?: boolean | undefined;
7
+ normalDepthBuffer?: import("three").Texture | undefined;
8
+ samples?: number | undefined;
9
+ rings?: number | undefined;
10
+ worldDistanceThreshold?: number | undefined;
11
+ worldDistanceFalloff?: number | undefined;
12
+ worldProximityThreshold?: number | undefined;
13
+ worldProximityFalloff?: number | undefined;
14
+ distanceThreshold?: number | undefined;
15
+ distanceFalloff?: number | undefined;
16
+ rangeThreshold?: number | undefined;
17
+ rangeFalloff?: number | undefined;
18
+ minRadiusScale?: number | undefined;
19
+ luminanceInfluence?: number | undefined;
20
+ radius?: number | undefined;
21
+ intensity?: number | undefined;
22
+ bias?: number | undefined;
23
+ fade?: number | undefined;
24
+ color?: import("three").Color | undefined;
25
+ resolutionScale?: number | undefined;
26
+ resolutionX?: number | undefined;
27
+ resolutionY?: number | undefined;
28
+ width?: number | undefined;
29
+ height?: number | undefined;
30
+ } & import("react").RefAttributes<SSAOEffect>>;
@@ -0,0 +1,5 @@
1
+ export declare const Scanline: ({ blendFunction, opacity, ...props }: {
2
+ [x: string]: any;
3
+ blendFunction?: any;
4
+ opacity?: any;
5
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,20 @@
1
+ import { SelectiveBloomEffect } from 'postprocessing';
2
+ import type { BloomEffectOptions } from 'postprocessing';
3
+ import React, { RefObject } from 'react';
4
+ import { Object3D } from 'three';
5
+ type ObjectRef = RefObject<Object3D>;
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
+ }>;
13
+ export declare const SelectiveBloom: React.ForwardRefExoticComponent<BloomEffectOptions & Partial<{
14
+ lights: Object3D[] | ObjectRef[];
15
+ selection: Object3D | Object3D[] | ObjectRef | ObjectRef[];
16
+ selectionLayer: number;
17
+ inverted: boolean;
18
+ ignoreBackground: boolean;
19
+ }> & React.RefAttributes<SelectiveBloomEffect>>;
20
+ export {};
@@ -0,0 +1,5 @@
1
+ export declare const Sepia: ({ blendFunction, opacity, ...props }: {
2
+ [x: string]: any;
3
+ blendFunction?: any;
4
+ opacity?: any;
5
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ export declare const ShockWave: ({ blendFunction, opacity, ...props }: {
2
+ [x: string]: any;
3
+ blendFunction?: any;
4
+ opacity?: any;
5
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import { TextureEffect } from 'postprocessing';
3
+ export declare const Texture: import("react").ForwardRefExoticComponent<{
4
+ blendFunction?: import("postprocessing").BlendFunction | undefined;
5
+ texture?: import("three").Texture | undefined;
6
+ aspectCorrection?: boolean | undefined;
7
+ } & {
8
+ textureSrc: string;
9
+ /** opacity of provided texture */
10
+ opacity?: number | undefined;
11
+ } & import("react").RefAttributes<TextureEffect>>;
@@ -0,0 +1,5 @@
1
+ export declare const TiltShift: ({ blendFunction, opacity, ...props }: {
2
+ [x: string]: any;
3
+ blendFunction?: any;
4
+ opacity?: any;
5
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,22 @@
1
+ import { BlendFunction, Effect } from 'postprocessing';
2
+ export declare class TiltShiftEffect extends Effect {
3
+ constructor({ blendFunction, blur, // [0, 1], can go beyond 1 for extra
4
+ taper, // [0, 1], can go beyond 1 for extra
5
+ start, // [0,1] percentage x,y of screenspace
6
+ end, // [0,1] percentage x,y of screenspace
7
+ samples, // number of blur samples
8
+ direction, }?: {
9
+ blendFunction?: BlendFunction | undefined;
10
+ blur?: number | undefined;
11
+ taper?: number | undefined;
12
+ start?: number[] | undefined;
13
+ end?: number[] | undefined;
14
+ samples?: number | undefined;
15
+ direction?: number[] | undefined;
16
+ });
17
+ }
18
+ export declare const TiltShift2: ({ blendFunction, opacity, ...props }: {
19
+ [x: string]: any;
20
+ blendFunction?: any;
21
+ opacity?: any;
22
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { ToneMappingEffect } from 'postprocessing';
2
+ import { type EffectProps } from '../util';
3
+ export type ToneMappingProps = EffectProps<typeof ToneMappingEffect>;
4
+ export declare const ToneMapping: ({ blendFunction, opacity, ...props }: {
5
+ [x: string]: any;
6
+ blendFunction?: any;
7
+ opacity?: any;
8
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ export declare const Vignette: ({ blendFunction, opacity, ...props }: {
2
+ [x: string]: any;
3
+ blendFunction?: any;
4
+ opacity?: any;
5
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { BlendFunction, Effect } from 'postprocessing';
2
+ export declare class WaterEffectImpl extends Effect {
3
+ constructor({ blendFunction, factor }?: {
4
+ blendFunction?: BlendFunction | undefined;
5
+ factor?: number | undefined;
6
+ });
7
+ }
8
+ export declare const WaterEffect: ({ blendFunction, opacity, ...props }: {
9
+ [x: string]: any;
10
+ blendFunction?: any;
11
+ opacity?: any;
12
+ }) => import("react/jsx-runtime").JSX.Element;
package/dist/index.d.ts CHANGED
@@ -1 +1,37 @@
1
- export * from '../src/index.ts'
1
+ export * from './Selection';
2
+ export * from './EffectComposer';
3
+ export * from './util';
4
+ export * from './effects/Autofocus';
5
+ export * from './effects/LensFlare';
6
+ export * from './effects/Bloom';
7
+ export * from './effects/BrightnessContrast';
8
+ export * from './effects/ChromaticAberration';
9
+ export * from './effects/ColorAverage';
10
+ export * from './effects/ColorDepth';
11
+ export * from './effects/Depth';
12
+ export * from './effects/DepthOfField';
13
+ export * from './effects/DotScreen';
14
+ export * from './effects/Glitch';
15
+ export * from './effects/GodRays';
16
+ export * from './effects/Grid';
17
+ export * from './effects/HueSaturation';
18
+ export * from './effects/Noise';
19
+ export * from './effects/Outline';
20
+ export * from './effects/Pixelation';
21
+ export * from './effects/ScanlineEffect';
22
+ export * from './effects/SelectiveBloom';
23
+ export * from './effects/Sepia';
24
+ export * from './effects/SSAO';
25
+ export * from './effects/SMAA';
26
+ export * from './effects/FXAA';
27
+ export * from './effects/Ramp';
28
+ export * from './effects/Texture';
29
+ export * from './effects/ToneMapping';
30
+ export * from './effects/Vignette';
31
+ export * from './effects/ShockWave';
32
+ export * from './effects/LUT';
33
+ export * from './effects/TiltShift';
34
+ export * from './effects/TiltShift2';
35
+ export * from './effects/ASCII';
36
+ export * from './effects/Water';
37
+ export * from './effects/N8AO';
package/dist/util.d.ts ADDED
@@ -0,0 +1,17 @@
1
+ import React, { RefObject } from 'react';
2
+ import { Vector2 } from 'three';
3
+ import * as THREE from 'three';
4
+ import { type ThreeElement } from '@react-three/fiber';
5
+ import type { Effect, Pass, BlendFunction } from 'postprocessing';
6
+ export declare const resolveRef: <T>(ref: T | React.RefObject<T>) => T;
7
+ export type EffectConstructor = new (...args: any[]) => Effect | Pass;
8
+ export type EffectProps<T extends EffectConstructor> = ThreeElement<T> & ConstructorParameters<T>[0] & {
9
+ blendFunction?: BlendFunction;
10
+ opacity?: number;
11
+ };
12
+ export declare const wrapEffect: <T extends EffectConstructor>(effect: T, defaults?: EffectProps<T> | undefined) => ({ blendFunction, opacity, ...props }: {
13
+ [x: string]: any;
14
+ blendFunction?: any;
15
+ opacity?: any;
16
+ }) => import("react/jsx-runtime").JSX.Element;
17
+ export declare const useVector2: (props: Record<string, unknown>, key: string) => THREE.Vector2;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-three/postprocessing",
3
- "version": "3.0.3",
3
+ "version": "3.0.4",
4
4
  "description": "postprocessing wrapper for React and @react-three/fiber",
5
5
  "keywords": [
6
6
  "postprocessing",
@@ -24,11 +24,11 @@
24
24
  "url": "git+https://github.com/pmndrs/react-postprocessing.git"
25
25
  },
26
26
  "scripts": {
27
- "build": "vite build",
27
+ "build": "rimraf dist && vite build && tsc",
28
28
  "eslint": "eslint . --fix --ext=js,ts,jsx,tsx",
29
29
  "eslint:ci": "eslint . --ext=js,ts,jsx,tsx",
30
30
  "test": "vitest run",
31
- "typecheck": "tsc"
31
+ "typecheck": "tsc --noEmit"
32
32
  },
33
33
  "dependencies": {
34
34
  "maath": "^0.6.0",
@@ -36,7 +36,7 @@
36
36
  "postprocessing": "^6.36.6"
37
37
  },
38
38
  "devDependencies": {
39
- "@react-three/fiber": "^9.0.1",
39
+ "@react-three/fiber": "^9.0.4",
40
40
  "@types/node": "^22.10.7",
41
41
  "@types/react": "^19.0.2",
42
42
  "@types/react-dom": "^19.0.2",
@@ -53,6 +53,7 @@
53
53
  "prettier": "^2.8.8",
54
54
  "react": "^19.0.0",
55
55
  "react-dom": "^19.0.0",
56
+ "rimraf": "^6.0.1",
56
57
  "three": "^0.156.0",
57
58
  "typescript": "^5.0.4",
58
59
  "vite": "^4.3.5",