<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/PhysicallyBasedMaterial/ambientOcclusion-swift.property",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation23PhysicallyBasedMaterialV16ambientOcclusionAC07AmbientG0Vvp"
  },
  "title" : "ambientOcclusion"
}
-->

# ambientOcclusion

The ambient occlusion values for a material.

```
var ambientOcclusion: PhysicallyBasedMaterial.AmbientOcclusion { get set }
```

## Discussion

Ambient occlusion represents the entity’s exposure to ambient light.

Specify ambient occlusion using a UV-mapped image called an *ambient
occlusion map*. A value of black (`0.0`) represents parts of the model
that receive less ambient light because that part of the model is a
crevice, dent, or recessed area, or because another part of the same
entity is preventing ambient light from reaching it. Ambient occlusion
values of white (`1.0`) represent flat portions of the model that
receive full ambient light. You generate ambient occlusion maps using a
3D software package.

The following code loads an ambient occlusion map:

```swift if let aoResource = try? TextureResource.load(named:
"entity_ao") {
    let aoMap = MaterialParameters.Texture(aoResource)
    material.emissiveColor = .init(texture: aoMap)
} ```
```

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)