Project

DistanceToNearestSufrace Slime Effect

  • Kyle Liu
  • Unreal
  • December 8, 2021

Warning

The DistanceToNearstSurface function has a known issue in UE5.3, resulting in a blocky output. This bug will be addressed and fixed in UE5.4. For more details, refer to https://issues.unrealengine.com/issue/UE-150397.

End Result

alt text

Shader Graph

alt text

Settings

Please remember to deactivate the “Affect Distance Field Lighting” option for objects where you do not want the distance field effect to be generated, such as the slime itself. alt text

Variations

By masking the VertexNormalWS with RG, it restricts the deformation of the slime in the z-direction, causing it to deform only when it comes into close contact with the surface. This prevents protrusions as if the slime is being attracted to the surface. alt text

alt text

Reference and Credit PrismaticaDev: https://www.youtube.com/watch?v=yzvq8aonDYQ