Building Slime Material in UE5...

v1 โ still WIP. things will change.
1. The Slime Material: Look + Motion

Target look: translucent body with subtle refraction, soft "thickness," and a gentle wobble that sells mass.
When I started the slime, the goal was a gooey, reactive feel that stays light enough for gameplay. I'm experimenting with translucency, refraction, Fresnel rim lighting, and distance-field-driven WPO so the slime appears to "attach" to nearby objects or the floor.
The Challenge: Realistic Deformation
Slime shouldn't feel static โ it should give when it gets close to surfaces. I tested three approaches before landing on one.
Approach 1 โ Raymarching in Translucency

Prototyped a raymarching setup using a custom node inspired by Inigo Quilez's Distance Functions. The idea is a layered, volumetric look by integrating light through a semi-transparent medium โ it looks really cool.
Didn't use it though. Expensive when combined with translucency and refraction, and finicky at grazing angles. Great for cinematics, not worth the complexity for real-time gameplay right now.

Approach 2 โ Distance Fields โ World Position Offset โ

Sample mesh distance fields โ basically distance to the nearest surface โ and use that signal to drive WPO. The slime bulges and settles toward nearby geometry, reading as if it's sticking to the ground or props.
Chose this one. Good balance of look vs. cost, native UE5 support, and a reactive feel without needing bespoke physics.
Note
- Deformation quality depends on vertex density and sensible limits. I clamp offsets, use a smooth falloff near contact, and gate the effect by speed to avoid crawling artifacts.
- LOD stability matters too โ high LODs get fuller offsets, far LODs get reduced or disabled.
Approach 3 โ Custom Fluid Physics Simulation
True soft-body/fluid behavior with really beautiful deformation. Passed on it for now โ heavy to run and maintain for moment-to-moment gameplay. Great for hero shots, not the right call for v1.
Current v1 Shader Setup

Translucency & Refraction
- Translucent shading with refraction for jelly look
- Fresnel rim for wet edge highlights
WPO via Distance Fields
- Distance-to-surface drives WPO โ slime settles and flattens when close to floors/props
- Falloff + clamp prevent over-offsets
- Vertex density controls how crisp the deformation feels
- Subtle noise layered in for a soft ambient jiggle
Still to do: micro normal layering, material switches and LODs (masked fallback, cheaper refraction, simpler WPO) for the optimization pass.