CIFilter on SCNNode only works in Simulator

Having a little head scraper with new filter features in SceneKit with iOS9. To make things as simple as possible if I add a line:

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

In the default SceneKit project, build and run for the simulator, the pixels of the ship, as expected. If I create and run the same project on the device, the ship will disappear. I tried various permutations, multiple devices, and even several SceneKit demos on blogs, and they all have the same problem. I'm just not sure what I am missing.

+2
source share
1 answer

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

If you need CIFilter, you must explicitly request a GL-based renderer (using the InterfacePuilder or SCNView "renderAPI" property).

+1
source

Source: https://habr.com/ru/post/1237877/


All Articles