Categories
Uncategorized

Working with Particles in Metal

Today, we’re going to start a new series about particles in Metal. Since most of the time particles are tiny objects, we are not usually concerned about their geometry. This makes them fit for a compute shader because later on we will want to have granular control over particle-particle interactions and this is a case fit […]

Categories
Uncategorized

Using ARKit with Metal part 2

As underlined last time, there are three layers in an ARKit application: Rendering, Tracking and Scene Understanding. Last time we analyzed in great detail how Rendering is done in Metal using a custom view. ARKit uses Visual Inertial Odometry for accurate Tracking of the world around it and to combine camera sensor data with CoreMotion data. No additional calibration is necessary for image stability while we are in motion. In this article we […]

Categories
Uncategorized

Using ARKit with Metal

Augmented Reality provides a way of overlaying virtual content on top of real world views usually obtained from a mobile device camera. Last month at WWDC 2017 we were all thrilled to see Apple’s new ARKit framework which is a high level API that works with A9-powered devices or newer, running on iOS 11. Some of the ARKit experiments we’ve already seen are outstanding, such […]

Categories
Uncategorized

Introducing Metal 2

This year’s WWDC was probably the most important one ever, at least as far as we – the Metaldevelopers – are concerned. I can wholeheartedly say it was the best week of my life, for sure! Let’s get to the Games and Graphics news. The most unexpected trophy goes to the renaming of Metal to Metal 2. It has the most significant additions and enhancements since […]

Categories
Uncategorized

Working with memory in Metal part 2

There are a couple of topics we need to discuss in more depth about working with memory. Last time we have seen that to create MTLBuffer objects we have 3 options: by creating a new memory allocation with new data, by copying data from an existing allocation into a new allocation and by reusing an existing storage […]

Categories
Uncategorized

Working with memory in Metal

Today we look at how memory is managed when working with the GPU. The Metal framework defines memory sources as MTLBuffer objects which are typeless and unformatted allocations of memory (any type of data), and MTLTexture objects which are formatted allocations of memory holding image data. We only look at buffers in this article. To create MTLBuffer objects we have 3 options: makeBuffer(length:options:) creates a MTLBuffer object […]

Categories
Uncategorized

Ambient Occlusion in Metal

Today we will be looking into ambient occlusion. We are going to work on the playground we used in Shadows in Metal part 2 and build up on that. First, let’s add a new object type – a rectangular box: Next, let’s also add a new distance function for our new struct: Then, update our scene to something […]

Categories
Uncategorized

Shadows in Metal part 2

In this second part of the series, we will be looking into soft shadows. We are going to work on the playground we used in Raymarching in Metal and build up on that because it was already set up for 3D objects. Let’s set up a basic scene that has a sphere, a plane, a light and a ray: Next, […]

Categories
Uncategorized

Shadows in Metal part 1

A quite important topic in Computer Graphics is lighting and shadows. This will be a first episode from a multi-part series about Shadows in Metal. We are going to work on the playground we used in Using metal part 15 and build up on that. Let’s set up a basic scene: We first created the differenceOp() function which returns the difference between two signed distances. […]

Categories
Uncategorized

Raymarching in Metal

Raymarching is a fast rendering method used in realtime graphics. The geometry is usually not passed to the renderer but rather created in the shader using Signed Distance Fields (SDF) functions that describe the shortest distance between a point and the surface of any object in the scene. The SDFreturns a negative number if the point is inside of […]