Skip to content

Commit c115639

Browse files
fix(ToneMapping): remove use of CONVOLUTION attribute (#308)
1 parent 35b1950 commit c115639

File tree

1 file changed

+3
-53
lines changed

1 file changed

+3
-53
lines changed

src/effects/ToneMapping.tsx

Lines changed: 3 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,6 @@
1-
import { ToneMappingEffect, EffectAttribute } from 'postprocessing'
2-
import { EffectProps } from '../util'
3-
import { forwardRef, useEffect, useMemo } from 'react'
1+
import { ToneMappingEffect } from 'postprocessing'
2+
import { type EffectProps, wrapEffect } from '../util'
43

54
export type ToneMappingProps = EffectProps<typeof ToneMappingEffect>
65

7-
export const ToneMapping = forwardRef<ToneMappingEffect, ToneMappingProps>(function ToneMapping(
8-
{
9-
blendFunction,
10-
adaptive,
11-
mode,
12-
resolution,
13-
maxLuminance,
14-
whitePoint,
15-
middleGrey,
16-
minLuminance,
17-
averageLuminance,
18-
adaptationRate,
19-
...props
20-
},
21-
ref
22-
) {
23-
const effect = useMemo(
24-
() =>
25-
new ToneMappingEffect({
26-
blendFunction,
27-
adaptive,
28-
mode,
29-
resolution,
30-
maxLuminance,
31-
whitePoint,
32-
middleGrey,
33-
minLuminance,
34-
averageLuminance,
35-
adaptationRate,
36-
}),
37-
[
38-
blendFunction,
39-
adaptive,
40-
mode,
41-
resolution,
42-
maxLuminance,
43-
whitePoint,
44-
middleGrey,
45-
minLuminance,
46-
averageLuminance,
47-
adaptationRate,
48-
]
49-
)
50-
51-
useEffect(() => {
52-
effect.dispose()
53-
}, [effect])
54-
55-
return <primitive {...props} ref={ref} object={effect} attributes={EffectAttribute.CONVOLUTION} />
56-
})
6+
export const ToneMapping = wrapEffect(ToneMappingEffect)

0 commit comments

Comments
 (0)