Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS - Combining SpriteKit and Metal

Is it possible to combine SpriteKit with Metal? and if it is, how could one achieve to combine metal particles and SKNodes in a physics world so that the collide with each other, what's the usual approach for this kind of requirement.

Thanks

like image 962
Andrespch Avatar asked Jul 25 '15 15:07

Andrespch


2 Answers

They are two totally different technologies. Sprite Kit is a framework that abstracts all of the rendering work for you as well as provides you with a built-in physics engine. Whereas Metal is purely a low-level GPU-accelerated graphics API which gives you complete control over the rendering process. It is similar to OpenGL ES but with much less overhead.

Sprite Kit will use Metal (on eligible devices) to render your scene. You don't need to do a single thing because Sprite Kit handles all rendering behind-the-scenes.

You don't combine them, they are two totally different frameworks. If you are looking to add physics to Metal then you will either need to write your own physics engine or use an an already existing engine like Box2D (which I believe Sprite Kit uses internally).

like image 188
Epic Byte Avatar answered Sep 27 '22 17:09

Epic Byte


This appears to be possible now using SKRenderer which allows you to mix SpriteKit and Metal (by the looks of it adding SpriteKit to Metal and vice versa).

It's iOS 11+, macOS 10.13+ and tvOS 11+.

like image 33
trojanfoe Avatar answered Sep 27 '22 17:09

trojanfoe