diff --git a/src/effects/Texture.tsx b/src/effects/Texture.tsx index e9e0666..d51d04d 100644 --- a/src/effects/Texture.tsx +++ b/src/effects/Texture.tsx @@ -5,10 +5,12 @@ import { TextureLoader, RepeatWrapping } from 'three' type TextureProps = ConstructorParameters[0] & { textureSrc: string + /** opacity of provided texture */ + opacity?: number } export const Texture = forwardRef(function Texture( - { textureSrc, texture, ...props }: TextureProps, + { textureSrc, texture, opacity = 1, ...props }: TextureProps, ref: Ref ) { const t = useLoader(TextureLoader, textureSrc) @@ -20,5 +22,5 @@ export const Texture = forwardRef(function Texture( t.wrapS = t.wrapT = RepeatWrapping }, [t]) const effect = useMemo(() => new TextureEffect({ ...props, texture: t || texture }), [props, t, texture]) - return + return })