beyond programmable shading: in...
TRANSCRIPT
![Page 1: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/1.jpg)
Beyond Programmable Shading: In Action
SIGGRAPH 2008
5/19/2008
Course Organizers: Aaron Lefohn, Intel Mike Houston, AMD
Course Speakers:
Aaron Lefohn Intel Mike Houston AMD David Luebke NVIDIA Jon Olick Id Software Fabio Pellacini Dartmouth College
Speaker Contact Info:
Aaron Lefohn 2700 156th Ave NE, Suite 300 Bellevue, WA 98007 [email protected]
Mike Houston 4555 Great America Parkway Suite 501 Santa Clara, CA 95054 [email protected]
David Luebke 1912 Lynchburg Dr. Charlottesville, VA 22903 [email protected]
Jon Olick 3819 Towne Crossing #222 Mesquite, TX 75150 [email protected]
Fabio Pellacini 6211 Sudikoff Lab Hanover, NH 03755 [email protected]
![Page 2: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/2.jpg)
Beyond Programmable Shading: In Action
Course Description:
This second course in a series will demonstrate case studies of combining traditional rendering API usage with advanced parallel computation from game developers, researchers, and graphics hardware vendors. There are strong indications that the future of interactive graphics programming is a model more flexible than today’s OpenGL/Direct3D pipelines. As such, graphics developers need to have a basic understanding of how to combine emerging parallel programming techniques and more flexible graphics processors with the traditional interactive rendering pipeline. Each case study includes a live demo and discusses the mix of parallel programming constructs used, details of the graphics algorithm, and how the rendering pipeline and computation interact to achieve the technical goals. Intended Audience: We are targeting researchers and engineers interested in investigating advanced graphics techniques using parallel programming techniques on many-core GPU and CPU architectures, as well as graphics and game developers interested in integrating these techniques into their applications. Prerequisites: Attendees are expected to have experience with a modern graphics API (OpenGL or Direct3D), including basic experience with shaders, textures, and framebuffers and/or background with parallel programming languages. Some background with parallel programming on CPUs or GPUs is useful but not required as an overview of will be provided in the course. Attendees are strongly encouraged to attend the first course in this series, “Beyond Programmable Shading: Fundamentals.” Level of difficulty: Advanced Special presentation requirements: Several speakers will bring their own demo machines for use in the course. Speakers: - Aaron Lefohn, Intel - Mike Houston, AMD - David Luebke, NVIDIA - Jon Olick, Id Software - Fabio Pellacini, Dartmouth College
![Page 3: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/3.jpg)
“Beyond Programmable Shading: In Action” - Introduction: Mike Houston: 15 min
o Brief recap of course 1 From programmable shading to fully programmable graphics List of programming environment possibilities Recap of benefits over using the traditional graphics pipeline Teaser pictures for case studies
(NOTE: All case studies will discuss the graphics algorithms, the mix of parallel computation being used to achieve the effect(s), as well as performance and of course pretty pictures)
- Research Case Study
o Interactive Cinematic Lighting: Fabio Pellacini: 30 min The fake: pre-computing your way to interactive global illumination
on a GPU The real deal: no-pre-computation global illumination in 5 seconds
with CPUs + GPU What it will take to do this 500 times faster
- Games Case Studies
o Current Generation Parallelism in Games: Jon Olick (Sony/Id): 30 min Offloading work from the GPU to many CPU cores Triangle culling, progressive meshes, displacement maps Geometry compression / decompression: indices, vertices Tightly-coupled CPU-GPU synchronization techniques
o Next Generation Parallelism in Games: Jon Olick (Id): 30 min Why ray casting? What are the advantages over rasterization? Does it add end-user value? Risks? Efficient implementations, control flow, data structures
- Break, 15 minutes - Graphics Hardware Vendor Case Studies
o Each of the hardware vendor talks will give a case study covering several advanced graphics algorithms that require a mix of data- and/or task-parallel computation as well as the traditional graphics pipeline. Example topics may include, but are not limited to:
Interactive global illumination Building/using irregular data structures during interactive rendering Combining real-time physics and rendering Combining ray tracing and rasterization
o Each case study will describe the graphics algorithms, the data structures used/built, the parallel algorithms and programming tools used, as well as give live demos.
![Page 4: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/4.jpg)
o The details of the case studies cannot be revealed at this time due to intellectual property limitations; however, each of the vendors and speakers has a strong reputation of delivering cutting-edge content and algorithm design to the SIGGRAPH community.
NVIDIA case study: 30 min AMD case study: 30 min Intel case study: 30 min
- Conclusions: Lefohn + All Speakers: 15 min
o Summary of state-of-the-world o Guesses at the future o Open Q & A with all speakers
Speaker Biographies
Aaron Lefohn, Ph.D.
Aaron Lefohn is a Senior Graphics Architect at Intel on the Larrabee project. Previously, he designed parallel programming models for graphics as a Principal Engineer at Neoptica, a computer graphics startup that was acquired by Intel in October 2007. Aaron's Ph.D. in Computer Science from the University of California Davis focused on data structure abstractions for graphics processors and data-parallel algorithms for rendering. From 2003 - 2006, he was a researcher and graphics software engineer at Pixar Animation Studios, focusing on interactive rendering tools for artists and GPU acceleration of RenderMan. Aaron was formerly a theoretical chemist and was an NSF graduate fellow in computer science.
Aaron Lefohn 2700 156th Ave NE, Suite 300 Bellevue, WA 98007 425-881-4891 [email protected]
Mike Houston, Ph.D.
Mike Houston is a System Architect in the Advanced Technology Development group at AMD in Santa Clara working in architecture design and programming models for parallel architectures. He received his Ph.D. in Computer Science from Stanford University in 2008 focusing on research in programming models, algorithms, and runtime systems for parallel architectures including GPUs, Cell, multi-core, and clusters. His dissertation includes the Sequoia runtime system, a system for programming hierarchical memory machines. He received his BS in
![Page 5: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/5.jpg)
Computer Science from UCSD in 2001 and is a recipient of the Intel Graduate Fellowship.
Mike Houston 4555 Great America Parkway Suite 501 Santa Clara, CA 95054 408-572-6010 [email protected],
David Luebke, Ph.D.
David Luebke is a Research Scientist at NVIDIA Corporation, which he joined after eight years on the faculty of the University of Virginia. He has a Ph.D. in Computer Science from the University of North Carolina and a B.S. in Chemistry from the Colorado College. Luebke's research interests are GPU computing and realistic real-time computer graphics. Recent projects include advanced reflectance and illumination models for real-time rendering, image-based acquisition of real-world environments, temperature-aware graphics architecture, and scientific computation on GPUs. Past projects include leading the book "Level of Detail for 3D Graphics" and the Virtual Monticello museum exhibit at the New Orleans Museum of Art.
David Luebke 1912 Lynchburg Dr. Charlottesville, VA 22903 434-409-1892 [email protected]
Jon Olick
Jon Olick has been working on games and games technology professionally for the past 9 years, helping to create multi-million selling games such as Medal of Honor: Allied Assault. Currently, Jon is a Programmer and Engineer at id Software. Previously, on the ICE team (a technology group based at Naughty Dog) he played key architecture roles in the design and development of many Sony first and third party tools and technologies for PlayStation 3. This work has already been used in game titles such as Uncharted: Drakes Fortune, Resistance: Fall of Man, Heavenly Sword, NBA 07, Warhawk, MotorStorm and MLB 2007. He is a published author in the book GPU Gems 2. Jon Olick 3819 Towne Crossing #222 Mesquite, TX 75150
![Page 6: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/6.jpg)
918-407-3744 [email protected]
Fabio Pellacini, Ph.D.
Fabio Pellacini is an assistant professor in computer science at Dartmouth College. His research focuses on algorithms for interactive, high-quality rendering of complex environments and for artist-friendly material and lighting design to support more effective content creation. Prior to joining academia, Pellacini worked at Pixar Animation Studios on lighting algorithms, where he received credits on various movie productions. Pellacini received his Laurea degree in physics from the University of Parma (Italy), and his M.S. and Ph.D. in computer science from Cornell University. Fabio Pellacini 6211 Sudikoff Lab Hanover, NH 03755 603-646-8710 [email protected]
![Page 7: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/7.jpg)
Beyond Programmable Shading: In Action
Beyond Programmable Shading:Beyond Programmable Shading: In ActionIn Action
Mike HoustonMike HoustonAMDAMD
![Page 8: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/8.jpg)
2Beyond Programmable Shading: In Action
Disclaimer about these Course NotesDisclaimer about these Course Notes
• The material in this course is bleeding edge– Unfortunately, that means we can’t share most of
the details with you until SIGGRAPH 2008– Several talks are missing from the submitted notes– The talks that are included may change substantially
• To address this inconvenience– We will post all course notes/slides on a permanent
web page, available the first day of SIGGRAPH 2008
![Page 9: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/9.jpg)
3Beyond Programmable Shading: In Action
Review from course 1 (Fundamentals)Review from course 1 (Fundamentals)
Future interactive rendering techniques
will be an inseparable mix of data- and task-parallel algorithms
and graphics pipelines
![Page 10: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/10.jpg)
4Beyond Programmable Shading: In Action
How do we write new interactive 3D rendering algorithms?
![Page 11: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/11.jpg)
5Beyond Programmable Shading: In Action
FixedFixed--Function Graphics PipelineFunction Graphics Pipeline
• Writing new rendering algorithms means– Tricks with stencil buffer, depth buffer, blending, …
– Examples• Shadow volumes• Hidden line removal• …
![Page 12: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/12.jpg)
6Beyond Programmable Shading: In Action
Programmable ShadingProgrammable Shading
• Writing new rendering algorithms means– Tricks with stencil buffer, depth buffer, blending, …– Plus: Writing shaders
– Examples• Parallax mapping • Shadow-mapped spot light• …
![Page 13: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/13.jpg)
7Beyond Programmable Shading: In Action
Beyond Programmable ShadingBeyond Programmable Shading
• Writing new rendering algorithms means– Tricks with stencil buffer, depth buffer, blending, …– Plus: Writing shaders– Plus: Writing data- and task-parallel algorithms
• Analyze results of rendering pipeline• Create data structures used in rendering pipeline
– Examples• Dynamic summed area table• Dynamic quadtree adaptive shadow map• Dynamic ambient occlusion• …
![Page 14: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/14.jpg)
8Beyond Programmable Shading: In Action
“Fast Summed-Area Table Generation and its Applications,” Hensley et al., Eurographics 2005
“Resolution Matched Shadow Maps,” Lefohn et al., ACM Transactions on Graphics 2007
“Dynamic Ambient Occlusion and Indirect Lighting,” Bunnell, GPU Gems II, 2005
![Page 15: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/15.jpg)
9Beyond Programmable Shading: In Action
Beyond Programmable ShadingBeyond Programmable Shading
• Writing new rendering algorithms means– Tricks with stencil buffer, depth buffer, blending, …– Plus: Writing shaders– Plus: Writing data- and task-parallel algorithms
• Analyze results of rendering pipeline• Create data structures used in rendering pipeline
– Plus: Extending, modifying, or creating graphics pipelines
– Examples• PlayStation 3 developers creating hybrid Cell/GPU graphics
pipelines– See upcoming talk from Jon Olick (Id Software)
• Active area of research
![Page 16: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/16.jpg)
10Beyond Programmable Shading: In Action
Why Why ““Beyond Programmable Shading?Beyond Programmable Shading?””
• Short answer:– The parallel processors in your desktop machine or
game console are now flexible and powerful enough to execute both• User-defined parallel programs and • Graphics pipelines
• …All within 1/30th of a second
![Page 17: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/17.jpg)
11Beyond Programmable Shading: In Action
This CourseThis Course
• Case studies from game developers, academics, and industry
![Page 18: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/18.jpg)
12Beyond Programmable Shading: In Action
This CourseThis Course
• Show-casing new interactive rendering algorithms that result in more realistic imagery than is possible using only the pre- defined DX/OpenGL graphics pipeline by
• Combining task-, data-, and/or graphics pipeline parallelism,
• Analyzing intermediate data produced by graphics pipeline,
• Building and using complex data structures every frame, or
• Modifying/extending the graphics pipelines
![Page 19: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/19.jpg)
13Beyond Programmable Shading: In Action
Speakers (in order of appearance)Speakers (in order of appearance)
• Mike Houston, AMD• Fabio Pellacini, Dartmouth College • Jon Olick, Id Software• Dave Luebke, NVIDIA • Aaron Lefohn, Intel
![Page 20: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/20.jpg)
14Beyond Programmable Shading: In Action
ScheduleSchedule• Intro 1:45 – 2:00 Houston• Research Case Study
– Interactive Cinematic Lighting 2:00 – 2:30 Pellacini
• Games Case Studies – Current Generation Parallelism in Games 2:30 – 3:00 Olick
– Next Generation Parallelism in Games 3:00 – 3:30 Olick
<Break> 3:30 – 3:45
• Graphics Hardware Vendor Case Studies – NVIDIA 3:45 – 4:15 Luebke– AMD 4:15 – 4:45 Houston– Intel 4:45 – 5:15 Lefohn
• Q & A 5:15+
![Page 21: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/21.jpg)
interactive cinematic lighting
fabiopellacini
joint work with M. Hasan (Cornell), K. Bala (Cornell), K. Vidimce et al. (Pixar)
![Page 22: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/22.jpg)
disclaimer: will skip details
ask questions if interested
![Page 23: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/23.jpg)
digital lighting design
user repeatedly set lighting parameters
feedback: run the rendering algorithm
![Page 24: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/24.jpg)
digital lighting design
user repeatedly set lighting parameters
feedback: run the rendering algorithm
goal: interactive feedback
![Page 25: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/25.jpg)
digital lighting design
user repeatedly set lighting parameters
feedback: run the rendering algorithm
goal: intuitive interfaces
![Page 26: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/26.jpg)
“I have started to work in this field more than 15 years ago. I do not understand why, while computers get faster, it takes us more time than before to make an image”
- jc kalache, dp, pixar
![Page 27: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/27.jpg)
cinematic rendering
• high geometric complexity105 smooth primitives
• high shading complexity103shaders with 105 ops with 5 GBs textures
• high quality antialiasingno artifacts with depth-of-field, motion blur
• complex lightingindirect illumination, subsurface scattering,environment lighting, ambient occlusion
![Page 28: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/28.jpg)
cinematic rendering
• high geometric complexity105 smooth primitives
• high shading complexity103shaders with 105 ops with 5 GBs textures
• high quality antialiasingno artifacts with depth-of-field, motion blur
• complex lightingindirect illumination, subsurface scattering,environment lighting, ambient occlusion
![Page 29: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/29.jpg)
goal: interactive feedback
in complex environments with high accuracy
![Page 30: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/30.jpg)
cinematic rendering
• high geometric complexity105 smooth primitives
• high shading complexity103shaders with 105 ops with 5 GBs textures
• high quality antialiasingno artifacts with depth-of-field, motion blur
• complex lightingindirect illumination, subsurface scattering,environment lighting, ambient occlusion
![Page 31: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/31.jpg)
direct indirect
first indirect bounce other indirect bouncesdirect bounce
![Page 32: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/32.jpg)
[image courtesy of B. Walter]
![Page 33: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/33.jpg)
complex lighting as many-lights
lighting simulation converted to “virtual” point lights
[image courtesy of B. Walter]
![Page 34: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/34.jpg)
= Σ
= Σ
= Σ
![Page 35: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/35.jpg)
~1M
pix
els
~100k lights
![Page 36: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/36.jpg)
![Page 37: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/37.jpg)
~ 0.1 s
~ 30 m
real
tim
eof
flin
e
computing one column
[SIGGRAPH 2005b][SIGGRAPH 2005a]
lpicsimages
![Page 38: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/38.jpg)
method:
cache
approx.
data-parallel hardware
lpicsimages
![Page 39: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/39.jpg)
results: artist at work
one column at a time
lpicsimages
![Page 40: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/40.jpg)
motion blur and depth of field
[Regan-Kelley et al., SIGGRAPH 2007]
lightspeedimages
![Page 41: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/41.jpg)
impact: interactivity for cinematic lighting changes
artists workflow
![Page 42: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/42.jpg)
lessons learned
• interactive cinematic lighting is possible• interactive algorithms mostly match offline• hard to match: shader as content is bad!• render-dependent look definition
![Page 43: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/43.jpg)
10 min 13 min 20 min
brute force too slow
![Page 44: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/44.jpg)
direct on virtual lights
indirect illumination
cache
[SIGGRAPH 2006]
![Page 45: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/45.jpg)
method:
precompute (sparsely) matrix compress by signal processing data-parallel sparse multiply
![Page 46: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/46.jpg)
![Page 47: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/47.jpg)
3D virtual lights arrange into image wavelet transform
method: impose a wavelet basis, by clustering, then lossily compress
coherence → sparse light vector
![Page 48: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/48.jpg)
method: impose same wavelet basis for rowsconstruct sparse images for each columns
coherence → sparse matrixaf
ter w
avel
et x
form
orig
inal
col
umns
lit b
y w
avel
et li
ghts
lit b
y or
igin
al li
ghts
![Page 49: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/49.jpg)
results
precomputation: 1.6 h
11.4 – 18.7 fps
107k polys
![Page 50: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/50.jpg)
results
precomputation: 2.5 h
8.5 – 25.8 fps
2.1M polys
![Page 51: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/51.jpg)
impact: highest quality interactive illumination for
lighting design to date
![Page 52: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/52.jpg)
lessons learned
• interactive global illumination is possible• interactive algorithms do not match offline• operations: rasterize, shade, other kernels• other kernels are CPU or (painfully) GPU
![Page 53: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/53.jpg)
required improvement:
dynamic environments with no precomputation
![Page 54: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/54.jpg)
900
pixe
ls
700 lights
insight:
[SIGGRAPH 2007]
![Page 55: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/55.jpg)
similarcolumns
intuition: coherence → low rank
![Page 56: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/56.jpg)
![Page 57: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/57.jpg)
renderrepresentatives
final image asweighted sum
![Page 58: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/58.jpg)
clustercolumns
renderrepresentatives
final image asweighted sum
method:cluster similar columns render representatives
computed sum
![Page 59: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/59.jpg)
unknownmatrix
render rowson GPU
assemblerows intoreducedmatrix
clusterreducedcolumns
renderrepresentative
columnson GPU
final image asweighted sum ofrepresentative
columns
method:render a few rows,
cluster reduced columns
![Page 60: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/60.jpg)
sum of column pairs
norms of reduced columns
dist of reduced columns
cost of all
clusters
cluster metric
clustering as unbiased importance sampling
![Page 61: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/61.jpg)
results
300 rows / 900 cols: ~ 17 s reference: ~ 17 m
2.1 M polys / 100 k lights
![Page 62: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/62.jpg)
results
complex geometry and arbitrary materials/lights
![Page 63: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/63.jpg)
comparison to state of the art
> 30x for same quality
insight: data parallel queries
stoc
hast
ic p
oint
sam
plin
g on
CPU
stoc
hast
ic “
cohe
rent
”sa
mpl
ing
on G
PU
![Page 64: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/64.jpg)
impact: fastest algorithm for previewing accurate lighting
![Page 65: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/65.jpg)
next: geometric scalability (cities, forests, crowds in secs)
![Page 66: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/66.jpg)
take home message
• shaders are not content (renderer lock)• complex lighting does not map to GL/DX• GL/DX are great for other applications• for us, GL/DX complexity is not useful• for us, GL/DX constraints’ stifle innovation
![Page 67: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/67.jpg)
questions?
![Page 68: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/68.jpg)
Beyond Programmable Shading: In Action
Current Generation Parallelism Current Generation Parallelism In GamesIn Games
Jon Jon OlickOlickid Softwareid Software
![Page 69: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/69.jpg)
Beyond Programmable Shading: In Action
Brief History of ParallelismBrief History of Parallelism
• 1 Processor– The good old days.– Why parallelize? Just wait a little and your programs
will get faster.
![Page 70: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/70.jpg)
Beyond Programmable Shading: In Action
Brief History of ParallelismBrief History of Parallelism
• 2 to 3 Processors– Logical splitting of game process into pipelined
pieces.• Game• Rendering• Sound• Loading/Decompression
![Page 71: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/71.jpg)
Beyond Programmable Shading: In Action
Brief History of ParallelismBrief History of Parallelism
• About 6 to 8 Processors– The transition to a job scheduling type architecture– 1st order parallelism
• Game• Rendering• Sound• Physics• Collision• Loading/Decompression• Etc…
![Page 72: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/72.jpg)
Beyond Programmable Shading: In Action
Brief History of ParallelismBrief History of Parallelism
• About 8 to 16 Processors– End of CPU history.– Enter 1998 in GPU history.
• Approx # of processors as average parallel scalar operations.
– 2nd order parallelism– Jobs which create and manage the resources of
other jobs.• GPU Command Processor (DMA engine)
![Page 73: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/73.jpg)
Beyond Programmable Shading: In Action
Brief History of ParallelismBrief History of Parallelism
• About 16+ processors– 3rd order parallelism– Jobs which create and manage the resources of
other jobs which create and manage the resources of other jobs• GPU Vertex Processors
![Page 74: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/74.jpg)
Beyond Programmable Shading: In Action
Brief History of ParallelismBrief History of Parallelism
![Page 75: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/75.jpg)
Beyond Programmable Shading: In Action
Current State of ParallelismCurrent State of Parallelism
• Desktop Processors– Intel Core 2 Quad - 4 processors - 3.2 ghz - 51.2
Gflops (102.4 Gflops theoretical)• Soon to be 8 core?
• Multimedia Processors– Cell Processor - 8 processors - 3.2 ghz - 134.4 Gflops
(192.0 Gflops theoretical)• 1 main, 7 co-processors
• Graphics Accelerators– 8800 GTX - 1.35 ghz - 345.6 Gflops (518.43 Gflops
theoretical)• 128 stream processors
![Page 76: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/76.jpg)
Beyond Programmable Shading: In Action
THE CELL PROCESSORTHE CELL PROCESSOR
![Page 77: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/77.jpg)
Beyond Programmable Shading: In Action
PLAYSTATIONPLAYSTATION®®3 Cell Processor Overview3 Cell Processor Overview
• Game• Animation• Geometry Processing• Post Processing• Occlusion Rasterization• Sorting• Collision Detection• Fourier Transform• (De)Compression• Not going to cover all of these…
![Page 78: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/78.jpg)
Beyond Programmable Shading: In Action
PLAYSTATIONPLAYSTATION®®3 Cell Processor Overview3 Cell Processor Overview
• Parallelize ordinarily sequential CPU processing
• Assist in what is typically considered GPU processing
![Page 79: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/79.jpg)
Beyond Programmable Shading: In Action
PLAYSTATIONPLAYSTATION®®3 Cell Processor Overview3 Cell Processor Overview
• Fitting code and data in the 256k local co- processor memory
• Best solutions are ones that don't treat the 256k local store as a typical on demand caching architecture– Scattered reads bad, sequential reads good
• Software Pipelining• Only 16 bytes aligned reads/writes• Synchronization
![Page 80: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/80.jpg)
Beyond Programmable Shading: In Action
MD6 ANIMATION PROCESSINGMD6 ANIMATION PROCESSING
![Page 81: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/81.jpg)
Beyond Programmable Shading: In Action
GameLogic
MD6 Animation ProcessingMD6 Animation Processing
![Page 82: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/82.jpg)
Beyond Programmable Shading: In Action
Blending TreeGeneration
GameLogic
MD6 Animation ProcessingMD6 Animation Processing
![Page 83: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/83.jpg)
Beyond Programmable Shading: In Action
Low Level OperationList Generation
Blending TreeGeneration
GameLogic
MD6 Animation ProcessingMD6 Animation Processing
![Page 84: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/84.jpg)
Beyond Programmable Shading: In Action
Low Level Operation Execution
Low Level OperationList Generation
Blending TreeGeneration
GameLogic
MD6 Animation ProcessingMD6 Animation Processing
![Page 85: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/85.jpg)
Beyond Programmable Shading: In Action
Low Level Operation Execution
Low Level OperationList Generation
Blending TreeGeneration
GameLogic
Serial
Parallel
MD6 Animation ProcessingMD6 Animation Processing
![Page 86: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/86.jpg)
Beyond Programmable Shading: In Action
• Additive Blending• Subtractive Blending• Animation Algebra
– Blend Equations• Animation blending trees in the form of an equation.• Example equation:
– (animA + animB) – animC
MD6 Animation ProcessingMD6 Animation Processing
![Page 87: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/87.jpg)
Beyond Programmable Shading: In Action
Partial Animation BlendingPartial Animation Blending
• Generalized play an animation only on the face, torso, etc…
• One weight per joint per animation• Compute alpha for slerp via following
equation:– For each joint
• Let w0 = weight of joint in animation A• Let w1 = weight of joint in animation B• If(w1 > w0)
– Let alpha = (alpha * w1) / w0
• Else– Let alpha = ((w1 – w0) + alpha * w0) / w1
![Page 88: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/88.jpg)
Beyond Programmable Shading: In Action
Varying parameter treatmentVarying parameter treatment
![Page 89: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/89.jpg)
Beyond Programmable Shading: In Action
Varying parameter treatmentVarying parameter treatment
![Page 90: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/90.jpg)
Beyond Programmable Shading: In Action
Varying parameter treatmentVarying parameter treatment
16k 16k 16k
![Page 91: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/91.jpg)
Beyond Programmable Shading: In Action
MD6 MD6 Animation WebsAnimation Webs
• Separates Thinking from Representation– Game Object says what it wants to look like.– Animation Webs take care of the rest.
• Unstructured graph– Each node has a blend tree
• Designed with simplicity in mind– Animators should animate, not fiddle with nodes. – Extract as much information as possible directly
from the animation data.
![Page 92: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/92.jpg)
Beyond Programmable Shading: In Action
MD6 MD6 Animation WebsAnimation Webs
![Page 93: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/93.jpg)
Beyond Programmable Shading: In Action
MD6 MD6 Animation WebsAnimation Webs
= “play standAnim”
![Page 94: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/94.jpg)
Beyond Programmable Shading: In Action
MD6 MD6 Animation WebsAnimation Webs
You Are Here
•
Desired State = Stand•
Blend Equation = “play standAnim”
![Page 95: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/95.jpg)
Beyond Programmable Shading: In Action
MD6 MD6 Animation WebsAnimation Webs
•
Desired State = Stand•
Blend Equation = “play standAnim”
![Page 96: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/96.jpg)
Beyond Programmable Shading: In Action
MD6 MD6 Animation WebsAnimation Webs
•
Desired State = Stand•
Blend Equation = “play standAnim”
![Page 97: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/97.jpg)
Beyond Programmable Shading: In Action
MD6 MD6 Animation WebsAnimation Webs
•
Desired State = WalkWalk•
Blend Equation = “play standAnim”
![Page 98: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/98.jpg)
Beyond Programmable Shading: In Action
MD6 MD6 Animation WebsAnimation Webs
•
Desired State = Walk•
Blend Equation = “blend standAnim and walkAnim”
![Page 99: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/99.jpg)
Beyond Programmable Shading: In Action
MD6 MD6 Animation WebsAnimation Webs
•
Desired State = Walk•
Blend Equation = “play walkAnim”
![Page 100: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/100.jpg)
Beyond Programmable Shading: In Action
MD6 MD6 Animation WebsAnimation Webs
•
Desired State = Stand•
Blend Equation = “play standAnim”
![Page 101: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/101.jpg)
Beyond Programmable Shading: In Action
MD6 MD6 Animation WebsAnimation Webs
•
Desired State = Stand•
Blend Equation = “play standAnim”
![Page 102: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/102.jpg)
Beyond Programmable Shading: In Action
MD6 MD6 Animation WebsAnimation Webs
•
Desired Traversal = Stand to Walk•
Desired Direction = ~5 degrees
![Page 103: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/103.jpg)
Beyond Programmable Shading: In Action
MD6 MD6 Animation WebsAnimation Webs
•
Desired Traversal = Stand to Walk•
Desired Direction = ~175 degrees
![Page 104: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/104.jpg)
Beyond Programmable Shading: In Action
MD6 MD6 Animation WebsAnimation Webs
•
Desired State = Run
![Page 105: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/105.jpg)
Beyond Programmable Shading: In Action
MD6 MD6 Animation WebsAnimation Webs
•
Desired Traversal = Run to Cover••
Mechanical Behavior Mechanical Behavior –– Not believableNot believable
![Page 106: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/106.jpg)
Beyond Programmable Shading: In Action
MD6 MD6 Animation WebsAnimation Webs
•
Desired State = Run
![Page 107: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/107.jpg)
Beyond Programmable Shading: In Action
MD6 MD6 Animation WebsAnimation Webs
•
Desired State = Run
![Page 108: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/108.jpg)
Beyond Programmable Shading: In Action
MD6 Animation WebsMD6 Animation Webs
• Automatically picks best animation for search criteria
• Time warps animation to perfectly match criteria
• Works in parallel with game code
![Page 109: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/109.jpg)
Beyond Programmable Shading: In Action
GEOMETRY PROCESSINGGEOMETRY PROCESSING
![Page 110: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/110.jpg)
Beyond Programmable Shading: In Action
Two modes of usageTwo modes of usage
• Primary mode– Use offline tools– Partition into vertex sets– Use indexed triangles– All features of pipeline can be used
SPU
![Page 111: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/111.jpg)
Beyond Programmable Shading: In Action
Two modes of usage (cont)Two modes of usage (cont)
• Secondary mode– Data generated by other tools– Formats other than indexed triangles– Non-partitioned objects– Subset of pipeline features can be used
SPU
![Page 112: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/112.jpg)
Beyond Programmable Shading: In Action
SPU Geometry Pipeline StagesSPU Geometry Pipeline Stages
Index Decompress
Blend Shapes
Skinning
Triangle Culling
Compression
Vertex Decompress
Output
SPU Pipeline
Progressive Mesh
![Page 113: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/113.jpg)
Beyond Programmable Shading: In Action
Vertex DecompressionVertex Decompression
Index Decompress
Blend Shapes
Skinning
Triangle Culling
Compression
Vertex Decompress
Output
SPU Pipeline
Progressive Mesh
![Page 114: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/114.jpg)
Beyond Programmable Shading: In Action
Vertex AttributesVertex Attributes
Unique VertexArray 0Unique VertexArray 0
Instance VertexArray 1Instance VertexArray 1
![Page 115: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/115.jpg)
Beyond Programmable Shading: In Action
Vertex DecompressionVertex Decompression
Float TablesFloat TablesUnique VertexArray 0Unique VertexArray 0
Instance VertexArray 1Instance VertexArray 1
![Page 116: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/116.jpg)
Beyond Programmable Shading: In Action
24bit Unit Vector24bit Unit Vector
• Smallest 2 compression– Two smallest components with 10 bits each
• Encoded from –sqrt(2)/2 to +sqrt(2)/2– Largest component reconstructed via
• Largest = sqrt(1 – smallestA2 – smallestB2) • One additional bit for sign of largest component.
![Page 117: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/117.jpg)
Beyond Programmable Shading: In Action
24bit Unit Vector24bit Unit Vector
• Smallest 2 compression– Two smallest components with 10 bits each
• Encoded from –sqrt(2)/2 to +sqrt(2)/2– Largest component reconstructed via
• Largest = sqrt(1 – smallestA2 – smallestB2) • One additional bit for sign of largest component.
• One more bit to represent W as +1 or -1– For constructing bi-normal from normal and tangent.
![Page 118: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/118.jpg)
Beyond Programmable Shading: In Action
NN--bit Fixed Point bit Fixed Point with integer offsetswith integer offsets
• Simple n.x fixed point values– Per-segment integer offset
• Bit count may vary from attribute to attribute
![Page 119: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/119.jpg)
Beyond Programmable Shading: In Action
Index DecompressionIndex Decompression
Index Decompress
Blend Shapes
Skinning
Triangle Culling
Compression
Vertex Decompress
Output
SPU Pipeline
Progressive Mesh
![Page 120: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/120.jpg)
Beyond Programmable Shading: In Action
Index Table ConstructionIndex Table Construction
• Index table is created by a vertex cache optimizer– Based on K-cache algorithm
• Number of vertex program outputs affects Vertex Cache size.
• Four vertex mini cache most important optimization factor
![Page 121: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/121.jpg)
Beyond Programmable Shading: In Action
Strip ExampleStrip Example
3 new vertices
3
![Page 122: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/122.jpg)
Beyond Programmable Shading: In Action
Strip ExampleStrip Example
3
1
1 new vertex
![Page 123: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/123.jpg)
Beyond Programmable Shading: In Action
Strip ExampleStrip Example
3
11
1 new vertex
![Page 124: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/124.jpg)
Beyond Programmable Shading: In Action
Strip ExampleStrip Example
3
11
1
1 new vertex…
2 vertices + 1 per triangle in total
![Page 125: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/125.jpg)
Beyond Programmable Shading: In Action
Free Form ExampleFree Form Example
3 new vertices
3
![Page 126: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/126.jpg)
Beyond Programmable Shading: In Action
Free Form ExampleFree Form Example
1 new vertex
3
1
![Page 127: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/127.jpg)
Beyond Programmable Shading: In Action
Free Form ExampleFree Form Example
1 new vertex
3
1
1
![Page 128: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/128.jpg)
Beyond Programmable Shading: In Action
Free Form ExampleFree Form Example
1 new vertex
3
1
1
1
![Page 129: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/129.jpg)
Beyond Programmable Shading: In Action
Free Form ExampleFree Form Example
1 new vertex
3
1
1
1
1
![Page 130: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/130.jpg)
Beyond Programmable Shading: In Action
Free Form ExampleFree Form Example
0 new vertices!
3
1
1
1
1
0
![Page 131: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/131.jpg)
Beyond Programmable Shading: In Action
Free Form ExampleFree Form Example
1 new vertex
3
1
1
1
1
0
1
![Page 132: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/132.jpg)
Beyond Programmable Shading: In Action
Free Form ExampleFree Form Example
1 new vertex
3
1
1
1
1
0
1
1
![Page 133: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/133.jpg)
Beyond Programmable Shading: In Action
Free Form ExampleFree Form Example
1 new vertex
3
1
1
1
1
0
1
1
1
![Page 134: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/134.jpg)
Beyond Programmable Shading: In Action
Free Form ExampleFree Form Example
0 new vertices…
3
1
1
1
1
0
1
1
1
0
2 vertices + 3 per 4 triangles in total
![Page 135: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/135.jpg)
Beyond Programmable Shading: In Action
Index Cache OptimizerIndex Cache Optimizer
• Our vertex cache optimizer produces very regular index data
![Page 136: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/136.jpg)
Beyond Programmable Shading: In Action
Index DecompressionIndex Decompression
• Provided vertex cache optimizer produces very regular index data
![Page 137: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/137.jpg)
Beyond Programmable Shading: In Action
Index DecompressionIndex Decompression
0
1
2
Triangle Indexes
0 21
![Page 138: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/138.jpg)
Beyond Programmable Shading: In Action
Index DecompressionIndex Decompression
2
0
1
Triangle Indexes
2 10
![Page 139: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/139.jpg)
Beyond Programmable Shading: In Action
Index DecompressionIndex Decompression
![Page 140: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/140.jpg)
Beyond Programmable Shading: In Action
Index DecompressionIndex Decompression
![Page 141: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/141.jpg)
Beyond Programmable Shading: In Action
Index DecompressionIndex Decompression
85% compression6.5 : 1
![Page 142: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/142.jpg)
Beyond Programmable Shading: In Action
Blend ShapesBlend Shapes
Index Decompress
Blend Shapes
Skinning
Triangle Culling
Compression
Vertex Decompress
Output
SPU Pipeline
Progressive Mesh
![Page 143: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/143.jpg)
Beyond Programmable Shading: In Action
Blend Shapes in MLB 08: The ShowBlend Shapes in MLB 08: The Show
![Page 144: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/144.jpg)
Beyond Programmable Shading: In Action
SkinningSkinning
Index Decompress
Blend Shapes
Skinning
Triangle Culling
Compression
Vertex Decompress
Output
SPU Pipeline
Progressive Mesh
![Page 145: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/145.jpg)
Beyond Programmable Shading: In Action
Skinning on Skinning on SPUsSPUs
void SkinVs(float4 inPosition : ATTR0, float4 weights : ATTR3,float4 matrixIndex : ATTR4,
out float4 position : POSITION, uniform float4 joints[72], uniform float4x4 modelViewProj)
{position = 0;
for (int i = 0; i < 4; i++) {
float idx = matrixIndex[i];
float3x4 joint = float3x4(joints[idx+0], joints[idx+1], joints[idx+2]);
position += weights[i] * mul(joint, inPosition);}
position = mul(modelViewProj, position);}
![Page 146: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/146.jpg)
Beyond Programmable Shading: In Action
Skinning on SPUsSkinning on SPUs
30% Performance Improvement
![Page 147: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/147.jpg)
Beyond Programmable Shading: In Action
Skinning on SPUsSkinning on SPUs
30% Performance Improvement
Shadow map generation.... 70%!
![Page 148: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/148.jpg)
Beyond Programmable Shading: In Action
Discrete Progressive MeshDiscrete Progressive Mesh
• Smoothly reduces the triangle count as a model moves into the distance
• With discrete progressive mesh, the LOD calculation is done once for an entire object
Index Decompress
Blend Shapes
Skinning
Triangle Culling
Compression
Vertex Decompress
Output
SPU Pipeline
Progressive Mesh
![Page 149: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/149.jpg)
Beyond Programmable Shading: In Action
At an LOD there are two types of At an LOD there are two types of vertexesvertexes
LOD = 0.0
Parent Vertex
Child Vertex
![Page 150: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/150.jpg)
Beyond Programmable Shading: In Action
As the LOD level decreases, the As the LOD level decreases, the children children ““slideslide”” towards their parentstowards their parents
LOD = 0.2
Parent Vertex
Child Vertex
![Page 151: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/151.jpg)
Beyond Programmable Shading: In Action
The children continue to move towards The children continue to move towards their parentstheir parents
LOD = 0.7
Parent Vertex
Child Vertex
![Page 152: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/152.jpg)
Beyond Programmable Shading: In Action
At the next integral LOD, all child At the next integral LOD, all child vertexes disappear as do the trianglesvertexes disappear as do the triangles
LOD = 1.0
Parent Vertex
Child Vertex
![Page 153: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/153.jpg)
Beyond Programmable Shading: In Action
Continuous Progressive MeshContinuous Progressive Mesh
• Like discrete progressive mesh, child vertexes move smoothly toward their parents
• However, the LOD is calculated for each vertex instead of just once for the object
Index Decompress
Blend Shapes
Skinning
Triangle Culling
Compression
Vertex Decompress
Output
SPU Pipeline
Progressive Mesh
![Page 154: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/154.jpg)
Beyond Programmable Shading: In Action
Vertex set about to undergo continuous Vertex set about to undergo continuous progressive meshprogressive mesh
Parent Vertex
Child Vertex, LOD 1
Child Vertex, LOD 0
![Page 155: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/155.jpg)
Beyond Programmable Shading: In Action
A single vertex set can straddle several A single vertex set can straddle several LOD rangesLOD ranges
LOD = 1.0
Parent Vertex
Child Vertex, LOD 1
Child Vertex, LOD 0
LOD = 0.0
![Page 156: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/156.jpg)
Beyond Programmable Shading: In Action
Vertexes move depending on their Vertexes move depending on their distancedistance
Parent Vertex
Child Vertex, LOD 1
Child Vertex, LOD 0
LOD = 1.0
LOD = 0.0
![Page 157: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/157.jpg)
Beyond Programmable Shading: In Action
Triangle CullingTriangle Culling
Index Decompress
Blend Shapes
Skinning
Triangle Culling
Compression
Vertex Decompress
Output
SPU Pipeline
Progressive Mesh
![Page 158: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/158.jpg)
Beyond Programmable Shading: In Action
Up to Up to 70%70% of triangles do not contribute to of triangles do not contribute to final image.final image.
![Page 159: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/159.jpg)
Beyond Programmable Shading: In Action
Off Screen TrianglesOff Screen Triangles
![Page 160: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/160.jpg)
Beyond Programmable Shading: In Action
Back Facing TrianglesBack Facing Triangles
![Page 161: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/161.jpg)
Beyond Programmable Shading: In Action
Zero Area TrianglesZero Area Triangles
![Page 162: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/162.jpg)
Beyond Programmable Shading: In Action
Zero Area TrianglesZero Area Triangles
![Page 163: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/163.jpg)
Beyond Programmable Shading: In Action
No Pixel TrianglesNo Pixel Triangles
![Page 164: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/164.jpg)
Beyond Programmable Shading: In Action
Triangle CullingTriangle Culling
![Page 165: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/165.jpg)
Beyond Programmable Shading: In Action
Multisampling adds some complicationsMultisampling adds some complications……
![Page 166: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/166.jpg)
Beyond Programmable Shading: In Action
CulledCulled
![Page 167: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/167.jpg)
Beyond Programmable Shading: In Action
Triangle CullingTriangle Culling
10% to 20%Performance Improvement
![Page 168: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/168.jpg)
Beyond Programmable Shading: In Action
Compression for OutputCompression for Output
Index Decompress
Blend Shapes
Skinning
Triangle Culling
Compression
Vertex Decompress
Output
SPU Pipeline
Progressive Mesh
![Page 169: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/169.jpg)
Beyond Programmable Shading: In Action
Float TablesFloat Tables
![Page 170: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/170.jpg)
Beyond Programmable Shading: In Action
When done, the vertex attributes are When done, the vertex attributes are compressed into one output streamcompressed into one output stream
OutputVertex ArrayOutputVertex Array
Float TablesFloat Tables
![Page 171: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/171.jpg)
Beyond Programmable Shading: In Action
Output Buffering SchemesOutput Buffering Schemes
• Vertex and index data constructed by the SPUs is output from SPU local store
• Holes in the RSX command buffer are patched with pointers to the vertex and index data as well as the draw commands
Index Decompress
Blend Shapes
Skinning
Triangle Culling
Compression
Vertex Decompress
Output
SPU Pipeline
Progressive Mesh
![Page 172: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/172.jpg)
Beyond Programmable Shading: In Action
Double BufferDouble Buffer
• Each buffer stores vertex and index data for an entire frame
• SPUs atomically access a mutex which is used to allocate memory from a buffer
• Easy synchronization with the RSX™ once a frame
• Uses lots of memory
VertexandIndexDataforFrame 0
VertexandIndexDataforFrame 0
VertexandIndexDataforFrame 1
VertexandIndexDataforFrame 1
![Page 173: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/173.jpg)
Beyond Programmable Shading: In Action
It is possible to completely fill a bufferIt is possible to completely fill a buffer
• Can use a callback to allocate new memory (which you may not have)
• Don’t draw geometry that doesn’t fit (difficult to pick which geometry not to draw)
SPUSPUData
VertexandIndexData
VertexandIndexData
![Page 174: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/174.jpg)
Beyond Programmable Shading: In Action
Double buffering adds a frame of lagDouble buffering adds a frame of lag
Build Jobs on PPU Build Jobs on PPU
Process Jobs on SPU Process Jobs on SPU
Render on RSX™ Render on RSX™ Scan OutScan Out
Build Jobs on PPU Build Jobs on PPU
Process Jobs on SPU Process Jobs on SPU
Render on RSX™ Render on RSX™ Scan OutScan Out
Build Jobs on PPU Build Jobs on PPU
Process Jobs on SPU Process Jobs on SPU
Render on RSX™ Render on RSX™ Scan OutScan Out
![Page 175: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/175.jpg)
Beyond Programmable Shading: In Action
Single BufferingSingle Buffering
• Uses only half the memory!• Still possible to completely
fill the bufferVertexandIndexDataforSingleFrame
VertexandIndexDataforSingleFrame
![Page 176: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/176.jpg)
Beyond Programmable Shading: In Action
Single Buffering has a shorter pipelineSingle Buffering has a shorter pipeline
• Vertex and index data is created just-in-time for the RSX™
• Draw commands are inserted into the command buffer while the RSX™ is rendering
• Requires tight SPU↔RSX™
synchronization
Build Jobs on PPU Build Jobs on PPU
SPU Processing/ RSX™ Rendering SPU Processing/ RSX™ Rendering Scan OutScan Out
Build Jobs on PPU Build Jobs on PPU
SPU Processing/ RSX™ Rendering SPU Processing/ RSX™ Rendering Scan OutScan Out
Build Jobs on PPU Build Jobs on PPU
SPU Processing/ RSX™ Rendering SPU Processing/ RSX™ Rendering Scan OutScan Out
![Page 177: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/177.jpg)
Beyond Programmable Shading: In Action
SPUSPU↔↔RSXRSX™™ Synchronization Synchronization Using Local StallsUsing Local Stalls
CommandBuffer
Draw 17Draw 17
Local StallLocal Stall
OtherOther
Local StallLocal Stall
Local StallLocal Stall
Local StallLocal Stall
Local StallLocal Stall
Local StallLocal Stall
Place local stalls in the command buffer where necessaryRSX™ will stop processing at a local stall until it is overwritten by new commandsSPUs will generally stay ahead of the RSX™, so stalls rarely occur
Local StallLocal Stall
![Page 178: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/178.jpg)
Beyond Programmable Shading: In Action
SPU will overwrite local stalls when it SPU will overwrite local stalls when it outputs a set of new commandsoutputs a set of new commands
No SPU↔SPU synchronization required!
SPUSPU
CommandBuffer
Draw 17Draw 17
PutPointer
Local StallLocal Stall
OtherOther
Local StallLocal Stall
Local StallLocal Stall
Local StallLocal Stall
Local StallLocal Stall
Local Stall
Local StallNew Commands New Commands
![Page 179: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/179.jpg)
Beyond Programmable Shading: In Action
Ring BuffersRing Buffers
• Small memory footprint• Will not run out of memory• Can stall the SPUs if buffers
become full• Objects need to be
processed in the same order the RSX™ renders them to prevent deadlock
Vertex and Index
Vertex and Index
DataData
End ofFree Area
Start ofFree Area
![Page 180: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/180.jpg)
Beyond Programmable Shading: In Action
RSXRSX™™ writes a semaphore once a writes a semaphore once a chunk of data has been consumedchunk of data has been consumed
• A command to write a semaphore needs to be added to the command buffer after all commands that use the data– The value of the semaphore to be written is the new
end of free area pointer
Data 19Data 19
Data 6
Data 14Data 14
Start ofFree Area
Draw 6Draw 6
Draw 5Draw 5
Draw 7Draw 7
SemaphoreSemaphore
SemaphoreSemaphore
SemaphoreSemaphore
CurrentRSX™Execution
New End of Free Area
![Page 181: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/181.jpg)
Beyond Programmable Shading: In Action
Each SPU has its own bufferEach SPU has its own buffer
Data 23Data 23
Data 17Data 17
Data 10Data 10
Data 22Data 22
Data 11Data 11
Data 16Data 16
Data 19Data 19
Data 6Data 6
Data 14Data 14 Data 20Data 20
Data 7Data 7
Data 15Data 15
Data 21Data 21
Data 12Data 12
Data 9Data 9
Data 18Data 18
Data 8Data 8
Data 13Data 13
SPU 0SPU 0
SPU 1SPU 1
SPU 2SPU 2
SPU 3SPU 3
SPU 4SPU 4
SPU 5SPU 5
Buffer 0 Buffer 1
Buffer 3Buffer 2
Buffer 4 Buffer 5
![Page 182: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/182.jpg)
Beyond Programmable Shading: In Action
Geometry PerformanceGeometry Performance
![Page 183: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/183.jpg)
Beyond Programmable Shading: In Action
Software Pipelined C with SPU IntrinsicsSoftware Pipelined C with SPU Intrinsics
do{
m1 = in1;in1 = si_lqx(pIn1, offset);m2 = in2;in2 = si_lqx(pIn2, offset);m3 = in3;in3 = si_lqx(pIn3, offset);temp2 = si_selb(m3, m1, mask_0X00);si_stqx(out1, pOut1, offset);temp3 = si_selb(m2, m1, mask_00X0);si_stqx(out2, pOut2, offset);temp1 = si_selb(m1, m2, mask_0X00);si_stqx(out3, pOut3, offset);offset = si_ai(offset, 0x30);out2 = si_shufb(m2, temp2, qs_bCaD);out1 = si_selb(temp1, m3, mask_00X0);out3 = si_shufb(m3, temp3, qs_caBD);
} while(si_to_int(offset) != 0);
![Page 184: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/184.jpg)
Beyond Programmable Shading: In Action
Software Pipelined C with SPU IntrinsicsSoftware Pipelined C with SPU Intrinsics
Up to 20x faster
than naive C/C++
do{
m1 = in1;in1 = si_lqx(pIn1, offset);m2 = in2;in2 = si_lqx(pIn2, offset);m3 = in3;in3 = si_lqx(pIn3, offset);temp2 = si_selb(m3, m1, mask_0X00);si_stqx(out1, pOut1, offset);temp3 = si_selb(m2, m1, mask_00X0);si_stqx(out2, pOut2, offset);temp1 = si_selb(m1, m2, mask_0X00);si_stqx(out3, pOut3, offset);offset = si_ai(offset, 0x30);out2 = si_shufb(m2, temp2, qs_bCaD);out1 = si_selb(temp1, m3, mask_00X0);out3 = si_shufb(m3, temp3, qs_caBD);
} while(si_to_int(offset) != 0);
![Page 185: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/185.jpg)
Beyond Programmable Shading: In Action
1 SPU
![Page 186: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/186.jpg)
Beyond Programmable Shading: In Action
1 SPU
800,000+ Triangles Per Frame
at 60 Frames per Second
![Page 187: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/187.jpg)
Beyond Programmable Shading: In Action
1 SPU
800,000+Triangles Per Frame
at 60 Frames per Second
60% of which are culled!
![Page 188: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/188.jpg)
Beyond Programmable Shading: In Action
Next Generation ParallelismNext Generation Parallelism In GamesIn Games
Jon Jon OlickOlickid Softwareid Software
![Page 189: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/189.jpg)
Beyond Programmable Shading: In Action
GAME ENTITY PROCESSINGGAME ENTITY PROCESSING
![Page 190: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/190.jpg)
Beyond Programmable Shading: In Action
Game Entity ProcessingGame Entity Processing
• Current Generation– Serial Processing of entities in a giant for loop.
for(int i = 0; i < numEntities; ++i) {entity[i]->Think();
}
![Page 191: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/191.jpg)
Beyond Programmable Shading: In Action
Game Entity ProcessingGame Entity Processing
• Current Generation– Serial Processing of entities in a giant for loop.
• Next Generation– Parallelism via Double Buffering
![Page 192: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/192.jpg)
Beyond Programmable Shading: In Action
Game Entity ProcessingGame Entity Processing
• Current Generation– Serial Processing of entities in a giant for loop.
• Next Generation– Parallelism via Double Buffering– Each entity can only read from previous frame’s
results
![Page 193: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/193.jpg)
Beyond Programmable Shading: In Action
Game Entity ProcessingGame Entity Processing
• Current Generation– Serial Processing of entities in a giant for loop.
• Next Generation– Parallelism via Double Buffering– Each entity can only read from previous frame’s
results– Each entity can only write to itself– Every entity runs in parallel with each other with no
dependency stalls.
![Page 194: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/194.jpg)
Beyond Programmable Shading: In Action
Game Entity ProcessingGame Entity Processing
• Record the progress of the game and replay it to debug.
• Single thread and randomize processing of entities to help find bugs.
• Can protect memory so that bad accesses cause exceptions to enforce double buffering rules.
![Page 195: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/195.jpg)
Beyond Programmable Shading: In Action
RAY CASTINGRAY CASTING
![Page 196: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/196.jpg)
Beyond Programmable Shading: In Action
Why Ray Casting?Why Ray Casting?
• A good question…
![Page 197: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/197.jpg)
Beyond Programmable Shading: In Action
![Page 198: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/198.jpg)
Beyond Programmable Shading: In Action
• Back in Quake 1– If you had to make a decision between an additional
CPU and a Graphics Card which would you choose?
![Page 199: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/199.jpg)
Beyond Programmable Shading: In Action
• Back in Quake 1– If you had to make a decision between an additional
CPU and a Graphics Card which would you choose?– Why is this any different today?
![Page 200: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/200.jpg)
Beyond Programmable Shading: In Action
• Back in Quake 1– If you had to make a decision between an additional
CPU and a Graphics Card which would you choose?– Why is this any different today?– Its not.
![Page 201: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/201.jpg)
Beyond Programmable Shading: In Action
Why Ray Casting?Why Ray Casting?
• What value does it provide to game developers?– Scene complexity no longer significantly affects
performance or memory
![Page 202: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/202.jpg)
Beyond Programmable Shading: In Action
Why Ray Casting?Why Ray Casting?
• What value does it provide to end users?
![Page 203: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/203.jpg)
Beyond Programmable Shading: In Action
• Screen shot from RAGE goes here
![Page 204: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/204.jpg)
Beyond Programmable Shading: In Action
• Screen shot from RAGE goes here• (highlight flat regions)
![Page 205: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/205.jpg)
Beyond Programmable Shading: In Action
Why Ray Casting?Why Ray Casting?
![Page 206: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/206.jpg)
Beyond Programmable Shading: In Action
Current State of RasterizationCurrent State of Rasterization
Vertex Processing
Triangle Setup
Fragment Processing
Command BufferVertex
Processing
Fragment Processin
g
![Page 207: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/207.jpg)
Beyond Programmable Shading: In Action
Future of RasterizationFuture of Rasterization
![Page 208: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/208.jpg)
Beyond Programmable Shading: In Action
Future of RasterizationFuture of Rasterization
![Page 209: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/209.jpg)
Beyond Programmable Shading: In Action
Future of RasterizationFuture of Rasterization
![Page 210: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/210.jpg)
Beyond Programmable Shading: In Action
Future of RasterizationFuture of Rasterization
![Page 211: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/211.jpg)
Beyond Programmable Shading: In Action
Future of RasterizationFuture of Rasterization
![Page 212: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/212.jpg)
Beyond Programmable Shading: In Action
Future of RasterizationFuture of Rasterization
![Page 213: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/213.jpg)
Beyond Programmable Shading: In Action
Future of RasterizationFuture of Rasterization
![Page 214: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/214.jpg)
Beyond Programmable Shading: In Action
Future of RasterizationFuture of Rasterization
Vertex Processing
Triangle Setup
Fragment Processing
Command BufferVertex
Processing
Fragment Processing
Triangle Sorting
![Page 215: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/215.jpg)
Beyond Programmable Shading: In Action
Future of RasterizationFuture of Rasterization
Vertex Processing
Triangle Setup
Fragment Processing
Command Buffer
Multiple Cores
![Page 216: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/216.jpg)
Beyond Programmable Shading: In Action
Future of Future of RasterizationRasterization x2x2
GPU Triangle Setup
![Page 217: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/217.jpg)
Beyond Programmable Shading: In Action
Future of Future of RasterizationRasterization x2x2
150
GPU Triangle Setup
![Page 218: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/218.jpg)
Beyond Programmable Shading: In Action
Future of Future of RasterizationRasterization x2x2
151
GPU Triangle Setup
![Page 219: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/219.jpg)
Beyond Programmable Shading: In Action
Future of Future of RasterizationRasterization x2x2
152
GPU Triangle Setup
![Page 220: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/220.jpg)
Beyond Programmable Shading: In Action
Future of Future of RasterizationRasterization x2x2
153
GPU Triangle Setup
![Page 221: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/221.jpg)
Beyond Programmable Shading: In Action
Future of Future of RasterizationRasterization x2x2
154
GPU Triangle Setup
![Page 222: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/222.jpg)
Beyond Programmable Shading: In Action
Why Why voxelsvoxels, and not triangles?, and not triangles?
• Unifying Primitive• No Near Phase Collision• Solves Two Problems in One
– Unique Texturing & Unique Geometry
• Good for CUDA / Larabee
![Page 223: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/223.jpg)
Beyond Programmable Shading: In Action
Why is the control flow efficient?Why is the control flow efficient?
![Page 224: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/224.jpg)
Beyond Programmable Shading: In Action
Why is the control flow efficient?Why is the control flow efficient?
![Page 225: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/225.jpg)
Beyond Programmable Shading: In Action
Why is the control flow efficient?Why is the control flow efficient?
![Page 226: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/226.jpg)
Beyond Programmable Shading: In Action
Why is the control flow efficient?Why is the control flow efficient?
![Page 227: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/227.jpg)
Beyond Programmable Shading: In Action
VoxelVoxel MipMip Mapping Mapping –– Thin WallsThin Walls
![Page 228: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/228.jpg)
Beyond Programmable Shading: In Action
Voxel Mip Mapping Voxel Mip Mapping –– Thin WallsThin Walls
![Page 229: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/229.jpg)
Beyond Programmable Shading: In Action
Voxel Mip Mapping Voxel Mip Mapping –– Thin WallsThin Walls
![Page 230: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/230.jpg)
Beyond Programmable Shading: In Action
Voxel Mip Mapping Voxel Mip Mapping –– Thin WallsThin Walls
![Page 231: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/231.jpg)
Beyond Programmable Shading: In Action
Caveats of RayCaveats of Ray--Tracing?Tracing?
• “Primary rays cache, secondary rays thrash”™– Importance sampling to the rescue!
• Ray Tracing != Ray Casting
![Page 232: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/232.jpg)
Beyond Programmable Shading: In Action
Results May VaryResults May Vary
![Page 233: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/233.jpg)
Beyond Programmable Shading: In Action
Sparse Voxel OctSparse Voxel Oct--treestrees
• Oct-trees as collection of maximal blocks.– Related to run-length encoding.
• Possibly variable splitting planes in future.– Guided by artist placed hint planes.
![Page 234: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/234.jpg)
Beyond Programmable Shading: In Action
Data StructureData Structure
• Disk Caching with Virtual and Physical Pages– Start out with a single virtual page.– Render some voxels into the tree until page capacity
is reached.– Split page into 8 sub-pages and attempt to add the
overflow voxel again.– Store out virtual pages to disk.– Load/Unload each page’s levels as necessary at
runtime.
![Page 235: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/235.jpg)
Beyond Programmable Shading: In Action
Data StructureData Structure
• Page capacity can be based on...– CUDA's shared memory size– Cell's SPU local store size– Optimum disk streaming performance– Minimum physical page memory
![Page 236: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/236.jpg)
Beyond Programmable Shading: In Action
Data Structure Data Structure –– Page FragmentationPage Fragmentation
• Traverse indexing oct-tree– Write out pages according to optimal layout (breadth
first, depth first, etc...)
![Page 237: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/237.jpg)
Beyond Programmable Shading: In Action
Data Structure Data Structure -- Page OptimizationPage Optimization
• Execution time proportional to number of nodes.
• Number of nodes can be reduced through translation.
• Translating by 2n doesn’t affect any oct-tree level smaller than 2n
![Page 238: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/238.jpg)
Beyond Programmable Shading: In Action
Data Structure Data Structure -- Page OptimizationPage Optimization
• Create scratch page with enlarged region – 2n+1 x 2n+1 x 2n+1
• Apply successive translations of magnitude power of 2 in the x, y, & z directions and keep a count of the number of nodes required.
• Store off total translation so that the ray casting can be adjusted appropriately.
• O(4n)– n is the number of levels in the oct-tree
![Page 239: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/239.jpg)
Beyond Programmable Shading: In Action
Data Structure Data Structure -- Page OptimizationPage Optimization
172
![Page 240: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/240.jpg)
Beyond Programmable Shading: In Action
Data Structure Data Structure -- Page OptimizationPage Optimization
173
![Page 241: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/241.jpg)
Beyond Programmable Shading: In Action
Data Structure Data Structure -- Page OptimizationPage Optimization
• Minimize outside nodes for faster tracing
![Page 242: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/242.jpg)
Beyond Programmable Shading: In Action
Data Structure Data Structure -- Page OptimizationPage Optimization
175
![Page 243: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/243.jpg)
Beyond Programmable Shading: In Action
Data Structure Data Structure -- Page OptimizationPage Optimization
176
![Page 244: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/244.jpg)
Beyond Programmable Shading: In Action
Data Structure Data Structure -- Page OptimizationPage Optimization
177
![Page 245: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/245.jpg)
Beyond Programmable Shading: In Action
Data StructureData Structure
• Different structures for runtime and storage.
![Page 246: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/246.jpg)
Beyond Programmable Shading: In Action
Runtime Data StructureRuntime Data Structure
• child pointers : 32• diffuse rgb : 3• specular scale/power : 1• normal xy : 2• total : 38 bytes per node
![Page 247: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/247.jpg)
Beyond Programmable Shading: In Action
Storage Data StructureStorage Data Structure
• children bit mask : 1• diffuse rgb : 3• specular scale/power : 1• normal xy : 2• total : 7 bytes per node
![Page 248: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/248.jpg)
Beyond Programmable Shading: In Action
Data CompressionData Compression
• Compressing child bits• Compressing Colors
![Page 249: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/249.jpg)
Beyond Programmable Shading: In Action
Compressing Child BitsCompressing Child Bits
• (diagram showing statistical distribution of child bytes)
![Page 250: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/250.jpg)
Beyond Programmable Shading: In Action
Compressing Child BitsCompressing Child Bits
• Split by oct-tree level. • Arithmetic Compression• (diagram showing statistical distribution of
child bytes at each oct-tree level)
![Page 251: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/251.jpg)
Beyond Programmable Shading: In Action
Compressing Color DataCompressing Color Data
• (Diagram showing each node of the tree as a delta between itself and its parent)
![Page 252: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/252.jpg)
Beyond Programmable Shading: In Action
Compressing Color DataCompressing Color Data
• Split by oct-tree level.• Quantization • Arithmetic Compression
![Page 253: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/253.jpg)
Beyond Programmable Shading: In Action
Data Structure SizeData Structure Size
• 1.15 bits of positional data per voxel• Cost savings improves as triangle size
decreases.• 72 bits equivalent per triangle in oct-tree
– (for next generation)
• 160 bits per triangle in traditional format– x,z,y,s,t all 32-bits– 2.2:1 compression ratio
• 80 bits per triangle in compressed format– x,y,z,s,t all 16-bits– 1.1:1 compression ratio
![Page 254: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/254.jpg)
Beyond Programmable Shading: In Action
Generating the dataGenerating the data
• Every surface can enumerate into voxels.• 3D Scan Conversion• Volume Projection• Subdivision
![Page 255: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/255.jpg)
Beyond Programmable Shading: In Action
3D Scan Conversion3D Scan Conversion
Z=0
Z=1
Z=2
Z=3
Z=4
=
![Page 256: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/256.jpg)
Beyond Programmable Shading: In Action
3D Scan Conversion3D Scan Conversion
![Page 257: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/257.jpg)
Beyond Programmable Shading: In Action
3D Scan Conversion3D Scan Conversion
![Page 258: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/258.jpg)
Beyond Programmable Shading: In Action
3D Scan Conversion3D Scan Conversion
![Page 259: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/259.jpg)
Beyond Programmable Shading: In Action
3D Scan Conversion3D Scan Conversion
• Only 8 connectivity required.• Flood fill world and remove unnecessary
voxels.
![Page 260: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/260.jpg)
Beyond Programmable Shading: In Action
Generating the dataGenerating the data
• Generate geometry mip-maps• Geometry mips consume 15% extra data
![Page 261: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/261.jpg)
Beyond Programmable Shading: In Action
Generating the dataGenerating the data
• Save off the un-lit data.
![Page 262: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/262.jpg)
Beyond Programmable Shading: In Action
Generating the dataGenerating the data
• Perform ray-tracing to light the voxels.
![Page 263: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/263.jpg)
Beyond Programmable Shading: In Action
Using the dataUsing the data
• For each pixel on the screen– Shoot out a ray into the oct-tree and record the
color (and depth?)
![Page 264: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/264.jpg)
Beyond Programmable Shading: In Action
Need More Detail?Need More Detail?
• Bottom up?• Top Down?• Etc…
![Page 265: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/265.jpg)
Beyond Programmable Shading: In Action
Rendering Skinned CharactersRendering Skinned Characters
• Ray cast against triangle mesh• Transform to base pose• Trace with local oct-tree
![Page 266: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/266.jpg)
Beyond Programmable Shading: In Action
Abstracting Skinned CharactersAbstracting Skinned Characters
• Moving world geometry without oct-tree re- organization cost.
• Enables instancing.
![Page 267: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/267.jpg)
Beyond Programmable Shading: In Action
Hybrid RenderingHybrid Rendering
• Render a coarse hull of the geometry into a z-buffer.– Automatically calculate from voxel geometry.
• Post-process the depth-buffer to start the ray casting at the point specified by the depth-buffer instead of at the ray origin.– Possibly transforming it as well.
![Page 268: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/268.jpg)
Beyond Programmable Shading: In Action
Hybrid RenderingHybrid Rendering
• Skips most of the traversal process. – 2x to 4x expected speed improvement
• Allows dynamic geometry• Prevents second and third order ray tracing
– No z-buffer pre-pass to transform ray start for dynamic geometry
![Page 269: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/269.jpg)
Beyond Programmable Shading: In Action
Hybrid Rendering Hybrid Rendering with Atmospheric Effectswith Atmospheric Effects• Atmospheric effects in combination with
rasterization possible.– Rasterize coarse hull into depth buffer– Rasterize triangles into color and alternate depth
buffer– At ray-collision time, keep track of atmospheric
collisions along the way.– If hit rasterized depth,
• stop and modify existing color
– Else • modify voxel color.
![Page 270: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/270.jpg)
Beyond Programmable Shading: In Action
Adaptive SubAdaptive Sub--SamplingSampling
• After rendering the scene, perform a Sobel edge filter over the frame buffer to figure out where additional rays would improve the quality of the image.
• Cast additional rays.• Repeat until 16 ms.
![Page 271: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/271.jpg)
Beyond Programmable Shading: In Action
Adaptive SubAdaptive Sub--Sampling ProblemsSampling Problems
• Inherently always sampling the most divergent parts of the scene
• Can manage performance hit by sampling highly aliased to less aliased in chunks
![Page 272: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/272.jpg)
Beyond Programmable Shading: In Action
Infinite Surface DetailInfinite Surface Detail
• Oct-tree node's recursively point back in on themselves to create an infinite amount of detail
• Create detail types octree sub-segments to simulate rough, smooth, porous, sharp edges, etc.. – Recursive trees are entirely in cache, so very fast
calculation.– Requires delta compressed colors to be in the
runtime format for correct shadowing• Not a huge computation burden, but more bandwidth
required
![Page 273: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/273.jpg)
Beyond Programmable Shading: In Action
How much time to innovate?How much time to innovate?
• 1 year tools• 3 months runtime
![Page 274: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/274.jpg)
Beyond Programmable Shading: In Action
Expected Runtime PerformanceExpected Runtime Performance
• 33% of the time rendering characters / etc• 66% of the time rendering world• Ray-casting the world must complete in
~20ms for 30 FPS• Theoretically possible on today's technology
(GeForce 8800 Series)– Possible on 7800 with additional memory
requirements.
![Page 275: Beyond Programmable Shading: In Actionwebstaff.itn.liu.se/~jonun/web/teaching/2009-TNCG13/Siggraph08/class/... · Each case study includes a live demo and discusses the mix of parallel](https://reader034.vdocuments.us/reader034/viewer/2022043002/5f7e40f5ca0f68334c47dd3d/html5/thumbnails/275.jpg)
Beyond Programmable Shading: In Action
How would this affect a platform launch?How would this affect a platform launch?
• Generational skip in geometric complexity• Next gen platforms 4 times better at least• Completely plausible at 720p and 60 FPS w/
antialaising– or 1080p and 60 FPS