Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commitdd348ac6c3

README.md

Island lagoon

The spectral ocean against a shore: an island rising out of a lagoon at a beach's slope, so one view holds every water depth from the waterline to open blue.

Load @builtin::systems.oceans.demo.island_lagoon with the scene.load tool, then walk down to the water.

What it shows

  • Depth as colour. The water column's absorption is per-channel, so the sea reads turquoise where the sand is a metre or two down and turns blue as the bed falls away. The gradient is the ground's own slope seen through the water, not a painted ramp.
  • The seabed through the surface. The bed is refracted, attenuated over the real path the light travelled, and lit by the caustic web the surface focuses onto it.
  • Shoaling. Chop dies as the bottom comes up — geometry and shading together — so the shallows are glassy while the open water stays crisp.
  • The shoreline. Wash along the waterline, foam that clings to breaking crests, and a sea that meets the sand instead of ending at it.
  • A sun path over water. The glitter track is the surface's own slope statistics under this scene's directional light.

Things to try

local Presets = require("@builtin::systems.oceans.modules.oceanPresets")
Presets.names()                                 -- nine sea states, calm to gale
entity("lagoonSea").Ocean.preset = "gale"       -- the same shore under a gale
entity("lagoonSea").Ocean.seaLevel = 2.0        -- flood the beach

A preset is a whole sea — spectrum, swell, colour, all three foam layers and the seabed — so swapping one changes the water and leaves the island, the light and the sky exactly where they are.

What it is made of

  • @builtin::systems.oceans.demo.islandLagoon — the terrain graph the island is baked from.
  • Ocean — the sea, bound to that landscape through its ground field.
  • A directional sun, an ambient fill, a ProceduralSky and a PhysicalAtmosphere. The ocean carries no light of its own: every reflection, the glitter and the foam's shading come from these.