Stylized Water 3 – Documentation

Stylized Water 3

Stylized Water 3
Version: 3.0.0
Review

4.4.Waves #

Waves can play an important part in water for a scene, both for its visual characteristic and spatial presence.

This asset features wave animations in the form of layered “trochoidal” waves, also known as “Gerstner waves”. Because the amount of variations are virtually endless, a profile-based design makes it possible to easily pick from different pre-made wave animations.

The wave animation applies to each individual vertex. Using a mesh for the water with a low vertex density yields inaccurate results.

Wave Profiles

You’ll notice a Wave Profile is assigned to any material that uses waves:

In the Stylized Water 3/Profiles folder you’ll find a selection of pre-made profiles, ready to assign to a material

These profile are all finetuned to approximate certain types of waves, as their names imply.

On each material that uses them you can still scale the Height, Wave length and Steepness being applied.

Dynamically blending between two profiles is not possible. Particularly because wave lengths need to remain constant.

Concept

It’s important to understand that an individual wave layer is defined by three primary parameters:

  • Length: the horizontal distance (in meters) between each peak/crest
  • Amplitude: the vertical length between its bottom and top
  • Steepness: the amount of horizontal movement

These parameters are then used as inputs for the wave algorithm in the shader.

When several layers, each with different parameter values, are added on top of each other a “wave scape” is created.

Editor

A wave profile defines the characteristic of the wave animation pattern. Games, such as Fortnite, often use a set of pre-defined parameters finetuned by artists. This editor provides such control.

Variation, between each layer, is key. Therefore a Procedural Editor utility is available. This sets parameters to a random value within the specified range.

The included pre-made profiles are also created using this utility. Settings will be saved to the profile, so you are free to experiment with it and come back to it at a later time.

It is absolutely possible for some ‘seed’ values to yield garbage result. Try changing it until you see something you’re satisfied with.

Scripting

Wave profiles can also be created or modified through code. You may want to do this to dynamically adjust the Amplitude multiplier, for instance based on weather conditions. Wave Profiles are Scriptable Objects so creating them is nothing unique.

A profile contains an array of Wave objects, each of which defines the parameters of an individual wave. Combined they make up “layers”.

In order for changes made to the profile, or its layers, to sync to materials that use it the UpdateShaderParameters() function must be called. This creates a lookup table from all the layers, which is readable on the GPU.


Footnote: true oceanic wave simulations are not possible. This relies on a different and advanced subset of techniques that fall outside of the scope of this asset.

Waves will always show a repetitive pattern when viewed from afar. Multi-stage cascaded rendering falls outside of the scope for this asset.

Yes No Suggest edit
Last updated on October 15, 2024
0 of 0 users found this section helpful
Suggest Edit