I was working on updating some geometry, based on some Ray Casting process… And I ended up with this funny Playground, so I share
It’s based on a very simple trick :
For each ground vertex you take a Ray from under the surface
You launch ray upward
If it collides under the snow surface (shoe), you move down the considered vertex to collided position.
Unfortunately, it’s not real time, there is some kind of lag between the animated mesh, and the updated ground… But I can ensure that this simple trick, when real time, fakes the stuff so badly well
Ok, I was really unhappy with this bad performances. It appears it came from Ray Casting on high poly mesh (dude). I optimized by Ray Casting only on some custom (invisible) shoe boxes :
Going from ~40 fps to >120 fps : Now I’m ok with this
I can’t find my example of a similar effect… I was drawing the foot prints on a texture and modifying the geometry of the ground in the vertex shader using that texture.
Thanks for sharing. I implemented footprinting on my snowfight game based on your idea. It was pretty difficult to implement a fast realtime footprinting on large-size land. Goldball - Snowfight and Cups-And-Balls 3D.
Tricotou: Did you try to cut the snow land into chunks ?
No. The snow surface is a single big Ground mesh for each land. Chunking snow surface causes unexpected boundary effects on every chunk. Instead, I applied optimized algorithm to find the exact area under an object on snow, which was pretty difficult to implement because the Ground mesh (for snow surface) in Babylon.js only maintains array of points for mesh. It requires complicated calculation to locate the index of array of mesh.