SlideShare a Scribd company logo
METAL
Quick intro to 3D Graphics and GPU computing
www.sigmapoint.pl
SOME NUMBERS
• One frame of 1920x1080 is over 8MB of data
• 60fps gives ~ 17ms to render a frame
• Witcher 3’s world area is about 136km2 - one
meter spaced grid (awful) takes over 2GB alone
• 7
AND SOME PHYSICS
• Light is weird - and really complicated (also computationally)
• Luminosity has aVERY big range, which your eyes can somewhat
cope with - but you monitor can’t
• Atomic structure of an object heavily influences it’s interaction
with light
• Water has no color - but it reflects, refracts and diffracts light
• Modelling water (liquid, gas) movement is hard
HDR
“Ahh, it’s nothing what it really looks like”
Simple shadow changes perception a lot
I really like these illusions and I need more slides with pictures
Let’s do this!
SIMPLE PROJECTION
JUST KIDDING
But your program is really going to do this
VERTICES
FRAGMENTS
Decent per-fragment shading with very simple geometry
TEXTURING
More than just images
CPUVS GPU
Multipurpose vs streamlined
PIPELINE
PIPELINE IN CODE
RENDER PASS
SHADERS
DEMOTIME
OVERTHE HUMP
Means it’s downhill from now on
TEXTURING AIN’T SO EASY
LET’S ADD SHADOWS
Surfaces shading themselves thanks to floating point errors
JUST ADD A MARGIN AND…
Our object appears to be floating above the ground
COSTLY DETAILS
Small color differences, big effect
WHY LEARN METAL
• Multicore machines are standard, OpenGL is inherently one thread only,
pipeline stall is still a thing
• OpenGL started as an abstraction that hid the GPU altogether - your
program might still revert to CPU rendering without a warning
• Deprecated APIs everywhere, nothing was ever removed
• Backwards compatibility means magic arguments to functions that used
to do something completely different
• Really hard for beginners, practically impossible/inviable to master
Or why you shouldn’t bother with OpenGL
DEBUGGING
“You forgot to unbind a buffer here”
MEANWHILE, IN METAL
• Designed for multithreaded processing
• Simplifies interaction with GPU instead of pretending
it’s not there
• Clean, well documented API
• Helpful assertions everywhere, compile-time errors
for shaders, debugging facilities
Thanks!
Contact:
grzegorz.sikorski@sigmapoint.pl
@Sigmapoint_pl
Images from the Interwebs:
http://www.moline.com/equip%20cutters%20dies.htm
http://computersnetto.blogspot.com/2015/02/old-computers.html
http://smashinghub.com/amazing-optical-illusion-photos.htm
http://http.developer.nvidia.com/GPUGems/gpugems_ch25.html
https://www.opengl.org/discussion_boards/showthread.php/162308-per-vertex-lighting-vs-per-pixel-lighting/page2
http://www.3dgep.com/rendering-and-special-effects-in-unity-3-5/
https://commons.wikimedia.org/wiki/File:Swiss_army_knife_closed_20050612.jpg
http://www.game-debate.com/blog/?b_id=1943&author=TeroMarsu&title=Graphical%20Effects%20Explained&page=2
http://www.fabiensanglard.net/shadowmapping/index.php
http://www.independentdeveloper.com/archive/2007/12/08/ac3d-plugin-nmf-ati-normal-map-exporter
https://www.flickr.com/photos/sudhee/82891943
www.sigmapoint.pl

More Related Content

