Search code examples
swiftscenekitscnview

SceneKit – Make higher resolution in SCNView


I am using SceneKit and I hate the resolution of the geometry. I read developer documentation and other websites. I found an article on the developer documentation. It gave me this image:

Apples image

But couldn't find any information how to do that, only another stupid article on the developer documentation. I really need a higher resolution – it should be smoothed.

My geometry renders by default

Is there some one how can help me with this problem?


Solution

  • All the built-in shape geometries have xxxSegmentCount properties. You can increase them to make them smoother. Here's a summary table:

    Shape segmentCount properties
    SCNPlane widthSegmentCount, heightSegmentCount, cornerSegmentCount
    SCNBox widthSegmentCount, heightSegmentCount, lengthSegmentCount, chamferSegmentCount
    SCNSphere segmentCount
    SCNPyramid widthSegmentCount, heightSegmentCount, lengthSegmentCount
    SCNCone radialSegmentCount, heightSegmentCount
    SCNCylinder radialSegmentCount, heightSegmentCount
    SCNCapsule radialSegmentCount, heightSegmentCount, capSegmentCount
    SCNTube radialSegmentCount, heightSegmentCount
    SCNTorus pipeSegmentCount, ringSegmentCount

    You can't control the segment counts for SCNText and SCNShape, however. Their polygon counts are controlled by SceneKit, but it should always be high enough no matter how zoomed in you are. You shouldn't need to worry about this.

    Additional note: The levelOfDetail you found is for setting different geometries to use (perhaps with different segment counts) when the camera is a different distance away from the object, to improve performance.