Unity 6 and Water Deformer

Unity 6 preview after 6000.0.9 has the water deformer deprecated, and suggest using water decal instead. But I can’t really find equivalent functionality in the water decal.

Here’s my use case:

  • Water Deformer set to texture type
  • My script collects positions from time to time and pass the points to a custom render texture to render a normal map with ripple effects
  • The water deformer with this custom render texture deforms the water surface to render ripples.

Pretty much the pool example scene except my water deformer follows the character and the texture is a custom render texture.

Now with water decal I don’t know how to replicate this, you can set a material to the decal but it needs to be a specific water decal material, I don’t know how to make that work with my custom render texture.

Besides I’m a bit confused that the HDRP versions are exactly the same between 6000.0.9 and 6000.0.15, they are both 17.0.3 but in 6000.0.9 my setup works fine and in 6000.0.15 the water deformer is not working at all, plus properties like deformationAreaSize and deformationAreaOffset are removed entirely!

The documentation for HDRP 17.0.3 mentioned none of these changes. I understand that Unity and HDRP versions might be tightly coupled but when you make changes like this shouldn’t you at least up the version and update the documents?

You have to make a new WaterDecal shadergraph, expose a texture property for you custom render texture, sample it and connect to the “deformation” output.

1 Like

Thanks. I’ve got this working.

But when building the player these error message showed up when compiling the shaders.
Shader error in ‘Shader Graphs/Water Decal’: invalid subscript ‘stereoTargetEyeIndexAsRTArrayIdx’ at Decal.shadergraph(221) (on d3d11)
Shader error in ‘Shader Graphs/Sample Water Decal’: invalid subscript ‘stereoTargetEyeIndexAsRTArrayIdx’ at Decal.shadergraph(468) (on d3d11)
Shader error in ‘Shader Graphs/RippleDecal’: invalid subscript ‘stereoTargetEyeIndexAsRTArrayIdx’ at Assets/SharedAssets/Shader/Shared/RippleDecal.shadergraph(187) (on d3d11)

Looks like something to do with VR, but the build actually works fine including the ripple effect in VR.
Is there something I’m doing wrong or can I simply ignore these?

This is version 6000.0.23f1

Thanks for the feedback.
Just to be sure before starting the issue process, this means that the build process actually goes through with some errors but everything working “fine” no matter the errors / warnings ?

That’s right, everything works in the player including the ripple effect which is using that RippleDecal shader.
I guess it’s just some unnecessary shader variants that it tries to compile.

Thanks, it’s been reported on our side and will get looked at !

I’m on version 6.0.23, and I’m getting these build errors as long as water is enabled in any of my hdrp assets as well (including when water decals are disabled). When I’m working or playing in editor there are no issues with the water whatsoever.

Here are the setting the the HDRP assets file which cause the issue:

1 Like

Yes, thanks for the feedback, it’s known on our side and will get fixed as well.

Here’s the tracking link so that you can follow it in real time.

1 Like