实现适配ARKit的SceneKit adaptive subdivision(参考WWDC2017 Fox Demo)
SceneKit 自适应细分功能实现问题
当前落地目标为实现与WWDC 2017 SceneKit演示中Fox网格效果一致的自适应细分能力,且保证功能可在ARKit场景下正常运行,现存两个待验证的核心实现方向:
- 初始化细分流程时,是否需要将
pointOfView.camera作为配置项传入 - 是否需要在SceneKit渲染代理方法中,实时计算模型与相机的距离,动态调整
subdivisionLevel参数
当前已编写的细分配置代码
let tessellator = SCNGeometryTessellator() tessellator.edgeTessellationFactor = 3.0 tessellator.insideTessellationFactor = 3.0 newNode.geometry?.tessellator = tessellator tessellator.smoothingMode = .pnTriangles tessellator.isAdaptive = true tessellator.maximumEdgeLength = 50 modelNode.geometry?.wantsAdaptiveSubdivision = true modelNode.geometry?.subdivisionLevel = 1
可参考的官方信息来源
- Apple开发文档关于
subdivisionLevel属性的说明条目 - WWDC2017 Session 604中23:00时间点的SceneKit功能演示片段
内容的提问来源于stack exchange,提问作者Dan M
相关产品推荐
相关产品推荐

