@react-three/postprocessing 3.0.5 → 3.1.1

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 (106) hide show
  1. package/README.md +6 -7
  2. package/dist/EffectComposer.d.ts +9 -2
  3. package/dist/EffectGroup.d.ts +9 -0
  4. package/dist/createEffectComponent.d.ts +30 -0
  5. package/dist/effects/ASCII.d.ts +28 -7
  6. package/dist/effects/Autofocus.d.ts +1 -1
  7. package/dist/effects/Bloom.d.ts +9 -1
  8. package/dist/effects/BrightnessContrast.d.ts +14 -1
  9. package/dist/effects/ChromaticAberration.d.ts +26 -3
  10. package/dist/effects/ColorAverage.d.ts +7 -7
  11. package/dist/effects/ColorDepth.d.ts +7 -1
  12. package/dist/effects/Depth.d.ts +12 -1
  13. package/dist/effects/DotScreen.d.ts +14 -1
  14. package/dist/effects/FXAA.d.ts +10 -1
  15. package/dist/effects/Glitch.d.ts +16 -11
  16. package/dist/effects/GodRays.d.ts +1 -1
  17. package/dist/effects/Grid.d.ts +7 -6
  18. package/dist/effects/HueSaturation.d.ts +14 -1
  19. package/dist/effects/LUT.d.ts +1 -1
  20. package/dist/effects/LensFlare.d.ts +46 -5
  21. package/dist/effects/Noise.d.ts +7 -1
  22. package/dist/effects/Outline.d.ts +6 -3
  23. package/dist/effects/Pixelation.d.ts +1 -1
  24. package/dist/effects/Ramp.d.ts +58 -6
  25. package/dist/effects/SMAA.d.ts +9 -1
  26. package/dist/effects/SSAO.d.ts +1 -1
  27. package/dist/effects/ScanlineEffect.d.ts +12 -1
  28. package/dist/effects/SelectiveBloom.d.ts +1 -1
  29. package/dist/effects/Sepia.d.ts +12 -1
  30. package/dist/effects/ShockWave.d.ts +11 -1
  31. package/dist/effects/Texture.d.ts +4 -4
  32. package/dist/effects/TiltShift.d.ts +9 -1
  33. package/dist/effects/TiltShift2.d.ts +44 -4
  34. package/dist/effects/ToneMapping.d.ts +9 -3
  35. package/dist/effects/Vignette.d.ts +18 -1
  36. package/dist/effects/Water.d.ts +17 -1
  37. package/dist/index.d.ts +4 -1
  38. package/dist/index.js +2205 -713
  39. package/dist/index.js.map +1 -1
  40. package/dist/passes/DepthPicking.d.ts +11 -0
  41. package/dist/{effects → passes}/N8AO.d.ts +2 -1
  42. package/dist/util.d.ts +9 -15
  43. package/dist/wrapEffect.d.ts +3 -3
  44. package/package.json +6 -5
  45. package/src/EffectComposer.tsx +143 -42
  46. package/src/EffectGroup.tsx +74 -0
  47. package/src/createEffectComponent.tsx +71 -0
  48. package/src/effects/ASCII.tsx +75 -28
  49. package/src/effects/Autofocus.tsx +24 -77
  50. package/src/effects/Bloom.tsx +32 -4
  51. package/src/effects/BrightnessContrast.tsx +5 -2
  52. package/src/effects/ChromaticAberration.tsx +13 -21
  53. package/src/effects/ColorAverage.tsx +3 -16
  54. package/src/effects/ColorDepth.tsx +23 -2
  55. package/src/effects/Depth.tsx +4 -2
  56. package/src/effects/DepthOfField.tsx +48 -26
  57. package/src/effects/DotScreen.tsx +5 -2
  58. package/src/effects/FXAA.tsx +4 -2
  59. package/src/effects/Glitch.tsx +26 -31
  60. package/src/effects/GodRays.tsx +90 -6
  61. package/src/effects/Grid.tsx +17 -18
  62. package/src/effects/HueSaturation.tsx +5 -2
  63. package/src/effects/LUT.tsx +9 -11
  64. package/src/effects/LensFlare.tsx +209 -55
  65. package/src/effects/Noise.tsx +14 -2
  66. package/src/effects/Outline.tsx +55 -56
  67. package/src/effects/Pixelation.tsx +11 -8
  68. package/src/effects/Ramp.tsx +96 -7
  69. package/src/effects/SMAA.tsx +18 -2
  70. package/src/effects/SSAO.tsx +130 -22
  71. package/src/effects/ScanlineEffect.tsx +6 -6
  72. package/src/effects/SelectiveBloom.tsx +26 -44
  73. package/src/effects/Sepia.tsx +4 -2
  74. package/src/effects/ShockWave.tsx +30 -2
  75. package/src/effects/Texture.tsx +10 -9
  76. package/src/effects/TiltShift.tsx +30 -2
  77. package/src/effects/TiltShift2.tsx +72 -6
  78. package/src/effects/ToneMapping.tsx +16 -3
  79. package/src/effects/Vignette.tsx +5 -2
  80. package/src/effects/Water.tsx +21 -6
  81. package/src/index.ts +4 -2
  82. package/src/passes/DepthPicking.tsx +63 -0
  83. package/src/{effects → passes}/N8AO.tsx +28 -4
  84. package/src/tests/Autofocus.test.tsx +38 -0
  85. package/src/tests/Bloom.test.tsx +76 -0
  86. package/src/tests/ChromaticAberration.test.tsx +50 -0
  87. package/src/tests/ColorDepth.test.tsx +71 -0
  88. package/src/tests/DepthOfField.test.tsx +130 -0
  89. package/src/tests/DepthPicking.test.tsx +250 -0
  90. package/src/tests/EffectComposer.test.tsx +501 -8
  91. package/src/tests/EffectGroup.test.tsx +337 -0
  92. package/src/tests/Glitch.test.tsx +56 -0
  93. package/src/tests/GodRays.test.tsx +101 -0
  94. package/src/tests/Grid.test.tsx +34 -0
  95. package/src/tests/LUT.test.tsx +64 -0
  96. package/src/tests/N8AO.test.tsx +92 -0
  97. package/src/tests/Outline.test.tsx +122 -0
  98. package/src/tests/SSAO.test.tsx +140 -0
  99. package/src/tests/SelectiveBloom.test.tsx +48 -0
  100. package/src/tests/ShockWave.test.tsx +95 -0
  101. package/src/tests/TiltShift.test.tsx +76 -0
  102. package/src/tests/createEffectComponent.test.tsx +286 -0
  103. package/src/tests/effects.smoke.test.tsx +46 -42
  104. package/src/util.tsx +148 -23
  105. package/src/wrapEffect.tsx +3 -2
  106. package/dist/tests/test-utils.d.ts +0 -12
