I think it’s pretty nice feature which brings more realism into the game. I haven’t found such surface deformation system for Unity on Asset Store so I’ve decided to make this one. Work still in progress but basic things are done and I would like to share the results with community.
The basic technique is similiar to AC3 and Arkham Asylym but I’m using power of compute shaders for almost all heavy calculations and manipulations with textures. It means that there is no direct impact on CPU performance.
The one bad thing that compute shaders and tesselation requires DX11. So Windows platform only.
And here what’s already done:
Realtime deformation with various settings such as deformation speed and smoothness
Realtime normal map generation
PBR shader
Not only flat surface supported. Even more you can edit base heightmap and depth of the surface in editor similiar to terrain editing
Next steps:
More realistic looking deformation
API for interaction with surface. It will give the possibility to add physics behaviour. For example, decreasing the speed of the character after entering to snowdrift
Terrain alignment. Just place the surface anywhere above your terrain and click “Align”!
There is more things that I should consider developing deformable surface system? Please, let me know what you think about it.
Cool, would you be willing to share code, I’m looking for walking in the snow effect! Will buy if needed.
Another question is, couldn’t this be recreated with terrain deformation?
Hi. Around two weeks if there will be no issues with Asset Store submission process.
In practice, I think there is no reason to place the surface on the whole terrain. It is better to place it on small important areas where your player can walk on.
The performance is highly depends on the heightmap resolution you choose. Higher heightmap resoultion lets you make the surface wider but it will consume more GPU resources. Also, as I mentioned above there is almost no impact on CPU performance and it will not take long from the main thread.
DX11 requirement is not the only reason. Compute shaders requires OpenGL 4.3 which is still not available on OS X as I know. Compute shader is the core of my project so it is not possible to implement it using Mac.
Just ended up with surface editing. Similiar to terrain editing, but with two painting modes. The first one is for heightmap, and other one for the deformable part. It may be useful to make a tire tracks or footprints for example.
Guys! Here is another video of game named Steep from Ubisoft with such deformation system. I suppose they used nearly the same but more advanced technique. Looks quite good!
YouTube