Metal Programming Guide

Tutorial and Reference via Swift

E-book Engels 2017 9780134668956
Verwachte levertijd ongeveer 9 werkdagen

Samenvatting

Master Metal: The Next-Generation Graphics and GPU Programming Platform for Apple Developers

 

Metal enables Apple developers to maximize performance in demanding tasks like 3D graphics, games, scientific programming, visualization, and GPU-accelerated machine learning. Metal® Programming Guide is the authoritative, practical guide to Metal for all iOS programmers who are interested in graphics programming but don’t know where to start.

 

Pioneering Apple developer Janie Clayton covers everything from basic draw calls to advanced parallel computing, combining easy-to-understand conceptual explanations with well-tested Swift 4/Xcode 9 sample code (available for download at GitHub).

 

Clayton introduces the essential Metal, graphics, and math concepts every graphics programmer needs to know. She also discusses key graphics-specific libraries, concepts, and Metal Classes, presenting techniques and examples you’ll find valuable for both graphics and data processing. Clayton also provides coverage of the Metal Compute Pipeline, demonstrating practical GPU programming applications ranging from image processing to neural networking.
Quickly get a basic Metal project running Work with Metal resources and memory management Learn how shaders are compiled and accessed by the CPU Program both 2D and 3D graphics with Metal Import 3D models and assets from Blender, Maya, and other programs Apply imported textures to model objects Use multipass rendering to efficiently implement computationally expensive techniques Leverage tessellation to reduce mesh detail Use the GPU for a wide spectrum of general-purpose computing applications Get started with the Metal Performance Shaders Framework

Specificaties

ISBN13:9780134668956
Taal:Engels
Bindwijze:e-book

Lezersrecensies

Wees de eerste die een lezersrecensie schrijft!

Inhoudsopgave

