Scripting Support (C#)

advanced scripting

Global Snow (Built-in) · Scripting Support (C#)

Control Global Snow at runtime using the GlobalSnowEffect namespace. The snow effect is a camera-based MonoBehavior accessible via the singleton GlobalSnow.instance.

using GlobalSnowEffect;

GlobalSnow snow = GlobalSnow.instance;
snow.snowAmount = 0.8f;
snow.snowTint = Color.white;
snow.UpdateMaterialProperties();

GlobalSnow

MonoBehavior attached to the Main Camera. Manages snow coverage, particles, terrain marks, footprints, frost, and coverage masking. Access via GlobalSnow.instance.

General

static GlobalSnow instance read-only

Singleton reference to the active GlobalSnow component.

Camera snowCamera read-only

The camera this snow effect is attached to.

bool deferred read-only

Returns true if the camera is using the deferred rendering path.

GlobalSnowProfile profile

Gets or sets a profile. Setting this applies the profile settings to the snow component.

GameObject sun

Reference to the directional light used for snow lighting calculations.

bool enableWMAPI

Enables the World Machine API integration for heightmap-driven snow.

bool forceForwardRenderingPath

When true, forces forward rendering even when the camera is set to deferred. Built-in exclusive.

bool debugSnow

Enables debug visualization of snow coverage.

CameraEvent deferredCameraEvent

When the snow passes execute in deferred mode. Values: BeforeReflections (default) or BeforeLighting. Built-in exclusive.

bool showSnowInSceneView

Enables snow preview in the Scene View.

bool forceSPSR

Enables Single Pass Stereo Rendering for VR (OpenVR only).

bool floatingPointNormalsBuffer

Use 16-bit floating-point normal buffer instead of 8-bit for deferred rendering. Reduces artifacts at distance. Built-in exclusive.

Snow Appearance

float snowAmount

Overall snow intensity. Range 0 (no snow) to 2 (maximum coverage). Default: 1.

Color snowTint

Tint color applied to the snow surface.

float smoothness

Snow surface smoothness/glossiness. Range 0-1, default: 0.9.

SNOW_QUALITY snowQuality

Snow surface complexity: FlatShading, NormalMapping, or ReliefMapping.

float snowNormalsStrength

Strength of the normal map on the snow surface. Range 0-2, default: 1.

float noiseTexScale

Scale of the noise texture used for snow variation. Default: 0.1.

float reliefAmount

Intensity of the relief/parallax mapping effect. Range 0.05-0.3, default: 0.3.

bool occlusion

Enables ambient occlusion on the snow surface. Default: true.

float occlusionIntensity

Intensity of the snow ambient occlusion effect. Range 0.01-5, default: 1.2.

float glitterStrength

Strength of the glitter/sparkle effect on the snow surface. Default: 0.75.

float maxExposure

Maximum exposure value for the snow. Controls brightness clamp. Range 0-2, default: 0.85.

Altitude and Coverage

float minimumAltitude

Minimum world-space altitude where snow appears. Default: -10.

float minimumAltitudeVegetationOffset

Additional altitude offset for vegetation snow coverage.

float altitudeScatter

Amount of randomness in the altitude boundary. Range 0-250, default: 20.

float altitudeBlending

Blending factor for altitude-based snow transitions. Range 0-500, default: 25.

int coverageExtension

Extension of the coverage capture area. 1 = 256x256 m, 4 = 1024x1024 m. Default: 1.

int coverageResolution

Resolution of the coverage depth texture. 1 = 512, 4 = 4096. Default: 1.

bool smoothCoverage

Smooths the zenithal coverage result. Built-in exclusive. Default: true.

bool showCoverageGizmo

Displays the coverage area bounds in the Scene View.

float groundCoverage

Ground-level snow coverage amount. Range 0-0.5, default: 0.

Slope

float slopeThreshold

Slope angle threshold above which snow is removed. Range 0-1, default: 0.7.

float slopeSharpness

Sharpness of the slope-based snow removal transition. Range 0-1, default: 0.5.

float slopeNoise

Amount of noise applied to slope-based snow edges. Range 0-1, default: 0.5.

float distanceSlopeThreshold

Slope threshold for the distance-optimized snow layer. Range 0-1, default: 0.7.

Distance Optimization

bool distanceOptimization

Enables simplified snow rendering beyond the detail distance. Built-in exclusive.

float detailDistance

Distance in meters where full snow transitions to simplified. Default: 100.

Color distanceSnowColor

Tint color applied to the distance-optimized snow layer.

bool bigWorldAntiflicker

Reduces z-fighting on very large terrains. Default: true.

bool distanceIgnoreNormals

Distance snow ignores surface normals for flat coverage. Built-in exclusive.

bool distanceIgnoreCoverage

Distance snow ignores the zenithal coverage pass. Built-in exclusive.

Coverage Mask

bool coverageMask

Enables the coverage mask system.

Texture2D coverageMaskTexture

The coverage mask texture. White = snow, black = no snow.

Vector3 coverageMaskWorldSize

World-space size of the mask area.

Vector3 coverageMaskWorldCenter

World-space center of the mask area.

bool coverageMaskFillOutside

Areas outside the mask are filled with snow when true. Default: true.

Snowfall

bool snowfall

Enables the snowfall particle system. Default: true.

float snowfallIntensity

Emission rate of snowflakes. Range 0.001-1, default: 0.1.

float snowfallSpeed

Fall speed of snowflakes.

float snowfallWind

Horizontal wind force on snowflakes. Range 0-2, default: 0.

float snowfallDistance

Maximum visibility distance for snowflakes. Range 10-200, default: 100.

bool snowfallUseIllumination

Snowflakes receive Global Illumination.

bool snowfallReceiveShadows

Snowflakes receive shadows from scene geometry.

Snow Dust

float snowdustIntensity

Intensity of wind-driven snow dust near ground level. Range 0-1.

float snowdustVerticalOffset

Height offset for the dust emitter. Range 0-2, default: 0.5.

Camera Frost

bool cameraFrost

Enables the screen-space frost overlay. Default: true.

float cameraFrostIntensity

Strength of the frost effect. Range 0.001-1.5, default: 0.35.

float cameraFrostSpread

How much of the screen edges are covered. Range 1-5, default: 1.2.

float cameraFrostDistortion

Image distortion amount from frost. Range 0-1, default: 0.25.

Color cameraFrostTintColor

Tint color for frosted areas.

Footprints

bool footprints

Enables human-shaped footprint decals.

Texture2D footprintsTexture

Custom texture for footprint stamps.

bool footprintsAutoFPS

Automatically generates footprints for the FPS character.

int footprintsDuration

Seconds before footprints fade out. Range 1-240, default: 60.

float footprintsScale

Scale of each footprint stamp. Range 0.04-1, default: 1.

float footprintsObscurance

How darkened the footprint depression appears. Range 0.05-0.5, default: 0.1.

Terrain Marks

bool terrainMarks

Enables collision-driven snow deformation trails.

int terrainMarksDuration

Seconds before marks fade out. Range 1-240, default: 180.

float terrainMarksDefaultSize

Default radius of each terrain mark. Range 0-1, default: 0.25.

float terrainMarksViewDistance

Maximum rendering distance for marks. Range 0-1024, default: 200.

bool terrainMarksAutoFPS

Automatically leaves terrain marks for the FPS character.

float terrainMarksRoofMinDistance

Minimum overhead clearance before marks are stamped.

float terrainMarksStepMaxDistance

Maximum distance between consecutive trail marks.

float terrainMarksRotationThreshold

Minimum rotation in degrees before a new mark is stamped.

int terrainMarksTextureSize

Internal resolution of the terrain marks render texture.

Exclusion

LayerMask layerMask

Which layers receive snow coverage via the zenithal depth pass.

LayerMask zenithalMask

Which layers participate in the zenithal occlusion pass.

bool excludedCastShadows

Excluded objects still cast shadows into snow. Default: true.

int defaultExclusionLayer

Layer number used internally for exclusion rendering. Default: 27.

bool exclusionDoubleSided

Enable for double-sided excluded objects.

float exclusionDefaultCutOff

Alpha cutoff threshold for excluded semi-transparent objects. Range 0-1.

bool exclusionUseFastMaskShader

Uses optimized mask shader for exclusions. Deferred only. Default: true.

Material Fixes (Forward)

bool fixMaterials

Forces non-transparent materials to expose an Opaque RenderType tag.

bool opaqueCutout

Discards transparent pixels on opaque objects.

bool fixTreeOpaque

Forces opaque rendering on tree objects.

bool updateSpeedTree

Enables SpeedTree snow support with variant shaders.

bool speedTreeRemoveLeaves

Prunes tree leaves for a winter look using a SpeedTree variant shader.

float billboardCoverage

Snow amount on tree billboards. Range 0-2, default: 1.4.

float grassCoverage

Snow amount on grass. Range 0-1, default: 0.75.

Ground Check

GROUND_CHECK groundCheck

Method for ground detection: None, CharacterController, or RayCast.

CharacterController characterController

Reference to the CharacterController (when using CharacterController mode).

float groundDistance

Maximum raycast distance for ground detection.

Mask Editor

bool maskEditorEnabled

Activates the Scene View mask painting tool.

int maskTextureResolution

Resolution of the mask texture.

int maskBrushMode

Brush mode: add or remove snow.

float maskBrushWidth

Brush size in world units.

float maskBrushFuzziness

Softness of brush edges.

float maskBrushOpacity

Opacity of each brush stroke.

Methods

void UpdateMaterialProperties()

Queues an update of all snow material properties. Call after modifying any snow properties at runtime.

void UpdateMaterialPropertiesNow()

Immediately updates all snow material properties (synchronous).

void UpdateSnowfallProperties()

Updates the snowfall particle system with current settings.

void UpdateSnowdustProperties()

Updates the snow dust particle system with current settings.

void UpdateSnowCoverage()

Forces a recalculation of the snow coverage depth texture.

void RefreshExcludedObjects()

Refreshes the list of excluded objects. Scans for GlobalSnowIgnoreCoverage components.

float GetSnowAmountAt(Vector3 position)

Returns the current snow amount at a world position (0 = no snow, 1 = full snow). Useful for gameplay logic.

Terrain Marks and Footprints Methods

void MarkSnowAt(Vector3 position)

Stamps a terrain mark at the specified world position using the default size.

void MarkSnowAt(Vector3 position, float radius)

Stamps a terrain mark at the specified world position with a custom radius.

void FootprintAt(Vector3 position, Vector3 moveDir)

Stamps a footprint at the specified position oriented along the movement direction.

void CollisionStay(Vector3 contactPoint, ...)

Called during collision contact to continuously stamp terrain marks.

void CollisionStop()

Called when collision contact ends.

Coverage Mask Methods

void MaskPaint(Vector3 pos, byte value, float brushWidth, float brushOpacity = 1f, float brushFuzziness = 0f)

Paints the coverage mask at a world position. value 0 = remove snow, 255 = full snow.

void MaskClear(byte value = 255)

Clears the entire coverage mask to the specified value. Default 255 restores full snow.

void MaskFillArea(GameObject go, byte value, float opacity = 1f, float border = 0f)

Fills the mask area occupied by the given GameObject's bounds.

void MaskFillArea(Bounds bounds, byte value, float opacity = 1f, float fallOff = 0)

Fills the mask within the specified Bounds.

void MaskFillArea(Vector3 position, float radius, byte value, float opacity = 1f, float fallOff = 0)

Fills a circular area centered on a position with the given radius.

void SubmitCoverageMaskTextureChanges()

Submits pending coverage mask texture changes to the GPU.

Static Methods

static void IgnoreGameObject(GlobalSnowIgnoreCoverage obj)

Excludes a GameObject from snow coverage at runtime.

static void UseGameObject(GlobalSnowIgnoreCoverage obj)

Re-includes a previously excluded GameObject.

Events

event Action OnUpdateProperties

Fired when snow properties are updated. Subscribe to react to snow changes.

GlobalSnowProfile

ScriptableObject for saving and loading snow configurations. Create via Create > Global Snow Profile in the Project panel.

ScriptableObject GlobalSnowProfile

Stores a snapshot of all GlobalSnow properties. Assign to GlobalSnow.instance.profile to apply.

using GlobalSnowEffect;

// Load a saved profile
GlobalSnow snow = GlobalSnow.instance;
snow.profile = mySnowProfile;
snow.UpdateMaterialProperties();

GlobalSnowVolume

MonoBehavior that creates a trigger-based zone for modifying snow properties. Built-in exclusive component.

Collider targetCollider

The collider that activates this volume. If null, any entering collider triggers the volume.

bool debugMode

When true, draws the volume bounds in the Scene View.

GlobalSnow targetGlobalSnow

The GlobalSnow instance whose properties are modified. Uses GlobalSnow.instance if not set.

using GlobalSnowEffect;

// Create a snow volume at runtime
GameObject volumeObj = new GameObject("IndoorVolume");
BoxCollider box = volumeObj.AddComponent<BoxCollider>();
box.isTrigger = true;
box.size = new Vector3(10, 5, 10);

GlobalSnowVolume volume = volumeObj.AddComponent<GlobalSnowVolume>();
volume.targetGlobalSnow = GlobalSnow.instance;

Helper Components

MonoBehaviour GlobalSnowIgnoreCoverage

Attach to any GameObject to exclude it from snow coverage. Works in both deferred and forward modes.

MonoBehaviour GlobalSnowCollisionDetector

Attach to non-terrain objects to enable terrain mark collisions on their surface.

MonoBehaviour GlobalSnowColliderExtraInfo

Per-collider overrides for mark size, step distance, footprint mode, and rotation threshold.

Was this page helpful?