Skip to content
Work in progress. These docs describe Spawnite at launch, and some parts are still being built.

WaterOptions

The look of the engine’s water, a pond’s and the sea’s alike.

Property Type Default value Description
color? ColorRepresentation "#1f6f8b" The deep water’s colour.
directSpecularIntensity? number 1 How much of the lights’ highlight the water draws, the sun’s and every other light’s, from 0, none, to 1, the physically based one: lower it to calm a low sun’s glare on rough water. The sky’s reflection is unchanged.
facetContrast? number 0.07 How far each facet’s tint strays from the water’s colour, lighter or darker, from 0 to 1: 0.07 is a faint mosaic, 0.3 reads as cut glass. Only drawn where facetSize is above 0.
facetSize? number 0 The size in metres of the flat facets the surface breaks into, each tilting as the waves pass, for a low-poly look; 0 keeps the surface smooth.
foamColor? ColorRepresentation "#f0f8ff" The foam’s colour along the shore.
foamDepth? number 0.22 The metres of depth the shore’s broken foam reaches out to, past the solid line at the water’s edge: on a beach that falls a metre in six, 0.4 lays a skirt of foam about 2.4 m wide. 0 keeps the solid line alone. A pond’s depth is its own, 10 m for the whole of its plane, so there 0.4 reaches 4 % of the way in.
horizonColor? ColorRepresentation the deep color, which draws no band The colour the deep water turns to toward the horizon, where the view meets the water at a low angle, as a sea darkens to azure far out; the shallows keep their own colour. Stylized Water 2 names its own horizonColor.
rippleSize? number 1, and the sea’s 3 Metres across the ripples that drift over the surface’s colour, two layers of noise that lift it at a crest: 1 is a pond’s, 4 a lake’s. Unity HDRP calls its own small band ripples.
rippleSpeed? number 1 How fast the ripples drift: 1 is calm, 0 holds them still.
shallowColor? ColorRepresentation "#5bb3b7" The colour the water takes where it is shallowest, at its shore.
sparkleConeHalfAngleRadians? number Math.acos(0.992), about 0.127 How far a glint’s mirror may point from the light and still flash, in radians: the edge where its flash fades to nothing, at its brightest pointing straight at the light. A smaller angle makes each flash more selective, so fewer glints show and the band of them can narrow toward the light’s mirror; the band’s reach is about this and twice sparkleSpreadRadians either side of it, before the view’s angle stretches it across the water. 0.001 or more and under Math.PI / 2.
sparkleGlowColor? ColorRepresentation "#ffffff" The glow’s colour, its own rather than the light’s, so a gold glow stays gold under a warm sun: a white glow round a coloured light’s star stays white. The star itself keeps the light’s colour.
sparkleGlowIntensity? number 0 How strongly each glint glows: a soft four-rayed light round its star, the rays reaching further as its flash peaks, that takes the water’s own colour’s place under it in sparkleGlowColor, as a painted glint covers the sea, so the colour reads over a deep blue that added light would grey. It scales with sparkleIntensity and the light’s strength, so it dims under the moon, and saturates: past the point where the glow covers the water, more draws no brighter. The sea’s highlight, its sky and, in clear water, the bed still show through it, and foam keeps its own colour. 0 draws the star alone. 0 to 100.
sparkleGlowScale? number 1 How far each glint’s glow reaches, as a multiple of its own: at 1 it fades out inside its star’s cell, and at 2 it reaches the middles of the next cells, spanning sparkleSize times this. So a strip of small cells draws many stars as large as fewer big ones. Above 1 each pixel inside the glints’ band reads its neighbours’ stars: up to 2, the three nearest; above 2, all eight, which costs more again. A change across 1 or 2 compiles the water’s shader anew. The glints still fade by their cell’s pixels, so smaller cells fade nearer the camera. Only drawn where sparkleGlowIntensity is above 0. 1 to 3.
sparkleIntensity? number 0 How bright the glints are where the sun or the moon mirrors in the water: twinkling four-pointed stars in a band toward the light. 0 draws none; 1 is the reference, near white under a day’s sun at the engine’s exposure. Each takes its light’s colour and strength, and adds to the water after directSpecularIntensity, which scales the ordinary highlight alone. A glint is a small facet of its own tilt that flashes as it catches the light, so none show where the light stands too far from the view’s mirror for sparkleSpreadRadians.
sparkleSize? number 0.5 Metres between glints: one star a cell of this size, the star growing with it, so a larger size draws fewer, larger stars. A star draws only where its cell spans at least two pixels, so a far view wants a larger size.
sparkleSpreadRadians? number 0.16 The most each glint’s facet leans from straight up, in radians, whatever the waves and the facets: the band of glints spans about twice it either side of the light’s mirror, so raise it for a wider band, lower it for a tight one. 0 or more and under Math.PI / 2.
waveDirectionRadians? number the look's wind's direction, and 0 without one Radians the waves run toward, turned from +z toward +x as the look’s wind’s directionRadians reads: 0 runs along +z.
waveHeight? number 0, and the sea’s 0.25 Metres from trough to crest of a typical wave, as a sea’s significant height reads: four times the surface’s spread about its level. The rare highest crest, where all four waves meet, stands about 1.35 times it over its trough, which a dock’s clearance needs. 0 keeps the surface flat. The mesh needs vertices to move: the sea has its own, and a WaterMaterial’s plane takes segments about a metre apart.
waveLength? number 12 Metres crest to crest of the longest wave: the other three run shorter, the shortest at about half of it.
waveSpeed? number 1 How fast the waves run, as a share of deep water’s pace for their length, so a longer wave runs faster, as at sea: 1 is the sea’s own, 0 holds them still. The waves run on the world’s clock, so a float a system moves reads the same waves the page draws: the devtools’ pause holds them and its speed runs them faster. A change of the speed, the length or the direction while the world runs jumps the surface once to where the new values put it.