Contents

UnlitMaterial.Program

An object that represents the backing shader compilation required for unlit materials.

Declaration

final class Program

Overview

You can use this type to control when RealityKit compiles shaders, and to initialize UnlitMaterial objects with more predicitable loading performance.

When initializing an UnlitMaterial this way, a Program object is created first asynchronously, which is used to cache the material’s shader program so the UnlitMaterial can be loaded immediately later.

For example:

// Initialize descriptor with desired properties
var descriptor = UnlitMaterial.Descriptor()
descriptor.applyPostProcessToneMap = false

// Create program object
let program = await UnlitMaterial.Program(descriptor: descriptor)

// Create material (returns immediately)
let material = UnlitMaterial(program: program)

Topics

Structures

Initializers

Instance Properties