@react-three/postprocessing 2.3.0 → 2.3.3
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 +1 -1
- package/dist/{index.cjs.js → index.cjs} +4 -3
- package/dist/index.js +3 -2
- package/package.json +4 -9
package/README.md
CHANGED
|
@@ -124,4 +124,4 @@ Selection can be nested and group multiple object, higher up selection take prec
|
|
|
124
124
|
```
|
|
125
125
|
|
|
126
126
|
- [react-postprocessing exports](https://github.com/pmndrs/react-postprocessing/blob/master/api.md)
|
|
127
|
-
- [postprocessing docs](https://
|
|
127
|
+
- [postprocessing docs](https://pmndrs.github.io/postprocessing/public/docs/)
|
|
@@ -65,7 +65,7 @@ var wrapEffect = function wrapEffect(effectImpl, defaultBlendMode) {
|
|
|
65
65
|
return new effectImpl(props);
|
|
66
66
|
}, [props]);
|
|
67
67
|
React.useLayoutEffect(function () {
|
|
68
|
-
effect.blendMode.blendFunction = blendFunction
|
|
68
|
+
effect.blendMode.blendFunction = !blendFunction && blendFunction !== 0 ? defaultBlendMode : blendFunction;
|
|
69
69
|
if (opacity !== undefined) effect.blendMode.opacity.value = opacity;
|
|
70
70
|
invalidate();
|
|
71
71
|
}, [blendFunction, effect.blendMode, opacity]);
|
|
@@ -623,7 +623,7 @@ var SSAO = /*#__PURE__*/React.forwardRef(function SSAO(props, ref) {
|
|
|
623
623
|
return null;
|
|
624
624
|
}
|
|
625
625
|
|
|
626
|
-
return new postprocessing.SSAOEffect(camera, normalPass ? normalPass.texture : null, _extends__default["default"]({
|
|
626
|
+
return new postprocessing.SSAOEffect(camera, normalPass && !downSamplingPass ? normalPass.texture : null, _extends__default["default"]({
|
|
627
627
|
blendFunction: postprocessing.BlendFunction.MULTIPLY,
|
|
628
628
|
samples: 30,
|
|
629
629
|
rings: 4,
|
|
@@ -639,7 +639,8 @@ var SSAO = /*#__PURE__*/React.forwardRef(function SSAO(props, ref) {
|
|
|
639
639
|
color: null,
|
|
640
640
|
// @ts-ignore
|
|
641
641
|
normalDepthBuffer: downSamplingPass ? downSamplingPass.texture : null,
|
|
642
|
-
resolutionScale: resolutionScale != null ? resolutionScale : 1
|
|
642
|
+
resolutionScale: resolutionScale != null ? resolutionScale : 1,
|
|
643
|
+
depthAwareUpsampling: true
|
|
643
644
|
}, props));
|
|
644
645
|
}, [camera, normalPass, props]);
|
|
645
646
|
return /*#__PURE__*/React__default["default"].createElement("primitive", {
|
package/dist/index.js
CHANGED
|
@@ -24,7 +24,7 @@ const wrapEffect = function (effectImpl, defaultBlendMode) {
|
|
|
24
24
|
const invalidate = useThree(state => state.invalidate);
|
|
25
25
|
const effect = useMemo(() => new effectImpl(props), [props]);
|
|
26
26
|
useLayoutEffect(() => {
|
|
27
|
-
effect.blendMode.blendFunction = blendFunction
|
|
27
|
+
effect.blendMode.blendFunction = !blendFunction && blendFunction !== 0 ? defaultBlendMode : blendFunction;
|
|
28
28
|
if (opacity !== undefined) effect.blendMode.opacity.value = opacity;
|
|
29
29
|
invalidate();
|
|
30
30
|
}, [blendFunction, effect.blendMode, opacity]);
|
|
@@ -506,7 +506,7 @@ const SSAO = /*#__PURE__*/forwardRef(function SSAO(props, ref) {
|
|
|
506
506
|
return null;
|
|
507
507
|
}
|
|
508
508
|
|
|
509
|
-
return new SSAOEffect(camera, normalPass ? normalPass.texture : null, {
|
|
509
|
+
return new SSAOEffect(camera, normalPass && !downSamplingPass ? normalPass.texture : null, {
|
|
510
510
|
blendFunction: BlendFunction.MULTIPLY,
|
|
511
511
|
samples: 30,
|
|
512
512
|
rings: 4,
|
|
@@ -523,6 +523,7 @@ const SSAO = /*#__PURE__*/forwardRef(function SSAO(props, ref) {
|
|
|
523
523
|
// @ts-ignore
|
|
524
524
|
normalDepthBuffer: downSamplingPass ? downSamplingPass.texture : null,
|
|
525
525
|
resolutionScale: resolutionScale != null ? resolutionScale : 1,
|
|
526
|
+
depthAwareUpsampling: true,
|
|
526
527
|
...props
|
|
527
528
|
});
|
|
528
529
|
}, [camera, normalPass, props]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-three/postprocessing",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.3",
|
|
4
4
|
"description": "postprocessing wrapper for React and @react-three/fiber",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"postprocessing",
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
"3d"
|
|
12
12
|
],
|
|
13
13
|
"license": "MIT",
|
|
14
|
-
"
|
|
14
|
+
"type": "module",
|
|
15
|
+
"main": "dist/index.cjs",
|
|
15
16
|
"module": "dist/index.js",
|
|
16
17
|
"types": "dist/index.d.ts",
|
|
17
18
|
"sideEffects": false,
|
|
@@ -38,7 +39,7 @@
|
|
|
38
39
|
"typegen": "tsc --emitDeclarationOnly || true"
|
|
39
40
|
},
|
|
40
41
|
"dependencies": {
|
|
41
|
-
"postprocessing": "6.26.
|
|
42
|
+
"postprocessing": "^6.26.4",
|
|
42
43
|
"react-merge-refs": "^1.1.0",
|
|
43
44
|
"three-stdlib": "^2.8.11"
|
|
44
45
|
},
|
|
@@ -84,12 +85,6 @@
|
|
|
84
85
|
"peerDependencies": {
|
|
85
86
|
"@react-three/fiber": ">=7.0",
|
|
86
87
|
"react": ">=17.0",
|
|
87
|
-
"react-dom": ">=17.0",
|
|
88
88
|
"three": ">=0.136.0"
|
|
89
|
-
},
|
|
90
|
-
"peerDependenciesMeta": {
|
|
91
|
-
"react-dom": {
|
|
92
|
-
"optional": true
|
|
93
|
-
}
|
|
94
89
|
}
|
|
95
90
|
}
|