UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Landscape Tool
Using Editor Tools for Specific Tasks
FAQ
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine and Tools
GUI
Double Precision Coordinates
API
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
CIGI Client Plugin
Rendering-Related Classes

water_global_base

The water_global_base material simulates water and other liquids and is applied to the Water Global object.

The water_global_base material performs quad tessellation of the water surface. But keep in mind that not the whole water surface is tessellated. In fact, we have two parts of water: the inner part, which is close to the camera, is tessellated, and all the rest — the outer part — is not detailed. Tesselation as well as other parameters of the water_global_base materials can be adjusted to fit your requirements.

States#

In the States tab, you can set rendering passes and available options. Enabling some states activates additional textures and parameters in the Textures and Parameters tabs respectively.

Material window, States tab

Options#

FieldSpacer Interaction Enables the effect of FieldSpacer object on the Global Water object.
FieldHeight Interaction Enables the effect of FieldHeight object on the Global Water object.
FieldShoreline Interaction Enables the effect of the FieldShoreline object on the Global Water object. Enabling this option makes available the group of Field Shoreline states.
FieldSpacer Interaction Enables the influence of FieldSpacer object on the Global Water object.
Choppy Waves
Enables more realistic waves with sharp crests.
Choppy waves state disabled
Choppy waves state enabled
Underwater DOF
Adds an additional blur effect for underwater and overwater splice to make the waterline look more plausible.
High quality waterline state disabled
High quality waterline state enabled
Caustics
Enables the effect of light rays refraction by the water surface.
Caustics state disabled
Caustics state enabled
Caustics Distortion
Removes pixelation and makes caustics look smoother. When smoothing is not required, you can disable this option to gain performance.
Caustics Distortion state disabled
Caustics Distortion state enabled
Planar Reflection If enabled, this state allows using planar reflections on the water surface instead of SSR. It is better to use this option for undisturbed water (0-2 Beaufort).
Enabling the option activates Planar Reflection Map Size and Planar Reflection parameters.
Auxiliary Enables the auxiliary rendering pass for the material. Can be used for custom post-effects, such as thermal vision, night vision, etc.
Enabling the option activates the Auxiliary Color parameter.

Field Shoreline#

This set of states is enabled by toggling on the FieldShoreline Interaction option.

High Precision
Enables improved interpolation between the adjacent pixels of the shoreline texture to reduce stepping artifacts. This can be noticed when looking at the waterline separating overwater and underwater.
Notice
This state should be used only when geometry and/or normal states are enabled.
High Precision state disabled
High Precision state enabled
Normal Enables calculation of normals for geometry of shoreline waves. This option significantly reduces performance and can be used in cases, when really large waves are required. Enabling just the geometry state to simulate distortion of the water surface by a shoreline wave is enough in most cases.
Geometry
Toggles rendering of wave geometry for shoreline waves. If disabled, the water surface remains flat. Disabling this option in cases where wave geometry is hardly noticeable (e.g. a flight simulator) gives a performance gain.
Geometry state disabled
Geometry state enabled
Foam
Toggles rendering of foam for shoreline zones.
Foam state disabled
Foam state enabled

Post Processing and Post Processing (Backface)#

Post processing options activate post processing effects for the material. The effects are available both for front and back faces of the water surface.

  • DOF — enables the depth of field effect.
  • Motion blur — enables the motion blur effect.
  • Sun shafts — enables sun shafts.

Planar Reflection#

The Planar Reflection section containing Map Size is activated by enabling the Planar Reflection option. This parameter specifies the size of the planar reflection map, in pixels: the higher the value, the better the quality is.

Available sizes of the map are:

  • 128 — creates a reflection image with 128x128 resolution.
  • 256 — creates a reflection image with 256x256 resolution.
  • 512 — creates a reflection image with 512x512 resolution.
  • 1024 — creates a reflection image with 1024x1024 resolution.
  • 2048 — creates a reflection image with 2048x2048 resolution.
  • 4096 — creates a reflection image with 4096x4096 resolution.
  • Quart height — creates a reflection image with the resolution height/4 x height/4, where height is an application window height.
  • Half height — creates a reflection image with the resolution height/2 x height/2, where height is an application window height.
  • Height — creates a reflection image with the resolution height x height, where height is an application window height.

Textures#

Material window, Textures tab
Foam This texture specifies foam on water. The engine samples the foam texture twice to create plausibility of the real world foam behavior.
The texture is 3-channeled:
  • RGB values store the color.
