Deformable Surface

Hello friends!

Have you seen how player interacts with snow surface in Assasins’s Creed 3 or Batman: Arkham Asylym? If not, take a look:
YouTube

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.

13 Likes

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?

looking good, great work!

It will be paid asset for Asset Store. All source code will be included.

There will be the feature which let you fit the surface onto the terrain. It means that the surface does not depends on the terrain configuration.

Thanks!

YAAAY!

4 Likes

Hi, how long do you expect before you can make it available on eg the staore?

can this be used in a big terrain, or the framerate will be an issue

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.

1 Like

I saw your post about this on reddit a couple days ago and was really impressed. Shame to see it’s DX11 only since I do all my dev on a mac.

Still, if I ever take the plunge to Windows based development I may give this a look again!

2 weeks, cool! :slight_smile:

Thanks!

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.

Screenshot

Nice, looking forward to this.

Just played around with Unity built-in car controller and mud
Screenshot

1 Like

Physics implementation is ready! May be helpful in order to decrase player speed for example.
GIF

1 Like

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

At the same time, I’m finished working on the first release version and waiting for approval from Asset Store.

1 Like

it looks awesome, really well done! :slight_smile:

Cool! Can’t wait, can I ask how much you plan to sell it for?

It will cost 35$

Guys! Deformable Surface is now avaiable on Asset Store. If you have any questions, please follow this thread