skip to Main Content
I have a custom flask which is not primitive-type, how can I make the liquid fill it properly?
For non-primitive flask types (non cubic, cylindrical or spherical flasks), choose “Irregular” topology. Also if the model pivot is not at its center (for instance, the 0,0,0 position sits at the bottom of the flask instead of the middle) you may want to click “Center Pivot” which will modify the mesh vertices so the pivot gets reseted to the center of the model. This is necessary so the level property and other effects can work properly. Otherwise you can try modifying the Extents Scale or UpperLimit to try to fit the liquid to the extents of the flask without moving the pivot.

I need to use a non-capped (non closed) cup or flask, how can I use that?
See what happens when using an open container in the image below (cylinder topology on the left, irregular topology on the right):

The Cylinder topology assumes the container is closed, so it will automatically work as if the glass was closed on top. In this case a Cylinder topology could work better than Irregular topology. In the second glass, the Irregular topology uses the mesh itself to define the initial and end position of each volumetric ray. Since there’s no mesh on top of glass, the ray on the top edge starts in the interior of the glass instead of the top, producing the clipping in the image.

Another common solution to non-capped containers consists of putting a liquid volume with a cylinder topology inside your cup or open container. Set the detail setting to “Default No Flask” which will render just the liquid and it will work. Check out demo scene “NonCapped” for an example.

Does it work on mobile?
Liquid Mobile has been tested with success on Samsung Galaxy 6 and iPhone 7. Note that some options add some extra overhead so you may want to toggle them off:

Refraction Blur: when you enable this option, a CommandBuffer is attached to the main camera and a full screen blur is performed to produce the effect. Obviously this can add some performance penalty in mobile.

Irregular Topology: this is the most complex topology for the shader. It involves another CommandBuffer which renders the geometry back faces to perform the ray-tracing. If you need more performance you may want to try the Cylinder topology instead.

Depth Aware: enabling this option will make the fragment shader to check the Camera Depth Buffer. Disabling this option will save a texture fetch.

On mobile, I get some warnings in the console like “Tiled GPU Perf…”?
This is a known issue related to the use of CommandBuffers on mobile. You can ignore this message as in this case it does not affect the execution of the shader.

How can I obtain the Y position of the surface level?
Use the property liquidSurfaceYPosition (see previous section API).

Liquid does not get illuminated by additional lights
To support multiple lights, edit the shader corresponding to the detail level and look for/remove the word “noforwardadd”.

Compilation takes lot of time!
To reduce compilation time, you can remove unused Liquid Volume shaders located on the Liquid Volume/Resources/Shaders folder:

– LiquidVolumeDefault.shader: default style.

– LiquidVolumeDefaultNoFlask.shader: default with no flask style.

– LiquidVolumeBump.shader: texture/bump style.

– LiquidVolumeReflections: reflections style.

– LiquidVolumeSimple: simple style.

– LiquidVolumeSmoke: only smoke style.

– LiquidVolumeMultiple: allows several layers of liquid.

– LiquidVolumeMultipleNoFlask: several layers without flask.

In addition to remove unnecessary shaders, you can edit the shaders and reduce some features. Look for these lines in the shader files:

#pragma multi_compile __ LIQUID_VOLUME_DEPTH_AWARE Comment out the above line if you won’t use Depth Aware option in your build.

#pragma multi_compile __ LIQUID_VOLUME_DEPTH_AWARE_PASS Comment out the above line if you won’t use Parent Aware option in your build.

Expand the Shader Features section in Liquid Volume section. You’ll find additional options to fine tune the shader and locate the shades in your project.

Liquid does not render correctly when platform is set to WebGL
Select Edit -> Graphic Emulation -> WebGL 2.0 in Unity Editor. When building the app, the asset will be compatible with WebGL 1.0 but in Unity Editor it requires emulation with WebGL 2.0.

I have a question which is not covered in the guide...
Please use the Support Forum and post your question there. Our team will get back to you shortly.
Back To Top