Skip to content

Commit ca61b21

Browse files
author
v1rtl
committed
clean up
1 parent 81e85ce commit ca61b21

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

src/effects/Bloom.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { BloomEffect, BlendFunction } from 'postprocessing'
2-
import type { BloomEffectOptions } from 'postprocessing'
32
import { wrapEffect } from '../util'
43

5-
export const Bloom = wrapEffect<typeof BloomEffect, BloomEffectOptions>(BloomEffect, {
4+
export const Bloom = wrapEffect(BloomEffect, {
65
blendFunction: BlendFunction.ADD,
76
})

src/effects/ScanlineEffect.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
import { ScanlineEffect, BlendFunction } from 'postprocessing'
22
import { wrapEffect } from '../util'
33

4-
export const Scanline = wrapEffect(ScanlineEffect, { blendFunction: BlendFunction.OVERLAY })
4+
export const Scanline = wrapEffect(ScanlineEffect, { blendFunction: BlendFunction.OVERLAY, density: 1.25 })

src/effects/SelectiveBloom.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ export const SelectiveBloom = forwardRef(function SelectiveBloom(
9191
}
9292
}, [effect, invalidate, lights, selectionLayer])
9393

94-
const ref = useRef<SelectiveBloomEffect>()
9594
useEffect(() => {
9695
if (api && api.enabled) {
9796
if (api.selected?.length) {

src/util.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ export type EffectProps<T extends EffectConstructor> = ReactThreeFiber.Node<
2121
let i = 0
2222
const components = new WeakMap<EffectConstructor, React.ExoticComponent<any> | string>()
2323

24-
export const wrapEffect = <T extends EffectConstructor, P extends EffectProps<T>>(effect: T, defaults?: P) =>
24+
export const wrapEffect = <T extends EffectConstructor, P extends EffectProps<T> = EffectProps<T>>(
25+
effect: T,
26+
defaults?: P
27+
) =>
2528
/* @__PURE__ */ React.forwardRef<T, P>(function Effect(
2629
{ blendFunction = defaults?.blendFunction, opacity = defaults?.opacity, ...props },
2730
ref

0 commit comments

Comments
 (0)