SCNNode上的CIFilter仅适用于Simulator [英] CIFilter on SCNNode only works in Simulator

查看:143
本文介绍了SCNNode上的CIFilter仅适用于Simulator的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用iOS9的SceneKit中的新过滤器功能有点令人头疼。为了尽可能简化案例,如果我添加以下行:

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])!]

到默认的SceneKit项目,构建并运行对于模拟器,船按预期进行像素化。如果我在设备上构建并运行相同的项目,则该船将消失。我已尝试过各种排列,多个设备,甚至博客帖子上的几个SceneKit演示,它们都有同样的问题。我只是不确定我缺少什么。

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.

推荐答案

当使用Metal(这是一个)时,SceneKit不支持CIFilter默认设备)。请参阅SCNNode / filters文档。

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

如果需要CIFilter,则必须显式请求基于GL的渲染器(使用InterfaceBuilder或SCNView的renderingAPI属性)。

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

这篇关于SCNNode上的CIFilter仅适用于Simulator的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