@react-three/postprocessing 2.12.1 → 2.12.2
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/N8AO.d.ts +4 -0
- package/dist/index.cjs +14 -3
- package/dist/index.js +14 -3
- package/package.json +1 -1
package/dist/effects/N8AO.d.ts
CHANGED
|
@@ -3,6 +3,10 @@ type N8AOProps = {
|
|
|
3
3
|
aoRadius?: number;
|
|
4
4
|
distanceFalloff?: number;
|
|
5
5
|
intensity?: number;
|
|
6
|
+
quality?: 'performance' | 'low' | 'medium' | 'high' | 'ultra';
|
|
7
|
+
aoSamples?: number;
|
|
8
|
+
denoiseSamples?: number;
|
|
9
|
+
denoiseRadius?: number;
|
|
6
10
|
};
|
|
7
11
|
export declare const N8AO: import("react").ForwardRefExoticComponent<N8AOProps & import("react").RefAttributes<N8AOPostPass>>;
|
|
8
12
|
export {};
|
package/dist/index.cjs
CHANGED
|
@@ -510,12 +510,23 @@ const SSAO = React.forwardRef(function SSAO(props, ref) {
|
|
|
510
510
|
return jsxRuntime.jsx("primitive", { ref: ref, object: effect, dispose: null });
|
|
511
511
|
});
|
|
512
512
|
|
|
513
|
-
const N8AO = React.forwardRef((
|
|
513
|
+
const N8AO = React.forwardRef(({ quality, aoRadius, aoSamples, denoiseSamples, denoiseRadius, distanceFalloff, intensity }, ref) => {
|
|
514
514
|
const { camera, scene } = fiber.useThree();
|
|
515
515
|
const effect = React.useMemo(() => new n8ao.N8AOPostPass(scene, camera), []);
|
|
516
516
|
React.useLayoutEffect(() => {
|
|
517
|
-
Object.assign(effect.configuration,
|
|
518
|
-
|
|
517
|
+
Object.assign(effect.configuration, {
|
|
518
|
+
aoRadius,
|
|
519
|
+
distanceFalloff,
|
|
520
|
+
intensity,
|
|
521
|
+
aoSamples,
|
|
522
|
+
denoiseSamples,
|
|
523
|
+
denoiseRadius,
|
|
524
|
+
});
|
|
525
|
+
}, [aoRadius, distanceFalloff, intensity, aoSamples, denoiseSamples, denoiseRadius]);
|
|
526
|
+
React.useLayoutEffect(() => {
|
|
527
|
+
if (quality)
|
|
528
|
+
effect.setQualityMode(quality.charAt(0).toUpperCase() + quality.slice(1));
|
|
529
|
+
}, [quality]);
|
|
519
530
|
return jsxRuntime.jsx("primitive", { ref: ref, object: effect });
|
|
520
531
|
});
|
|
521
532
|
|
package/dist/index.js
CHANGED
|
@@ -490,12 +490,23 @@ const SSAO = forwardRef(function SSAO(props, ref) {
|
|
|
490
490
|
return jsx("primitive", { ref: ref, object: effect, dispose: null });
|
|
491
491
|
});
|
|
492
492
|
|
|
493
|
-
const N8AO = forwardRef((
|
|
493
|
+
const N8AO = forwardRef(({ quality, aoRadius, aoSamples, denoiseSamples, denoiseRadius, distanceFalloff, intensity }, ref) => {
|
|
494
494
|
const { camera, scene } = useThree();
|
|
495
495
|
const effect = useMemo(() => new N8AOPostPass(scene, camera), []);
|
|
496
496
|
useLayoutEffect(() => {
|
|
497
|
-
Object.assign(effect.configuration,
|
|
498
|
-
|
|
497
|
+
Object.assign(effect.configuration, {
|
|
498
|
+
aoRadius,
|
|
499
|
+
distanceFalloff,
|
|
500
|
+
intensity,
|
|
501
|
+
aoSamples,
|
|
502
|
+
denoiseSamples,
|
|
503
|
+
denoiseRadius,
|
|
504
|
+
});
|
|
505
|
+
}, [aoRadius, distanceFalloff, intensity, aoSamples, denoiseSamples, denoiseRadius]);
|
|
506
|
+
useLayoutEffect(() => {
|
|
507
|
+
if (quality)
|
|
508
|
+
effect.setQualityMode(quality.charAt(0).toUpperCase() + quality.slice(1));
|
|
509
|
+
}, [quality]);
|
|
499
510
|
return jsx("primitive", { ref: ref, object: effect });
|
|
500
511
|
});
|
|
501
512
|
|