@react-three/postprocessing 2.5.2 → 2.5.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/dist/index.cjs +25 -20
- package/dist/index.js +9 -4
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -19,7 +19,7 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
19
19
|
var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
|
|
20
20
|
var _construct__default = /*#__PURE__*/_interopDefaultLegacy(_construct);
|
|
21
21
|
|
|
22
|
-
var _excluded$
|
|
22
|
+
var _excluded$9 = ["blendFunction", "opacity"];
|
|
23
23
|
|
|
24
24
|
var isRef = function isRef(ref) {
|
|
25
25
|
return !!ref.current;
|
|
@@ -36,7 +36,7 @@ var wrapEffect = function wrapEffect(effectImpl, defaultBlendMode) {
|
|
|
36
36
|
return /*#__PURE__*/React.forwardRef(function Wrap(_ref, ref) {
|
|
37
37
|
var blendFunction = _ref.blendFunction,
|
|
38
38
|
opacity = _ref.opacity,
|
|
39
|
-
props = _objectWithoutPropertiesLoose__default["default"](_ref, _excluded$
|
|
39
|
+
props = _objectWithoutPropertiesLoose__default["default"](_ref, _excluded$9);
|
|
40
40
|
|
|
41
41
|
var invalidate = fiber.useThree(function (state) {
|
|
42
42
|
return state.invalidate;
|
|
@@ -223,11 +223,11 @@ var EffectComposer = /*#__PURE__*/React__default["default"].memo( /*#__PURE__*/R
|
|
|
223
223
|
}, children));
|
|
224
224
|
}));
|
|
225
225
|
|
|
226
|
-
var _excluded$
|
|
226
|
+
var _excluded$8 = ["target", "depthTexture"];
|
|
227
227
|
var DepthOfField = /*#__PURE__*/React.forwardRef(function DepthOfField(_ref, ref) {
|
|
228
228
|
var target = _ref.target,
|
|
229
229
|
depthTexture = _ref.depthTexture,
|
|
230
|
-
props = _objectWithoutPropertiesLoose__default["default"](_ref, _excluded$
|
|
230
|
+
props = _objectWithoutPropertiesLoose__default["default"](_ref, _excluded$8);
|
|
231
231
|
|
|
232
232
|
var invalidate = fiber.useThree(function (state) {
|
|
233
233
|
return state.invalidate;
|
|
@@ -257,11 +257,11 @@ var DepthOfField = /*#__PURE__*/React.forwardRef(function DepthOfField(_ref, ref
|
|
|
257
257
|
|
|
258
258
|
var DotScreen = wrapEffect(postprocessing.DotScreenEffect);
|
|
259
259
|
|
|
260
|
-
var _excluded$
|
|
260
|
+
var _excluded$7 = ["active"];
|
|
261
261
|
var Glitch = /*#__PURE__*/React.forwardRef(function Glitch(_ref, ref) {
|
|
262
262
|
var _ref$active = _ref.active,
|
|
263
263
|
active = _ref$active === void 0 ? true : _ref$active,
|
|
264
|
-
props = _objectWithoutPropertiesLoose__default["default"](_ref, _excluded$
|
|
264
|
+
props = _objectWithoutPropertiesLoose__default["default"](_ref, _excluded$7);
|
|
265
265
|
|
|
266
266
|
var invalidate = fiber.useThree(function (state) {
|
|
267
267
|
return state.invalidate;
|
|
@@ -301,10 +301,10 @@ var GodRays = /*#__PURE__*/React.forwardRef(function GodRays(props, ref) {
|
|
|
301
301
|
});
|
|
302
302
|
});
|
|
303
303
|
|
|
304
|
-
var _excluded$
|
|
304
|
+
var _excluded$6 = ["size"];
|
|
305
305
|
var Grid = /*#__PURE__*/React.forwardRef(function Grid(_ref, ref) {
|
|
306
306
|
var size = _ref.size,
|
|
307
|
-
props = _objectWithoutPropertiesLoose__default["default"](_ref, _excluded$
|
|
307
|
+
props = _objectWithoutPropertiesLoose__default["default"](_ref, _excluded$6);
|
|
308
308
|
|
|
309
309
|
var invalidate = fiber.useThree(function (state) {
|
|
310
310
|
return state.invalidate;
|
|
@@ -327,7 +327,7 @@ var HueSaturation = wrapEffect(postprocessing.HueSaturationEffect);
|
|
|
327
327
|
|
|
328
328
|
var Noise = wrapEffect(postprocessing.NoiseEffect, postprocessing.BlendFunction.COLOR_DODGE);
|
|
329
329
|
|
|
330
|
-
var _excluded$
|
|
330
|
+
var _excluded$5 = ["enabled", "children"];
|
|
331
331
|
var selectionContext = /*#__PURE__*/React.createContext(null);
|
|
332
332
|
function Selection(_ref) {
|
|
333
333
|
var children = _ref.children,
|
|
@@ -353,7 +353,7 @@ function Select(_ref2) {
|
|
|
353
353
|
var _ref2$enabled = _ref2.enabled,
|
|
354
354
|
enabled = _ref2$enabled === void 0 ? false : _ref2$enabled,
|
|
355
355
|
children = _ref2.children,
|
|
356
|
-
props = _objectWithoutPropertiesLoose__default["default"](_ref2, _excluded$
|
|
356
|
+
props = _objectWithoutPropertiesLoose__default["default"](_ref2, _excluded$5);
|
|
357
357
|
|
|
358
358
|
var group = React.useRef(null);
|
|
359
359
|
var api = React.useContext(selectionContext);
|
|
@@ -385,7 +385,7 @@ function Select(_ref2) {
|
|
|
385
385
|
}, props), children);
|
|
386
386
|
}
|
|
387
387
|
|
|
388
|
-
var _excluded$
|
|
388
|
+
var _excluded$4 = ["selection", "selectionLayer", "blendFunction", "patternTexture", "edgeStrength", "pulseSpeed", "visibleEdgeColor", "hiddenEdgeColor", "width", "height", "kernelSize", "blur", "xRay"];
|
|
389
389
|
var Outline = /*#__PURE__*/React.forwardRef(function Outline(_ref, forwardRef) {
|
|
390
390
|
var _ref$selection = _ref.selection,
|
|
391
391
|
selection = _ref$selection === void 0 ? [] : _ref$selection,
|
|
@@ -401,8 +401,8 @@ var Outline = /*#__PURE__*/React.forwardRef(function Outline(_ref, forwardRef) {
|
|
|
401
401
|
height = _ref.height,
|
|
402
402
|
kernelSize = _ref.kernelSize,
|
|
403
403
|
blur = _ref.blur,
|
|
404
|
-
xRay = _ref.xRay
|
|
405
|
-
_objectWithoutPropertiesLoose__default["default"](_ref, _excluded$
|
|
404
|
+
xRay = _ref.xRay,
|
|
405
|
+
props = _objectWithoutPropertiesLoose__default["default"](_ref, _excluded$4);
|
|
406
406
|
|
|
407
407
|
var invalidate = fiber.useThree(function (state) {
|
|
408
408
|
return state.invalidate;
|
|
@@ -413,7 +413,7 @@ var Outline = /*#__PURE__*/React.forwardRef(function Outline(_ref, forwardRef) {
|
|
|
413
413
|
camera = _useContext.camera;
|
|
414
414
|
|
|
415
415
|
var effect = React.useMemo(function () {
|
|
416
|
-
return new postprocessing.OutlineEffect(scene, camera, {
|
|
416
|
+
return new postprocessing.OutlineEffect(scene, camera, _extends__default["default"]({
|
|
417
417
|
blendFunction: blendFunction,
|
|
418
418
|
patternTexture: patternTexture,
|
|
419
419
|
edgeStrength: edgeStrength,
|
|
@@ -425,7 +425,7 @@ var Outline = /*#__PURE__*/React.forwardRef(function Outline(_ref, forwardRef) {
|
|
|
425
425
|
kernelSize: kernelSize,
|
|
426
426
|
blur: blur,
|
|
427
427
|
xRay: xRay
|
|
428
|
-
});
|
|
428
|
+
}, props));
|
|
429
429
|
}, [blendFunction, blur, camera, edgeStrength, height, hiddenEdgeColor, kernelSize, patternTexture, pulseSpeed, scene, visibleEdgeColor, width, xRay]);
|
|
430
430
|
var api = React.useContext(selectionContext);
|
|
431
431
|
React.useEffect(function () {
|
|
@@ -482,6 +482,8 @@ var Pixelation = /*#__PURE__*/React.forwardRef(function Pixelation(_ref, ref) {
|
|
|
482
482
|
|
|
483
483
|
var Scanline = wrapEffect(postprocessing.ScanlineEffect, postprocessing.BlendFunction.OVERLAY);
|
|
484
484
|
|
|
485
|
+
var _excluded$3 = ["selection", "selectionLayer", "lights", "luminanceThreshold", "luminanceSmoothing", "intensity", "width", "height", "kernelSize", "mipmapBlur"];
|
|
486
|
+
|
|
485
487
|
var addLight = function addLight(light, effect) {
|
|
486
488
|
return light.layers.enable(effect.selection.layer);
|
|
487
489
|
};
|
|
@@ -502,7 +504,9 @@ var SelectiveBloom = /*#__PURE__*/React.forwardRef(function SelectiveBloom(_ref,
|
|
|
502
504
|
intensity = _ref.intensity,
|
|
503
505
|
width = _ref.width,
|
|
504
506
|
height = _ref.height,
|
|
505
|
-
kernelSize = _ref.kernelSize
|
|
507
|
+
kernelSize = _ref.kernelSize,
|
|
508
|
+
mipmapBlur = _ref.mipmapBlur,
|
|
509
|
+
props = _objectWithoutPropertiesLoose__default["default"](_ref, _excluded$3);
|
|
506
510
|
|
|
507
511
|
if (lights.length === 0) {
|
|
508
512
|
console.warn('SelectiveBloom requires lights to work.');
|
|
@@ -517,16 +521,17 @@ var SelectiveBloom = /*#__PURE__*/React.forwardRef(function SelectiveBloom(_ref,
|
|
|
517
521
|
camera = _useContext.camera;
|
|
518
522
|
|
|
519
523
|
var effect = React.useMemo(function () {
|
|
520
|
-
return new postprocessing.SelectiveBloomEffect(scene, camera, {
|
|
524
|
+
return new postprocessing.SelectiveBloomEffect(scene, camera, _extends__default["default"]({
|
|
521
525
|
blendFunction: postprocessing.BlendFunction.SCREEN,
|
|
522
526
|
luminanceThreshold: luminanceThreshold,
|
|
523
527
|
luminanceSmoothing: luminanceSmoothing,
|
|
524
528
|
intensity: intensity,
|
|
525
529
|
width: width,
|
|
526
530
|
height: height,
|
|
527
|
-
kernelSize: kernelSize
|
|
528
|
-
|
|
529
|
-
|
|
531
|
+
kernelSize: kernelSize,
|
|
532
|
+
mipmapBlur: mipmapBlur
|
|
533
|
+
}, props));
|
|
534
|
+
}, [camera, height, intensity, kernelSize, luminanceSmoothing, luminanceThreshold, scene, width, height, mipmapBlur]);
|
|
530
535
|
var api = React.useContext(selectionContext);
|
|
531
536
|
React.useEffect(function () {
|
|
532
537
|
// Do not allow array selection if declarative selection is active
|
package/dist/index.js
CHANGED
|
@@ -346,7 +346,8 @@ const Outline = /*#__PURE__*/forwardRef(function Outline(_ref, forwardRef) {
|
|
|
346
346
|
height,
|
|
347
347
|
kernelSize,
|
|
348
348
|
blur,
|
|
349
|
-
xRay
|
|
349
|
+
xRay,
|
|
350
|
+
...props
|
|
350
351
|
}), [blendFunction, blur, camera, edgeStrength, height, hiddenEdgeColor, kernelSize, patternTexture, pulseSpeed, scene, visibleEdgeColor, width, xRay]);
|
|
351
352
|
const api = useContext(selectionContext);
|
|
352
353
|
useEffect(() => {
|
|
@@ -416,7 +417,9 @@ const SelectiveBloom = /*#__PURE__*/forwardRef(function SelectiveBloom(_ref, for
|
|
|
416
417
|
intensity,
|
|
417
418
|
width,
|
|
418
419
|
height,
|
|
419
|
-
kernelSize
|
|
420
|
+
kernelSize,
|
|
421
|
+
mipmapBlur,
|
|
422
|
+
...props
|
|
420
423
|
} = _ref;
|
|
421
424
|
|
|
422
425
|
if (lights.length === 0) {
|
|
@@ -435,8 +438,10 @@ const SelectiveBloom = /*#__PURE__*/forwardRef(function SelectiveBloom(_ref, for
|
|
|
435
438
|
intensity,
|
|
436
439
|
width,
|
|
437
440
|
height,
|
|
438
|
-
kernelSize
|
|
439
|
-
|
|
441
|
+
kernelSize,
|
|
442
|
+
mipmapBlur,
|
|
443
|
+
...props
|
|
444
|
+
}), [camera, height, intensity, kernelSize, luminanceSmoothing, luminanceThreshold, scene, width, height, mipmapBlur]);
|
|
440
445
|
const api = useContext(selectionContext);
|
|
441
446
|
useEffect(() => {
|
|
442
447
|
// Do not allow array selection if declarative selection is active
|