shown in other instead.
A water object represents infinitely spread water with auto-tessellation (wireframe of the water is not scaled - regardless of the camera position it stays the same). This type is suitable to represent boundless ocean while not overloading the GPU. However it cannot have a body assigned, and thus does not provide proper physical interaction with scene objects.
- A ObjectWater class to edit water object via UnigineScript
The water object consists of two surfaces approximating optical and dynamic behavior of the water:
- Water Surface includes the following effects:
- Surface waves — geometrical waves and rippling produced by surface displacement according to normal maps (see water_base material), as well as waves conditioned by the physical interaction with objects.
- Reflection — specular reflection of direct sunlight and skylight from the water surface.
- Fresnel effect — increase or decrease of water surface reflectance depending on the angle of the camera. In real life when looking at the water straight from above, it is transparent and non-reflective. When looking at the surface from a distance, the view angle becomes smaller and the amount of reflection increases until it seems completely non-transparent.
- Refraction as light passes through air-water boundary.
- Foam, spray or bubbles.
- Volume surface introduces the following:
- Underwater volume at the bottom. It simulates underwater conditions and adds the visual depth to the rendered water, by growing more opaque as it gets deeper. Underwater volume is available only for infinite water object. To imitate the same effect with water meshes, volumetric fog can be added.
- Subsurface scattering that allows you to achieve additional play of colors. It becomes most visible at the horizon when the viewing angle is close to the water surface.
- Caustics — light patterns formed on surfaces underneath the water. This effect is caused by the group of light rays focusing or defocussing because of the water surface is not flat, but rippled rough.
Depicting water should not be limited to the calm and still aquatic surface in the tranquil weather. Lakes disturbed and rippled by the wind, surf and breaking waves of the ocean can be simulated with four directional waves, summed to create dynamic undulation. This model uses static geometry animated in vertex shader. It delivers credible image, as movement each of the wave is set independently, greatly enhancing the realism and flexibility of adjustment.
The waves have the following characteristics defining their periodic and sinusoidal nature:
A directional wave (unlike the circular one from the objects, for example) travels along the specified direction:
- By the minimum value of 0, the wave spreads along the Y axis and is parallel to the X axis.
- Positive values rotate the wave about the Z axis, meaning the wave direction is slanted counterclockwise relative to its initial spread.
- Negative values rotate the wave on the water surface clockwise.
- By the maximum possible values of 180 or -180, the wave direction becomes parallel to the X axis yet again.
The wave progresses along the water surface with the definite speed:
- The minimum value of 0 means the wave is inactive.
- Increasing the value results in waves following each other faster.
The length represents distance between successive crests of the wave:
- The smaller the value is, the more rippled the water surface is.
- The higher the value is, the broader formed waves are.
Amplitude determines the distance between the highest and the lowest wave peaks. Together with the length, it sets the wave form.
- The minimum value of 0 means the wave is not formed.
- Increasing the value forms higher waves up to tsunami-like ones.