google / bigwheels

BigWheels is a cross-platform, API agnostic framework to build graphics applications.
Apache License 2.0
94 stars 37 forks source link

[glTF] Support occlusion texture #461

Open footballhead opened 7 months ago

footballhead commented 7 months ago

occlusionTexture is loaded and passed to the StandardMaterial but is never referenced.

The purpose is outlined in 3.9.3:

it indicates areas that receive less indirect lighting from ambient sources. Direct lighting is not affected. The red channel of the texture encodes the occlusion value, where 0.0 means fully-occluded area (no indirect lighting) and 1.0 means not occluded area (full indirect lighting). Other texture channels (if present) do not affect occlusion.

The texture binding for occlusion maps MAY optionally contain a scalar strength value that is used to reduce the occlusion effect. When present, it affects the occlusion value as 1.0 + strength * (occlusionTexture - 1.0).