How can you set the resolution in scenekit?
I would like to render the scenekit view at half the resolution and then scale it up. (I'm hoping this will give a performance boost to my game at the cost of non retina graphics)
How can you set the resolution in scenekit?
I would like to render the scenekit view at half the resolution and then scale it up. (I'm hoping this will give a performance boost to my game at the cost of non retina graphics)
'node' has a scale property, but I don't think you can outright scale an entire view without moving up to the root controller layout.
Try setting the height / width of the SCNView ? You may have to embed it in a view depending on your storyboard, but I would expect this to give you a real resolution setting.
However, if you are having preformance issues this is not the correct way to solve for them. A much better appraoch would be to recuce the number of lights in your scene and if you have only one look at how many triangles comprise your meshes and implement LOD and / or reduce the number of triangles to speed things up at the correct screen resolution.
on iOS: use UIView's contentScaleFactor
on OS X: when layer backed use the backing layer's contentsScale
otherwise (and so when using GL) you can use "wantsBestResolutionOpenGLSurface" to switch between 1x and 2x on retina display.
It has been years and I still don't have an answer to this...
SceneKit is quite bloated so in theory rendering at 1080p and then scaling up should allow us to use more fancy features.
In Metal we would set the size of the texture being rendered into, is there a way to reference that texture for scenekit and change it's dimensions?
SceneKit allows for rendering into a texture so my recommendation would be to create a FBO (or under Metal, a Metal texture render target) and render your Scene into what ever texture resolution you desire (or meets your performance requirements).
Then, draw the contents of the FBO to the screen.
A good starting point for this would be Dan Omachi's sample code "Mixing Metal and OpenGL in a View".
Utilize the technique of rendering to a FBO backed by a CVPixelBufferRef. You can then take this CVPixelBufferRef and use it as the contents of any CALayer, including the CALayer of a basic NSView.
In my testing the CALayer.contents will not redraw correctly if the CVPixelBufferRef is set repeatedly to the same value so you must double-buffer your rendering (ie. use dual CVPixelBufferRef).