Tesselation support in SceneKit

Per Session 604 @ WWDC, Metal now supports tesselation. Scenekit (by default) uses Metal. Is it then fair to assume that Scenekit supports tesselation too?


If most of the models are imported DAE models, what should be done in the 3D model apps (by the designer) to ensure that the geometry can take advantage of tesselation, i.e. the geometry is tesselatable? How is tesselation different from setting a higher sub-division level?

Replies

I have your exact same question. I have not watched session 604 yet but there is some documentation on SceneKit and Tessellation via the SCNProgram class.


https://developer.apple.com/reference/scenekit/scnprogram/1523852-tessellationcontrolshader


A program’s tessellation control shader executes once for each vertex in the geometry it renders. The tessellation control shader takes as input the vertex positions output by the vertex shader, and outputs tessellation-level information to be used by the hardware tessellator for subdividing polygons and edges. The tessellator then provides input to your tessellation evaluation shader.


Tessellation shaders require OS X and OpenGL Core Profile. To use OpenGL Core Profile in a SceneKit view, set the view’s

pixelFormat
property. Tessellation shading is optional—to render without a tessellation shader, set this property’s value to
nil
(the default). However, if you specify a tessellation control shader, a tessellation evaluation shader is also required.

SceneKit compiles and links your shader program only when it is needed for rendering. To be notified of program compilation errors, provide a

delegate
object for the program.


https://developer.apple.com/reference/scenekit/scnprogram/1523760-tessellationevaluationshader

The designer needs to model and export in polygons, as they're known to be in Maya and 3ds Max. ie four sided polygons. These work far and the away the best for tesselation.


Tell them you will do the SubD smoothing in engine, to only send you the raw polygons without any smoothing applied.


Most game modellers are already working in this manner. You'd be hard pressed to find someone that isn't.


When you tell them you have Subdivision settings in Scene Kit, they'll get it. And want to see the results. And they'll be able to send you lower resolution models in polygons and you can set the amount of tessellation based on the performance of the target device, distance from camera, etc.

Thanks, that explanation was very helpful.


>>......and you can set the amount of tessellation based on the performance of the target device, distance from camera, etc.


Would be nice 🙂 to have some tesselation settings that can be tweaked in SceneKit Editor. Writing tesselation shaders looks complicated. 😕 A sample code would be a big help.