Quick Liquid Setup

The Liquid Shader (3D) exposes a lot of properties, and finding a believable combination of all of them by hand takes time. QuickLiquidSetup.cs exists to skip that step: it maps five intuitive controls onto the whole set of shader properties, so that a plausible liquid is only a couple of sliders away.

Attach the component to the same GameObject as your Liquid Surface via Add Component > Project GAMEDEV > Essential 3D Shaders > Quick Liquid Setup. It updates immediately, both in the Editor and in Play Mode, and offers the following settings.

The component writes its values through a MaterialPropertyBlock, which means it never modifies your material asset. Disabling or removing the component restores the material to exactly the values you authored in the inspector, and two liquid surfaces sharing one material can still be given different Quick Liquid Setup settings. Because Quick Liquid Setup overrides the movement, wave, ripple, and patch properties of the material – as well as its Normal Strength – changing those properties on the material itself will have no visible effect while the component is enabled. Remove or disable the component if you would rather author every property by hand. Quick Liquid Setup requires a Renderer on the same GameObject, and only one instance of the component per GameObject is allowed. If nothing happens after attaching it, make sure it sits on the same GameObject as your Liquid Surface, and that its Mesh Renderer has a Liquid Shader (3D) material assigned to it.

Movement Speed

The base speed of the whole liquid – the flow, the waves, the ripples, and the patches. Each of those layers receives its own multiplier on top of this value, so that they never move in lockstep. Set to 0 to bring the liquid to a complete standstill.

Movement Direction

The primary direction of movement, in degrees (0 – 360). 0 moves along the local +X axis, 90 moves along the local +Z axis. The waves and the patches are automatically offset by a few degrees from this direction to keep the surface from looking mechanical.

Viscosity

How thick the liquid is (0 – 1). Thin liquids such as water move quickly, with fine, lively surface detail. Thick liquids such as lava, honey, or tar crawl, with a heavier, slower surface response and a more pronounced relief from the normal map.

Volatility

How energetic the surface is (0 – 1). Low values produce an almost still surface; high values produce tall waves, strong ripples, and pronounced vertex displacement.

Patch Preset

The behaviour of the patches floating on the liquid, as one of seven presets: None, Subtle, Sparse, Balanced, Dense, Crust, and Slick. Crust covers the surface in large, hard-edged plates of cooled crust; Slick produces a thin, oily film; None switches off the distortion of the patches and keeps only a faint trace of them. The color of the patches is not part of the preset – set it on the material, with the Patch Color property.

All five settings are also available in code. Assigning to any of them re-applies the setup immediately, which makes it straightforward to have, for example, lava thicken and slow down as it cools. The component lives in the ProjectGamedev.Shaders.Essential3DShaders.LiquidShader3D namespace.

With quickLiquidSetup being the Quick Liquid Setup component of your liquid, change the settings like so:
quickLiquidSetup.MovementSpeed = 0.5f;
quickLiquidSetup.MovementDirection = 90f;
quickLiquidSetup.Viscosity = 0.9f;
quickLiquidSetup.Volatility = 0.25f;
quickLiquidSetup.Patches = QuickLiquidSetup.PatchPreset.Crust;

public float MovementSpeed

See Movement Speed. Negative values are clamped to 0.

public float MovementDirection

See Movement Direction. Values are clamped between 0 and 360.

public float Viscosity

See Viscosity. Values are clamped between 0 and 1.

public float Volatility

See Volatility. Values are clamped between 0 and 1.

public QuickLiquidSetup.PatchPreset Patches

public void Apply()

Re-applies the setup to the Renderer on the same GameObject. The property setters above already call this method, so you only need it on demand. The Apply Quick Liquid Setup entry in the component's context menu does the same.

Movement Speed Movement Direction Viscosity Volatility Patch Preset Scripting