This page has been translated automatically.
Video Tutorials
Interface
Essentials
Advanced
How To
Basics
Rendering
Professional (SIM)
UnigineEditor
Interface Overview
Assets Workflow
Version Control
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Lighting
Sandworm
Using Editor Tools for Specific Tasks
Extending Editor Functionality
Built-in Node Types
Nodes
Objects
Effects
Decals
Light Sources
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
Materials and Shaders
Rebuilding the Engine Tools
GUI
Double Precision Coordinates
API Reference
Animations-Related Classes
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
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
VR-Related Classes
Content Creation
Content Optimization
Materials
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials

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).

Notice
The maximum number of waves is 256, but higher values significantly affect performance, so we recommend keeping the number below 100 and using the minimum possible number.

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
Notice
Intersection rays are visualized with blue arrows. If jitter occurs at non-zero intersection angles, try lowering the Precision value.

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:

  1. Find the C++ Samples demo in the Demos section and click Install (if you haven't installed it yet).
  2. 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.
  3. In the Create New Project window, that opens, enter the name for your new project in the corresponding field and click Create New Project.
  4. 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.

Last update: 2024-02-27
Build: ()