3

I'm trying to make my SCNNode which is a sphere to glow like this picture of our planet: enter image description here

I tried creating another node and applying a CIFilter with no luck:

let filter = CIFilter(name: "CIGaussianBlur")!
filter.setDefaults()
filter.setValue(1, forKey: kCIInputRadiusKey)
let atmosphere=SCNSphere(radius: 21)
atmosphere.firstMaterial?.diffuse.contents=UIColor.blueColor()
let atmosphereNode = SCNNode(geometry: atmosphere)  
atmosphereNode.filters=[filter]

From what I could research this is due to Metal not supporting CIFilter but using OpenGL might work but I don't know how to change my project to OpenGL.

Kevin
  • 611
  • 3
  • 9
  • 14
  • Bah, my dupehammer obliterated a possibly useful link to other not-quite-duplicate questions: [SceneKit, CIFilter. CICategoryBlur filters nothing visible](http://stackoverflow.com/q/34210293/957768) and [CIFilter on SCNNode only works in Simulator](http://stackoverflow.com/q/34279833/957768). – rickster Mar 01 '16 at 17:46
  • Also note that for something as simple as a fuzzy circular halo behind a sphere, a realtime blur shader is probably not very good in terms of visual bang for your performance-cost buck — see the duplicate question for some strategies to get that done without CIFilters. (Do file bugs if you find CIFilter not working regardless.) – rickster Mar 01 '16 at 17:51
  • @rickster thanks, will try your suggestion – Kevin Mar 02 '16 at 01:04

0 Answers0