LIQUID VOLUME
QUICK START GUIDE
Contents
Introduction ............................................................................................................................................. 3
Quick Start ................................................................................................................................................ 3
Add Liquid Volumes to 3D Scenes ...................................................................................................................... 3
Add Liquid Volumes to 2D Scenes (and GUI) ...................................................................................................... 4
Inspector Settings .................................................................................................................................... 5
General Settings ................................................................................................................................................. 5
Liquid Settings .................................................................................................................................................... 6
Foam Settings ..................................................................................................................................................... 7
Smoke Settings ................................................................................................................................................... 8
Flask Settings ...................................................................................................................................................... 8
Physics Settings ................................................................................................................................................... 9
Advanced Settings ............................................................................................................................................ 10
Shader Features ................................................................................................................................................ 11
API (using the Liquid Volume with C#) .................................................................................................. 12
FAQ (Frequent Asked Cuestions) ........................................................................................................... 13
I have a custom flask which is not primitive-type, how can I make the liquid fill it properly? ......................... 13
I need to use a non-capped (non closed) cup or flask, how can I use that? ..................................................... 13
Does it work on mobile? ................................................................................................................................... 13
On mobile, I get some warnings in the console like “Tiled GPU Perf…”? ......................................................... 14
How can I obtain the Y position of the surface level? ...................................................................................... 14
Compilation takes lot of time! .......................................................................................................................... 14
Liquid does not get illuminated by additional lights ......................................................................................... 14
Support ................................................................................................................................................... 15
Introduction
Thanks for purchasing!
Liquid Volume is a powerful and highly customizable shader that simulates realistic and animated
liquid containers. Can be used in real 3D scenes and 2D UI (demos included).
Asset Store link: https://www.assetstore.unity3d.com/#!/preview/70992/211764
Quick Start
There’re several demo scenes included. We highly recommend checking them out before using the
asset in your project and to play with the different script values in those scenes. The Potion demo
scene contains a Potion prefab which you may also use in your scene. The Beer scene contains a
BeerFlask prefab as well.
Add Liquid Volumes to 3D Scenes
To create a liquid volume in a 3D scene, simply attach a LiquidVolume component to any sphere,
cylinder or box game object:
For convenience you can find ready to use prefabs located in Resources/Prefabs folder which you
may drag and drop to your scene.
Add Liquid Volumes to 2D Scenes (and GUI)
Liquid Volume can also be used to show indicators in your UI. Check demo scene
“RPG_LifeAndMagic”.
To add a sphere indicador to your scene, locate the CameraLife or CameraMagic prefabs in
LiquidVolume/Resources/Prefabs and drop it into your scene. It will create a sphere flask with a
custom camera that will render the image to the render texture s LifeRT or MagicRT, located in
Resources/Textures.
Once you accomplish the step above, you can use the LifeRT texture in a RawImage UI component of
your game interface.
The same approach can be used to create other types of indicators.
Inspector Settings
The LiquidVolume component presents many appearance and behaviour options organized in the
following sections:
General Settings
- Topology: specifies the underline geometry, which must be compatible with sphere, cylinder,
cube or irregular types. The potion and beer flask included in the demos uses a cylinder
topology for example. However for most non-primitive types choosing Irregular will produce
better results at any angle.
- Detail: simple (do not uses 3D textures and is compatible with mobile), default, default with
no flask (has fewer render passes), texture bump (adds additional texturing and bump
mapping options to the flask) and reflections (uses a cubemap for reflections).
- Depth Aware: enable this option to allow objects inside the liquid container.
- Parent Aware: uses parent object’s geometry as a boundary for the current liquid. Use only
with irregular topology when liquid volume is inside another object and to prevent seeing
through the container other liquids in the background. If you don't see any artifact, don't
enable this option as it adds an additional render pass for the liquid containers.
- Global Alpha: allows you to control the overall transparency of liquid and smoke.