@@ -1,2 +1,13 @@
1
1
  import { SepiaEffect } from 'postprocessing';
2
- export declare const Sepia: (props: import("..").EffectProps<typeof SepiaEffect>) => import("react").JSX.Element;
2
+ export declare const Sepia: (props: {
3
+ blendFunction?: import("postprocessing").BlendFunction;
4
+ intensity?: number;
5
+ } & {
6
+ blendFunction?: import("postprocessing").BlendFunction;
7
+ opacity?: number;
8
+ args?: [({
9
+ blendFunction?: import("postprocessing").BlendFunction;
10
+ intensity?: number;
11
+ } | undefined)?] | undefined;
12
+ ref?: import("react").Ref<SepiaEffect> | undefined;
13
+ }) => import("react").JSX.Element;
@@ -1,2 +1,12 @@
1
+ import type { ReactThreeFiber } from '@react-three/fiber';
1
2
  import { ShockWaveEffect } from 'postprocessing';
2
- export declare const ShockWave: (props: import("..").EffectProps<typeof ShockWaveEffect>) => import("react").JSX.Element;
3
+ import { Ref } from 'react';
4
+ export type ShockWaveProps = {
5
+ position?: ReactThreeFiber.Vector3;
6
+ speed?: number;
7
+ maxRadius?: number;
8
+ waveSize?: number;
9
+ amplitude?: number;
10
+ ref?: Ref<ShockWaveEffect>;
11
+ };
12
+ export declare function ShockWave(props: ShockWaveProps): import("react").JSX.Element;
@@ -1,10 +1,10 @@
1
1
  import { TextureEffect } from 'postprocessing';
