<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ModelIO",
  "identifier" : "/documentation/ModelIO/MDLSkyCubeTexture/init(name:channelEncoding:textureDimensions:turbidity:sunElevation:upperAtmosphereScattering:groundAlbedo:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Model I/O"
    ],
    "preciseIdentifier" : "c:objc(cs)MDLSkyCubeTexture(im)initWithName:channelEncoding:textureDimensions:turbidity:sunElevation:upperAtmosphereScattering:groundAlbedo:"
  },
  "title" : "init(name:channelEncoding:textureDimensions:turbidity:sunElevation:upperAtmosphereScattering:groundAlbedo:)"
}
-->

# init(name:channelEncoding:textureDimensions:turbidity:sunElevation:upperAtmosphereScattering:groundAlbedo:)

Initializes a sky cube texture object with the specified parameters.

```
init(name: String?, channelEncoding: MDLTextureChannelEncoding, textureDimensions: vector_int2, turbidity: Float, sunElevation: Float, upperAtmosphereScattering: Float, groundAlbedo: Float)
```

## Parameters

`name`

The [`name`](/documentation/ModelIO/MDLNamed/name) property for the new texture object.

`channelEncoding`

The data format for each channel value per texel—for example, 8-bit integer or 32-bit floating point. For possible values, see [`MDLTextureChannelEncoding`](/documentation/ModelIO/MDLTextureChannelEncoding).

`textureDimensions`

The texel dimensions (width and height) of the texture image.

`turbidity`

The cloudiness or haziness of the simulated sky. See the [`turbidity`](/documentation/ModelIO/MDLSkyCubeTexture/turbidity) property.

`sunElevation`

The sun’s position in the simulated sky. See the [`sunElevation`](/documentation/ModelIO/MDLSkyCubeTexture/sunElevation) property.

`upperAtmosphereScattering`

A factor that influences the color of the simulated sky. See the [`upperAtmosphereScattering`](/documentation/ModelIO/MDLSkyCubeTexture/upperAtmosphereScattering) property.

`groundAlbedo`

A factor that influences the clarity of the simulated sky. See the [`groundAlbedo`](/documentation/ModelIO/MDLSkyCubeTexture/groundAlbedo) property.

## Return Value

A new sky cube texture object.

## Discussion

The newly created texture is a cube texture; that is, its [`isCube`](/documentation/ModelIO/MDLTexture/isCube) property is <doc://com.apple.documentation/documentation/Swift/true>, and its [`dimensions`](/documentation/ModelIO/MDLTexture/dimensions) property reflects the vertical layout of cube faces.

This initializer does not generate texel data; the [`MDLSkyCubeTexture`](/documentation/ModelIO/MDLSkyCubeTexture) class automatically generates data and caches it for reuse when you use one of the [`MDLTexture`](/documentation/ModelIO/MDLTexture) methods listed in Accessing Texture Data.

---

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)