One Logo Pool Ball
RealityFoundation · IOS API REFERENCE

TextureResource.CreateOptions

struct · iOS 15.0+ · SDK 27.1

struct CreateOptions

An object that holds texture resource creation options.

Members (8)

get · iOS 18.0+

compression

TypeScript
get compression(): Promise<TextureResource_Compression>
Swift declaration
var compression: TextureResource.Compression
set · iOS 18.0+

compression

TypeScript
setCompression(value: TextureResource_Compression): Promise<void>
Swift declaration
var compression: TextureResource.Compression
get · iOS 15.0+

mipmapsMode

TypeScript
get mipmapsMode(): Promise<TextureResource_MipmapsMode>
Swift declaration
var mipmapsMode: TextureResource.MipmapsMode

Whether the texture resource automatically generates mipmaps.

set · iOS 15.0+

mipmapsMode

TypeScript
setMipmapsMode(value: TextureResource_MipmapsMode): Promise<void>
Swift declaration
var mipmapsMode: TextureResource.MipmapsMode

Whether the texture resource automatically generates mipmaps.

init · iOS 18.0+

init

TypeScript
static initSemanticCompressionMipmapsMode(semantic: (TextureResource_Semantic) | null, compression: TextureResource_Compression, mipmapsMode?: TextureResource_MipmapsMode): Promise<TextureResource_CreateOptions>
Swift declaration
init(semantic: TextureResource.Semantic?, compression: TextureResource.Compression, mipmapsMode: TextureResource.MipmapsMode = .allocateAndGenerateAll)

Creates a texture creation options structure. The `semantic` value you pass tells RealityKit how you plan to use the texture data from this resource. For example, passing ``RealityKit/TextureResource/Semantic-swift.enum/color`` lets RealityKit know you're using the texture to pass perceptual color information to the shaders, such as for providing a UV-mapped base color for physically based rendering materials. Passing ``RealityKit/TextureResource/Semantic-swift.enum/raw`` tells RealityKit to pass the pixel values with as little processing as possible. If semantic is `nil`, RealityKit tries to infer a semantic from the texture's source data. If it's unable to determine a semantic from the texture source data, it will infer a semantic from the texture's usage. Providing a value for `semantic` ensures that RealityKit passes the texture resource exactly as you intend. - Note: RealityKit only takes embedded color space data into account when rendering a texture if you pass ``RealityKit/TextureResource/Semantic-swift.enum/color`` for `semantic`. - Parameters: - semantic: The intended use of the texture resource. - mipmapsMode: Whether to automatically allocate or generate mipmaps. - compression:Compression to be applied to the texture.

init · iOS 15.0+

init

TypeScript
static initSemanticMipmapsMode(semantic?: (TextureResource_Semantic) | null, mipmapsMode?: TextureResource_MipmapsMode): Promise<TextureResource_CreateOptions>
Swift declaration
init(semantic: TextureResource.Semantic?, mipmapsMode: TextureResource.MipmapsMode = .allocateAndGenerateAll)

Creates a texture creation options structure. The `semantic` value you pass tells RealityKit how you plan to use the texture data from this resource. For example, passing ``RealityKit/TextureResource/Semantic-swift.enum/color`` lets RealityKit know you're using the texture to pass perceptual color information to the shaders, such as for providing a UV-mapped base color for physically based rendering materials. Passing ``RealityKit/TextureResource/Semantic-swift.enum/raw`` tells RealityKit to pass the pixel values with as little processing as possible. If semantic is `nil`, RealityKit tries to infer a semantic from the texture's source data. If it's unable to determine a semantic from the texture source data, it will infer a semantic from the texture's usage. Providing a value for `semantic` ensures that RealityKit passes the texture resource exactly as you intend. - Note: RealityKit only takes embedded color space data into account when rendering a texture if you pass ``RealityKit/TextureResource/Semantic-swift.enum/color`` for `semantic`. - Parameters: - semantic: The intended use of the texture resource. - mipmapsMode: Whether to automatically allocate or generate mipmaps.

get · iOS 15.0+

semantic

TypeScript
get semantic(): Promise<(TextureResource_Semantic) | null>
Swift declaration
var semantic: TextureResource.Semantic?

The intended use of the texture.

set · iOS 15.0+

semantic

TypeScript
setSemantic(value?: (TextureResource_Semantic) | null): Promise<void>
Swift declaration
var semantic: TextureResource.Semantic?

The intended use of the texture.

Skipped declarations

No declarations were skipped in this snapshot.

All RealityFoundation types →