Light Types
Filament supports three main light types, each serving different purposes in scene illumination.Directional Lights
Directional lights have a direction but no position. All light rays are parallel and come from infinitely far away, making them ideal for simulating sunlight.- No falloff over distance
- Can cast shadows
- Intensity specified in lux (lumen/m²)
- Type::SUN also draws a sun disk in the sky
- Only one directional light is fully supported per scene
Point Lights
Point lights emit light from a position in all directions. The intensity diminishes with the inverse square of the distance.- Have a position but emit in all directions
- Intensity specified in lumens (luminous power)
- Falloff distance defines sphere of influence
- Cannot cast shadows
- Multiple point lights supported
Spot Lights
Spot lights are similar to point lights but emit light in a cone defined by inner and outer angles.- Have both position and direction
- Defined by inner and outer cone angles
- Can cast shadows (Type::SPOT and Type::FOCUSED_SPOT)
- Type::FOCUSED_SPOT: physically correct
- Type::SPOT: decouples illumination from cone angle for artistic control
Light Intensity
Filament uses physically-based units for light intensity:Directional Lights
- Measured in lux (lumen/m²)
- Sun illuminance: ~100,000 lux
- Overcast day: ~1,000 lux
- Indoor office: ~300-500 lux
Point and Spot Lights
- Measured in lumens (total luminous power)
- Can also use candela (luminous intensity)
- Set from wattage with efficiency:
EFFICIENCY_INCANDESCENT: 2.2%EFFICIENCY_HALOGEN: 7.0%EFFICIENCY_FLUORESCENT: 8.7%EFFICIENCY_LED: 11.7%
Light Color
Light color is specified in linear sRGB space:Light Channels
Lights can be assigned to channels (0-7) for selective rendering:Updating Lights
Light properties can be modified at runtime:Performance Considerations
General Guidelines
- Prefer spot lights to point lights when possible
- Use smallest feasible outer cone angle for spot lights
- Minimize falloff distance for point and spot lights
- Avoid overlapping light influence spheres
- Hundreds of non-overlapping lights can be handled efficiently
- Overlapping lights significantly impact performance
Shadow Casting
- Only directional and spot lights can cast shadows
- Shadow casting has significant performance cost
- Limit number of shadow-casting lights
- See Shadows documentation for optimization
Sun Configuration
For Type::SUN lights, additional parameters control the sun’s appearance:Destroying Lights
Lights must be explicitly destroyed:The maximum number of lights per scene depends on GPU capabilities, but Filament supports up to 2048 lights per Engine instance.
Next Steps
Shadows
Configure shadow mapping for realistic lighting
IBL
Set up image-based lighting for environment illumination