Instance Method


Initializes a sky cube texture object with the specified parameters.


- (instancetype)initWithName:(NSString *)name channelEncoding:(MDLTextureChannelEncoding)channelEncoding textureDimensions:(vector_int2)textureDimensions turbidity:(float)turbidity sunElevation:(float)sunElevation upperAtmosphereScattering:(float)upperAtmosphereScattering groundAlbedo:(float)groundAlbedo;



The name property for the new texture object.


The data format for each channel value per texel—for example, 8-bit integer or 32-bit floating point. For possible values, see MDLTextureChannelEncoding.


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


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


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


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


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

Return Value

A new sky cube texture object.


The newly created texture is a cube texture; that is, its isCube property is YES, 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.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software