<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/TextureResource/CreateOptions/init(semantic:compression:mipmapsMode:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation15TextureResourceC13CreateOptionsV8semantic11compression11mipmapsModeAeC8SemanticOSg_AC11CompressionVAC07MipmapsJ0Otcfc"
  },
  "title" : "init(semantic:compression:mipmapsMode:)"
}
-->

# init(semantic:compression:mipmapsMode:)

Creates a texture creation options structure.

```
init(semantic: TextureResource.Semantic?, compression: TextureResource.Compression, mipmapsMode: TextureResource.MipmapsMode = .allocateAndGenerateAll)
```

## Parameters

`semantic`

The intended use of the texture resource.

`compression`

Compression to be applied to the texture.

`mipmapsMode`

Whether to automatically allocate or generate mipmaps.

## Discussion

The `semantic` value you pass tells RealityKit how you plan to use the texture data from this resource. For example, passing
[`TextureResource.Semantic.color`](/documentation/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 [`TextureResource.Semantic.raw`](/documentation/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
> ``doc://com.apple.RealityKit/documentation/RealityKit/TextureResource/Semantic-swift.enum/color`` for `semantic`.

---

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)