James Hill

Senior Technical/VFX Artist

Medi Gel Distance Fields

We have a weapon in Squids from Space called the Medigel Launcher and I wanted the effect to have a meta-ball look to it, where when one blob contacts another they join together smoothly. To do this I utilized the distance to nearest surface node in the material editor and modified the surface normal of the geometry. In the video below the impact from the gun spawns a blueprint actor with some gameplay bits and a visual mesh that looks like a squashed sphere. Currently distance fields don't work on mesh particles so we opted to spawn a mesh and use a timeline to animates the shape of the blob over time.



I started off by following this thread with some interesting uses of Distance Fields. It goes into detail about deforming the geometry when it comes into contact with another object, in essence I wanted the opposite to occur, I wanted the geometry to attract.
https://forums.unrealengine.com/development-discussion/rendering/43636-distance-field-soft-bodies

Here is the material I came up with, basically what this does is when geometry comes in proximity to another object is uses world position offset to push the verticites along their normal a set distance. This gives the look of surface tension, however this only gets us part of the way there. When the geometry penetrates other geometry there is still a hard edge, to alleviate this I used the distance field gradient node and plugged that directly into the normal of the material.
MetaBloby Material
Heres is what the blobs look like close up and how they interact with other geometry



This is what the distance field look like in the above example
DF_Blobs

This is the world normal before I modify it
NoDF_WorldNormal
Here is the world normal after I have modified it using distance fields
DF_WorldNormal