Here’s a (very) simple shadow mapping example that might get you started. Ask here if you have questions and I’ll do my best to answer them. I’ve annotated the code a little bit, but my intensions are to improve it more at some later time.
When Defold editor can be a 3D editor?
Don’t you think that you (as Defold engeneer) should use in examples render.set_render_target (introduced in 1.2.139) instead of old and deprecated enable/disable_render_target?
Wow, the shadow is even casted on the other object Do this method allows to cast self shadows? On the object itself?
Yeah you are right, totally forgot about that change
Yeah, it does self-shadow, look at the shadow side of the sphere to see the effect. It looks a “bit” strange now due to the bias value, but it’s a common issue with shadow mapping. There’s fixes and improvements to add that will make it better
Implemented cascaded shadow maps this weekend, I’ll clean up the code and put the source online later this week