---
title: "init(positions:coefficients:tetrahedronIndices:)"
framework: realitykit
role: symbol
role_heading: Initializer
path: "realitykit/diffuseproberesource/init(positions:coefficients:tetrahedronindices:)"
---

# init(positions:coefficients:tetrahedronIndices:)

Creates a diffuse probe resource from arrays of probe data.

## Declaration

```swift
@MainActor 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

Discussion note: 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.
