SlideShare une entreprise Scribd logo
1  sur  36
Shadow Volumes on Programmable Graphics Hardware Stefan Brabec Hans-Peter Seidel MPI Informatik
Overview ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Shadow Volumes ,[object Object],[object Object],[object Object],[object Object],[object Object]
Shadow Volumes ,[object Object],[object Object],[object Object],occluder light shadow region lit
Shadow Volume Generation ,[object Object],[object Object],[object Object],[object Object],[object Object]
Shadow Volume Generation ,[object Object],Light Light FF BF FF FF Silhouette Edge (v0,v1) ! No Silhouette Edge ! n 1 n 2 n 1 n 2
Shadow Volume Rendering ,[object Object],[object Object]
Shadow Volume Rendering ,[object Object],[object Object],[object Object],[object Object],[object Object],silhouette detection   Focus of this talk:
Motivation ,[object Object]
Motivation ,[object Object]
Our method ,[object Object],[object Object],[object Object],[object Object],[object Object]
Input Data ,[object Object],[object Object],[object Object],Example: This is  not  a closed mesh, but since we are only focusing on one edge of this mesh its ok.
Coordinate Transformation ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Transform to world/eye space ,[object Object],[object Object],[object Object],[object Object],P 0 P 1 P 2 P 3 P 4 position texture P 0 P 1 P 2 P 3 P 4 P N
Transform to world/eye space ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],!!ARBvp1.0 ATTRIB  iVertexPos  = vertex.position; ATTRIB  iVertexIdx  = vertex.texcoord[0]; PARAM   mv[4]  = { state.matrix.modelview }; OUTPUT  oPos  = result.position; OUTPUT  oDumpPos  = result.texcoord[0]; # Transform the vertex to eye coordinates .   DP4   oDumpPos.x, mv[0], iVertexPos; DP4   oDumpPos.y, mv[1], iVertexPos; DP4   oDumpPos.z, mv[2], iVertexPos; DP4   oDumpPos.w, mv[3], iVertexPos; # Vertex position is its index (x,y,0,1) MOV   oPos, iVertexIdx; END
Transform to world/eye space ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Process edges ,[object Object],[object Object],[object Object],[object Object],[object Object]
Process edges ,[object Object],[object Object],[object Object],E 0_idx P 0_idx P 1_idx P 3_idx P 4_idx glBegin(GL_POINTS) ; glAttrib(P0_idx, P3_idx,  P1_idx, P4_idx); glVertex1f(E0_idx); glEnd();
Process Edges ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Process edges ,[object Object],E 0_idx P 0_idx P 1_idx P 3_idx P 4_idx input data 4 texture lookups for  world space positions P 0 P 1 P 3 P 4 registers P 3 P 0 P 1 P 4 N 1  = (P 3 –P 0 )x(P 1 –P 0 ) N 2  = (P 4 –P 0 )x(P 3 –P 0 ) front & back  facing ? position texture P 0 P 1 P 2 P 3 P 4 Light Store silhouette flag (yes/no) at edge index E 0 E 1 E 2 E 3 E 4 E M edge texture
Silhouette Detection ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Rendering Shadow Volumes ,[object Object],for all lights  { for all edges  { if (is silhouette edge for light i) { get edge’s vertices  render extruded quad  } } }
Rendering shadow volumes ,[object Object],[object Object],[object Object],[object Object],position texture P 0 P 1 P 2 P 3 P 4 P N E 0 E 1 E 2 E 3 E 4 E M edge texture glBegin(GL_QUADS) ; glVertex(P0_idx, E0_idx, 0); glVertex(P1_idx, E0_idx, 0); glVertex(P1_idx, E0_idx, 1); glVertex(P0_idx, E0_idx, 1); P =  Lookup (p_idx) mask =  Lookup (e_idx) if (mask & silhouette) { if (extrude)  // 0 or 1 flag out = P – Light_pos else out = P }  else  { out = (0,0,0,1)  // outside view   }
Rendering shadow volumes ,[object Object],[object Object],E 0 =  silhouette quad texture E` 0 =  silhouette &    extrude P 0 L P 3 P 0- L P 3- L Q 0 Q 1 Q 2 Q 3 Q 0  = (P 0x ,P 0y ,P 0z , E 0 ) Q 1  = (P 3x ,P 3y ,P 3z , E 0 ) Q 2  = (P 3x ,P 3y ,P 3z , E` 0 ) Q 3  = (P 0x ,P 0y ,P 0z , E` 0 )
Rendering Shadow Volumes ,[object Object],[object Object],[object Object],[object Object],[object Object],Light0: Silhouette Light0: Extrude  Light1: Silhouette Light1: Extrude
Rendering Shadow Volumes ,[object Object],Vertex Array: glBegin(GL_QUADS) ; glArrayElement(0); glArrayElement(1); glArrayElement(2); glArrayElement(3); P_xyz = IN_xyz; E = IN_w; if(E & silhouette) { if(E & extrude) out = P-L; else out = P; } else { out = somewhere outside view } Q 0 Q 1 Q 2 Q 3
Rendering Shadow Volumes ,[object Object],[object Object],[object Object],[object Object],[object Object]
ARB_superbuffers ,[object Object],[object Object],[object Object],[object Object],[object Object],glVertexArrayMem ( GL_VERTEX_ARRAY,    4,  mem, 0); memory block glAttachMem ( GL_DRAW_FRAMEBUFFER,  GL_AUX0, mem); glAttachMem ( GL_TEXTURE_2D,    GL_IMAGES, mem); glAllocMem2D (fmt, w, h, …)
ARB_superbuffers ,[object Object],[object Object],[object Object],[object Object],[object Object]
Summary ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Summary ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Summary ,[object Object],[object Object],[object Object],[object Object],[object Object]
Results
Conclusions ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Future Work ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Thank you !

Contenu connexe

Tendances

Oit And Indirect Illumination Using Dx11 Linked Lists
Oit And Indirect Illumination Using Dx11 Linked ListsOit And Indirect Illumination Using Dx11 Linked Lists
Oit And Indirect Illumination Using Dx11 Linked Lists
Holger Gruen
 

Tendances (20)

CS 354 Viewing Stuff
CS 354 Viewing StuffCS 354 Viewing Stuff
CS 354 Viewing Stuff
 
CS 354 Graphics Math
CS 354 Graphics MathCS 354 Graphics Math
CS 354 Graphics Math
 
CS 354 Introduction
CS 354 IntroductionCS 354 Introduction
CS 354 Introduction
 
CS 354 Acceleration Structures
CS 354 Acceleration StructuresCS 354 Acceleration Structures
CS 354 Acceleration Structures
 
NVIDIA's OpenGL Functionality
NVIDIA's OpenGL FunctionalityNVIDIA's OpenGL Functionality
NVIDIA's OpenGL Functionality
 
Anatomy of a Texture Fetch
Anatomy of a Texture FetchAnatomy of a Texture Fetch
Anatomy of a Texture Fetch
 
OpenGL 3.2 and More
OpenGL 3.2 and MoreOpenGL 3.2 and More
OpenGL 3.2 and More
 
Modern OpenGL Usage: Using Vertex Buffer Objects Well
Modern OpenGL Usage: Using Vertex Buffer Objects Well Modern OpenGL Usage: Using Vertex Buffer Objects Well
Modern OpenGL Usage: Using Vertex Buffer Objects Well
 
GDC 2012: Advanced Procedural Rendering in DX11
GDC 2012: Advanced Procedural Rendering in DX11GDC 2012: Advanced Procedural Rendering in DX11
GDC 2012: Advanced Procedural Rendering in DX11
 
CS 354 Programmable Shading
CS 354 Programmable ShadingCS 354 Programmable Shading
CS 354 Programmable Shading
 
CS 354 Final Exam Review
CS 354 Final Exam ReviewCS 354 Final Exam Review
CS 354 Final Exam Review
 
Beyond porting
Beyond portingBeyond porting
Beyond porting
 
CS 354 Project 2 and Compression
CS 354 Project 2 and CompressionCS 354 Project 2 and Compression
CS 354 Project 2 and Compression
 
CS 354 GPU Architecture
CS 354 GPU ArchitectureCS 354 GPU Architecture
CS 354 GPU Architecture
 
Trident International Graphics Workshop 2014 4/5
Trident International Graphics Workshop 2014 4/5Trident International Graphics Workshop 2014 4/5
Trident International Graphics Workshop 2014 4/5
 
Oit And Indirect Illumination Using Dx11 Linked Lists
Oit And Indirect Illumination Using Dx11 Linked ListsOit And Indirect Illumination Using Dx11 Linked Lists
Oit And Indirect Illumination Using Dx11 Linked Lists
 
NVIDIA OpenGL in 2016
NVIDIA OpenGL in 2016NVIDIA OpenGL in 2016
NVIDIA OpenGL in 2016
 
OpenGL for 2015
OpenGL for 2015OpenGL for 2015
OpenGL for 2015
 
Matlab Feature Extraction Using Segmentation And Edge Detection
Matlab Feature Extraction Using Segmentation And Edge DetectionMatlab Feature Extraction Using Segmentation And Edge Detection
Matlab Feature Extraction Using Segmentation And Edge Detection
 
CS 354 Lighting
CS 354 LightingCS 354 Lighting
CS 354 Lighting
 

En vedette

Shadow Techniques for Real-Time and Interactive Applications
Shadow Techniques for Real-Time and Interactive ApplicationsShadow Techniques for Real-Time and Interactive Applications
Shadow Techniques for Real-Time and Interactive Applications
stefan_b
 
Shaders in Unity by Zoel
Shaders in Unity by ZoelShaders in Unity by Zoel
Shaders in Unity by Zoel
Agate Studio
 

En vedette (7)

Shadow Techniques for Real-Time and Interactive Applications
Shadow Techniques for Real-Time and Interactive ApplicationsShadow Techniques for Real-Time and Interactive Applications
Shadow Techniques for Real-Time and Interactive Applications
 
Shaders in Unity by Zoel
Shaders in Unity by ZoelShaders in Unity by Zoel
Shaders in Unity by Zoel
 
Unity advanced computer graphics week 02
Unity advanced computer graphics week 02Unity advanced computer graphics week 02
Unity advanced computer graphics week 02
 
Shader Programming With Unity
Shader Programming With UnityShader Programming With Unity
Shader Programming With Unity
 
Shaders - Claudia Doppioslash - Unity With the Best
Shaders - Claudia Doppioslash - Unity With the BestShaders - Claudia Doppioslash - Unity With the Best
Shaders - Claudia Doppioslash - Unity With the Best
 
Cg shaders with Unity3D
Cg shaders with Unity3DCg shaders with Unity3D
Cg shaders with Unity3D
 
Slideshare ppt
Slideshare pptSlideshare ppt
Slideshare ppt
 

Similaire à Shadow Volumes on Programmable Graphics Hardware

Practical Spherical Harmonics Based PRT Methods
Practical Spherical Harmonics Based PRT MethodsPractical Spherical Harmonics Based PRT Methods
Practical Spherical Harmonics Based PRT Methods
Naughty Dog
 
D3 D10 Unleashed New Features And Effects
D3 D10 Unleashed   New Features And EffectsD3 D10 Unleashed   New Features And Effects
D3 D10 Unleashed New Features And Effects
Thomas Goddard
 

Similaire à Shadow Volumes on Programmable Graphics Hardware (20)

Chapter-3.pdf
Chapter-3.pdfChapter-3.pdf
Chapter-3.pdf
 
Beginning direct3d gameprogramming09_shaderprogramming_20160505_jintaeks
Beginning direct3d gameprogramming09_shaderprogramming_20160505_jintaeksBeginning direct3d gameprogramming09_shaderprogramming_20160505_jintaeks
Beginning direct3d gameprogramming09_shaderprogramming_20160505_jintaeks
 
GL Shading Language Document by OpenGL.pdf
GL Shading Language Document by OpenGL.pdfGL Shading Language Document by OpenGL.pdf
GL Shading Language Document by OpenGL.pdf
 
Vertex Shader Tricks by Bill Bilodeau - AMD at GDC14
Vertex Shader Tricks by Bill Bilodeau - AMD at GDC14Vertex Shader Tricks by Bill Bilodeau - AMD at GDC14
Vertex Shader Tricks by Bill Bilodeau - AMD at GDC14
 
OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...
OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...
OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...
 
Rendering basics
Rendering basicsRendering basics
Rendering basics
 
Advanced Game Development with the Mobile 3D Graphics API
Advanced Game Development with the Mobile 3D Graphics APIAdvanced Game Development with the Mobile 3D Graphics API
Advanced Game Development with the Mobile 3D Graphics API
 
GPU - how can we use it?
GPU - how can we use it?GPU - how can we use it?
GPU - how can we use it?
 
Practical Spherical Harmonics Based PRT Methods
Practical Spherical Harmonics Based PRT MethodsPractical Spherical Harmonics Based PRT Methods
Practical Spherical Harmonics Based PRT Methods
 
Practical spherical harmonics based PRT methods.ppsx
Practical spherical harmonics based PRT methods.ppsxPractical spherical harmonics based PRT methods.ppsx
Practical spherical harmonics based PRT methods.ppsx
 
lectureAll-OpenGL-complete-Guide-Tutorial.pdf
lectureAll-OpenGL-complete-Guide-Tutorial.pdflectureAll-OpenGL-complete-Guide-Tutorial.pdf
lectureAll-OpenGL-complete-Guide-Tutorial.pdf
 
Intro to OpenGL ES 2.0
Intro to OpenGL ES 2.0Intro to OpenGL ES 2.0
Intro to OpenGL ES 2.0
 
Creating an Uber Clone - Part IV - Transcript.pdf
Creating an Uber Clone - Part IV - Transcript.pdfCreating an Uber Clone - Part IV - Transcript.pdf
Creating an Uber Clone - Part IV - Transcript.pdf
 
Open GL ES Android
Open GL ES AndroidOpen GL ES Android
Open GL ES Android
 
Trident International Graphics Workshop 2014 1/5
Trident International Graphics Workshop 2014 1/5Trident International Graphics Workshop 2014 1/5
Trident International Graphics Workshop 2014 1/5
 
Bai 1
Bai 1Bai 1
Bai 1
 
3 d graphics with opengl part 2
3 d graphics with opengl  part 23 d graphics with opengl  part 2
3 d graphics with opengl part 2
 
D3 D10 Unleashed New Features And Effects
D3 D10 Unleashed   New Features And EffectsD3 D10 Unleashed   New Features And Effects
D3 D10 Unleashed New Features And Effects
 
Opengl basics
Opengl basicsOpengl basics
Opengl basics
 
OpenGL ES based UI Development on TI Platforms
OpenGL ES based UI Development on TI PlatformsOpenGL ES based UI Development on TI Platforms
OpenGL ES based UI Development on TI Platforms
 

Dernier

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Dernier (20)

Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 

Shadow Volumes on Programmable Graphics Hardware

  • 1. Shadow Volumes on Programmable Graphics Hardware Stefan Brabec Hans-Peter Seidel MPI Informatik
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 34.
  • 35.