Contents

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

Initializes a sky cube texture object with the specified parameters.

Declaration

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

Parameters

  • name:

    The 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.

  • textureDimensions:

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

  • turbidity:

    The cloudiness or haziness of the simulated sky. See the Turbidity property.

  • sunElevation:

    The sun’s position in the simulated sky. See the Sunelevation property.

  • upperAtmosphereScattering:

    A factor that influences the color of the simulated sky. See the Upperatmospherescattering property.

  • groundAlbedo:

    A factor that influences the clarity of the simulated sky. See the Groundalbedo property.

Return Value

A new sky cube texture object.

Discussion

The newly created texture is a cube texture; that is, its isCube property is true, and its dimensions property reflects the vertical layout of cube faces.

This initializer does not generate texel data; the MDLSkyCubeTexture class automatically generates data and caches it for reuse when you use one of the MDLTexture methods listed in Accessing Texture Data.