[Released] Deformable Surface

Requirements: DX11 & Shader Model 5.0 support

This asset allows you to create and manage the system with realtime volumetric surface deformation. You might already noticed similar feature in some AAA titles. Such feature will definitely make your game more dynamic and realistic looking. To achieve the best performance it uses true power of compute shaders along with DX11 hardware tessellation.

  • Edit surface with brush or import heightmap. Just like Unity built-in Terrain

  • Well-configurable. Mesh size, map resolution, blend height, deformation smoothing, speed, layer mask and tesselation settings

  • Well-optimized. Let GPU deal with it!

  • Deformation state save / load and physics implementation

  • PBR shaders

Asset Store: Deformable Surface | Particles/Effects | Unity Asset Store

Changelog

v2.0
New:

  • Access to save/load the state of deformation
  • New additional shader: Standard Cutout
  • Quad patch tesselation
  • Heightmap import
  • New parameters: Normal Intensity, Max Height
  • Custom shaders are now allowed
  • All texture maps combined into one ARGB32 format
  • Linear color space support
  • Unity 2018.3 support
  • Overall performance improvement

Fixes:

  • Incorrect base mesh normals
  • Deformation smoothing is not affected at top height
  • Odd deformation and smoothing at top-right edges of base map
  • Performance issue in painting mode
  • Surface double-rendering issue caused by depth camera
  • Various minor fixes

v1.1.2

  • Fixed bug where the whole surface has been deformed at scene start
  • Fixed issue with incorrect lights in Unity 2017.2 and above

v1.1.1

  • Fixed issue with SetTexture failed and normal map generation for newly created surface

v1.1

  • Metallic Smoothness texture slot was removed. Alpha value of Albedo texture map is now used as a source for smoothness
  • Inverted version of depth camera shader for Unity 5.5 was removed. Shader directive is now handle this
  • Added maps quality setting which allows to save some VRAM almost without quality loss
  • Editor side compute shader logic moved to separate .compute file
6 Likes

I am currently using RTP terrain shaders, does your shader integrate well into other shader packages? Or does your shader have functionality comparable to RTP?

Hi. My shader has no compatibility with other assets. Deformable surface is a separate object with its own mesh and collider, but you can cover your terrain with this surface in one click. It is not a perfect solution, but manipulating with texture tiling and position will make it look like the surface is a part of the terrain.

Currently I can’t tell if I can implement all RTP visual features in this asset. RTP is a great asset and it has much more advanced terrain shader than Unity bult-in terrain has.

1 Like

hey, absolutely amazing asset and I was wondering if you were going to make your “surface physics Sphere” script work directly with the unity wheel collider? because at the moment I’m finding it impossible to make them work together.
thanks for all your work to make this asset.

Hi, thanks!

SurfacePhysics scene is just a showcase of how to get offset value at given point. Then you can use this value however you want. It is clamped between 0 and 1.

I don’t know how exactly wheel collider and other things is configured in your project. You could limit the angular velocity, damping ratio, maximum velocity of the whole object etc. There is no unique approach, so this thing is up to you.

ok thanks anyway though

thanks for your works, it’s kind of part i was needing for my project.
but i need it to be tilelable and if it works nice in terms of memory, it’s not good due to the normal map

2895925--213037--Screenshot at 2016-12-23 14 17 28.png
and when i hit play the mesh is deformed along the surface normal to a 45° angle certainly:
2895925--213038--Screenshot at 2016-12-23 14 18 32.png

is it possible to check about it ?

also another thing is about the material, wich is wimple but maybe to much simple, and would be nice to being able to mix our own shaders to get better results, don’t know if you can do it


thanks

Hi.

I don’t recommend to use the surface as a tile part. Currently there is no way to make it seamless cause distanced tesselation method will render it incorrectly.

Those deformations at top-right corners comes from compute shader. It is reading all neighbour pixels so it goes out of bounds by one pixel of the heightmap in that place. I’ve noticed this before release but leave it as is due to optimization reason.

What about material is that there is no way to write a simple surface shader for it. Applying tesselation in surface shader will not allow to use custom in-out structs. For sure that’s kind of dumb limitation. So in order to change the shader by your needs you should learn how vert-frag shader works. It’s may be painful but not impossible :slight_smile:

Anyway, currently I’m working on v1.1 and will see what I can do with all of this.