Shoreline LUT LUT texture used for shoreline wetness effect.
Normal Detail
The Normal Detail map stores normal information required to achieve an additional (detail) effect of Normal Mapping. Normal map helps to create ripples (cat's-paw effect) on the water surface.
The texture is 2-channeled:
  • RG values store two components of a surface normal.
  • B value is calculated based on the R and G values in run-time.
With absolutely white normal map
With ripple-simulated normal map
Depth LUT LUT texture that shows the color of the bottom. Depending on the depth, the engine chooses the color of the water and multiplies it by the depth LUT texture. This generated LUT shows how deep the photon goes through water until completely scattered.
The texture is 4-channeled:
  • RGB values store color.
  • A value is used to create "transparent" water near the shore. In other words, it defines the fog density.
Caustic The 3D Caustic texture determines the pattern of light rays refracted by the water surface.
The texture is 1-channeled:
  • R value defines the caustics pattern.
Height The Height texture is used to create height displacement for waves. By using the height texture, the engine creates waves on the water surface. The engine performs triple access to the texture.
The texture is 1-channeled:
  • R value defines the height of the wave.

Parameters#

Geometry Parameters#

Max Tessellation Factor
The tessellation factor determines how much to subdivide each patch.
Tessellation factor set to 1
Tessellation factor set to 16
Tessellation Exponent Tessellation Exponent is in charge of the rate of changing the tessellation factor. It specifies how fast tessellation fades from the center point of the inner water area to the outer part.
Tessellation Distance
The engine doesn't tessellate the whole water surface because it would significantly affect performance. In fact, there are two parts of the water: inner (close to the camera) and outer. This parameter specifies the size of the inner water grid — the part of the water that is tessellated.
Procedural Normal Blur The ratio of the procedurally generated normal blurring. The lower the value, the more blurred (hence, more flatten) the water surface is.
Procedural Normal Weakening The ratio of procedurally generated normal weakening.
Choppiness Force The sharpness of the wave crests. If Choppy Waves is enabled, the engine moves the vertices near the wave crest closer to the crest and recalculates their normals to make them look more plausible. This parameter specifies the force of the described contraction.
Choppiness Normal Blur The blurring of normals for vertices near the wave crest that have been affected by the geometry modification (i. e. by Choppiness Force).
Choppiness Normal Weakening Weakening of normals to make the form of waves less sharp and outlined.
Procedural Fragment Scale Intensity of the effect a Field Height produces on the water surface.

Waves Animation Parameters#

Waves for the water_global_base material are created by using the height map. The engine performs sampling from this height map and creates waves by using a simple formula:

Formula
A*H1 + B*H2 + C*H3

In this formula, H1, H2, H3 are samplings from height map, and A, B, C are the Height Scale parameters.

Additional ripples (cat's-paw effect) are created by using the normal detail map.

Wave 0 UV Transform Specifies the UV transform for the first sample of the height texture. The first two values are the scale texture coordinates along the X and Y axes. The third and forth specify the wind force and direction for the U and V axes.
Wave 0 Height Scale Sets the height scale for the first sample of the height texture.
Wave 1 UV Transform Specifies the UV transform of the second sample of the height texture. The first two values are the scale texture coordinates along the X and Y axes. The third and forth specify the wind force and direction for the U and V axes.
Wave 1 Height Scale Sets the height scale of the second sample of the height texture.
Wave 2 UV Transform Specifies the UV transform of the third sample of the height texture. The first two values are the scale texture coordinates along the X and Y axes. The third and forth specify the wind force and direction for the U and V axes.
Wave 2 Height Scale Sets the height scale of the third sample of the height texture.
Detail 0 UV Transform Specifies the UV transform for the first sample of the normal detail texture. The first two values are the scale texture coordinates along the X and Y axes. The third and forth specify the wind force and direction for the U and V axes.
Detail 0 Intensity Sets the intensity of the first sample of the normal detail texture.
Detail 1 UV Transform Specifies the UV transform for the second sample of the normal detail texture. The first two values are the scale texture coordinates along the X and Y axes. The third and forth specify the wind force and direction for the U and V axes.
Detail 1 Intensity Sets the intensity of the second sample of the normal detail texture.

Foam Parameters#

Patch 0 UV Size Size of the first foam texture patch.
Patch 0 UV Speed Speed of the first foam patch.
Patch 1 UV Size Size of the second foam texture patch.
Patch 1 UV Speed Speed of the second foam patch.
Wave Contrast
Contrast of the foam mask.
Wave Intensity Foam intensity on the wave crests.
Shoreline Intensity Foam intensity near shores or different objects in water.

Subsurface Scattering Parameters#

Color
The water Subsurface Scattering (SSS) color.
Ambient Intensity
Intensity of subsurface scattering for ambient lighting. The lower the value, the faster the light rays dissipate in water.
Intensity Through Waves
Intensity of light rays passing through waves. The lower the value, the faster the light rays dissipate in water.
Intensity Around Foam
Intensity of subsurface scattering near the foam areas.
Diffuse Intensity Intensity of subsurface scattering for diffuse lighting.

Underwater Parameters#

The Underwater parameters adjust the underwater part of the water_global_base material.

The final color of underwater is calculated using the following formula:

Final Color Formula
FinalColor = FogColor * SunLighting^(1/FogSunLighting) + FogColor * EnvLighting^(1/FogEnvLighting)

FogColor, FogSunLighting, and FogEnvLighting are specified in the material. The other parameters (Sun and Environment lighting) are calculated according to the sun lighting and environment lighting of the scene. In fact, this formula defines how the sun and the environment lights affect the final underwater color.

Fog Transparency
The transparency of the underwater fog. The higher the value, the more transparent the underwater fog is.
Fog Color
The underwater fog color. The Sun and Environment lighting affect this parameter to create the final underwater fog color.
Fog Lighting Depth
The distance from the water surface, in units, up to which the light affects the underwater color.
Lighting Offset Height offset for lighting.
DOF Distance Focal distance for the underwater DOF effect.
Fog Environment Lighting Degree of impact of the environment lighting on the final underwater color.
Fog Sun Lighting Degree of impact of the sun lighting on the final underwater color.
Shafts Intensity Intensity of the underwater sun shafts.
Waterline Size
Size of the borderline between the overwater and underwater environments.

Other Parameters#

Reflection Roughness
The environment reflection roughness of the water surface. This parameter helps to tweak reflections on the water surface relative to the environment.
Reflection Occlusion
The occlusion factor for environment reflections on parts of the water surface with negative normals. Using this parameter enables simulation of reflection of waves on the water surface removing too bright areas on waves close to the horizon.
  • By the minimum value of 0, no occlusion is performed for reflections of waves, no matter what normals the water surface has.
  • By the higher values, occlusion is performed for reflections on parts of the water surface with negative normals that have a certain slope. The higher the value, the less intensive reflections are on the surface parts with negative normals.

Reflection Occlusion Slope Slope of negative normals of the water surface, at which occlusion is performed for wave reflections.
Refraction Scale
Scale of the water refraction.
Diffuse Distortion Distortion of decals projected onto water.
Soft Intersection Soft intersection of water with the shoreline and surfaces of objects.

Caustics#

Notice
The Caustics state should be enabled to fine-tune this set of parameters.
UV Transform UV Transform coordinates for the caustic texture.
Distance Fade Distance from the water surface downwards, at which light shapes fade, in units.
Animation Speed Movement speed of the light patterns.
Brightness Brightness of the light shapes.

Shoreline#

Wave Speed The speed of tidal waves.
Wave Tiling The frequency of tidal waves.
Exponent Nonlinearity of tidal waves frequency and movement speed depending on their distance from the shoreline.
Foam Stretching Width of the Shoreline LUT texture that creates a tidal wave.
Mask Tiling Size of the foam procedural pattern used to reduce the foam tiling effect when seen from above.
Wave Mode Prominence of oncoming tidal waves.
Falloff Visibility gradient of waves coming from sea to the shore.
Beaufort Falloff Height control of main geometry waves near the shoreline.
Foam Intensity Degree of foam intensity along the shoreline.
Foam Exp Visibility of the foam texture pattern.
Front Exp Semi-transparency of the foam at an angle to the wind direction. Allows making the foam visible only on the windward side.
Wetness Intensity Intensity of the wetness effect along the shoreline.
Wetness Distance Spread of the wetness area along the shoreline, in units.
Wetness Offset Offset of the wetness area from the water, in units.

Planar Reflection#

Viewport Mask The viewport mask of the reflection camera. A surface has its reflection rendered, if its viewport mask and its material's viewport mask match this mask.
Distance Distance from the reflection viewport camera to the reflected object, in units. This distance sums up to the distance from the camera to the reflective surface plus the distance from object to reflective surface.
Pivot Offset Position of the reflection pivot point.

Field Interaction#

Physics Field Mask The field mask that controls CPU-related operations with fields. For example, intersection with a wave created by Field Height can be detected, if a relevant Field Mask is enabled.
Visual Field Mask The field mask that controls GPU-related (visually perceptible) effects of fields.

Auxiliary#

Auxiliary color parameter
Auxiliary Color The color that goes into the auxiliary buffer. Alpha is the blend factor.
Last update: 2019-11-28