View in English

  • Apple Developer
    • Get Started

    Explore Get Started

    • Overview
    • Learn
    • Apple Developer Program

    Stay Updated

    • Latest News
    • Hello Developer
    • Platforms

    Explore Platforms

    • Apple Platforms
    • iOS
    • iPadOS
    • macOS
    • tvOS
    • visionOS
    • watchOS
    • App Store

    Featured

    • Design
    • Distribution
    • Games
    • Accessories
    • Web
    • Home
    • CarPlay
    • Technologies

    Explore Technologies

    • Overview
    • Xcode
    • Swift
    • SwiftUI

    Featured

    • Accessibility
    • App Intents
    • Apple Intelligence
    • Games
    • Machine Learning & AI
    • Security
    • Xcode Cloud
    • Community

    Explore Community

    • Overview
    • Meet with Apple events
    • Community-driven events
    • Developer Forums
    • Open Source

    Featured

    • WWDC
    • Swift Student Challenge
    • Developer Stories
    • App Store Awards
    • Apple Design Awards
    • Apple Developer Centers
    • Documentation

    Explore Documentation

    • Documentation Library
    • Technology Overviews
    • Sample Code
    • Human Interface Guidelines
    • Videos

    Release Notes

    • Featured Updates
    • iOS
    • iPadOS
    • macOS
    • watchOS
    • visionOS
    • tvOS
    • Xcode
    • Downloads

    Explore Downloads

    • All Downloads
    • Operating Systems
    • Applications
    • Design Resources

    Featured

    • Xcode
    • TestFlight
    • Fonts
    • SF Symbols
    • Icon Composer
    • Support

    Explore Support

    • Overview
    • Help Guides
    • Developer Forums
    • Feedback Assistant
    • Contact Us

    Featured

    • Account Help
    • App Review Guidelines
    • App Store Connect Help
    • Upcoming Requirements
    • Agreements and Guidelines
    • System Status
  • Quick Links

    • Events
    • News
    • Forums
    • Sample Code
    • Videos
 

Vidéos

Ouvrir le menu Fermer le menu
  • Collections
  • Toutes les vidéos
  • À propos

