Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Joseph McMahon - SpriteKit as an Intro to Scene...

Joseph McMahon - SpriteKit as an Intro to SceneKit and Metal

Joseph McMahon presenting at the September 2015 Brooklyn Swift Developers Meetup: http://meetup.com/Brooklyn-Swift-Developers/events/225289456/

Video: https://youtu.be/MSLi7ACh2Ks

Tweet

More Decks by Brooklyn Swift Developers Meetup

Other Decks in Education

Transcript

  1. About • WPI for MS Robotics Engineering – 3D software,

    computer vision, controls • Tishman Construction – 3D CAD, apps for skyscrapers joemcm.com
  2. Citrus Studios • 4 people –Code –Art –Music & SFX

    –Project management • Launching Orbert in December for iOS 9 citrusstudios.io
  3. Orbert • SpriteKit – UIKit, AppKit • Core Animation •

    AVFoundation • GameplayKit orbert.io
  4. Rumors • Macbook Pro 2016 – Intel Skylake chipset –

    Nvidia GeForce GTX 950 • Develop OS X first
  5. import SpriteKit class Level: SKScene { ... init(size: CGSize, ...){

    super.init(size: size, ...) ... } override func didMoveToView(){...} override func update(){...} ... } subclass SKScene initializers parameters allocate SKScene vars allocate variables initialize game update game helper functions
  6. Old SpriteKit Features • SKShader • SKLightNode – Shadows •

    SKPhysicsBody – Per pixel • SKConstraint and Inverse Kinematics • SKFieldNode • SK3DNode • Xcode – Texture Atlas – .sks 2D Scene Editor – SKReferenceNode
  7. New SpriteKit Features • SKAudioNode • SKCameraNode • Xcode –

    Particle Editor – Live editor – animations and cut scenes!
  8. let myCamera: SKCameraNode = SKCameraNode() // init() allocations omitted var

    hero: SKSpriteNode = SKSpriteNode() var objects: [SKSpriteNode] = [] override fund didMoveToView(){ camera = myCamera addChild(hero) hero.addChild(myCamera) for object in objects{ addChild(objects[object]) } }
  9. import UIKit import SceneKit class Level: SCNScene { ... init(size:

    CGSize, ...){ super.init(size: size, ...) ... } override func didMoveToView(){...} override func update(){...} ... }
  10. import SpriteKit class Level: SKScene { ... init(size: CGSize, ...){

    super.init(size: size, ...) ... } override func didMoveToView(){...} override func update(){...} ... }
  11. Metal • Low level access to GPU • Integrated with

    SpriteKit and SceneKit • Designed for the A7 (5s)
  12. import UIKit import SceneKit import MetalKit // Only exists on

    iOS devices // MetalKit includes ModelIO class ViewController: UIViewController { let theView = SCNView() let scene = SCNScene(named: "Art.scnassets/ Building.scn")! override func viewDidLoad() { super.viewDidLoad() theView.scene = scene } }
  13. Other Frameworks • GameplayKit – Pathfinding – State machines –

    Artificial Intelligence • Game Center – GKLocalPlayer – GKPlayer • ReplayKit
  14. Subclasses of SKNode SK3DNode SKAudioNode SKCameraNode SKCropNode SKEffectNode SKEmitterNode SKFieldNode

    SKLabelNode SKLightNode SKReferenceNode SKShapeNode SKSpriteNode SKVideoNode
  15. Conclusion • Frameworks aren’t just for iOS • Maybe it’s

    better to make an OS X app first • tvOS? • watchOS?
  16. Conclusion • Now is a great time to develop GPU

    intensive apps for iOS and OS X – 800,000,000 iOS devices @ WWDC2014 – 40,000,000 OS X devices – New hardware – OS X 10.11 El Capitan on September 30th
  17. Myths • SpriteKit and SceneKit are just for games •

    Metal is too hard • Games are all easy