<!--
{
  "availability" : [
    "iOS: 8.0.0 - 26.0.0",
    "iPadOS: 8.0.0 - 26.0.0",
    "macCatalyst: 13.1.0 - 26.0.0",
    "macOS: 10.8.0 - 26.0.0",
    "tvOS: 9.0.0 - 26.0.0",
    "visionOS: 1.0.0 - 26.0.0",
    "watchOS: 3.0.0 - 26.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "SceneKit",
  "identifier" : "/documentation/SceneKit/SCNMaterial/locksAmbientWithDiffuse",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "SceneKit"
    ],
    "preciseIdentifier" : "c:objc(cs)SCNMaterial(py)locksAmbientWithDiffuse"
  },
  "title" : "locksAmbientWithDiffuse"
}
-->

# locksAmbientWithDiffuse

A Boolean value that determines whether the material responds identically to both ambient and diffuse lighting. Animatable.

```
var locksAmbientWithDiffuse: Bool { get set }
```

## Discussion

When modeling real-world lighting, a surface is typically considered to have a single “base” color or texture that is visible under both ambient and diffuse light. When this property’s value is <doc://com.apple.documentation/documentation/Swift/false>, SceneKit does not have this limitation: you may use a material’s [`diffuse`](/documentation/SceneKit/SCNMaterial/diffuse) property to provide a color or texture that is visible under direct lighting, and its [`ambient`](/documentation/SceneKit/SCNMaterial/ambient) property to provide a different color or texture for areas not directly illuminated.

When this property’s value is <doc://com.apple.documentation/documentation/Swift/true>, or when using the [`physicallyBased`](/documentation/SceneKit/SCNMaterial/LightingModel-swift.struct/physicallyBased) shading mode, SceneKit uses the [`diffuse`](/documentation/SceneKit/SCNMaterial/diffuse) property for ambient lighting, ignoring the [`ambient`](/documentation/SceneKit/SCNMaterial/ambient) property and ensuring that the material responds identically to both ambient and diffuse light.

The default value for this property is <doc://com.apple.documentation/documentation/Swift/true> for new apps on all platforms. (In OS X v10.9 and earlier, the default value is <doc://com.apple.documentation/documentation/Swift/false>.)

You can animate changes to this property’s value. See [Animating SceneKit Content](/documentation/SceneKit/animating-scenekit-content). Animating this property fades between the results of rendering with each state.

---

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)