This reminds of an error I got while setting up SKRenderer for this project: SKRenderer Demo.
See code and comment in SKOfflineRenderer.swift:
// If I dont use a depth/stencil texture, rendering crashes on simulator, device, and Mac
// Without it, rendering only works on Xcode Live Preview
let depthStencilDesc = MTLTextureDescriptor()
depthStencilDesc.pixelFormat = .depth32Float_stencil8
depthStencilDesc.width = pixelWidth
depthStencilDesc.height = pixelHeight
depthStencilDesc.usage = .renderTarget
depthStencilDesc.storageMode = .private
The code is inside the init, check how the depthStencilTexture is setup for SKRenderer, it may help you.
Topic:
Graphics & Games
SubTopic:
RealityKit
Tags: