API
The following section describes the exposed properties of the shader. You can use these properties to change the shader options dynamically from your own scripts.
_MainTex
The main (color) texture of the liquid, scrolled across the surface by the Liquid options.
See Main Texture for more information.
Usage
With
material being the material of the liquid surface's mesh renderer,
and newTexture being the main texture you would like to apply to the liquid,
set the value like so:material.SetTexture("_MainTex", newTexture);
and read it like so:
Texture texture = material.GetTexture("_MainTex");
_BaseColor
An additional color multiplied with the one already present in the main texture.
See Albedo for more information.
Usage
With
material being the material of the liquid surface's mesh renderer,
and newColor being the albedo color you would like to apply to the liquid,
set the value like so:material.SetColor("_BaseColor", newColor);
and read it like so:
Color color = material.GetColor("_BaseColor");
_Cutoff
The alpha cutoff threshold value, compared against the alpha value of the Albedo color.
See Alpha Cutoff for more information.
Usage
With
material being the material of the liquid surface's mesh renderer,
and newCutoff being the cutoff value you would like to apply to the liquid,
set the value like so:material.SetFloat("_Cutoff", newCutoff);
and read it like so:
float cutoff = material.GetFloat("_Cutoff");
_AmbientOcclusion
A value between 0 and 1 that controls how much ambient (indirect) light reaches the surface.
See Ambient Occlusion for more information.
Usage
With
material being the material of the liquid surface's mesh renderer,
and newAmbientOcclusion being the ambient occlusion value you would like to apply to the liquid,
set the value like so:material.SetFloat("_AmbientOcclusion", newAmbientOcclusion);
and read it like so:
float occlusion = material.GetFloat("_AmbientOcclusion");
_MetallicGlossMap
The metallic map.
See Metallic Map for more information.
Usage
With
material being the material of the liquid surface's mesh renderer,
and newMap being the metallic map you would like to apply to the liquid,
set the value like so:material.SetTexture("_MetallicGlossMap", newMap);
and read it like so:
Texture metallicMap = material.GetTexture("_MetallicGlossMap");
_Metallic
The metallic value applied on top of the metallic map.
See Metallic for more information.
Usage
With
material being the material of the liquid surface's mesh renderer,
and newMetallic being the metallic value you would like to apply to the liquid,
set the value like so:material.SetFloat("_Metallic", newMetallic);
and read it like so:
float metallic = material.GetFloat("_Metallic");
_BumpMap
The normal (bump) map.
See Normal Map for more information.
Usage
With
material being the material of the liquid surface's mesh renderer,
and newMap being the normal map you would like to apply to the liquid,
set the value like so:material.SetTexture("_BumpMap", newMap);
and read it like so:
Texture normalMap = material.GetTexture("_BumpMap");
_BumpScale
The strength of the normal map.
See Normal Strength for more information.
Usage
With
material being the material of the liquid surface's mesh renderer,
and newStrength being the normal strength value you would like to apply to the liquid,
set the value like so:material.SetFloat("_BumpScale", newStrength);
and read it like so:
float strength = material.GetFloat("_BumpScale");
_VerticalOffset
Shifts the whole liquid surface along its normals by the given distance in local units.
See Vertical Offset for more information.
Usage
With
material being the material of the liquid surface's mesh renderer,
and newOffset being the vertical offset value you would like to apply to the liquid,
set the value like so:material.SetFloat("_VerticalOffset", newOffset);
and read it like so:
float offset = material.GetFloat("_VerticalOffset");
_EmissionColor
The HDR color of the emission.
See Emission Color for more information.
Usage
With
material being the material of the liquid surface's mesh renderer,
and newColor being the emission color you would like to apply to the liquid,
set the value like so:material.SetColor("_EmissionColor", newColor);
and read it like so:
Color color = material.GetColor("_EmissionColor");
_EmissionMap
The emission map, which flows across the surface together with the main texture.
See Emission Map for more information.
Usage
With
material being the material of the liquid surface's mesh renderer,
and newMap being the emission map you would like to apply to the liquid,
set the value like so:material.SetTexture("_EmissionMap", newMap);
and read it like so:
Texture emissionMap = material.GetTexture("_EmissionMap");
_EmissionExtraIntensity
An additional intensity value that makes the emission stronger than the HDR color alone allows.
See Emission Extra Intensity for more information.
Usage
With
material being the material of the liquid surface's mesh renderer,
and newIntensity being the extra intensity value you would like to apply to the liquid,
set the value like so:material.SetFloat("_EmissionExtraIntensity", newIntensity);
and read it like so:
float intensity = material.GetFloat("_EmissionExtraIntensity");
_LiquidMovementSpeed
How quickly the liquid textures flow across the surface.
See Liquid Movement Speed for more information.
Usage
With
material being the material of the liquid surface's mesh renderer,
and newSpeed being the liquid movement speed value you would like to apply to the liquid,
set the value like so:material.SetFloat("_LiquidMovementSpeed", newSpeed);
and read it like so:
float speed = material.GetFloat("_LiquidMovementSpeed");
_LiquidMovementDirection
The direction of the flow, in degrees.
See Liquid Movement Direction for more information.
Usage
With
material being the material of the liquid surface's mesh renderer,
and newDirection being the liquid movement direction value you would like to apply to the liquid,
set the value like so:material.SetFloat("_LiquidMovementDirection", newDirection);
and read it like so:
float direction = material.GetFloat("_LiquidMovementDirection");
_WaveSpeed
How quickly the waves travel across the surface.
See Wave Speed for more information.
Usage
With
material being the material of the liquid surface's mesh renderer,
and newSpeed being the wave speed value you would like to apply to the liquid,
set the value like so:material.SetFloat("_WaveSpeed", newSpeed);
and read it like so:
float speed = material.GetFloat("_WaveSpeed");
_WaveDirection
The direction in which the waves travel, in degrees.
See Wave Direction for more information.
Usage
With
material being the material of the liquid surface's mesh renderer,
and newDirection being the wave direction value you would like to apply to the liquid,
set the value like so:material.SetFloat("_WaveDirection", newDirection);
and read it like so:
float direction = material.GetFloat("_WaveDirection");
_WaveFrequency
How closely the wave crests follow each other.
See Wave Frequency for more information.
Usage
With
material being the material of the liquid surface's mesh renderer,
and newFrequency being the wave frequency value you would like to apply to the liquid,
set the value like so:material.SetFloat("_WaveFrequency", newFrequency);
and read it like so:
float frequency = material.GetFloat("_WaveFrequency");
_WaveAmplitude
How far the vertices are displaced by the waves.
See Wave Amplitude for more information.
Usage
With
material being the material of the liquid surface's mesh renderer,
and newAmplitude being the wave amplitude value you would like to apply to the liquid,
set the value like so:material.SetFloat("_WaveAmplitude", newAmplitude);
and read it like so:
float amplitude = material.GetFloat("_WaveAmplitude");
_WaveDistortionStrength
The amount of noise mixed into the waves.
See Wave Distortion Strength for more information.
Usage
With
material being the material of the liquid surface's mesh renderer,
and newStrength being the wave distortion strength value you would like to apply to the liquid,
set the value like so:material.SetFloat("_WaveDistortionStrength", newStrength);
and read it like so:
float strength = material.GetFloat("_WaveDistortionStrength");
_RippleSpeed
How quickly the ripples animate.
See Ripple Speed for more information.
Usage
With
material being the material of the liquid surface's mesh renderer,
and newSpeed being the ripple speed value you would like to apply to the liquid,
set the value like so:material.SetFloat("_RippleSpeed", newSpeed);
and read it like so:
float speed = material.GetFloat("_RippleSpeed");
_RippleSize
The size of an individual ripple.
See Ripple Size for more information.
Usage
With
material being the material of the liquid surface's mesh renderer,
and newSize being the ripple size value you would like to apply to the liquid,
set the value like so:material.SetFloat("_RippleSize", newSize);
and read it like so:
float size = material.GetFloat("_RippleSize");
_RippleAmplitude
How far the vertices are displaced by the ripples.
See Ripple Amplitude for more information.
Usage
With
material being the material of the liquid surface's mesh renderer,
and newAmplitude being the ripple amplitude value you would like to apply to the liquid,
set the value like so:material.SetFloat("_RippleAmplitude", newAmplitude);
and read it like so:
float amplitude = material.GetFloat("_RippleAmplitude");
_RippleFrequency
How far out of step neighbouring parts of the surface ripple.
See Ripple Frequency for more information.
Usage
With
material being the material of the liquid surface's mesh renderer,
and newFrequency being the ripple frequency value you would like to apply to the liquid,
set the value like so:material.SetFloat("_RippleFrequency", newFrequency);
and read it like so:
float frequency = material.GetFloat("_RippleFrequency");
_PatchSpeed
How quickly the patches drift across the liquid.
See Patch Speed for more information.
Usage
With
material being the material of the liquid surface's mesh renderer,
and newSpeed being the patch speed value you would like to apply to the liquid,
set the value like so:material.SetFloat("_PatchSpeed", newSpeed);
and read it like so:
float speed = material.GetFloat("_PatchSpeed");
_PatchDensity
How many patches are spread across the surface.
See Patch Density for more information.
Usage
With
material being the material of the liquid surface's mesh renderer,
and newDensity being the patch density value you would like to apply to the liquid,
set the value like so:material.SetFloat("_PatchDensity", newDensity);
and read it like so:
float density = material.GetFloat("_PatchDensity");
_PatchMovementDirection
The direction in which the patches drift, in degrees.
See Patch Movement Direction for more information.
Usage
With
material being the material of the liquid surface's mesh renderer,
and newDirection being the patch movement direction value you would like to apply to the liquid,
set the value like so:material.SetFloat("_PatchMovementDirection", newDirection);
and read it like so:
float direction = material.GetFloat("_PatchMovementDirection");
_PatchThreshold
The cut-off that decides how much of the surface is covered by patches.
See Patch Threshold for more information.
Usage
With
material being the material of the liquid surface's mesh renderer,
and newThreshold being the patch threshold value you would like to apply to the liquid,
set the value like so:material.SetFloat("_PatchThreshold", newThreshold);
and read it like so:
float threshold = material.GetFloat("_PatchThreshold");
_PatchSoftness
How sharply the patches end.
See Patch Softness for more information.
Usage
With
material being the material of the liquid surface's mesh renderer,
and newSoftness being the patch softness value you would like to apply to the liquid,
set the value like so:material.SetFloat("_PatchSoftness", newSoftness);
and read it like so:
float softness = material.GetFloat("_PatchSoftness");
_PatchColor
The color of the patches.
See Patch Color for more information.
Usage
With
material being the material of the liquid surface's mesh renderer,
and newColor being the patch color you would like to apply to the liquid,
set the value like so:material.SetColor("_PatchColor", newColor);
and read it like so:
Color color = material.GetColor("_PatchColor");
_PatchDistortionStrength
The amount of noise warping the outline of the patches.
See Patch Distortion Strength for more information.
Usage
With
material being the material of the liquid surface's mesh renderer,
and newStrength being the patch distortion strength value you would like to apply to the liquid,
set the value like so:material.SetFloat("_PatchDistortionStrength", newStrength);
and read it like so:
float strength = material.GetFloat("_PatchDistortionStrength");
_PatchTransparency
How much of the liquid underneath shows through the patches.
See Patch Transparency for more information.
Usage
With
material being the material of the liquid surface's mesh renderer,
and newTransparency being the patch transparency value you would like to apply to the liquid,
set the value like so:material.SetFloat("_PatchTransparency", newTransparency);
and read it like so:
float transparency = material.GetFloat("_PatchTransparency");