Metallic by Tutorials [SUBSCRIBER]

Metallic by Tutorials [SUBSCRIBER]



  • Platform
    iOS 13

  • Language
    Swift 5.1

  • Editor
    Xcode 11

Construct your personal low-level recreation engine in Metallic!

This e-book will introduce you to graphics programming in Metallic — Apple’s framework for programming on the GPU.

By the tip of this e-book, you’ll construct your personal recreation engine in Metallic the place you possibly can create 3D scenes and construct your personal 3D video games.

Developer Information


Construct your personal low-level recreation engine in Metallic!

Metallic is a unified utility programming interface (API) for the graphics processing unit, or GPU. It’s unified as a result of it applies to each 3D graphics and data-parallel computation paradigms. Metallic is a low-level API as a result of it supplies programmers near-direct entry to the GPU. Lastly, Metallic is a low-overhead API as a result of it reduces the central processing unit (CPU) price by multi-threading and pre-compiling of assets.

However past the technical definition, Metallic is essentially the most applicable manner to make use of the GPU’s parallel processing energy to visualise information or resolve numerical challenges. It’s additionally tailor-made for use for machine studying, picture/video processing or, as this e-book describes, graphics rendering.

This e-book will introduce you to low-level graphics programming in Metallic — Apple’s framework for programming on the graphics processing unit (GPU). As you progress by means of this e-book, you’ll study lots of the fundamentals that go into making a recreation engine and step by step put collectively your personal engine. As soon as your recreation engine is full, you’ll be capable of put collectively 3D scenes and program your personal easy 3D video games. Since you’ll have constructed your 3D recreation engine from scratch, you’ll be capable of customise each side of what you see in your display screen.

This e-book is for intermediate Swift builders fascinated by studying 3D graphics or gaining a deeper understanding of how recreation engines work.

Desk of Contents

Part I: The Participant

It takes a wealth of information to render a easy triangle on the display screen or animate recreation characters. This part will information you thru the required fundamentals of vertex wrangling, lighting, textures and character animation; and in case you’re apprehensive in regards to the math, don’t be! Though laptop graphics is very math-intensive, every chapter explains the whole lot you want, and also you’ll get expertise creating and rendering fashions.


Hey, Metallic!

Study Metallic, why you’d use it over different graphics frameworks, and get a fast begin by rendering your first primitive object!


3D Fashions

Go into depth with 3D fashions, render them on the display screen, and discover ways to work with fashions in Blender.


The Rendering Pipeline

Up to now, you’ve been working in playgrounds. You’ll go additional with Metallic by making a macOS app from scratch, the place you’ll learn the way the rendering pipeline works to create the graphics on display screen.


Coordinate Areas

We might all like to be math geniuses however a few of us misplaced the chance early in life. Thankfully to make use of math, you do not at all times must know precisely what’s beneath the hood. On this chapter you are going to grow to be a matrix grasp and you’ll study what matrices can do for you and tips on how to manipulate them painlessly.


Lighting Fundamentals

Lighting and past! On this chapter you may study fundamental lighting; however extra importantly, you may discover ways to craft information in shaders, and be on the trail to mastering shader artistry. Lighting, shadows, non-photorealistic rendering – these are all strategies that begin with the strategies that you will study on this chapter.



Now that you’ve got gentle in your scene, the following step is so as to add shade to it. On this chapter you may find out about UV coordinates, texturing a mannequin, samplers, mipmaps, and the asset catalog.


Maps & Supplies

That is the ultimate chapter on tips on how to render nonetheless fashions. Within the earlier chapter, you rendered a easy home with a single shade texture imported utilizing Mannequin I/O. On this chapter you may learn the way to make use of materials teams to explain a floor, and tips on how to design textures for micro element.


Character Animation

endering nonetheless fashions is a good achievement, however rendering fashions that transfer is much more enjoyable. To date your fashions have been easy inanimate props. You will now render characters with physique motion and provides them character. On this chapter, you may begin off by bouncing a ball, after which transfer on to rendering a pleasant skeleton.

Part II: The Scene

With the fundamentals beneath your belt, you possibly can transfer on to creating recreation scenes with surroundings, skies and terrains. You’ll be capable of add a number of fashions to a scene, and transfer across the scene and discover it.


The Scene Graph

