materialAO
Provides the final, calculated Ambient Occlusion (AO) value, which combines the AO map and intensity, used to create soft contact shadows in crevices and corners.
Core Advantages
Highly abstract, encapsulating the logic of AO map sampling and intensity blending into a single node, and seamlessly integrating with the material's `.aoMap` and `.aoMapIntensity` properties without manual Uniform management.
Common Uses
Enhancing PBR material realism by adding contact shadows to indirect lighting.
As a procedural mask to blend textures (like moss) in crevices.
As an inverted emissive mask to make crevices glow.
Directly outputting its value to debug AO maps and UV setups.
How to adjust
Adjust by modifying material properties in JavaScript. Set `material.aoMap` to specify the occlusion texture, and adjust `material.aoMapIntensity` (a number) to control the shadow strength. An intensity of 0 has no effect, while higher values create deeper shadows.
Code Examples
1// Use materialAO as a mix factor to blend in a moss texture in crevices (where AO is low)
2const mossFactor = materialAO.oneMinus(); // 1.0 - materialAO
3const finalColor = mix( stoneColor, mossColor, mossFactor );