materialSpecular
Provides the material's final specular (highlight) color, intelligently sourcing its data from the corresponding properties of different materials (e.g., Phong or PBR).
Core Advantages
Its core advantage is unification and abstraction: it masks the internal differences in how `MeshPhongMaterial` and `MeshStandardMaterial` handle highlight color, providing developers with a single, reliable interface.
Common Uses
Simulating metallic looks in `MeshPhongMaterial` by setting a colored specular highlight.
Representing the white or colored highlights on tinted plastics or gemstones.
Creating iridescent effects (like oil slicks) using a texture map in the PBR specular workflow.
Using a `specularMap` to 'paint' highlight areas on a surface to simulate scratches or wetness.
How to adjust
Configure by modifying material properties in JavaScript. For `MeshPhongMaterial`, adjust `.specular` and `.specularMap`. For `MeshStandardMaterial`, adjust `.specularColor`, `.specularIntensity`, and `.specularColorMap`.
Code Examples
1// In the Phong lighting model, the specular color is multiplied by the lighting result
2const finalSpecular = materialSpecular.mul( light.color ).mul( specularFactor );