<p style="margin:0px;">Preface xvii</p> <p style="margin:0px;">Acknowledgments xxiii</p> <p style="margin:0px;">About the Author xxv</p> <p style="margin:0px;">&nbsp;</p> <p style="margin:0px;">Part I: Metal Basics 1</p> <p style="margin:0px;">&nbsp;</p> <p style="margin:0px;">Chapter 1: What Is Metal? 3</p> <p style="margin:0px;">History of Graphics APIs 4</p> <p style="margin:0px;">Metal: The New Way to Do Graphics on Apple Platforms 6</p> <p style="margin:0px;">Metal in Context: How Metal Complements and Supports Other Platform Frameworks 10</p> <p style="margin:0px;">Summary 10</p> <p style="margin:0px;">&nbsp;</p> <p style="margin:0px;">Chapter 2: Overview of Rendering and Raster Graphics 13</p> <p style="margin:0px;">Representing the GPU 14</p> <p style="margin:0px;">Preparing Data for the GPU 16</p> <p style="margin:0px;">Summary 24</p> <p style="margin:0px;">&nbsp;</p> <p style="margin:0px;">Chapter 3: Your First Metal Application (Hello, Triangle!) 25</p> <p style="margin:0px;">Creating a Metal Application in Xcode (without Using a Template) 25</p> <p style="margin:0px;">Creating a MTLDevice 28</p> <p style="margin:0px;">Creating a CAMetalLayer 28</p> <p style="margin:0px;">Creating a Vertex Buffer 29</p> <p style="margin:0px;">A First Look at Shaders 31</p> <p style="margin:0px;">Libraries, Functions, and Pipeline States 34</p> <p style="margin:0px;">Introducing Render Passes 35</p> <p style="margin:0px;">Introducing MetalKit Features and MTKView 39</p> <p style="margin:0px;">Summary 40</p> <p style="margin:0px;">&nbsp;</p> <p style="margin:0px;">Part II: Rendering and Graphics 41</p> <p style="margin:0px;">&nbsp;</p> <p style="margin:0px;">Chapter 4: Essential Mathematics for Graphics 43</p> <p style="margin:0px;">Language of Mathematics 43</p> <p style="margin:0px;">Coordinate Spaces and Moving among Them 44</p> <p style="margin:0px;">Points, Vectors, and Vector Operations 46</p> <p style="margin:0px;">Normalization and Unit Vectors 49</p> <p style="margin:0px;">Pythagorean Theorem 50</p> <p style="margin:0px;">Sine, Cosine, and Tangent 52</p> <p style="margin:0px;">Matrices and Matrix Operations 53</p> <p style="margin:0px;">Transformations: Scale, Translation, Rotation, Projection 55</p> <p style="margin:0px;">Summary 60</p> <p style="margin:0px;">&nbsp;</p> <p style="margin:0px;">Chapter 5: Introduction to Shaders 61</p> <p style="margin:0px;">Metal Shading Language Overview 61</p> <p style="margin:0px;">Setting Up Shaders 63</p> <p style="margin:0px;">Your First Shader: Pass Through 63</p> <p style="margin:0px;">Writing Your First Shader 68</p> <p style="margin:0px;">Uniform Buffer 74</p> <p style="margin:0px;">Summary 82</p> <p style="margin:0px;">&nbsp;</p> <p style="margin:0px;">Chapter 6: Metal Resources and Memory Management 83</p> <p style="margin:0px;">Introduction to Resources in Metal 83</p> <p style="margin:0px;">The Argument Table: Mapping between Shader Parameters and Resources 84</p> <p style="margin:0px;">Buffers 85</p> <p style="margin:0px;">Resource Options: Storage Mode, Cache Mode, Purgeability 86</p> <p style="margin:0px;">Preparing Data for the Vertex Shader and Vertex Descriptors 87</p> <p style="margin:0px;">Copying to and from Buffers 88</p> <p style="margin:0px;">Introduction to Textures 89</p> <p style="margin:0px;">Copying to and from Textures 93</p> <p style="margin:0px;">Compressed Texture Support 94</p> <p style="margin:0px;">The Blit Command Encoder 94</p> <p style="margin:0px;">Generating Mipmaps 96</p> <p style="margin:0px;">Summary 97</p> <p style="margin:0px;">&nbsp;</p> <p style="margin:0px;">Chapter 7: Libraries, Functions, and Pipeline States 99</p> <p style="margin:0px;">What Are Libraries and Functions? 99</p> <p style="margin:0px;">The Metal Two-Phase Compilation Architecture 100</p> <p style="margin:0px;">Creating Libraries at Compile Time and Runtime 101</p> <p style="margin:0px;">Command Encoders 103</p> <p style="margin:0px;">Render Pipeline Descriptors and State 104</p> <p style="margin:0px;">Pipeline Reflection 105</p> <p style="margin:0px;">Summary 105</p> <p style="margin:0px;">&nbsp;</p> <p style="margin:0px;">Chapter 8: 2D Drawing 107</p> <p style="margin:0px;">Metal Graphics Rendering Pipeline 107</p> <p style="margin:0px;">Sample Project: Build a Star 108</p> <p style="margin:0px;">Metal Primitive Types 113</p> <p style="margin:0px;">Responding to MTKViewDelegate Methods 115</p> <p style="margin:0px;">Retrieving a Drawable 115</p> <p style="margin:0px;">Creating a Command Buffer 116</p> <p style="margin:0px;">Creating a Command Encoder 117</p> <p style="margin:0px;">Fixed-Function State on the Command Encoder 119</p> <p style="margin:0px;">Passing Data to Shaders 121</p> <p style="margin:0px;">Issuing Draw Calls 124</p> <p style="margin:0px;">Scheduling and Enqueuing Command Buffers 124</p> <p style="margin:0px;">Summary 126</p> <p style="margin:0px;">&nbsp;</p> <p style="margin:0px;">Chapter 9: Introduction to 3D Drawing 127</p> <p style="margin:0px;">Model-View-Projection Transformations 127</p> <p style="margin:0px;">Clip Space and the View Frustum 131</p> <p style="margin:0px;">Shading Models 136</p> <p style="margin:0px;">Basic Lighting 138</p> <p style="margin:0px;">Animation 140</p> <p style="margin:0px;">Summary 141</p> <p style="margin:0px;">&nbsp;</p> <p style="margin:0px;">Chapter 10: Advanced 3D Drawing 143</p> <p style="margin:0px;">Constructing a Hierarchical World with Scene Graphs 143</p> <p style="margin:0px;">Instanced Rendering 145</p> <p style="margin:0px;">Summary 155</p> <p style="margin:0px;">&nbsp;</p> <p style="margin:0px;">Chapter 11: Interfacing with Model I/O 157</p> <p style="margin:0px;">What Are Model Files? 158</p> <p style="margin:0px;">Importing a Model 161</p> <p style="margin:0px;">Meshes and Submeshes 163</p> <p style="margin:0px;">Render State Pipeline 164</p> <p style="margin:0px;">Asset Initialization 165</p> <p style="margin:0px;">Render State Setup and Drawing 166</p> <p style="margin:0px;">Exporting Files 167</p> <p style="margin:0px;">Summary 168</p> <p style="margin:0px;">&nbsp;</p> <p style="margin:0px;">Chapter 12: Texturing and Sampling 169</p> <p style="margin:0px;">Texture Mapping 169</p> <p style="margin:0px;">Mipmapping 171</p> <p style="margin:0px;">Sampling 172</p> <p style="margin:0px;">Precompiled Sampler States 175</p> <p style="margin:0px;">Passing Textures and Samplers to Graphics Functions 177</p> <p style="margin:0px;">Summary 182</p> <p style="margin:0px;">&nbsp;</p> <p style="margin:0px;">Chapter 13: Multipass Rendering Techniques 183</p> <p style="margin:0px;">When (and Why) to Use Multipass Rendering 183</p> <p style="margin:0px;">Metal Render Pass Descriptors 184</p> <p style="margin:0px;">Creating and Managing Render Targets 185</p> <p style="margin:0px;">Revisiting Load-Store Actions 188</p> <p style="margin:0px;">Summary 190</p> <p style="margin:0px;">&nbsp;</p> <p style="margin:0px;">Chapter 14: Geometry Unleashed: Tessellation in Metal 191</p> <p style="margin:0px;">Removing Bottlenecks by Using Tessellation 191</p> <p style="margin:0px;">Catmull-Clark Subdivision 192</p> <p style="margin:0px;">Per-Patch Tessellation Factors 195</p> <p style="margin:0px;">Metal Tessellation Fixed-Function Pipeline 197</p> <p style="margin:0px;">Setting Up a Tessellation Kernel 201</p> <p style="margin:0px;">Post-Tessellation Vertex Function 202</p> <p style="margin:0px;">Draw Patches 204</p> <p style="margin:0px;">Summary 208</p> <p style="margin:0px;">&nbsp;</p> <p style="margin:0px;">Part III: Data Parallel Programming 209</p> <p style="margin:0px;">&nbsp;</p> <p style="margin:0px;">Chapter 15: The Metal Compute Pipeline 211</p> <p style="margin:0px;">Introduction to GPU Programming 212</p> <p style="margin:0px;">Concurrency versus Parallelism 213</p> <p style="margin:0px;">Using GPUs for General Computation 216</p> <p style="margin:0px;">Kernel Functions 217</p> <p style="margin:0px;">The Metal Compute Command Encoder 218</p> <p style="margin:0px;">Issuing Grids of Work 220</p> <p style="margin:0px;">Finding Your Way in the Grid inside the Kernel Function 223</p> <p style="margin:0px;">Reading and Writing Resources in Kernel Functions 223</p> <p style="margin:0px;">Summary 224</p> <p style="margin:0px;">&nbsp;</p> <p style="margin:0px;">Chapter 16: Image Processing in Metal 225</p> <p style="margin:0px;">Introduction to Image Processing 225</p> <p style="margin:0px;">Creating a Metal Texture 227</p> <p style="margin:0px;">Desaturation Kernels 230</p> <p style="margin:0px;">Convolution and Dispatching a 2D Grid 232</p> <p style="margin:0px;">Blur Effects 235</p> <p style="margin:0px;">Selecting an Optimal Threadgroup Size 238</p> <p style="margin:0px;">Summary 239</p> <p style="margin:0px;">&nbsp;</p> <p style="margin:0px;">Chapter 17: Machine Vision 241</p> <p style="margin:0px;">How a Computer Sees the World 241</p> <p style="margin:0px;">Noise and Smoothing 242</p> <p style="margin:0px;">Sobel Edge Detection 244</p> <p style="margin:0px;">Thresholding 245</p> <p style="margin:0px;">Histograms 246</p> <p style="margin:0px;">Facial Recognition 246</p> <p style="margin:0px;">Summary 253</p> <p style="margin:0px;">&nbsp;</p> <p style="margin:0px;">Chapter 18: Metal Performance Shaders Framework 255</p> <p style="margin:0px;">Overview of Metal Performance Shaders Framework 255</p> <p style="margin:0px;">Image Processing with the MPS Framework 257</p> <p style="margin:0px;">Matrix Operations with MPS 267</p> <p style="margin:0px;">Summary 269</p> <p style="margin:0px;">&nbsp;</p> <p style="margin:0px;">Chapter 19: Neural Network Concepts 271</p> <p style="margin:0px;">Overview of Neural Networks 271</p> <p style="margin:0px;">Neural Network Components 272</p> <p style="margin:0px;">Neural Network Architecture 281</p> <p style="margin:0px;">Summary 283</p> <p style="margin:0px;">&nbsp;</p> <p style="margin:0px;">Chapter 20: Convolutional Neural Networks 285</p> <p style="margin:0px;">History of Convolutional Neural Networks 285</p> <p style="margin:0px;">MPSImage 289</p> <p style="margin:0px;">Convolutional Neural Network Kernels 290</p> <p style="margin:0px;">Convolution Data Source 296</p> <p style="margin:0px;">Neural Network Graph 298</p> <p style="margin:0px;">Summary 299</p> <p style="margin:0px;">&nbsp;</p> <p style="margin:0px;">Index 301</p>

Managementboek Top 100

Rubrieken

Populaire producten

    Personen

      Trefwoorden

        Metal Programming Guide