Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting started with Metal [closed]

Tags:

ios

swift

metal

I'm an Objective-C / Swift software developer (in training) currently with an application in the App Store. But I have recently really been interested in Metal, Apple's new alternative to OpenGL. But I'm not exactly sure how to begin... Apple's documentation is handy, but only if you really know what you are doing in the first place. Are there any good tips to beginning? I really haven't explored the area of 3D game programming so would you recommend I learn another language first? And if so which?

I'm just looking for good tutorial books or sites that get in depth with the how and why. I like to understand what exactly I'm doing instead of just typing in code, but there are so many languages and beginner's books that I really don't know where to start... Can anyone help me with this?

like image 743
jaller200 Avatar asked Jan 30 '15 04:01

jaller200


2 Answers

Metal is a newer graphics API. So if you are new to graphics and 3D game programming you may want to start with OpenGL- specifically since there are many textbooks out there that teaches you fundamentals of graphics using OpenGL. As for a web page on OpenGL, one of my favorite ones is songho. Books on OpenGL ES2.0 and OpenGL ES3.0 includes sections on programming with OpenGLES for iOS.

If you would specifically like to explore Metal API itself, there are multiple videos from WWDC 2014 that details on the basics and has demos on how to do work with Metal in Xcode. An introductory article that details on what and why with respect to Metal is the objc.io one. And a more detailed one is metalbyexample.

To understand in depth as to how these graphics APIs work, you might need a grasp on GPU architecture. The Real-Time Rendering is probably the best book on the subject. These lecture videos from Prof. John Owens at UC Davis also describes the architecture in a clear and concise manner.

like image 59
codingminion Avatar answered Nov 11 '22 01:11

codingminion


  1. I would definitely recommend Marius Horga's blog as a starting point. It is how I started and Marius is always willing to help.

  2. Another place to go is metalbyexample.com by Warren Moore and of course his book. However, it has a significant amount of code written in Objective-C, but it is fairly easy to translate to Swift.

  3. Download the sample code from Apple at: https://developer.apple.com/metal/

  4. Recently I created a GitHub repo how to translate Shadertoy shader code into Metal, which you can access it in here.

[Important Note] - Some of the sample code given is already incompatible with Xcode 8 and Swift 3 and you will need to work out the changes needed to prevent the compiler from choking on them. If you need three great code samples by Apple showing how to use textures, multithreading at the CPU and GPU level, and how to draw primitives in Metal, being also Xcode 8 beta 6, Swift 3 compatible, just send me an email and I will send them to you.

like image 37
jvarela Avatar answered Nov 11 '22 01:11

jvarela