<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ModelIO",
  "identifier" : "/documentation/ModelIO/MDLAsset/placeLightProbes(withDensity:heuristic:using:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Model I/O",
      "ModelIO"
    ],
    "preciseIdentifier" : "c:objc(cs)MDLAsset(cm)placeLightProbesWithDensity:heuristic:usingIrradianceDataSource:"
  },
  "title" : "placeLightProbes(withDensity:heuristic:using:)"
}
-->

# placeLightProbes(withDensity:heuristic:using:)

Automatically creates and places light probes for use in illuminating a scene.

```
class func placeLightProbes(withDensity value: Float, heuristic type: MDLProbePlacement, using dataSource: any MDLLightProbeIrradianceDataSource) -> [MDLLightProbe]
```

## Parameters

`value`

A value that determines the coarseness or fineness with which to evaluate the scene. Lower values evaluate fewer positions, resulting in fewer light probes and lower fidelity. Higher values evaluate more positions, resulting in higher fidelity at increased computational cost.

`type`

An option that determine how Model I/O uses the data source to position light probes.

`dataSource`

A custom object that provides information about the scene to be evaluated.

## Return Value

An array of light probe objects for use in the scene.

## Discussion

When you call this method, you must pass a custom object implementing the [`MDLLightProbeIrradianceDataSource`](/documentation/ModelIO/MDLLightProbeIrradianceDataSource) protocol. Model I/O queries this object to determine how to place light probes.

When you use the [`MDLProbePlacement.uniformGrid`](/documentation/ModelIO/MDLProbePlacement/uniformGrid) heuristic,  Model I/O simply divides the [`boundingBox`](/documentation/ModelIO/MDLLightProbeIrradianceDataSource/boundingBox) region your data source provides into `value` units in each dimension, and creates an array of light probe objects to fill each position in the resulting grid.

When you use the [`MDLProbePlacement.irradianceDistribution`](/documentation/ModelIO/MDLProbePlacement/irradianceDistribution) heuristic, Model I/O uses the same grid to sample information about the lighting conditions in your scene (by calling the [`sphericalHarmonicsLevel`](/documentation/ModelIO/MDLLightProbeIrradianceDataSource/sphericalHarmonicsLevel) and [`sphericalHarmonicsCoefficients(atPosition:)`](/documentation/ModelIO/MDLLightProbeIrradianceDataSource/sphericalHarmonicsCoefficients(atPosition:)) methods of your data source), then creates and positions light probes to optimally account for differences in lighting conditions across the scene.

---

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)