heestand-xyz/PixelKit

Metal View res not set

Closed this issue · 1 comments

Hi,

trying to setup this on scenekit , I think I am missing one or two steps for the init

Crash on the below in ScenePIX.swift , line 91
renderer.render(atTime: 0, viewport: viewport, commandBuffer: commandBuffer, passDescriptor: renderPassDescriptor)
<--- renderer seems nil <--- Thread 1: Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value

Log:
RenderKit ready to render.
PixelKit #00 WARNING [1] ScenePIX Render >>> Metal View res not set
PixelKit #1 INFO [1] ScenePIX Res >>> Applied: custom(w: 1500, h: 1000) [1500x1000]
Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value: file PixelKit/ScenePIX.swift, line 91

Code
DispatchQueue.global(qos: .background).async {
let scenePix = ScenePIX(at: .custom(w: 1500, h: 1000))
scenePix.setup(cameraNode: self.sceneView.currentPointOfView()!, scene: self.sceneView.currentScene()!, sceneView: self.sceneView)
let res: Resolution = .custom(w: 1500, h: 1000)
let circle = CirclePIX(at: res)
circle.radius = 0.45
circle.bgColor = .clear
let finalPix: PIX = scenePix * circle
finalPix.view.frame = self.view.bounds
self.view.addSubview(finalPix.view)
}

May I have an hint were to look please as there are no readme or examples around on scenePIX?

Thank you very much.

Hi, I can't find the bug, is the issue still there?
What version of PixelKit are you running?