A classic skybox glues photos onto the six faces of a cube, but three/addons/objects/Sky.js computes physically based atmospheric scattering (the Preetham model) in a shader instead. Feed it a single sun direction (sunPosition) and it works out Rayleigh scattering (the blue sky) and Mie scattering (the hazy glow around the sun) together, so the sky reddens automatically when the sun sits low and blues out when it’s high.
The shader is painted on the inside face (side: BackSide) of one large cube (BoxGeometry) sized with sky.scale.setScalar(N), so as long as the camera stays inside that cube, it always reads as sky. The sun’s position is given in spherical coordinates: convert elevation and azimuth to radians with THREE.MathUtils.degToRad, build a direction vector with Vector3.setFromSphericalCoords, and assign it to sky.material.uniforms.sunPosition.value.
This demo sweeps elevation between 8° and 32° over time, drifting from a low golden-hour sky toward a higher midday one. Four values — turbidity (atmospheric haze), rayleigh (sky-blue intensity), and mieCoefficient/mieDirectionalG (the shape of the sun’s glow) — tune everything from a clear day to a hazy one.
When to use
A quick sky backdrop without an external HDRI, or animating a day/night or sunrise/sunset transition.