Slime Swarm
Mobile-Ready VAT Slimes in Unity.

Challenge
Design a wave base encounters for an upcoming title, where the player is rushed by swarms of 40-50 slime mobs simultaneously. The game is initially targeting Steam with an eventual mobile port, meaning performance budgets were extremely tight. Traditional animation methods presented massive hurdles for fluid, jelly-like motion: skeletal meshes required high bone counts that caused massive CPU overhead and tanked the framerate, while Alembic caches introduced unacceptable memory bloat and storage overhead that completely disqualified them for a mobile target.
The Goal: Engineer a highly optimized animation and rendering pipeline
- Stable Framerate with 50+ complex, deforming meshes on screen at once
- Visual fidelity needed to match realistic Slime locomotion
- Gelatinous semi-translucent material with deep color volume and striking, emissive features that track perfectly with the slime’s motion.
Solution
To decouple the animation calculations entirely from the CPU, I implemented a Vertex Animation Textures (VAT) pipeline. By baking the complex vertex deformations (stretching, squashing, and physics-based jiggling) into 2D position and normal textures, the animation is evaluated entirely on the GPU. This enabled the use of GPU Instancing, allowing dozens of Slime to render in a single draw call with zero skeletal overhead.
Workflow
Phase 1: 3D
- Sculpting & Optimization: I established the initial form and volume in ZBrush, focusing on a strong top-down silhouette. In Blender, I performed aggressive manual retopology to ensure an exceptionally low vertex count, prioritizing edge loops that cleanly support extreme stretching and squashing.
- Layered Animation & Simulation: In Blender, I built a semi automated core rig for directional movement and jumps, with 3 control bones to drive all the bones using constraints. I drove shape keys along the rig for impact compression and mid-air stretching, and ran lightweight physics simulations over the mesh to capture the realistic, secondary jiggling aftershocks of the slime landing.
- VAT Baking: The XYZ coordinates of every vertex over the animation timeline were baked into RGB values on a 2D texture map, alongside a secondary map for vertex normals to ensure accurate dynamic lighting during deformation.
Phase 2: Slime Shader
- Aesthetic Goals & Texture Authoring: The visual target was heavily inspired by classic RPG gelatinous creatures—requiring a semi-transparent, jelly-like volume with a distinct, darker, dense core and lighter, watery edges. To keep memory overhead low for the eventual mobile port, I avoided heavy, full-color texture maps. Instead, I authored optimized grayscale masks in Substance Painter. These masks packed surface detail variations and precise emission zones (the eyes) into a single, efficient texture footprint, allowing the Unity shader to drive the actual color math dynamically.
- Solving Transparency & Depth Sorting: Standard alpha-blended transparency in Unity immediately presented a classic Z-sorting challenge: the engine was drawing the back faces of the slime in front of the front faces, breaking the illusion of volume and creating a messy visual read. After experimenting with dithering and alternative render queues, I engineered a more robust and performant solution using Fresnel math to fake the volume rather than relying on full-mesh transparency.
The Shader Graph Architecture
- The Fresnel Engine: Instead of expensive true volume rendering, the core logic relies on a Fresnel Effect node. This node is used as the alpha driver for a Lerp (Linear Interpolate) node, which mathematically blends between the dense
Core Colorand the lighter, highly saturatedEdge Colorbased on the camera’s viewing angle. - Edge-Only Opacity: I fed that inverse Fresnel data into the master node’s Alpha channel. By forcing the dense core of the slime to be fully opaque and allowing only the very edges (the rim) to be semi-transparent, I completely bypassed the engine’s depth-sorting issues.
- Optimized Rendering: To fully resolve the transparency sorting, the Graph Settings are explicitly configured with Depth Write: Force Enabled. This forces the engine to correctly sort the semi-transparent outer gel against the opaque inner core and the environment behind it.
- Emissive Tracking: The glowing eyes are driven by an HDR emissive property masked out by the Substance Painter textures. Because the overall deformation is handled purely via Vertex Animation Textures (VAT), the glowing eyes perfectly track with the heavy distortion of the slime’s body without any texture swimming.
- Artist-Friendly Parameterization: The Shader Graph blackboard features a fully exposed suite of properties. Parameters like
Core Color,Edge Color,Fresnel Power, andEmissive Intensityare accessible directly in the material inspector, allowing for rapid iteration and the creation of various slime variants without duplicating the shader.
Conclusion
This approach successfully faked the illusion of deep, translucent volume without the performance cost or sorting artifacts of true transparency. Combined with the HDR emissive map driving the eyes—which flawlessly track the VAT mesh deformation—the final material hits the “realistic stylized” target while remaining heavily optimized.