Plus de vidéos

  • À propos
  • Code
  • Explore bindless rendering in Metal

    Unleash the full potential of your shaders and implement modern rendering techniques by adding Argument Buffers to adopt bindless rendering. Learn how to make your entire scene and resources available to the GPU to make the most out of raytracing and rasterization pipelines.

    Ressources

    • Rendering reflections in real time using ray tracing
    • Applying realistic material and lighting effects to entities
    • Accelerating ray tracing using Metal
    • Managing groups of resources with argument buffers
    • Metal Feature Set Tables
    • Metal
    • Metal Shading Language Specification
      • Vidéo HD
      • Vidéo SD

    Vidéos connexes

    WWDC22

    • Go bindless with Metal 3

    WWDC21

    • Enhance your app with Metal ray tracing
    • Explore hybrid rendering with Metal ray tracing
    • Optimize high-end games for Apple GPUs
  • Rechercher dans cette vidéo…
    • 0:07 - Simple Intersection Kernel 2

      if(i.type == intersection_type::triangle)
      {
        constant Instance& inst     = get_instance(i);
        constant Mesh&     mesh     = get_mesh(inst, i);
        constant Material& material = get_material(inst, i);
        
        color = shade_pixel(mesh, material, i);
      }   
      
      outImage.write(color, tid);
    • 0:08 - PBR fragment shading requires several textures

      fragment half4 pbrFragment(ColorInOut in [[stage_in]],
                                 texture2d< float > albedo    [[texture(0)]],
                                 texture2d< float > roughness [[texture(1)]],
                                 texture2d< float > metallic  [[texture(2)]],
                                 texture2d< float > occlusion [[texture(3)]])
      {	
      	half4 color = calculateShading(in, albedo, roughness, metallic, occlusion);
      	return color;
      }
    • 0:09 - Bindless makes all textures available via AB navigation

      fragment half4 pbrFragmentBindless(ColorInOut in [[stage_in]], 
                                         device const Scene* pScene [[buffer(0)]])
      {
      	device const Instance& instance = pScene->instances[in.instance_id];
      	device const Material& material = pScene->materials[instance.material_id];
      	
      	half4 color = calculateShading(in, material);
      	
      	return color;
      }
    • 1:48 - Simple Intersection Kernel 1

      if (intersection.type == intersection_type::triangle) 
      {
        // solid blue triangle
        color = float4(0.0f, 0.0f, 1.0f, 1.0f);
      }   
      
      outImage.write(color, tid);
    • 11:33 - Encoder creation

      struct Instance
      {
          constant Mesh*     pMesh            [[id(0)]];
          constant Material* pMaterial        [[id(1)]];
          constant float4x4  modelTransform   [[id(2)]];
      };
    • 11:50 - Encoder via reflection

      // Shader code references scene
      kernel void RTReflections( constant Scene* pScene [[buffer(0)]] );
    • 13:08 - Argument Buffers referenced indirectly

      MTLArgumentDescriptor* meshArg 
      = [MTLArgumentDescriptor argumentDescriptor];
      
      meshArg.index    = 0;
      meshArg.dataType = MTLDataTypePointer;
      meshArg.access   = MTLArgumentAccessReadOnly;
      
      // Declare all other arguments (material and transform)
         
      id<MTLArgumentEncoder> instanceEncoder 
      = [device newArgumentEncoderWithArguments:@[meshArg, 
                                                  materialArg, 
                                                  transformArg]];
    • 16:10 - Navigation 1

      // Instance and Mesh
      
      constant Instance& instance = pScene->instances[intersection.instance_id];
      constant Mesh&     mesh     = instance.mesh[intersection.geometry_id];
      
      // Primitive indices
      
      ushort3 indices; // assuming 16-bit indices, use uint3 for 32-bit
      
      indices.x = mesh.indices[ intersection.primitive_id * 3 + 0 ];
      indices.y = mesh.indices[ intersection.primitive_id * 3 + 1 ];
      indices.z = mesh.indices[ intersection.primitive_id * 3 + 2 ];
    • 16:43 - Navigation 2

      // Vertex data
      
      packed_float3 n0 = mesh.normals[ indices.x ];
      packed_float3 n1 = mesh.normals[ indices.y ];
      packed_float3 n2 = mesh.normals[ indices.z ];
      
      // Interpolate attributes
      
      float3 barycentrics = calculateBarycentrics(intersection);
      float3 normal       = weightedSum(n0, n1, n2, barycentrics);
    • 17:15 - Simple Intersection Kernel

      if(i.type == intersection_type::triangle)
      {
        constant Instance& inst     = get_instance(i);
        constant Mesh&     mesh     = get_mesh(inst, i);
        constant Material& material = get_material(inst, i);
        
        color = shade_pixel(mesh, material, i);
      }   
      
      outImage.write(color, tid);
    • 19:30 - PBR fragment shading requires several textures

      fragment half4 pbrFragment(ColorInOut in [[stage_in]],
                                 texture2d< float > albedo    [[texture(0)]],
                                 texture2d< float > roughness [[texture(1)]],
                                 texture2d< float > metallic  [[texture(2)]],
                                 texture2d< float > occlusion [[texture(3)]])
      {	
      	half4 color = calculateShading(in, albedo, roughness, metallic, occlusion);
      	
        return color;
      }
    • 19:48 - Bindless makes all textures available via AB navigation

      fragment half4 pbrFragmentBindless(ColorInOut in [[stage_in]], 
                                         device const Scene* pScene [[buffer(0)]])
      {
      	device const Instance& instance = pScene->instances[in.instance_id];
      	device const Material& material = pScene->materials[instance.material_id];
      	
      	half4 color = calculateShading(in, material);
      	
      	return color;
      }

Developer Footer

  • Vidéos
  • WWDC21
  • Explore bindless rendering in Metal
  • Open Menu Close Menu
    • iOS
    • iPadOS
    • macOS
    • tvOS
    • visionOS
    • watchOS
    • App Store
    Open Menu Close Menu
    • Swift
    • SwiftUI
    • Swift Playground
    • TestFlight
    • Xcode
    • Xcode Cloud
    • Icon Composer
    • SF Symbols
    Open Menu Close Menu
    • Accessibility
    • Accessories
    • Apple Intelligence
    • Audio & Video
    • Augmented Reality
    • Business
    • Design
    • Distribution
    • Education
    • Games
    • Health & Fitness
    • In-App Purchase
    • Localization
    • Maps & Location
    • Machine Learning & AI
    • Security
    • Safari & Web
    Open Menu Close Menu
    • Documentation
    • Downloads
    • Sample Code
    • Videos
    Open Menu Close Menu
    • Help Guides & Articles
    • Contact Us
    • Forums
    • Feedback & Bug Reporting
    • System Status
    Open Menu Close Menu
    • Apple Developer
    • App Store Connect
    • Certificates, IDs, & Profiles
    • Feedback Assistant
    Open Menu Close Menu
    • Apple Developer Program
    • Apple Developer Enterprise Program
    • App Store Small Business Program
    • MFi Program
    • Mini Apps Partner Program
    • News Partner Program
    • Video Partner Program
    • Security Bounty Program
    • Security Research Device Program
    Open Menu Close Menu
    • Meet with Apple
    • Apple Developer Centers
    • App Store Awards
    • Apple Design Awards
    • Apple Developer Academies
    • WWDC
    Read the latest news.
    Get the Apple Developer app.
    Copyright © 2026 Apple Inc. All rights reserved.
    Terms of Use Privacy Policy Agreements and Guidelines