@react-three/postprocessing 2.13.0 → 2.14.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/dist/effects/FXAA.d.ts +8 -0
- package/dist/effects/N8AO.d.ts +1 -0
- package/dist/index.cjs +6 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +7 -4
- package/package.json +2 -2
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FXAAEffect } from 'postprocessing';
|
|
3
|
+
export declare const FXAA: import("react").ForwardRefExoticComponent<Omit<import("@react-three/fiber").ExtendedColors<import("@react-three/fiber").Overwrite<Partial<FXAAEffect>, import("@react-three/fiber").NodeProps<FXAAEffect, typeof FXAAEffect>>> & {
|
|
4
|
+
blendFunction?: import("postprocessing").BlendFunction | undefined;
|
|
5
|
+
} & {
|
|
6
|
+
blendFunction?: import("postprocessing").BlendFunction | undefined;
|
|
7
|
+
opacity?: number | undefined;
|
|
8
|
+
}, "ref"> & import("react").RefAttributes<typeof FXAAEffect>>;
|
package/dist/effects/N8AO.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ type N8AOProps = {
|
|
|
9
9
|
denoiseSamples?: number;
|
|
10
10
|
denoiseRadius?: number;
|
|
11
11
|
color?: ReactThreeFiber.Color;
|
|
12
|
+
screenSpaceRadius?: boolean;
|
|
12
13
|
};
|
|
13
14
|
export declare const N8AO: import("react").ForwardRefExoticComponent<N8AOProps & import("react").RefAttributes<N8AOPostPass>>;
|
|
14
15
|
export {};
|
package/dist/index.cjs
CHANGED
|
@@ -511,6 +511,8 @@ const SSAO = React.forwardRef(function SSAO(props, ref) {
|
|
|
511
511
|
|
|
512
512
|
const SMAA = wrapEffect(postprocessing.SMAAEffect);
|
|
513
513
|
|
|
514
|
+
const FXAA = wrapEffect(postprocessing.FXAAEffect);
|
|
515
|
+
|
|
514
516
|
const Texture = React.forwardRef(function Texture({ textureSrc, texture, ...props }, ref) {
|
|
515
517
|
const t = fiber.useLoader(THREE.TextureLoader, textureSrc);
|
|
516
518
|
React.useLayoutEffect(() => {
|
|
@@ -733,7 +735,7 @@ const SSR = React.forwardRef(function SSR({ ENABLE_BLUR = true, USE_MRT = true,
|
|
|
733
735
|
return jsxRuntime.jsx("primitive", { ref: ref, object: effect, ...props });
|
|
734
736
|
});
|
|
735
737
|
|
|
736
|
-
const N8AO = React.forwardRef(({ quality, aoRadius = 5, aoSamples = 16, denoiseSamples = 4, denoiseRadius = 12, distanceFalloff = 1, intensity = 1, color, }, ref) => {
|
|
738
|
+
const N8AO = React.forwardRef(({ screenSpaceRadius, quality, aoRadius = 5, aoSamples = 16, denoiseSamples = 4, denoiseRadius = 12, distanceFalloff = 1, intensity = 1, color, }, ref) => {
|
|
737
739
|
const { camera, scene } = fiber.useThree();
|
|
738
740
|
const effect = React.useMemo(() => new n8ao.N8AOPostPass(scene, camera), []);
|
|
739
741
|
React.useLayoutEffect(() => {
|
|
@@ -745,8 +747,9 @@ const N8AO = React.forwardRef(({ quality, aoRadius = 5, aoSamples = 16, denoiseS
|
|
|
745
747
|
aoSamples,
|
|
746
748
|
denoiseSamples,
|
|
747
749
|
denoiseRadius,
|
|
750
|
+
screenSpaceRadius,
|
|
748
751
|
});
|
|
749
|
-
}, [color, aoRadius, distanceFalloff, intensity, aoSamples, denoiseSamples, denoiseRadius]);
|
|
752
|
+
}, [screenSpaceRadius, color, aoRadius, distanceFalloff, intensity, aoSamples, denoiseSamples, denoiseRadius]);
|
|
750
753
|
React.useLayoutEffect(() => {
|
|
751
754
|
if (quality)
|
|
752
755
|
effect.setQualityMode(quality.charAt(0).toUpperCase() + quality.slice(1));
|
|
@@ -766,6 +769,7 @@ exports.DepthOfField = DepthOfField;
|
|
|
766
769
|
exports.DotScreen = DotScreen;
|
|
767
770
|
exports.EffectComposer = EffectComposer;
|
|
768
771
|
exports.EffectComposerContext = EffectComposerContext;
|
|
772
|
+
exports.FXAA = FXAA;
|
|
769
773
|
exports.Glitch = Glitch;
|
|
770
774
|
exports.GodRays = GodRays;
|
|
771
775
|
exports.Grid = Grid;
|
package/dist/index.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ export * from './effects/SelectiveBloom';
|
|
|
22
22
|
export * from './effects/Sepia';
|
|
23
23
|
export * from './effects/SSAO';
|
|
24
24
|
export * from './effects/SMAA';
|
|
25
|
+
export * from './effects/FXAA';
|
|
25
26
|
export * from './effects/Texture';
|
|
26
27
|
export * from './effects/ToneMapping';
|
|
27
28
|
export * from './effects/Vignette';
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import React, { createContext, useState, useMemo, useRef, useContext, useEffect,
|
|
|
3
3
|
import * as THREE from 'three';
|
|
4
4
|
import { HalfFloatType, Vector3, TextureLoader, sRGBEncoding, RepeatWrapping, Uniform, Texture as Texture$1, Color, CanvasTexture, NearestFilter } from 'three';
|
|
5
5
|
import { useThree, useFrame, useInstanceHandle, extend, createPortal, useLoader, applyProps } from '@react-three/fiber';
|
|
6
|
-
import { EffectComposer as EffectComposer$1, RenderPass, NormalPass, DepthDownsamplingPass, Effect, EffectPass, Pass, DepthOfFieldEffect, MaskFunction, DepthPickingPass, CopyPass, BlendFunction, BloomEffect, BrightnessContrastEffect, ChromaticAberrationEffect, ColorAverageEffect, ColorDepthEffect, DepthEffect, DotScreenEffect, GlitchEffect, GlitchMode, GodRaysEffect, GridEffect, HueSaturationEffect, NoiseEffect, OutlineEffect, PixelationEffect, ScanlineEffect, SelectiveBloomEffect, SepiaEffect, SSAOEffect, SMAAEffect, TextureEffect, ToneMappingEffect, VignetteEffect, ShockWaveEffect, LUT3DEffect, TiltShiftEffect as TiltShiftEffect$1, EffectAttribute } from 'postprocessing';
|
|
6
|
+
import { EffectComposer as EffectComposer$1, RenderPass, NormalPass, DepthDownsamplingPass, Effect, EffectPass, Pass, DepthOfFieldEffect, MaskFunction, DepthPickingPass, CopyPass, BlendFunction, BloomEffect, BrightnessContrastEffect, ChromaticAberrationEffect, ColorAverageEffect, ColorDepthEffect, DepthEffect, DotScreenEffect, GlitchEffect, GlitchMode, GodRaysEffect, GridEffect, HueSaturationEffect, NoiseEffect, OutlineEffect, PixelationEffect, ScanlineEffect, SelectiveBloomEffect, SepiaEffect, SSAOEffect, SMAAEffect, FXAAEffect, TextureEffect, ToneMappingEffect, VignetteEffect, ShockWaveEffect, LUT3DEffect, TiltShiftEffect as TiltShiftEffect$1, EffectAttribute } from 'postprocessing';
|
|
7
7
|
import { isWebGL2Available } from 'three-stdlib';
|
|
8
8
|
import { easing } from 'maath';
|
|
9
9
|
import { SSREffect } from 'screen-space-reflections';
|
|
@@ -491,6 +491,8 @@ const SSAO = forwardRef(function SSAO(props, ref) {
|
|
|
491
491
|
|
|
492
492
|
const SMAA = wrapEffect(SMAAEffect);
|
|
493
493
|
|
|
494
|
+
const FXAA = wrapEffect(FXAAEffect);
|
|
495
|
+
|
|
494
496
|
const Texture = forwardRef(function Texture({ textureSrc, texture, ...props }, ref) {
|
|
495
497
|
const t = useLoader(TextureLoader, textureSrc);
|
|
496
498
|
useLayoutEffect(() => {
|
|
@@ -713,7 +715,7 @@ const SSR = forwardRef(function SSR({ ENABLE_BLUR = true, USE_MRT = true, ...pro
|
|
|
713
715
|
return jsx("primitive", { ref: ref, object: effect, ...props });
|
|
714
716
|
});
|
|
715
717
|
|
|
716
|
-
const N8AO = forwardRef(({ quality, aoRadius = 5, aoSamples = 16, denoiseSamples = 4, denoiseRadius = 12, distanceFalloff = 1, intensity = 1, color, }, ref) => {
|
|
718
|
+
const N8AO = forwardRef(({ screenSpaceRadius, quality, aoRadius = 5, aoSamples = 16, denoiseSamples = 4, denoiseRadius = 12, distanceFalloff = 1, intensity = 1, color, }, ref) => {
|
|
717
719
|
const { camera, scene } = useThree();
|
|
718
720
|
const effect = useMemo(() => new N8AOPostPass(scene, camera), []);
|
|
719
721
|
useLayoutEffect(() => {
|
|
@@ -725,8 +727,9 @@ const N8AO = forwardRef(({ quality, aoRadius = 5, aoSamples = 16, denoiseSamples
|
|
|
725
727
|
aoSamples,
|
|
726
728
|
denoiseSamples,
|
|
727
729
|
denoiseRadius,
|
|
730
|
+
screenSpaceRadius,
|
|
728
731
|
});
|
|
729
|
-
}, [color, aoRadius, distanceFalloff, intensity, aoSamples, denoiseSamples, denoiseRadius]);
|
|
732
|
+
}, [screenSpaceRadius, color, aoRadius, distanceFalloff, intensity, aoSamples, denoiseSamples, denoiseRadius]);
|
|
730
733
|
useLayoutEffect(() => {
|
|
731
734
|
if (quality)
|
|
732
735
|
effect.setQualityMode(quality.charAt(0).toUpperCase() + quality.slice(1));
|
|
@@ -734,4 +737,4 @@ const N8AO = forwardRef(({ quality, aoRadius = 5, aoSamples = 16, denoiseSamples
|
|
|
734
737
|
return jsx("primitive", { ref: ref, object: effect });
|
|
735
738
|
});
|
|
736
739
|
|
|
737
|
-
export { ASCII, Autofocus, Bloom, BrightnessContrast, ChromaticAberration, ColorAverage, ColorDepth, Depth, DepthOfField, DotScreen, EffectComposer, EffectComposerContext, Glitch, GodRays, Grid, HueSaturation, LUT, N8AO, Noise, Outline, Pixelation, SMAA, SSAO, SSR, Scanline, Select, Selection, SelectiveBloom, Sepia, ShockWave, Texture, TiltShift, TiltShift2, TiltShiftEffect, ToneMapping, Vignette, resolveRef, selectionContext, useVector2, wrapEffect };
|
|
740
|
+
export { ASCII, Autofocus, Bloom, BrightnessContrast, ChromaticAberration, ColorAverage, ColorDepth, Depth, DepthOfField, DotScreen, EffectComposer, EffectComposerContext, FXAA, Glitch, GodRays, Grid, HueSaturation, LUT, N8AO, Noise, Outline, Pixelation, SMAA, SSAO, SSR, Scanline, Select, Selection, SelectiveBloom, Sepia, ShockWave, Texture, TiltShift, TiltShift2, TiltShiftEffect, ToneMapping, Vignette, resolveRef, selectionContext, useVector2, wrapEffect };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-three/postprocessing",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.14.0",
|
|
4
4
|
"description": "postprocessing wrapper for React and @react-three/fiber",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"postprocessing",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"maath": "^0.5.3",
|
|
51
|
-
"n8ao": "^1.
|
|
51
|
+
"n8ao": "^1.4.0",
|
|
52
52
|
"postprocessing": "^6.31.0",
|
|
53
53
|
"screen-space-reflections": "2.5.0",
|
|
54
54
|
"three-stdlib": "^2.21.10"
|