2
- import { Ref } from 'react';
3
- type TextureProps = ConstructorParameters<typeof TextureEffect>[0] & {
2
+ import type { Ref } from 'react';
3
+ import { type EffectOptions } from '../createEffectComponent';
4
+ export type TextureProps = EffectOptions<typeof TextureEffect> & {
4
5
  textureSrc: string;
5
6
  /** opacity of provided texture */
6
7
  opacity?: number;
7
8
  ref?: Ref<TextureEffect>;
8
9
  };
9
- export declare function Texture({ textureSrc, texture, opacity, ref, ...props }: TextureProps): import("react").JSX.Element;
10
- export {};
10
+ export declare function Texture({ textureSrc, texture, opacity, ...props }: TextureProps): import("react").JSX.Element;
@@ -1,2 +1,10 @@
1
1
  import { TiltShiftEffect } from 'postprocessing';
2
- export declare const TiltShift: (props: import("..").EffectProps<typeof TiltShiftEffect>) => import("react").JSX.Element;
2
+ import type { Ref } from 'react';
3
+ import { type EffectOptions } from '../createEffectComponent';
4
+ type TiltShiftOptions = EffectOptions<typeof TiltShiftEffect>;
5
+ export type TiltShiftProps = TiltShiftOptions & {
6
+ opacity?: number;
7
+ ref?: Ref<TiltShiftEffect>;
8
+ };
9
+ export declare function TiltShift({ blendFunction, kernelSize, resolutionScale, resolutionX, resolutionY, ...liveProps }: TiltShiftProps): import("react").JSX.Element;
10
+ export {};
@@ -1,4 +1,6 @@
1
1
  import { BlendFunction, Effect } from 'postprocessing';
2
+ import type { Ref } from 'react';
3
+ type Vec2Tuple = [number, number];
2
4
  export declare class TiltShiftEffect extends Effect {
3
5
  constructor({ blendFunction, blur, // [0, 1], can go beyond 1 for extra
4
6
  taper, // [0, 1], can go beyond 1 for extra
@@ -9,10 +11,48 @@ export declare class TiltShiftEffect extends Effect {
9
11
  blendFunction?: BlendFunction | undefined;
10
12
  blur?: number | undefined;
11
13
  taper?: number | undefined;
12
- start?: number[] | undefined;
13
- end?: number[] | undefined;
14
+ start?: Vec2Tuple | undefined;
15
+ end?: Vec2Tuple | undefined;
14
16
  samples?: number | undefined;
15
- direction?: number[] | undefined;
17
+ direction?: Vec2Tuple | undefined;
16
18
  });
19
+ private u;
20
+ private setU;
21
+ get blur(): number;
22
+ set blur(value: number);
23
+ get taper(): number;
24
+ set taper(value: number);
25
+ get start(): Vec2Tuple;
26
+ set start(value: Vec2Tuple);
27
+ get end(): Vec2Tuple;
28
+ set end(value: Vec2Tuple);
29
+ get samples(): number;
30
+ set samples(value: number);
31
+ get direction(): Vec2Tuple;
32
+ set direction(value: Vec2Tuple);
17
33
  }
18
- export declare const TiltShift2: (props: import("..").EffectProps<typeof TiltShiftEffect>) => import("react").JSX.Element;
34
+ export type TiltShift2Props = {
35
+ blendFunction?: BlendFunction;
36
+ blur?: number;
37
+ taper?: number;
38
+ start?: Vec2Tuple;
39
+ end?: Vec2Tuple;
40
+ samples?: number;
41
+ direction?: Vec2Tuple;
42
+ ref?: Ref<TiltShiftEffect>;
43
+ };
44
+ export declare const TiltShift2: (props: TiltShift2Props & {
45
+ blendFunction?: BlendFunction;
46
+ opacity?: number;
47
+ args?: [({
48
+ blendFunction?: BlendFunction | undefined;
49
+ blur?: number | undefined;
50
+ taper?: number | undefined;
51
+ start?: Vec2Tuple | undefined;
52
+ end?: Vec2Tuple | undefined;
53
+ samples?: number | undefined;
54
+ direction?: Vec2Tuple | undefined;
55
+ } | undefined)?] | undefined;
56
+ ref?: Ref<TiltShiftEffect> | undefined;
57
+ }) => import("react").JSX.Element;
58
+ export {};
@@ -1,4 +1,10 @@
1
1
  import { ToneMappingEffect } from 'postprocessing';
2
- import { type EffectProps } from '../wrapEffect';
3
- export type ToneMappingProps = EffectProps<typeof ToneMappingEffect>;
4
- export declare const ToneMapping: (props: EffectProps<typeof ToneMappingEffect>) => import("react").JSX.Element;
2
+ import type { Ref } from 'react';
3
+ import { type EffectOptions } from '../createEffectComponent';
4
+ type ToneMappingOptions = EffectOptions<typeof ToneMappingEffect>;
5
+ export type ToneMappingProps = ToneMappingOptions & {
6
+ opacity?: number;
7
+ ref?: Ref<ToneMappingEffect>;
8
+ };
9
+ export declare function ToneMapping({ minLuminance, maxLuminance, ...liveProps }: ToneMappingProps): import("react").JSX.Element;
10
+ export {};
@@ -1,2 +1,19 @@
1
1
  import { VignetteEffect } from 'postprocessing';
2
- export declare const Vignette: (props: import("..").EffectProps<typeof VignetteEffect>) => import("react").JSX.Element;
2
+ export declare const Vignette: (props: {
3
+ blendFunction?: import("postprocessing").BlendFunction;
4
+ technique?: import("postprocessing").VignetteTechnique;
5
+ eskil?: boolean;
6
+ offset?: number;
7
+ darkness?: number;
8
+ } & {
9
+ blendFunction?: import("postprocessing").BlendFunction;
10
+ opacity?: number;
11
+ args?: [({
12
+ blendFunction?: import("postprocessing").BlendFunction;
13
+ technique?: import("postprocessing").VignetteTechnique;
14
+ eskil?: boolean;
15
+ offset?: number;
16
+ darkness?: number;
17
+ } | undefined)?] | undefined;
18
+ ref?: import("react").Ref<VignetteEffect> | undefined;
19
+ }) => import("react").JSX.Element;
@@ -1,8 +1,24 @@
1
1
  import { BlendFunction, Effect } from 'postprocessing';
2
+ import type { Ref } from 'react';
2
3
  export declare class WaterEffectImpl extends Effect {
3
4
  constructor({ blendFunction, factor }?: {
4
5
  blendFunction?: BlendFunction | undefined;
5
6
  factor?: number | undefined;
6
7
  });
8
+ get factor(): number;
9
+ set factor(value: number);
7
10
  }
8
- export declare const WaterEffect: (props: import("..").EffectProps<typeof WaterEffectImpl>) => import("react").JSX.Element;
11
+ export type WaterEffectProps = {
12
+ blendFunction?: BlendFunction;
13
+ factor?: number;
14
+ ref?: Ref<WaterEffectImpl>;
15
+ };
16
+ export declare const WaterEffect: (props: WaterEffectProps & {
17
+ blendFunction?: BlendFunction;
18
+ opacity?: number;
19
+ args?: [({
20
+ blendFunction?: BlendFunction | undefined;
21
+ factor?: number | undefined;
22
+ } | undefined)?] | undefined;
23
+ ref?: Ref<WaterEffectImpl> | undefined;
24
+ }) => import("react").JSX.Element;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,6 @@
1
+ export * from './createEffectComponent';
1
2
  export * from './EffectComposer';
3
+ export * from './EffectGroup';
2
4
  export * from './Selection';
3
5
  export * from './util';
4
6
  export * from './wrapEffect';
@@ -35,4 +37,5 @@ export * from './effects/TiltShift2';
35
37
  export * from './effects/ToneMapping';
36
38
  export * from './effects/Vignette';
37
39
  export * from './effects/Water';
38
- export * from './effects/N8AO';
40
+ export * from './passes/DepthPicking';
41
+ export * from './passes/N8AO';