I would like to display a simple round drop shadow under a Mesh. The drop shadow should be a cheap round dark spot on whatever surface is below the Mesh at any time.
I cannot use the built-in three.js shadowMap feature as it is too expensive, even when I set it to use three.BasicShadowMap. Furthermore, the shadows cast by three.js’s shadowMap feature “penetrate” through surfaces, meaning that if you have a shadow-casting Mesh above a platform, and the platform is above the ground, both the platform AND the ground will receive the shadow.
I have upwards of hundreds of small objects that need simple drop shadows. I’d like the shadows to be as cheap as possible, preferably just little round spots that are always cast downwards, and stop at the first surface they meet.
Does anyone have any suggestions or advice for this?
Prerender it. Use something like 3ds max, or blender. Before that ask the artist or whomever provided these many meshes to generate the fake shadow as part of the asset.
If not possible and you are dynamically generating this, then do it yourself. Either setup bhv, path trace the shadow. Or render many shadow maps from a hemisphere around the object and average them (there’s an example). Or render the object from the top, maybe slice it, and then blur the result.
You can also do this ahead of time. Write a script to do all this, load your asset, compute this, save textures.
Once this is done the asset would be considered “ready”.
A cheaper looking drop shadow than what three.js offers, ideally just a simple round dark spot that doesn’t change shape no matter the shape of the mesh casting it.
The drop shadow must not penetrate meshes (as described in the ground/platform example in my original post).
This could work if the ground is completely flat, however it sounds like the “platforms” are elevated and may all be at differing heights, one option could be to implement something similar to @prisoner849 ‘s example here LightNoise (selective bloom + noise) on the platform material?