i have a SceneKit game with only SceneKit geometry objects written in Swift 1.2 (started this in may)
its runs perfect so far
then i started looking around for info on adding a shader to my scene to spice it up a bit and found that apple has a pretty big library of shaders
so i changed the shader i liked to what i needed and added it to my objects
since development will not be ready by next week (im not sure if apple will release a GM seed then or not, but i want to play safe) i need to make my game ready for swift 2.0
after running the migration assistent to migrate from swift 1.2 to 2.0 my entire app broke
linker command errors and al that nasty stuff
so i started to migrate manually
but how can i add shaders to a scene in swift 2.0 ?
thanks
here is my code i used to add it in 1.2 (this works in v1.2, but gve me an error in 2.0)
let shaders = NSMutableDictionary()
shaders[SCNShaderModifierEntryPointFragment] = String(contentsOfFile: NSBundle.mainBundle().pathForResource("wallShader", ofType: "shader")!, encoding: NSUTF8StringEncoding, error: nil)
var material = SCNMaterial()
material.shaderModifiers = shaders as [NSObject : AnyObject]
var wallNode = SCNNode(geometry: geo)
wallNode.geometry!.materials = [material]