@@ -14,6 +14,8 @@ export type SelectiveBloomProps = BloomEffectOptions &
14
14
lights : Object3D [ ] | ObjectRef [ ]
15
15
selection : Object3D | Object3D [ ] | ObjectRef | ObjectRef [ ]
16
16
selectionLayer : number
17
+ inverted : boolean
18
+ ignoreBackground : boolean
17
19
} >
18
20
19
21
const addLight = ( light : Object3D , effect : SelectiveBloomEffect ) => light . layers . enable ( effect . selection . layer )
@@ -24,6 +26,8 @@ export const SelectiveBloom = forwardRef(function SelectiveBloom(
24
26
selection = [ ] ,
25
27
selectionLayer = 10 ,
26
28
lights = [ ] ,
29
+ inverted = false ,
30
+ ignoreBackground = false ,
27
31
luminanceThreshold,
28
32
luminanceSmoothing,
29
33
intensity,
@@ -43,8 +47,8 @@ export const SelectiveBloom = forwardRef(function SelectiveBloom(
43
47
const invalidate = useThree ( ( state ) => state . invalidate )
44
48
const { scene, camera } = useContext ( EffectComposerContext )
45
49
const effect = useMemo (
46
- ( ) =>
47
- new SelectiveBloomEffect ( scene , camera , {
50
+ ( ) => {
51
+ const effect = new SelectiveBloomEffect ( scene , camera , {
48
52
blendFunction : BlendFunction . ADD ,
49
53
luminanceThreshold,
50
54
luminanceSmoothing,
@@ -54,8 +58,12 @@ export const SelectiveBloom = forwardRef(function SelectiveBloom(
54
58
kernelSize,
55
59
mipmapBlur,
56
60
...props ,
57
- } ) ,
58
- [ scene , camera , luminanceThreshold , luminanceSmoothing , intensity , width , height , kernelSize , mipmapBlur , props ]
61
+ } ) ;
62
+ effect . inverted = inverted ;
63
+ effect . ignoreBackground = ignoreBackground ;
64
+ return effect ;
65
+ } ,
66
+ [ scene , camera , luminanceThreshold , luminanceSmoothing , intensity , width , height , kernelSize , mipmapBlur , inverted , ignoreBackground , props ]
59
67
)
60
68
61
69
const api = useContext ( selectionContext )
0 commit comments