look
The cold northern afternoon: the sun, the ambient, the sky and the colour of the water. One idempotent call.
look
The cold northern afternoon: the sun, the ambient, the sky and the colour of the water. One idempotent call.
local Look = require("game.sea.look")
Look.apply(NPB) -- sun, ambient, sky, ocean, environment probe
Look.wind() -- { direction, speed } the sea is running under
game.boot builds a sun, an ambient light, a procedural sky and one ocean before
any slice runs, because the player's junk has to float on something. This module
takes those four over and states what they are: a Baltic in autumn under thin
overcast, an hour or two before dusk.
Every value is assigned rather than accumulated, so apply can be re-run against
a live scene while a number is being tuned, and a scene reload lands on exactly
the same sea as the last one.
The three decisions worth knowing before changing anything
The scene carries no HeightFog, deliberately. At any non-zero density it
lays a flat pale sheet over the near ~250 m of water with a straight seam across
the middle of the frame, and leaves the water beyond it untouched
(OrigoZero/zero#8382). Distance here comes instead from a sky whose lower
hemisphere is nearly as bright as its horizon, and from the ocean's own
fresnel.fadeStart settle held off until 320 m.
SUN.direction is a measured bearing, not a taste. The procedural sky places
its sun disc from timeOfDay and cannot be told to draw none
(OrigoZero/zero#8384), so the light is aimed at where that disc actually is at
timeOfDay = 16 — elevation 17 degrees, bearing south-east. Change one and the
sun splits in two: a glitter path running out of one bearing and a disc drawn at
another.
The environment probe is captured last. Every wave face reflects the scene's probes, so the sky has to be captured after it is the sky this scene wants.
Who consumes it
game.sea only. Look.wind() is public for anything that should agree with the
sea state — a wake, a pennant, a drifting hulk.
Scoped to this part · feeds back into the world's score.