A set of options that control how RealityKit writes entities to a reality file.
## Overview
Use ``Entity/WriteOptions`` to tune the tradeoff between export speed, file size, and runtime
cost when you save a scene to a `.reality` file.
Pass a value of this type to ``Entity/write(to:options:)`` or ``Entity/ConfigurationCatalog/write(to:options:)``
as an array literal containing one or more option values.
```swift
let combinedOptions: Entity.WriteOptions = [
.preferFastExport,
.preferSmallTextureFiles(quality: .standard)
]
```
## Expediting Reality File Exports
The ``Entity/WriteOptions/preferFastExport`` reduces the time required to write
a reality file but produces a larger file on disk.
## Reducing Texture File Size
The ``Entity/WriteOptions/preferSmallTextureFiles(quality:)`` method returns options
that instruct RealityKit to encode textures using smaller file representations, at the cost of longer
load times and higher memory usage. Specify a
``Entity/WriteOptions/TextureQuality`` level to control the tradeoff between visual fidelity
and file size.
Members (2)
get · iOS 27.0+
preferFastExport
TypeScript
static get preferFastExport(): Promise<Entity_WriteOptions>
Swift declaration
static var preferFastExport: Entity.WriteOptions { get }
Expedite the reality file export when possible.
This option may disable archival compression during the export process.
This reduces the time required to write a reality file but produces a larger file on disk.
Use this option when rapid iteration is more important than file size,
such as during development in a content authoring tool.
Reduce textures' file size while preserving its dimensions.
The returned option instructs RealityKit to encode textures using smaller file
representations. RealityKit selects the best strategy for each texture based
on context, which may include lossy image encoding, preserving the original
source image, or regenerating mipmaps.
- Warning: While writing smaller texture files reduces the size of reality files on disk,
loading those textures can increase memory usage and load times
compared to the default compressed format. Larger memory region
can also consume more power during rendering due to increased
cache pressure.
- Note: RealityKit ignores this option for textures created with ``TextureResource/Compression/none``.
Skipped declarations
1 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.
Entity.WriteOptions.init(arrayLiteral:)
A variable number of Swift arguments is not supported.