Wave Profile
Scriptable Object that contains configuration for waves shape.
You can have as many profiles as you want, but it's strongly recommended to resuse them between different surfaces as much as possible.
Each actively used profile on scene adds extra processing pass for every frame.
In most cases you will want to stick with one or two reusable profiles per scene.
Waves List
Automatic Values
- Auto Wave Height - if enabled, height of each wave is calculated automatically from it's steepness, length and LS ratio
- Default 0.143 value translates to 1:7 ratio, which is maximum ratio of ocean waves on Earth can achieve
- Auto Wave Speed - if enabled, speed of each wave is calculated automatically from it's length and gravity value
- Default 9.81 is gravity on Earth
Generator
This is basic waves generator.
I suggest experimenting with it for a while.
If need more advanced tool or want to import waves from external source, you can do it via public WaterProfile
functions or rewriting DragonWater.Utils.GerstnerWavesGenerator
class.
Projection
Waves are projected from camera's origin.
Here you can configure visibility distance and how detailed they should be.
It only affects visual, not physics which is indpendent via Water Sampler.
- Texture Size - higher resolution means more detailed waves, but also heavier calculations
- Projection Size - half of this value can be treated as visibility radius - lower value means more detailes waves, but they will sooner appear flat on screen
Wave Area
- Amplitude Multiplier - global multiplier for amplitude (similar to Local Wave Areas setting)
- Steepness Multiplier - global multiplier for steepness (similar to Local Wave Areas setting)
- Hillness Multiplier - global multiplier for hillness (similar to Local Wave Areas setting)
- Include Local Areas - should this wave profile include Local Wave Areas?
Hillness
Hillness is an additional parameter for every point on wave, just like it's level offset or normal.
In theory, higher hillness mean point is higher from base water level. This value is used e.g. to draw foam on wave tips.
This value is usually in range 0-1, but it's not always the case and depending on configuration - it can be negative on deep areas of waves, which can be important for some Material Profile configurations.
Hillness is calculated with the following formula:
float height_param = yOffset / avgAmplitude; // offset from base water level, can be both - positive or negative float normal_param = 1.0 - dot(up, normal); // usually, the higher point is, the normal vector is more horizontal hillness = (height_parm * HillnessOffsetFactor) + (normal_param ^ HillnessNormalPower);
- Hillness Offset Factor - how much offset from water level influences hillness. Final factor that comes from this is usually in range from -1 to 1, because of average amplitude calculated from all waves.
- Hillness Normal Power - the more normal vector offsets from up, the higher hillness influence will be. This parameter controls power of it.
Ripple Effect
Simulation parameters for ripple when it's use on surface with this wave profile.
Read more: Ripple Effect
Waves Origin
By default, Wave Profile uses world origin at 0,0 with 0 degree rotation as origin to calculate waves.
It means that waves are always same at position x,y no matter what is your transform of water surface.
This makes wave profile nicely reusable between surfaces but it does not always look correctly on moving surface.
To solve this issue, you can change Wave Profile origin (both, position and its rotation) at runtime, so waves will properly move and rotate with surface transform.
Although, this will limit profile reusability between surfaces in some cases - if you want multiple moving surfaces at the same time, you will most likely need to create separate profile for each.
You can change profile waves origin in two ways:
- From script by changing
WorldOriginPosition
andWorldOriginRotation
properties, or - Directly via Water Surface configuration in inspector.