Description:
Lighting is key to realism. In Three.js, real-time lighting can be achieved via a mix of techniques:
- Light Probes (LightProbe & SH Coefficients): Low-cost ambient light sampling.
- Baked Lighting (via Blender/3D Tool): Precomputed light stored in texture maps, used for static scenes.
- Image-Based Lighting (IBL): Uses HDR environment maps for reflections and soft lighting.
- Physical Lighting: Uses physically-based rendering (PBR) standards with
MeshStandardMaterialorMeshPhysicalMaterial.
These techniques can be mixed and matched for optimal visuals and performance.
Use Cases:
- Realistic environments (labs, indoors, outdoor daylight).
- XR experiences with dynamic weather or day-night cycles.
- Scenes requiring reflection accuracy (robotics simulations, mirrors, water).
Advantages:
- Boosts realism without performance penalties (baking/IBL).
- Light probes + IBL are suitable for mobile/VR.
- More consistent lighting across scenes when using HDRIs.
Limitations:
- Baked lighting cannot adapt to moving lights or shadows.
- Requires Blender/3D tool expertise.
- Real-time shadows can be expensive on large scenes.