<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: -",
    "macOS: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/GaussianSplatResource/BufferResource-swift.struct/init(count:position:scale:rotation:opacity:sphericalHarmonics:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation21GaussianSplatResourceC06BufferE0V5count8position5scale8rotation7opacity18sphericalHarmonicsAESi_AC0F10DescriptorVA4M_AC23SphericalHarmonicDegreeOttKcfc"
  },
  "title" : "init(count:position:scale:rotation:opacity:sphericalHarmonics:)"
}
-->

# init(count:position:scale:rotation:opacity:sphericalHarmonics:)

Creates a buffer resource from descriptors for each per-splat property.

```
@MainActor init(count: Int, position: GaussianSplatResource.BufferDescriptor, scale: GaussianSplatResource.BufferDescriptor, rotation: GaussianSplatResource.BufferDescriptor, opacity: GaussianSplatResource.BufferDescriptor, sphericalHarmonics: (GaussianSplatResource.BufferDescriptor, GaussianSplatResource.SphericalHarmonicDegree)) throws
```

## Parameters

`count`

The number of splats to render.

`position`

The descriptor for each splat’s position.

`scale`

The descriptor for each splat’s scale.

`rotation`

The descriptor for each splat’s rotation.

`opacity`

The descriptor for each splat’s opacity.

`sphericalHarmonics`

The descriptor for each splat’s spherical
harmonic coefficients, paired with the degree those coefficients
represent.

## Discussion> Throws: An error if a descriptor is invalid or its buffer is too
> small for the splat count, or if the count exceeds the maximum the
> platform supports.

---

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)