Wind Zones

Wind zones are the primary way that you can interact with the Zephyr wind system. These components can be placed on objects in your scene to interact with the wind in a unique way for each wind zone type.

Interacting with Wind Zones

Create a new wind zone using the Game Object functions or by adding a component to an empty object.

Once created, adjust the properties of your wind zone in the inspector. For detailed descriptions of each property, check out the individual zone type pages.

API

Parameters

Every wind zone (regardless of type) has a few public properties. These are overridden in the individual wind zone scripts.

Property
Type
Description

ApplicationOrder

int

Defines the order in which wind zones are applied to Zephyr. In general, multiplicative effects are applied after additive effects.

Radius

float

Determines the radius (in meters) of the effect.

Strength

float

Arbitrary value that determines the strength of the effect. Typically corresponds to wind speed, but may refer to another value depending on the wind zone type.

ID

int

A constant value used to ID the wind zone.

Position

Vector3

Cached reference to transform.position for better performance.

Direction

Vector3

Cached reference to transform.forward (or transformed direction) for better performance.

AuxOne, AuxTwo, AuxThree

float

Optional auxiliary parameters that may be overridden in the case that additional properties need to be passed to the GPU while applying the wind zones.

VariationTime

float

Reference to the frequency of variations.

VariationMagnitude

float

Reference to the magnitude of variations. A value of 0 will always return the full strength effect and a value of 1 will interpolate between the full effect strength and a strength of 0 based on the variation method.

VariationOffsetX

float

Reference to the current variation offset (X coordinate only)

VariationOffsetY

float

Reference to the current variation offset (Y/Z coordinate only)

These values are references only. To override these (or override the default behavior), create your own custom wind zone!

Methods

ApplyWind

Applies the wind zone function to a position. Takes in a position and a reference to the current wind vector. This function is applied differently depending on the wind zone type.

Editing HLSL

Zephyr works on both the CPU (for physics, particles, and gameplay logic) and the GPU (for shaders, VFX). For this to work, any logic for wind zones must be written in C# and HLSL.

Folder Structure

Each wind zone script has a linked HLSL file in the Runtime/Shader/HLSL/Wind Zones folder. These are then applied in the ApplyWindZones.hlsl file. For more information on editing this, take a look at the Custom Wind Zone page.

Last updated