CIFilter on SCNNode only works in Simulator

耗尽温柔 提交于 2019-12-31 03:14:08

问题


Having a bit of a head-scratcher with the new filter features in SceneKit with iOS9. To simplify the case as much as possible, if I add the line:

ship.filters = [CIFilter(name: "CIPixellate", withInputParameters: [kCIInputScaleKey: 30])!]

To the default SceneKit project, build and run for simulator, the ship pixellates as expected. If I build and run the same project on-device, the ship disappears. I've tried various permutations, multiple devices, and even several SceneKit demonstrations on blog postings, and they all have the same issue. I'm just not sure what I'm missing.


回答1:


CIFilter are not supported by SceneKit when using Metal (which is the default on the device). See documentation of SCNNode / filters.

If you need CIFilter you have to explicitly request a GL based renderer (using InterfaceBuilder or SCNView's "renderingAPI" property).



来源:https://stackoverflow.com/questions/34279833/cifilter-on-scnnode-only-works-in-simulator

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!