Creates a sky material from atmosphere settings; only the values you give are applied over the defaults.
inclination from -0.5 to 0.5 lifts the sun from the horizon and azimuth from 0 to 1 turns
it around the sky; turbidity adds haze and luminance sets the overall brightness.
The atmosphere settings and the sun placement
The sky material
const sky = bitbybit.babylon.material.skyMaterial.create({ luminance: 1, turbidity: 10, rayleigh: 2, mieCoefficient: 0.005, mieDirectionalG: 0.8, distance: 500, inclination: 0.49, azimuth: 0.25, sunPosition: [0, 100, 100], useSunPosition: false, cameraOffset: [0, 0, 0], up: [0, 1, 0], dithering: false });
const dome = bitbybit.babylon.meshBuilder.createSphere({ diameter: 1000, segments: 32, sideOrientation: Bit.Inputs.BabylonMesh.sideOrientationEnum.backside, enableShadows: false });
bitbybit.babylon.mesh.setMaterial({ babylonMesh: dome, material: sky, includeChildren: false });
Reads the overall brightness of a sky material.
The material
The luminance
Reads how hazy a sky material's air is.
The material
The turbidity
Reads the Rayleigh scattering strength of a sky material, the setting behind its blue.
The material
The Rayleigh value
Reads how much haze a sky material has around the sun.
The material
The Mie coefficient
Reads how tightly a sky material's haze glow gathers around the sun.
The material
The Mie directional value
Reads how far the sky dome sits from the camera in a sky material.
The material
The distance
Reads how high the sun stands in a sky material, from -0.5 to 0.5.
The material
The inclination
Reads where around the horizon the sun stands in a sky material, from 0 to 1.
The material
The azimuth
Reads the sun direction of a sky material; when useSunPosition is off it reflects the
inclination and azimuth.
The material
The sun position vector
Reads whether a sky material places the sun from sunPosition rather than from inclination
and azimuth.
The material
True when the explicit sun position is used
Reads the horizon offset vector of a sky material.
The material
The offset vector
Reads the direction a sky material treats as up.
The material
The up vector
Reads whether a sky material dithers its gradients to hide color banding.
The material
True when dithering is on
Changes the overall brightness of a sky material, between 0 and 1.
The material and the luminance
Changes how hazy a sky material's air is; more haze whitens the sky and spreads the sun's glow.
The material and the turbidity
Changes how strongly a sky material scatters light in the way that makes a clear sky blue; higher is a deeper, brighter blue.
The material and the Rayleigh value
Changes how much haze a sky material has around the sun, between 0 and 0.1; more makes a wider, whiter glow.
The material and the Mie coefficient
Changes how tightly a sky material's haze glow gathers around the sun; values near 1 make a small bright halo, lower values spread it.
The material and the Mie directional value
Changes how far the sky dome sits from the camera in a sky material, which changes how the horizon reads.
The material and the distance
Changes how high the sun stands in a sky material, from -0.5 below the horizon through 0 at
the horizon to 0.5 overhead; ignored while useSunPosition is on.
The material and the inclination
Changes where around the horizon the sun stands in a sky material, from 0 to 1 for a full
turn; ignored while useSunPosition is on.
The material and the azimuth
Places the sun of a sky material at an explicit direction vector; it takes effect only while
useSunPosition is on, otherwise inclination and azimuth decide.
The material and the sun position vector
Chooses whether a sky material places the sun from sunPosition, when true, or from
inclination and azimuth, when false.
The material and the flag
Shifts the horizon of a sky material by an offset vector, so the sky can sit higher or lower relative to the camera.
The material and the offset vector
Changes which direction a sky material treats as up, normally [0, 1, 0]; change it for
scenes that use another axis as up.
The material and the up vector
Turns dithering on or off for a sky material; on, it adds fine noise that hides color banding in smooth gradients.
The material and the flag
A procedural daytime sky computed from atmosphere settings rather than an image: where the sun is, how hazy the air is and how bright the sky glows. Put the material on a large inside-out box or sphere around the scene and move the sun with
inclinationandazimuth, or with an explicitsunPosition.