Shadow casting on text geometry

Your code was mostly fine. I wouldn’t worry too much about the scaling etc. With a spot light you can control shadow coverage by the placement of the light, and for a simple example like this, having a large scale probably isn’t a huge deal, since as long as it works… it works.

I scaled your text mesh down by .5

I rotated your ground plane by -90 degrees (Math.PI*-.5) (It was vertical before!)

I moved your SpotLight a bit…

I added a geometry.dispose() before you set the new geometry, so you don’t run out of memory
:slight_smile:

https://wm4m2j.csb.app/

https://codesandbox.io/p/sandbox/three-clock-forked-wm4m2j?file=%2Fsrc%2Findex.js%3A149%2C7

3 Likes