Liquid Procedural Shader (LPS)
Social
ArtStation
Telegram (Russian Community)
Discord
YouTube
Custom PBR glass and ray-traced liquid volume shader package featuring realistic surface sloshing, procedural 3D bubbles, dynamic foam, and volume conservation for CryEngine 5
Key Features
- Analytical Liquid Ray-Tracing: Renders real-time liquid volume inside glass containers using pixel-shader ray-marching without requiring secondary internal meshes or geometric Boolean cuts.
- Orientation-Independent Volume Conservation: Automatically preserves exact liquid volume during bottle rotation and tilting via a numerical volume solver (MF_SolveLevel).
- Physical Surface Dynamics: Simulates standing wave container modes using Bessel series functions, combined with capillary-gravity ripples and dynamic wave slope normal calculations.
- Procedural 3D Bubble System: Generates multi-layered spherical bubbles in a 3D grid with buoyant movement governed by Stokes' law, depth scaling, and variable rise speeds.
- Surface Meniscus & Foam Layering: Includes procedural Voronoi foam, edge meniscus reflections, surface sheen, and specular glints under direct light sources.
- Glass Pipeline Integration: Fully compatible with CryEngine's Glass shader pipeline while avoiding register overlaps and binary parser errors.
- Material Editor Parameter Control: Comprehensive control over fill fraction (0–1), liquid radius, absorption density, liquid color, bottle base offset, bottle length, slosh amount, foam thickness, and bubble gravity/scale.
Package Contents
Shader Source Files:
GlassLiquid.cfx — Core pixel and vertex shader implementation including analytical ray-marching and fluid dynamics.
GlassLiquid.ext — Shader property flag definition file (%LIQUID, %MF_LIQUID_TIME).
Test Geometry:
pump_bottle_example (by Artur) — Pump bottle 3D mesh for evaluating liquid behavior in complex container shapes.
Glass_bottle_exapleFBX (by gelmi.com.br) — Glass bottle 3D mesh for testing fluid volume conservation and tilting physics.
Documentation: Installation and setup instructions in English, Russian, and Chinese.
License & Terms
Shader Code (.cfx, .ext): Unrestricted commercial and non-commercial use permitted in any project.
3D Models (pump_bottle_example & Glass_bottle_exapleFBX): Copyright owned by Artur and gelmi.com.br respectively. Commercial usage is STRICTLY PROHIBITED (restricted to non-commercial evaluation and testing only).
Installation
1/ Move GlassLiquid.ext to Engine/Shaders/.
2/ Move GlassLiquid.cfx to Engine/Shaders/HWScripts/CryFX/.
3/ Copy the test model assets into GameSDK/Objects/.
CRITICAL:
Delete the shader cache directory at <Project_Folder>/USER/Shaders/Cache before starting Sandbox Editor to trigger re-compilation.