Water Global
The Water Global samples demonstrate how to control Global Water via API:
SDK Path: <SDK_INSTALLATION>
This sample demonstrates how to control the wave spectrum of Global Water in Manual mode via API over wave parameters (octaves - a set of waves at a specific size/frequency level, count per octave, length, amplitude, phase, and steepness).
Because all wave parameters are managed on the CPU side, they can be dynamically generated, modified, or stored for reproducible results and external integration (for example, to process Weather Control packets from IOS).
SDK Path: <SDK_INSTALLATION>source/nodes/water_custom_wave
This sample demonstrates how various parameters influence the accuracy of fetch (sampling water height and normal) and intersection (ray-water collision detection) operations on the Global Water object across different Beaufort levels (the Beaufort slider).
You can interactively adjust the following parameters:
- Steepness Quality: Controls wave detail resolution used in sampling.
- Amplitude Threshold: Filters out minor waves to improve performance at the cost of detail.
- Precision: Controls ray-water intersection accuracy. Lower values reduce jitter when intersecting at an angle.
- Intersection Angle: Adjusts the incoming ray direction for intersection tests, helping evaluate how steep angles affect detection stability.
The UI also allows you to:
- Select between Fetch and Intersection modes
- Show or hide normals at the sampled points
- Adjust the number of samples and visual point size
This sample is useful for fine-tuning water interaction accuracy in physics, gameplay, and visual effects - especially when working with sloped or moving viewpoints (e.g., cameras, characters, or objects interacting with water).
SDK Path: <SDK_INSTALLATION>source/nodes/water_fetch_intersection
SDK Path: <SDK_INSTALLATION>
SDK Path: <SDK_INSTALLATION>
Accessing Demo Source Code#
You can study and modify the source code of this demo to create your own projects. To access the source code do the following:
- Find the C++ Samples demo in the Demos section and click Install (if you haven't installed it yet).
- After successful installation the demo will appear in the Installed section, and you can click Copy as Project to create a project based on this demo.
- In the Create New Project window, that opens, enter the name for your new project in the corresponding field and click Create New Project.
- Now you can click Open Code IDE to check and modify source code in your default IDE, or click Open Editor to open the project in the UnigineEditor.
The information on this page is valid for UNIGINE 2.20 SDK.