Export & Texture Optimization
Preflight separates exporting from texture optimization so the common case stays fast while power users retain full control.
Exporting a Scene
Section titled “Exporting a Scene”File > Export… (Cmd+E) opens a standard save panel. Pick a destination, hit Save. The export uses your current texture optimization settings (or sensible defaults if you haven’t changed them).
Preflight supports two export modes:
| Mode | Description |
|---|---|
| Export (Fixed) | Preserves the scene graph structure — references, payloads, sublayers, and variants are kept intact. Produces a .usdz archive. |
| Export (Flattened) | Collapses the full composition into a single layer. Useful for delivery to renderers or platforms that don’t support layered USD. |
Both modes apply your texture optimization settings during export.
Optimize Textures
Section titled “Optimize Textures”File > Optimize Textures… opens a dedicated panel where you configure how textures are processed during export. Settings are saved across sessions — you set them once and every future export uses them.
Output Format
Section titled “Output Format”Controls the texture container format written into the exported archive.
| Option | Description |
|---|---|
| Automatic | Selects the best format for your current workflow. Resolves to PNG for OpenUSD targets and AVIF for RealityKit targets. |
| PNG | Lossless. Universally supported. Larger file size. |
| JPEG | Lossy. Good compression for photographic textures. No alpha channel. |
| AVIF | Modern lossy/lossless codec. Excellent compression with high quality. Supported by RealityKit on macOS 13+ and visionOS. |
| KTX2 | GPU-compressed container (ASTC/BC payloads). Used as a Metal pipeline intermediate. Not a scene-referenced format for Apple runtimes — use only if your pipeline explicitly requires it. |
Compression Quality
Section titled “Compression Quality”Controls the compression effort when converting textures.
| Option | Description |
|---|---|
| Automatic | Uses the target workflow default (Fast for quick iterations, Best for final delivery). |
| Fast | Minimal compression time. Good for iteration. |
| Balanced | Moderate compression with good quality. |
| Best | Maximum quality. Slower compression. Recommended for final export. |
Max Texture Size
Section titled “Max Texture Size”Limits the largest dimension (width or height) of exported textures. Textures exceeding this size are downscaled proportionally.
| Option | When to use |
|---|---|
| Automatic | Uses the target default (4096 px for RealityKit, unlimited for OpenUSD). |
| 1024–8192 | Override for specific size budgets. |
Generate Mipmaps
Section titled “Generate Mipmaps”Controls whether mipmaps are generated for exported textures.
- Automatic: On for RealityKit, off for OpenUSD.
- On / Off: Explicit override.
Mipmaps improve rendering performance for textures viewed at varying distances but increase file size.
Quality Metrics (PSNR)
Section titled “Quality Metrics (PSNR)”When enabled, Preflight computes PSNR (Peak Signal-to-Noise Ratio), MSE, and RMS metrics comparing the compressed texture against the original. Useful for validating that compression hasn’t degraded visual quality below acceptable thresholds.
Requires AppleTextureConverter (ships with Xcode).
Color Space
Section titled “Color Space”Optional fields for explicit color space conversion during export.
- Source: The color space of your input textures (e.g.,
DisplayP3). - Output: The target color space (e.g.,
sRGB).
Leave blank to preserve the original color space. Only specify these when your pipeline requires an explicit gamut conversion.
Workflow Defaults
Section titled “Workflow Defaults”The Automatic setting adapts to your current workflow target:
| Setting | OpenUSD | RealityKit |
|---|---|---|
| Format | PNG | AVIF |
| Quality | — | Fast |
| Max Size | Unlimited | 4096 px |
| Mipmaps | Off | On |
| Quality Metrics | Off | On |
AppleTextureConverter
Section titled “AppleTextureConverter”GPU-accelerated texture compression is provided by AppleTextureConverter, which ships as part of Xcode. Preflight links it in-process (no subprocess spawning, sandbox-safe).
When available, it enables:
- ASTC and BC1–7 compression
- GPU-accelerated mipmap generation
- PSNR/MSE quality comparison
- Memory-to-memory conversion
If Xcode is not installed, Preflight falls back to open-source conversion backends. A status indicator in the Optimize Textures panel shows availability.
Texture optimization is also available through the command line:
# Analyze textures in a scenepreflighttool texture analyze scene.usdz --target RealityKit
# Convert a single texturepreflighttool texture convert albedo.png albedo.avif --format avif --quality best
# Export with current preferencespreflighttool export scene.usdz output.usdz --target RealityKit