Sky and lights
Drop-in sky and lighting rig. Day: a physical (Preetham) sky, a warm sun with soft shadows, a hemisphere fill, an offline environment map baked from the sky and Lightformers (no network), exponential haze and a horizon band that hides the sea and sky seam. Night: a star dome with a moon in the sun direction, cool moonlight, a warm fill standing in for deck floodlights (deckLights) and a dark environment map. Set lights: false to keep your own lights; preview adds a reference pile with chrome and matte spheres standing in the sea.
Installation
Copies environment/sky.tsx and the shared lib/ into src/components/deck-twin/. Needs three, @react-three/fiber and @react-three/drei. See installation for the manual route.
Usage
import { Canvas } from '@react-three/fiber'
import { OrbitControls } from '@react-three/drei'
import { Stage } from './components/deck-twin/lib/stage'
import { Sky } from './components/deck-twin/environment/sky'
export default function Scene() {
return (
<Canvas shadows camera={{ position: [8, 5, 9], fov: 35 }}>
<Stage>
<Sky />
</Stage>
<OrbitControls makeDefault />
</Canvas>
)
}
Props
| Prop | Type | Default | Range |
|---|---|---|---|
mode | "day" | "night" | null | |
elevation | number (°) | null | 2 – 85 |
azimuth | number (°) | null | 0 – 360 |
haze | number | null | 0 – 4 |
deckLights | number | null | 0 – 2 |
stars | boolean | null | |
lights | boolean | null | |
preview | boolean | null | |
...group | position, rotation, scale… |
P&ID
Not drawn on P&IDs or layouts. Plot plans only carry a north arrow; sun path or lighting studies are separate reports.
Scene lighting for the 3D model, not plant equipment.
For agents
Machine-readable entry with props, ranges, defaults and ports:
Or fetch /r/sky.json, or copy a ready-made instruction:
Add the Deck Twin "Sky and lights" component to this project. Run `npx -y https://decktwin.com/cli/deck-twin-0.2.2.tgz add sky` (it copies the file and the shared lib into src/components/deck-twin/), then `npx -y https://decktwin.com/cli/deck-twin-0.2.2.tgz info sky` for its props, ranges and ports. Render <Sky /> inside a React Three Fiber <Canvas shadows>, wrapped in <Stage> from src/components/deck-twin/lib/stage. Set props from my data (metres, NPS in inches, ASME class) and leave the rest at defaults. Install three, @react-three/fiber, @react-three/drei and @types/three if they're missing. Full guide: https://decktwin.com/skill/SKILL.md