Namespace DFA.Puddlecraft
Classes
- CoverVolume
A box that tells Puddlecraft how sheltered a space is: indoors, under an arcade, behind a door. The rain sound is muffled only by the volumes the audio listener is inside, so an interior sounds indoors exactly where a volume says so and nowhere else. With Blocks Rain on, the box's top also keeps rain off whatever is under it.
The box is defined like a Box Collider (Center and Size, in the object's local space) and follows the object's position, rotation and scale.
Volumes nest through the hierarchy. A volume parented under another, such as a doorway inside a building, overrides its parent inside its own box, blending in from its faces over the Falloff distance. A nested volume only counts inside the volumes it is parented under, so a doorway's box can extend out through the door to start its falloff outside without muffling the street.
Cover is how muffled the rain sounds, from 0 (as loud as out in the open) to 1 (as muffled as fully indoors). The inspector shows it inverted, as a Rain Sound slider from quiet to loud. Most volumes only need coverClosed. For a door or window, a script or animation sets openness, which moves the cover from coverClosed (at 0) to coverOpen (at 1).
- DripEdge
A hand-drawn edge that water drips from, such as an overhanging ledge or eave without a gutter. Where each drop lands is worked out in the editor, so no colliders are needed at runtime.
- ProceduralSplatSettings
Settings that generate a procedural splat. The same settings always give the same shape.
- PuddleLook
How puddles look. Shared by every puddle in the scene.
- PuddleQuery
Asks what water is at a position, placed puddles and procedural ones: for footsteps, splashes, tyre spray or gameplay.
- PuddleRippleEmitter
Leaves a wake in standing water as this object moves through it: put one on each foot, wheel or anything that wades. It only disturbs water it is actually in, and reports entering and leaving. On the Low quality tier it still reports entering and leaving, but leaves no wake.
- PuddleSplat
A reusable puddle shape: a square heatmap of depth from 0 (dry) to 1 (deepest). Splats are placed in a scene with a PuddleSplatInstance (Puddle Splat component), which can be moved, scaled and rotated at any time without changing the splat itself.
- PuddleSplatInstance
A splat stamped into the scene. Only a reference plus a position, yaw and size: moving, resizing or swapping the splat never loses anything.
- PuddlecraftAudio
The sound of the rain: procedural rain built from ten crossfading frequency bands that follow the intensity, plus drips landing and spouts pouring. Add one per scene.
Where the audio listener is inside a CoverVolume, the rain is muffled and drips and spouts play quieter. Place volumes wherever the rain should sound sheltered, such as indoors.
- PuddlecraftBakeData
Saved puddle bake for one scene, written next to the scene when it's saved. Used in builds.
- PuddlecraftBehaviour
Base class for the Puddlecraft scene components the Puddlecraft tools edit: the controller, splat instances, drip edges, spouts and Cover Volumes. Registers itself with Puddlecraft while enabled, so renderers and tools never search the scene, and is the selection target that activates the Puddlecraft tool context in the editor.
- PuddlecraftController
Scene controller for Puddlecraft: the bridge between your weather and the rendering. Holds the rain state, the rain preset (the look), which layers get wet and which block rain, the rain cover and the bakes. One per scene.
- PuddlecraftEvents
Things that happen with water in the scene, for audio and gameplay.
- PuddlecraftRain
Draws the falling rain around a camera. Every drop is drawn by the GPU in a single call, so even a downpour of a hundred thousand drops costs the CPU almost nothing.
The drops take their look from the particle system on this object, which never emits particles itself: its material, Start Size (a single value or a range), Start Colour (one or two), and its renderer's Speed Scale, Length Scale and Min Particle Size. Its Max Particles caps the number of drops. The splashes and mist are ordinary particle systems and can be edited freely. How the rain falls (how much, how fast and how far around the camera) is set on the Rain Preset, under Rainfall.
The Rain Preset names this prefab, and Puddlecraft spawns it: around the camera in Play mode, and around the Scene view camera in Edit mode when Preview in Scene View is on. The copies are never saved in the scene. Each copy is drawn only for the camera it falls around, so the Scene view never shows the game camera's rain, and vice versa.
Drops belong to the world, not to the camera. Each one lands exactly on the surface below it, as found in the rain cover map, so drops stop on roofs and awnings instead of falling through them. Moving the camera, quickly, in any direction or by teleporting, reveals drops that were already on their way down. Where a drop lands, the Splashes system emits a splash and the water there gets rings. Drops are visible from Spawn Height above the camera downwards, and reach at least Fallback Depth below it.
- PuddlecraftRendererFeature
URP renderer feature that draws Puddlecraft's rain and puddles. Add it to every renderer that should show them. With Overlay shading it projects the placed puddles onto the scene depth and lights them (darkening, highlights, ripples, reflection probes); with Materials shading it leaves the water to your materials. In the editor, the Scene view can instead draw each splat as a heatmap for placement.
- PuddlecraftRipples
Pushes ripples into standing water: a splash at a point, or a wake along a path. Every camera's ripple simulation picks them up, except on the Low quality tier, which has none. Ripples outside standing water have no visible effect.
- PuddlecraftTracks
Wet tracks on dry ground: footprints and tyre tracks left by something that came out of a puddle. Tracks dry from their edges in.
With Materials shading, tracks merge into the wet ground of Puddlecraft materials, darkening and glossing them the way rain does, and only on the surface they were left on (not on a roof above or a floor below). With Overlay shading, and wherever tracks on two levels overlap, they are drawn over the finished image instead.
Up to Capacity tracks are kept at once; beyond that, the oldest are removed first.
- PuddlecraftWind
The wind Puddlecraft uses, read from the scene's directional Wind Zone. It tilts the rain, blows rain in under roofs and pushes waves across standing water. With no directional Wind Zone there is no wind.
Rotate the Wind Zone to change the direction. Its Main value sets the strength (1 or more is full strength), and its Pulse settings make it gust.
In a player, the Wind Zone is looked up when a scene loads, and again when the one in use is disabled or destroyed. A Wind Zone added at any other time is picked up at the next scene load.
- RainCoverData
Saved rain cover for one scene: a top-down grid of the highest surface over each spot. A point lower than that surface is under cover (a roof, an awning, a bridge) and gets no rain. Baked in the editor with ray tracing against render meshes.
- RainPreset
The look of the rain: puddles, wet surfaces, and the falling rain and spout water (the particle prefabs, and how the rain falls). Create one with Create > Puddlecraft > Rain Preset and assign it to the controller.
The controller holds the weather itself (how hard it rains, how fast puddles fill) and the bakes; the wind comes from the scene's Wind Zone.
- RainSoundscape
Procedural rain: ten frequency bands, from deep rumble to bright hiss, each a pair of stems that crossfade into an endless loop. How loud each band is comes from preset curves (light, medium, heavy, covered) blended by the rain intensity and by whether the listener is under cover. A band's gain is its level cubed.
- RainSpout
A point, or short outlet, that pours water in one direction, such as a drainpipe or gargoyle. The arc and landing point are traced in the editor, so no colliders are needed at runtime. The water itself is drawn by a RainSpoutEffects child (the Puddlecraft Spout Effects prefab).
The flow follows the water coming off the roof. With little water there is no pressure behind the outlet, so it dribbles off the lip as drops. As more water arrives, pressure builds and the water leaves faster and throws further, until a full flow follows the traced arc at full speed. As the roof drains, the flow eases back down to drips.
- RainSpoutEffects
The look of a rain spout's water, built from layers that each suit a different strength of flow. A thin trickle is a glassy stream with a small crown splash; a heavy gush is a white, fanning, fraying stream wrapped in spray, with a churning splash, foam and mist where it lands. How heavily the spout pours (its outlet width times its speed times its current flow) decides which layers show and how strongly. The particles are sized to the outlet.
This component sits on the "Puddlecraft Spout Effects" prefab under a RainSpout. The stream is a lit ribbon that follows the arc the water takes at the spout's current pressure, so it throws further as the flow builds up. When there is too little water for a jet, the spout drips off its lip instead, drawn with the drip material.
Every other layer is a plain Particle System that can be restyled freely; this component only controls where, how often and how large they emit.
- RainState
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.
- RainStem
One frequency band of rain: two stems that crossfade into an endless loop.
- RainfallSettings
The falling rain, spout water and drip-edge water: which particle prefabs and material draw them, and how the rain falls. The prefabs and material hold how it looks (sizes, colours); these settings decide where and how often it falls.
- RealtimeCoverSettings
Settings for the realtime rain cover map.
- SurfaceWetnessSettings
How rain wets the ground the sky reaches, in materials that use Puddlecraft/Lit (Wet), the puddlecraft-wetness Shader Graph node or the PuddlecraftWetness HLSL function: how unevenly it soaks and dries, whether it wets drop by drop, the size of the procedural puddles, and how far rain reaches in under the edge of a roof.
- TextureSplatSettings
Settings for a splat imported from an image: which image, which channel, and how its values map to depth.
Structs
- DripEdge.Impact
Where a drop released from origin lands. Baked in the editor.
- PuddleHit
What PuddleQuery.TryGetPuddleAt found at a position.
- RainSpoutEffects.Layer
One particle layer of the effect, and the range of flows it belongs to.
Enums
- PuddleShading
How puddles reach the screen.
- PuddlecraftQuality
How much Puddlecraft spends on the GPU. Use a lower tier on a renderer for mobile or low-end PCs.
- PuddlecraftResolution
Texels along each side of a camera-centred simulation or map.
- RainCoverMode
Where the rain cover map, the top-down map of what keeps rain off the ground, comes from.
- SplatBlend
How overlapping splats combine.
- SplatChannel
Which channel of an image becomes splat depth.
- SplatShape
Base outline used by procedural splats.
- SplatSource
Where a splat's shape comes from.