What is this mechanic? (deformable ground mesh)

Hi guys, I want to learn how do they do this mechanic in these videos? It is mesh deformation but I cant find any example, docs or tutorial for this mechanic. I know these are not actual games but I want to add the digging mechanic in my game.

  • Where should I start, have any idea?
  • Do you know any real game like these videos?

GoldGoblins

video-ad

2 Answers

2

Possibly painting to a rendertexture heightmap that’s used for the terrain. Could be just a vertex shader that’s sampling it to modify the mesh, or it could be more complex to generate optimized mesh with details only where needed. Could be done with Unity terrain too, but the updates might be slow for full terrain optimization.
If you don’t mind having a highly detailed mesh everywhere, it could really be a simple shader.
You would need to calculate normals and tangents too by sampling nearby pixels and calculating a gradient.

I made a similar thing at least twice. Once with Unity terrain, once with plain mesh. Depends on what you want to do with it.

If you want to see a game that has it, try Frostpunk. It’s done with the snow there.

There is an old GDC 2014 talk explaining how to create deformable snow, which is analogous to this effect:

Slides:

Barre-Brisebois_Colin_Deformable_Snow_Rendering.pdf (3.2 MB)
Source: https://www.gdcvault.com/play/1020177/Deformable-Snow-Rendering-in-Batman