On this chapter you may take your rendering engine and put collectively a easy recreation engine by abstracting the rendering code away from scene administration. This takes you to the following degree the place you can begin creating your personal video games.


Fragment Submit-Processing

Earlier than embarking on big options resembling tessellation and instancing, you may study some easy strategies to enhance your render high quality. A collection of operations run on the GPU after the fragments have been processed within the pipeline, together with alpha testing, depth testing, stencil testing, scissor testing, mixing, and anti-aliasing. You’ll contact on most of those operations on this chapter.


Tessellation & Terrains

To date, you’ve used regular map trickery within the fragment perform to point out the fantastic particulars of your low poly fashions. To realize the same degree of element with out utilizing regular maps requires a change of mannequin geometry by including extra vertices, which may problematically choke up the pipeline. On this chapter, you’re going to create an in depth terrain utilizing a small variety of factors. You’ll ship a flat floor aircraft with a grayscale texture describing the peak, and the tessellator will create as many vertices as wanted.



Study skyboxes, dice maps, image-based lighting and extra as you add some surrounding options to your digital surroundings.


Instancing & Procedural Technology

Lots of the finest options in video games aren’t coded manually; they’re procedurally generated as an alternative. Discover ways to generate vertices for grass, how fixed and argument buffers work, tips on how to use L-system timber, after which add the grass and random timber to your scene.


Multipass & Deferred Rendering

Up thus far, you might have been working tasks and playgrounds that solely had one move. In different phrases, you used only one render command encoder to submit all of your draw calls to the GPU. In additional advanced apps, you’d usually want the results of one move utilized in a following move earlier than presenting the feel to the display screen. Typically it’s worthwhile to render content material off-screen and use it in subsequent phases of your app. If you end this chapter, it is possible for you to to render a scene with shadows and a number of lights.


GPU-Pushed Rendering

To complete off this part, you’ll find out about triple buffering, tips on how to handle useful resource competition, CPU-GPU synchronization, tips on how to obtain multithreaded encoding, and tips on how to use the GPU profiler.

Part III: The Results

On this part, you may use compute shaders to create many alternative results. You will hint rays to render objects with extra realism than the rasterization strategies you’ve got used thus far.


Particle Programs

Study mills, emitters, particle life, the compute kernel, and extra.


Particle Conduct

You’ve discovered tips on how to create particles, now see tips on how to management their habits with forces, swarming and flocking habits, predator-prey habits, and crowd habits.


Rendering with Rays

This chapter covers all you’ll must know on tips on how to do detailed ray tracing, ray casting, path tracing and ray marching.


Superior Shadows

Study exhausting and delicate shadows, ambient occlusion, display screen area rendering and extra.


Superior Lighting

Get extremely detailed with the lighting results in your scene. Be taught in regards to the rendering equation, reflection and refraction, the Fresnel impact, lens flare, subsurface scattering and extra lighting particulars!


Metallic Efficiency Shaders

MPS consists of low-level, fine-tuned, high-performance kernels that run off the shelf with minimal configuration. The MPS kernels make use of data-parallel primitives which can be written in such a manner that they’ll make the most of every GPU household’s traits. On this chapter, you’ll dive a bit deeper into the world of MPS.


Integrating with SpriteKit & SceneKit

Convey all you’ve discovered collectively and discover ways to combine your recreation engine with SceneKit and SpriteKit. You’ll discover ways to import Metallic shaders, carry out toon rendering, and extra.


Debugging & Profiling
– New

Whether or not it’s objects within the scene you appear to have unintentionally misplaced, or possibly extra lights and shadows you need to render, you’ll get to make use of a few of Xcode’s wonderful instruments to search out out what’s taking place on the GPU, in addition to discover methods to optimize your recreation to run at blazing speeds.


Efficiency Optimization
– New

On this closing chapter, you’ll study extra methods to optimize the efficiency of your recreation. You’ll perceive tips on how to categorize GPUs, tips on how to handle reminiscence, tips on how to synchronize assets between the CPU and GPU, tips on how to transfer your recreation on a number of threads and what are the very best practices for a clean rendering.

Metallic by Tutorials

Construct your personal low-level recreation engine in Metallic!

This e-book will introduce you to graphics programming in Metallic — Apple’s framework for programming on the GPU.

By the tip of this e-book, you’ll construct your personal recreation engine in Metallic the place you possibly can create 3D scenes and construct your personal 3D video games.


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.