Enumeration: IntensityMode
Specifies the physical units used to measure light intensity in 3D scenes.
The IntensityMode enum determines how light intensity values are interpreted, allowing for physically-based lighting using real-world units. This enables more accurate and consistent lighting across different scenes and rendering environments.
Example
// Creating a physically accurate light with luminous intensity in candela
const spotLight = new BABYLON.SpotLight("spot", position, direction, angle, exponent, scene);
spotLight.intensity = 1500; // 1500 candela
spotLight.intensityMode = IntensityMode.INTENSITYMODE_LUMINOUSINTENSITY;
// Setting up a light with illuminance for architectural visualization
const sunLight = new BABYLON.DirectionalLight("sun", direction, scene);
sunLight.intensity = 100000; // 100,000 lux (bright sunlight)
sunLight.intensityMode = IntensityMode.INTENSITYMODE_ILLUMINANCE;
Enumeration Members
INTENSITYMODE_AUTOMATIC
INTENSITYMODE_AUTOMATIC:
0
Automatically selects the appropriate intensity unit based on light type:
- Point/spot lights use luminous intensity (candela)
- Directional lights use illuminance (lux)
This is the default mode that provides sensible units for each light type.
INTENSITYMODE_ILLUMINANCE
INTENSITYMODE_ILLUMINANCE:
3
Measures intensity in lux (lx), the SI unit of illuminance.
This unit (lumens per square meter) describes the amount of light that falls on a surface, making it ideal for directional lights and environmental lighting.
INTENSITYMODE_LUMINANCE
INTENSITYMODE_LUMINANCE:
4
Measures intensity in nits (cd/m²), the unit of luminance.
This unit describes the amount of light emitted from a surface per unit area, useful for emissive materials and display-related lighting.
INTENSITYMODE_LUMINOUSINTENSITY
INTENSITYMODE_LUMINOUSINTENSITY:
1
Measures intensity in candela (cd), the SI unit of luminous intensity.
This unit (lumens per steradian) describes the amount of light emitted in a specific direction, making it ideal for spot and point lights.
INTENSITYMODE_LUMINOUSPOWER
INTENSITYMODE_LUMINOUSPOWER:
2
Measures intensity in lumens (lm), the SI unit of luminous flux.
This unit describes the total amount of visible light emitted in all directions, useful for omnidirectional light sources.