PDF
Serious Animation (an introduction to Web Animations)
PDF
Пиксельные шейдеры для Web-разработчиков. Программируем GPU / Денис Радин (Li...
PDF
Animations on Fire - Making Web animations fast
PPTX
Cloud computing presentation by Pinky
PDF
Coffee script grunt
ZIP
Rails in the Cloud
PPT
DigitalCreationLita
PDF
[CocoaHeads Tricity] Michał Zygar - Consuming API
Serious Animation (an introduction to Web Animations)
Пиксельные шейдеры для Web-разработчиков. Программируем GPU / Денис Радин (Li...
Animations on Fire - Making Web animations fast
Cloud computing presentation by Pinky
Coffee script grunt
Rails in the Cloud
DigitalCreationLita
[CocoaHeads Tricity] Michał Zygar - Consuming API

Viewers also liked (6)

PDF
GPU Programming: Chicago CocoaConf 2015
PDF
iOS & Android Dev in C# & Visual Studio using Xamarin
PDF
Lecture 07 swift
PDF
Building Your First Android App with Xamarin
PDF
Building Mobile Cross-Platform Apps for iOS, Android & Windows in C# with Xam...
PDF
Build Features, Not Apps
GPU Programming: Chicago CocoaConf 2015
iOS & Android Dev in C# & Visual Studio using Xamarin
Lecture 07 swift
Building Your First Android App with Xamarin
Building Mobile Cross-Platform Apps for iOS, Android & Windows in C# with Xam...
Build Features, Not Apps
Ad

Similar to iOS intro to 3D graphics with Metal (20)

PDF
Gpu Programming With GPUImage and Metal
PDF
GPU Programming 360iDev
PDF
GPU Programming: CocoaConf Atlanta
PPTX
Android performance
PDF
Metail Skin Colour Authoring Tool
PDF
Android open gl2_droidcon_2014
PDF
AWS to Bare Metal: Motivation, Pitfalls, and Results
PDF
Power of WebGL (FSTO 2014)
PDF
Deferred shading
PPTX
The Rendering Pipeline - Challenges & Next Steps
PPTX
Adding more visuals without affecting performance
PDF
Digibury: Project Conway Big Reveal Part 2- the hardware build
PDF
Accelerating Data Science with Better Data Engineering on Databricks
PPT
Tessellation on any_budget-gdc2011
PPTX
PPT
How we optimized our Game - Jake & Tess' Finding Monsters Adventure
PPTX
Computer Graphics
PPTX
Future Directions for Compute-for-Graphics
PPTX
Unite Berlin 2018 - Book of the Dead Optimizing Performance for High End Cons...
PDF
Optimizing the graphics pipeline with compute
Gpu Programming With GPUImage and Metal
GPU Programming 360iDev
GPU Programming: CocoaConf Atlanta
Android performance
Metail Skin Colour Authoring Tool
Android open gl2_droidcon_2014
AWS to Bare Metal: Motivation, Pitfalls, and Results
Power of WebGL (FSTO 2014)
Deferred shading
The Rendering Pipeline - Challenges & Next Steps
Adding more visuals without affecting performance
Digibury: Project Conway Big Reveal Part 2- the hardware build
Accelerating Data Science with Better Data Engineering on Databricks
Tessellation on any_budget-gdc2011
How we optimized our Game - Jake & Tess' Finding Monsters Adventure
Computer Graphics
Future Directions for Compute-for-Graphics
Unite Berlin 2018 - Book of the Dead Optimizing Performance for High End Cons...
Optimizing the graphics pipeline with compute
Ad

iOS intro to 3D graphics with Metal

  • 1. METAL Quick intro to 3D Graphics and GPU computing www.sigmapoint.pl
  • 2. SOME NUMBERS • One frame of 1920x1080 is over 8MB of data • 60fps gives ~ 17ms to render a frame • Witcher 3’s world area is about 136km2 - one meter spaced grid (awful) takes over 2GB alone • 7
  • 3. AND SOME PHYSICS • Light is weird - and really complicated (also computationally) • Luminosity has aVERY big range, which your eyes can somewhat cope with - but you monitor can’t • Atomic structure of an object heavily influences it’s interaction with light • Water has no color - but it reflects, refracts and diffracts light • Modelling water (liquid, gas) movement is hard
  • 4. HDR “Ahh, it’s nothing what it really looks like”
  • 5. Simple shadow changes perception a lot
  • 6. I really like these illusions and I need more slides with pictures
  • 9. JUST KIDDING But your program is really going to do this
  • 12. Decent per-fragment shading with very simple geometry
  • 20. OVERTHE HUMP Means it’s downhill from now on
  • 22. LET’S ADD SHADOWS Surfaces shading themselves thanks to floating point errors
  • 23. JUST ADD A MARGIN AND… Our object appears to be floating above the ground
  • 24. COSTLY DETAILS Small color differences, big effect
  • 25. WHY LEARN METAL • Multicore machines are standard, OpenGL is inherently one thread only, pipeline stall is still a thing • OpenGL started as an abstraction that hid the GPU altogether - your program might still revert to CPU rendering without a warning • Deprecated APIs everywhere, nothing was ever removed • Backwards compatibility means magic arguments to functions that used to do something completely different • Really hard for beginners, practically impossible/inviable to master Or why you shouldn’t bother with OpenGL
  • 26. DEBUGGING “You forgot to unbind a buffer here”
  • 27. MEANWHILE, IN METAL • Designed for multithreaded processing • Simplifies interaction with GPU instead of pretending it’s not there • Clean, well documented API • Helpful assertions everywhere, compile-time errors for shaders, debugging facilities
  • 29. Contact: grzegorz.sikorski@sigmapoint.pl @Sigmapoint_pl Images from the Interwebs: http://www.moline.com/equip%20cutters%20dies.htm http://computersnetto.blogspot.com/2015/02/old-computers.html http://smashinghub.com/amazing-optical-illusion-photos.htm http://http.developer.nvidia.com/GPUGems/gpugems_ch25.html https://www.opengl.org/discussion_boards/showthread.php/162308-per-vertex-lighting-vs-per-pixel-lighting/page2 http://www.3dgep.com/rendering-and-special-effects-in-unity-3-5/ https://commons.wikimedia.org/wiki/File:Swiss_army_knife_closed_20050612.jpg http://www.game-debate.com/blog/?b_id=1943&author=TeroMarsu&title=Graphical%20Effects%20Explained&page=2 http://www.fabiensanglard.net/shadowmapping/index.php http://www.independentdeveloper.com/archive/2007/12/08/ac3d-plugin-nmf-ati-normal-map-exporter https://www.flickr.com/photos/sudhee/82891943 www.sigmapoint.pl