v1.1 is here!
Changelog

  • Metallic Smoothness texture slot was removed. Alpha value of Albedo texture map is now used as a source for smoothness
  • Inverted version of depth camera shader for Unity 5.5 was removed. Shader directive is now handle this
  • Added maps quality setting which allows to save some VRAM almost without quality loss
  • Editor side compute shader logic moved to separate .compute file

Hi V0odo0!!

I am interested in your asset but I have some doubts about whether I will get the results I want.
Could you pass a trial version of your asset to test it thoroughly before buying?

regards

Hi. Unfortunately there is no light or trial version. But you could ask me what you are interested regarding to this asset.

Hi
Ohh! what a pity!

Well my doubts, as I said, are related to what level of visual detail will come to show on the scene, if the material that uses your shader I put textures 2k, 1k, etc. Both in the near and in the distance.

Also performance theme …

Other doubts are how I can shape the mesh that uses its shader, so that it will fit well to the irregularities of my terrain. For example, I am creating an island and I especially want to be active for the theme of treading on beach sand and other sites.

Another problem I have read above is that it does not support RTP and I work with RTP. For me it is absolutely essential to be able to use your asset and RTP together. Which leads me to have to experiment and test with your asset to see if that is possible for me. That’s why I asked for a trial version.

I would also like to try more things to see if your asset meets my expectations.

Is there really no possibility of testing your asset before you buy? I would be very grateful since I am very interested in your asset, but I do not want to spend the money so that later it does not meet my expectations

regards

As I wrote above, deformable surface is a separated object with it’s own mesh and material. So it does not matter if you using RTP or Unity built-in terrain. Terrain alignment is just a small feature that copies terrain heightmap data and pastes it to the surface. The shader itself working in conjuction with compute shader and not suitable for terrain.

Note that there is no texture paint feature cause masking will cost much more memory then. You only able to change the geometry and choose only two types of textures with normal maps. One for the bottom part and upper for other. For example, the snow texture and the dirt under the snow texture.

Look at the 2nd video on Asset Store page. It has a demonstration of terrain alignment feature.

ok. I see it. Thank

Another question…

I want it for a very large island, but only for the whole sandy beach area. In the video you told me, I see that it adapts well to the terrain vertically (Y axis) … But what happens when you have to adapt the mesh to the turns (left / right) that has a coastline ?

I suppose you will have to create many “deformable surfaces” with your asset and place them properly … But then what performance would you have with many meshes of your asset in the terrain?

Greetings.

Is there a physics implementation on this yet?

I´ve been trying your asset but every time that a deformable surface is added to the scene I get this error message:

UnityException: SetTexture failed
DeformableSurface.InitBlurWeights () (at Assets/DeformableSurface/Scripts/DeformableSurface.cs:153)
DeformableSurface.Init () (at Assets/DeformableSurface/Scripts/DeformableSurface.cs:116)
DeformableSurface.Awake () (at Assets/DeformableSurface/Scripts/DeformableSurface.cs:99)

Is it working with Unity 5.4.2 or 5.5.1?

Cheers (and good job, it seems to be really useful!)

I found a workaround. I need to change (using the Editor debug mode) the scriptable object “New Deformable Surface” value for the SurfaceKernels from SurfaceKernelsEditor to SurfaceKernels.

It´s working, but it´s annoying to change everyone manuallly.

1 Like

Hi there, I bought your deformable surface asset from the Unity asset store and am having some issues getting it to work. I am not able to get newly created deformable surface to deform.

In Unity 5.5.0f windows 10, if I create a deformable surface and press play I get this error:

UnityException: SetTexture failed
UnityEngine.ComputeShader.SetTexture (Int32 kernelIndex, System.String name, UnityEngine.Texture texture) (at C:/buildslave/unity/build/artifacts/generated/common/runtime/ComputeShaderBindings.gen.cs:74)
DeformableSurface.InitBlurWeights () (at Assets/DeformableSurface/Scripts/DeformableSurface.cs:153)
DeformableSurface.Init () (at Assets/DeformableSurface/Scripts/DeformableSurface.cs:116)
DeformableSurface.Awake () (at Assets/DeformableSurface/Scripts/DeformableSurface.cs:99)

No game objects will deform the newly created surface. The demo scenes work as expected. Game objects I create will deform the demo scene surfaces as expected, it is just newly created surfaces that do not work.

Is it possible to add a new feature to the plugin? I´d like to add snow to a mesh. I know that it´s possible to add snow using a heighmap