Search Unity

This year, in the “What’s New in Metal” session at WWDC, Apple showed our Unity demo of adaptive tessellation written using Metal. The demo shows a low polygon sphere being tessellated with many more triangles as we shift between materials using displacement mapping, providing beautiful detail of each material.

image00

For this proof of concept, we added Metal Tessellation support to Unity, along with Metal Compute and native Metal shading language support. We can’t wait to ship support for these in future versions of Unity.

image02

Metal Tessellation allows Unity to enable pre-existing tessellation shaders for Metal, yet opens up new possibilities by decoupling the generation of tessellation factors from draw calls. You can either pre-generate them or write a custom compute shader to do it efficiently per draw or as a separate pass. Regardless of how you choose to generate tessellation factors, the rendering pipeline for each draw remains the same,with just a vertex and fragment shader, while accounting for newly generated patches emitted by the tessellator.

For the demo, we wrote a custom per draw “patch kernel” in a native Metal compute shader to calculate a tessellation factor buffer. We then cycled through a bunch of material properties set up in the Unity editor and displaced the triangles emitted by the tessellator in the “post tessellation vertex shader” (also written as a native Metal shader in Unity). The fragment shader is the same physically based Unitystandard shader currently existing in Unity, but with more triangles it really brings out the details in the material.

image01

Tessellation can be used to implement level of detail, efficiently adapt between materials (as in our demo), or for various other effects – limited only by your imagination! While tessellation has been around for a while, we’re excited to see it come to iOS as it can help produce extremely detailed meshes without storing/streaming large meshes on disk.

This is only one of the many features Apple announced for Metal. Some of the others such as Metal Resource Heaps and Memoryless Render Targets, offer potential for performance and memory usage improvements so we are also excited to see what we can do with them. Meanwhile, we look forward to seeing you use Metal Tessellation in your projects, and welcome your feedback!

23 Comments

Subscribe to comments

Comments are closed.

  1. Compute Shader for Mac and iOS will be available this year?

    1. Yes, we are working on adding Metal compute to Unity for Mac, iOS, and tvOS.

  2. Charles E. Campbell

    July 2, 2016 at 1:45 am

    Simply Amazing!

  3. what happens to open gl?

    1. Aras Pranckevičius

      June 19, 2016 at 9:05 pm

      Nothing changes compared to today. On both iOS & macOS, we support both Metal and OpenGL/ES.

      1. SUPER +64

  4. wait. so can we now use compute shaders on mac finally?
    and ios? with unity? after all these years *____*

    1. Filip Iliescu

      June 18, 2016 at 3:59 am

      Yes, compute *and* tessellation (through Metal) will be available soon on both iOS and Mac. Apple TV hardware does not yet support tessellation however.

  5. Tesselation huh? Can’t remember since when this existant… someone could recall me?

  6. Peter Musgrave

    June 17, 2016 at 9:39 pm

    Very interested in Metal Compute!

  7. Who would be interested in a technology that only works on 1 paltform

    C’mon Apple, remove the finger from your ass and add support for Vulkan damn

    1. This is something you should ask AMD/nVidia.
      Who implemented Vulkan on Windows? Certainly not MS!

      1. Oh, I understand that on iOS, only Apple can implement Vulkan. Don’t count on it though.

    2. also Metal works on iOS, tvOS and macOS. DX12 works on Windows 10 and XBox One. Not much more.

      1. Apple should have Vulkan support on their devices. Apple even was a member of Khronos group, being an active member developing Vulkan, then they bailed and made their own API. We COULD finally have ONE api to rule them all (Consoles, Windows/mac, iOS, Android) but no.

  8. Justin Fincher

    June 17, 2016 at 6:56 pm

    wrong link, should be
    https://developer.apple.com/videos/play/wwdc2016/604/
    not wwdc 2015 one.

    1. Thanks Justin. The link should be fixed now.

      1. Tijmen van den Heuvel

        June 20, 2016 at 8:59 am

        Too bad you need Safari or an app to watch the video. Just apple being apple i suppose.

        1. Oooh whooow, can’t believe they still do this kind of stuff. They blame Microsoft being such to force people using there software, but believe me, Apple is worse. Same problem here.

        2. apple is – and this is _IN GENERAL_ only one part of the problem
          the other one is random plankton always immediately mindlessly farting through the keyboard on the internet before actually undergo any effort whatsoever
          like in this case trying to click on ‘Resources’ and discovering there are links for both HD and SD versions of the talk for download

        3. Tijmen van den Heuvel

          June 21, 2016 at 9:09 am

          @ERREXOJ I dont want to download them, i want to stream them like i do with all other video i consume.

        4. if you don’t want to download them in order to WATCH them, then don’t consume – very easy.
          don’t claim you need Safari to do so, though.

  9. i am really interested