I'm using R3F with "Drei" and want to use the Text component. Unfortunately I need to set Depth Write and Depth Test to always have the text in the foreground. Here you can see that it ist possible to set a custom material to the text component.
https://drei.react-spring.io/?path=/story/abstractions-text--custom-material-text-st
But I can't get it going. When I attach a material like so:
<Text
color={"#222222"} // default
anchorX="center" // default
anchorY="top" // default
textAlign="center"
fontSize={fontSize}
maxWidth={10}
>
<meshBasicMaterial
attach="material"
depthWrite={false}
depthTest={false}
/>
Some Text
</Text>
I get errors like that:
Uncaught TypeError: Cannot assign to read only property 'dispose' of
object '#DerivedMaterial'
Can someone help me please?
Thanks
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…