import type { Context } from "../../../context"; import { SkyMaterial } from "@babylonjs/materials"; import * as Inputs from "../../../inputs"; /** * 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 `inclination` and `azimuth`, or with an explicit * `sunPosition`. */ export declare class BabylonMaterialSky { private readonly context; constructor(context: Context); /** * 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. * @param inputs - The atmosphere settings and the sun placement * @returns The sky material * @group create * @shortname sky material * @example * ```typescript * 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 }); * ``` */ create(inputs: Inputs.BabylonMaterial.SkyMaterialDto): SkyMaterial; /** * Changes the overall brightness of a sky material, between 0 and 1. * @param inputs - The material and the luminance * @group set * @shortname set luminance */ setLuminance(inputs: Inputs.BabylonMaterial.LuminanceDto): void; /** * Changes how hazy a sky material's air is; more haze whitens the sky and spreads the sun's * glow. * @param inputs - The material and the turbidity * @group set * @shortname set turbidity */ setTurbidity(inputs: Inputs.BabylonMaterial.TurbidityDto): void; /** * Changes how strongly a sky material scatters light in the way that makes a clear sky blue; * higher is a deeper, brighter blue. * @param inputs - The material and the Rayleigh value * @group set * @shortname set rayleigh */ setRayleigh(inputs: Inputs.BabylonMaterial.RayleighDto): void; /** * Changes how much haze a sky material has around the sun, between 0 and 0.1; more makes a * wider, whiter glow. * @param inputs - The material and the Mie coefficient * @group set * @shortname set mieCoefficient */ setMieCoefficient(inputs: Inputs.BabylonMaterial.MieCoefficientDto): void; /** * 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. * @param inputs - The material and the Mie directional value * @group set * @shortname set mieDirectionalG */ setMieDirectionalG(inputs: Inputs.BabylonMaterial.MieDirectionalGDto): void; /** * Changes how far the sky dome sits from the camera in a sky material, which changes how the * horizon reads. * @param inputs - The material and the distance * @group set * @shortname set distance */ setDistance(inputs: Inputs.BabylonMaterial.DistanceDto): void; /** * 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. * @param inputs - The material and the inclination * @group set * @shortname set inclination * @example * ```typescript * bitbybit.babylon.material.skyMaterial.setInclination({ material: sky, inclination: 0.1 }); * ``` */ setInclination(inputs: Inputs.BabylonMaterial.InclinationDto): void; /** * 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. * @param inputs - The material and the azimuth * @group set * @shortname set azimuth */ setAzimuth(inputs: Inputs.BabylonMaterial.AzimuthDto): void; /** * 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. * @param inputs - The material and the sun position vector * @group set * @shortname set sun position * @example * ```typescript * bitbybit.babylon.material.skyMaterial.setUseSunPosition({ material: sky, useSunPosition: true }); * bitbybit.babylon.material.skyMaterial.setSunPosition({ material: sky, sunPosition: [0, 50, 100] }); * ``` */ setSunPosition(inputs: Inputs.BabylonMaterial.SunPositionDto): void; /** * Chooses whether a sky material places the sun from `sunPosition`, when true, or from * inclination and azimuth, when false. * @param inputs - The material and the flag * @group set * @shortname set use sun position */ setUseSunPosition(inputs: Inputs.BabylonMaterial.UseSunPositionDto): void; /** * Shifts the horizon of a sky material by an offset vector, so the sky can sit higher or lower * relative to the camera. * @param inputs - The material and the offset vector * @group set * @shortname set camera offset */ setCameraOffset(inputs: Inputs.BabylonMaterial.CameraOffsetDto): void; /** * Changes which direction a sky material treats as up, normally `[0, 1, 0]`; change it for * scenes that use another axis as up. * @param inputs - The material and the up vector * @group set * @shortname set up */ setUp(inputs: Inputs.BabylonMaterial.UpDto): void; /** * Turns dithering on or off for a sky material; on, it adds fine noise that hides color banding * in smooth gradients. * @param inputs - The material and the flag * @group set * @shortname set dithering */ setDithering(inputs: Inputs.BabylonMaterial.DitheringDto): void; /** * Reads the overall brightness of a sky material. * @param inputs - The material * @returns The luminance * @group get * @shortname get luminance */ getLuminance(inputs: Inputs.BabylonMaterial.SkyMaterialPropDto): number; /** * Reads how hazy a sky material's air is. * @param inputs - The material * @returns The turbidity * @group get * @shortname get turbidity */ getTurbidity(inputs: Inputs.BabylonMaterial.SkyMaterialPropDto): number; /** * Reads the Rayleigh scattering strength of a sky material, the setting behind its blue. * @param inputs - The material * @returns The Rayleigh value * @group get * @shortname get rayleigh */ getRayleigh(inputs: Inputs.BabylonMaterial.SkyMaterialPropDto): number; /** * Reads how much haze a sky material has around the sun. * @param inputs - The material * @returns The Mie coefficient * @group get * @shortname get mieCoefficient */ getMieCoefficient(inputs: Inputs.BabylonMaterial.SkyMaterialPropDto): number; /** * Reads how tightly a sky material's haze glow gathers around the sun. * @param inputs - The material * @returns The Mie directional value * @group get * @shortname get mieDirectionalG */ getMieDirectionalG(inputs: Inputs.BabylonMaterial.SkyMaterialPropDto): number; /** * Reads how far the sky dome sits from the camera in a sky material. * @param inputs - The material * @returns The distance * @group get * @shortname get distance */ getDistance(inputs: Inputs.BabylonMaterial.SkyMaterialPropDto): number; /** * Reads how high the sun stands in a sky material, from -0.5 to 0.5. * @param inputs - The material * @returns The inclination * @group get * @shortname get inclination */ getInclination(inputs: Inputs.BabylonMaterial.SkyMaterialPropDto): number; /** * Reads where around the horizon the sun stands in a sky material, from 0 to 1. * @param inputs - The material * @returns The azimuth * @group get * @shortname get azimuth */ getAzimuth(inputs: Inputs.BabylonMaterial.SkyMaterialPropDto): number; /** * Reads the sun direction of a sky material; when `useSunPosition` is off it reflects the * inclination and azimuth. * @param inputs - The material * @returns The sun position vector * @group get * @shortname get sun position */ getSunPosition(inputs: Inputs.BabylonMaterial.SkyMaterialPropDto): Inputs.Base.Vector3; /** * Reads whether a sky material places the sun from `sunPosition` rather than from inclination * and azimuth. * @param inputs - The material * @returns True when the explicit sun position is used * @group get * @shortname get use sun position */ getUseSunPosition(inputs: Inputs.BabylonMaterial.SkyMaterialPropDto): boolean; /** * Reads the horizon offset vector of a sky material. * @param inputs - The material * @returns The offset vector * @group get * @shortname get camera offset */ getCameraOffset(inputs: Inputs.BabylonMaterial.SkyMaterialPropDto): Inputs.Base.Vector3; /** * Reads the direction a sky material treats as up. * @param inputs - The material * @returns The up vector * @group get * @shortname get up */ getUp(inputs: Inputs.BabylonMaterial.SkyMaterialPropDto): Inputs.Base.Vector3; /** * Reads whether a sky material dithers its gradients to hide color banding. * @param inputs - The material * @returns True when dithering is on * @group get * @shortname get dithering */ getDithering(inputs: Inputs.BabylonMaterial.SkyMaterialPropDto): boolean; }