<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/DiffuseProbeResource/init(positions:coefficients:tetrahedronIndices:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation20DiffuseProbeResourceC9positions12coefficients18tetrahedronIndicesACSays5SIMD3VySfGG_Says11InlineArrayVy$2_s5SIMD4VySfGGGSayANys6UInt16VGGtKcfc"
  },
  "title" : "init(positions:coefficients:tetrahedronIndices:)"
}
-->

# init(positions:coefficients:tetrahedronIndices:)

Creates a diffuse probe resource from arrays of probe data.

```
nonisolated convenience init(positions: [SIMD3<Float>], coefficients: [InlineArray<3, SIMD4<Float>>], tetrahedronIndices: [SIMD4<UInt16>]) throws
```

## Parameters

`positions`

The 3D positions of each probe, in local space relative to the probe group
entity. Must contain at least 4 positions to form a valid tetrahedral mesh.

`coefficients`

Spherical harmonic coefficients for each probe. Each entry contains
exactly 3 `SIMD4<Float>` values — one per RGB channel, ordered as
`(L0, L1.x, L1.y, L1.z)`. Must have the same count as `positions`.

`tetrahedronIndices`

Indices defining the tetrahedral mesh connectivity. Each
`SIMD4<UInt16>` references 4 probe positions by index into
`positions`. Must contain at least 1 tetrahedron, and all indices
must be less than `positions.count`.

## Discussion> Throws: An error if the data is invalid — for example, if `positions.count` and
> `coefficients.count` differ, if fewer than 4 probes are provided, or if any
> tetrahedral index is out of bounds.

---

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)