Table of Contents

Class RainState

Namespace
DFA.Puddlecraft

The scene's weather: how hard it rains, and the water it leaves behind. Wind is not part of the rain state; it comes from the scene's directional Wind Zone (see PuddlecraftWind).

intensity is how hard it rains, which sets how fast water arrives rather than a level the water settles at. While it rains at all, the ground keeps soaking and the puddles keep filling, more slowly in light rain, until they are full. They only dry and drain once the rain stops.

Placed puddles (the splats you place) are described by fill, how full they are, and wetMark, the high-water line left behind as they drain, which shows as a damp ring. They fill in the rain and then drain slowly, or keep their water.

Wet ground covers every surface the rain reaches, on materials that use the Puddlecraft wetness function. dampness darkens it and makes it glossy. Once it is soaked, groundWater grows procedural puddles, until heavy rain covers the ground in water.

All values advance on their own in Play mode. In Edit mode they stay where you set them.

[Serializable]
public sealed class RainState
Inheritance
RainState

Properties

dampness

How wet the ground the rain reaches is, 0 to 1. Soaks through over wetTime in a downpour, more slowly in light rain, and dries over dryTime. Independent of groundWater, so puddles can sit on dry ground.

public float dampness { get; set; }

Property Value

float

drainTime

Seconds (at least 0.1) for full placed puddles to drain once the rain stops.

public float drainTime { get; set; }

Property Value

float

dropRate

Raindrops landing per square metre per second in a downpour, 0 to 100; lighter rain has fewer. Each makes rings on standing water.

public float dropRate { get; set; }

Property Value

float

dryTime

Seconds (at least 0.1) for soaked ground, procedural puddles and damp rings to dry.

public float dryTime { get; set; }

Property Value

float

fill

How full the placed puddles are, 0 to 1. Setting it above wetMark raises wetMark with it; below it leaves a damp ring.

public float fill { get; set; }

Property Value

float

fillTime

Seconds (at least 0.1) for empty placed puddles to fill completely in a downpour. Lighter rain fills more slowly.

public float fillTime { get; set; }

Property Value

float

groundWater

How far procedural puddles have spread, 0 to 1. At 1 the ground is covered in water. In rain they only grow once the ground is soaked, but you can set them on dry ground.

public float groundWater { get; set; }

Property Value

float

intensity

How hard it's raining, from 0 (dry) to 1 (a downpour): how fast water arrives. Any rain keeps soaking the ground and filling the puddles, more slowly when it's light; they dry once it stops.

public float intensity { get; set; }

Property Value

float

keepWater

Placed puddles keep their water when the rain stops.

public bool keepWater { get; set; }

Property Value

bool

puddleTime

Seconds (at least 0.1) of a downpour, once the ground is soaked, for procedural puddles to cover it.

public float puddleTime { get; set; }

Property Value

float

ringArea

Side of the square around each camera where rain particles leave rings on standing water, in metres (8 to 64).

public float ringArea { get; set; }

Property Value

float

rippleArea

Side of the detailed square around each camera where footstep, wheel, drip and spout ripples are simulated, in metres (2 to 64). Every camera has its own simulation, the Scene view's included, so in split-screen or with several cameras each sees the ripples near it.

public float rippleArea { get; set; }

Property Value

float

rippleCoverage

Side of a wider, coarser square around each camera that carries ripples beyond the detailed one, in metres (0 to 512), at half the detailed resolution. 0, or no bigger than rippleArea, turns it off.

public float rippleCoverage { get; set; }

Property Value

float

rippleResolution

Texels along each side of the detailed ripple simulation. Area divided by this is the finest ripple.

public PuddlecraftResolution rippleResolution { get; set; }

Property Value

PuddlecraftResolution

runoff

How hard water is running down slopes, 0 to 1. Follows intensity, lagging behind it, so soaked ground stops flowing slowly after the rain stops.

public float runoff { get; set; }

Property Value

float

runoffTime

Seconds (at least 0.1) for the water running down slopes to calm once a downpour stops. It picks up four times faster when the rain gets heavier.

public float runoffTime { get; set; }

Property Value

float

wetMark

The high-water line, 0 to 1. Never below fill.

public float wetMark { get; set; }

Property Value

float

wetTime

Seconds (at least 0.1) of a downpour for dry ground to soak through. Lighter rain takes longer.

public float wetTime { get; set; }

Property Value

float

Methods

Advance(float)

Moves the weather on by deltaTime seconds. While it rains, placed puddles fill, the ground soaks and then grows procedural puddles, all faster the harder it rains, until they're full. Once the rain stops, placed puddles drain (unless they keep their water), leaving a damp ring, the water running down slopes calms, and the ground dries.

public void Advance(float deltaTime)

Parameters

deltaTime float