SlideShare a Scribd company logo
1 of 29
Download to read offline
Rendering Wounds in
   Left 4 Dead 2
   Alex Vlachos, Valve
     March 9, 2010
Outline
• Goals

• Technical Constraints

• Initial Prototype

• Final Solution
Left 4 Dead 1 Wounds
•   Built-in
•   5 variations only
•   Requires texture support
•   Always Fatal
The Pitch
      Gray Horsfield lives for destruction
(Gray is a Visual Effects Artist at Valve, previously at Weta)
Goals
• Accurate location of wounds

• Wounds match weapon strength
  – Remove limbs, torso, head, half of body


• Separate wound geometry & textures

• Several active/visible wounds per model
  – Shipped up to 2 active wounds
Technical Constraints
• Already at memory limits on the Xbox 360

• Didn’t want heavy CPU setup

• Ideally wanted a GPU solution

• No additional base meshes except for
  wound geometry
  – Better for artists to author
  – Share wound models among many infected
Common Infected Variation
• Simplest infected has over 24,000 variations




• We didn’t want to add another variable to this
Things We Didn’t/Couldn’t Do
• Model variations of each infected with all
  combinations of 1 and 2 wounds

• Use different index buffers to cull polygons –
  not friendly with LOD and low quality wound
  silhouettes

• Auto-generate new polygonal meshes with
  holes cut for wound models

• Author different body parts/sections with
  different wound variations
Initial Prototype
• Use pose-space ellipsoids to cull pixels
• Fill hole with wound model
Culling Inside an Ellipsoid
• Vertex Shader calculates relative distance
• Interpolate this value and clip / texkill
Benefits
• No additional vertex buffer data
• Still only one draw call for full model
• Wounds are a separate draw call with
  their own textures:
Problems
• Hard cut looked unnatural

• Wound models looked strange
  because they required a lip
  around the wound border

• Lacked blood on the clothes and
  skin near the border of the wound

• Required an exact geometric fit
  with the model
Projected Texture Experiment
Try using a projected texture and use alpha
  to kill pixels
Abdominal Wounds




• Projected texture will affect his back
• So let’s combine the texture and ellipsoid
Blood Layer
• The texture projection is aligned with an
  axis of the ellipse
• We multiply the blood layer by a gradient
  to prevent the blood from spraying too far
Vertex Shader Code
 // Subtract off ellipsoid center
 float3 vLocalPosition = ( vPreSkinnedPosition.xyz - vEllipsoidCenter.xyz );

 // Apply rotation and ellipsoid scale. Ellipsoid basis is the orthonormal basis
 // of the ellipsoid divided by the per-axis ellipsoid size.
 float3 vEllipsoidPosition;
 vEllipsoidPosition.x = dot( vEllipsoidSide.xyz, vLocalPosition.xyz );
 vEllipsoidPosition.y = dot( vEllipsoidUp.xyz, vLocalPosition.xyz );
 vEllipsoidPosition.z = dot( vEllipsoidForward.xyz, vLocalPosition.xyz );

 // Use the length of the position in ellipsoid space as input to texkill/clip
 float fTexkillInput = length( vEllipsoidPosition.xyz );

 // We use the xy of the position in ellipsoid space as the texture uv
 float2 vTextureCoords = vEllipsoidPosition.xy;
Other
• Depth-only and shadow render passes
  – You don’t want phantom shadows


• Hi-Z performance issues

• Wound models are attached to base
  skeleton of infected model
Multiple Wounds
We limited the final solution to 2 active wounds
Upper & Lower Back
Groin
Arms & Legs
Abdomen
Head Wounds
Half Body
Axe & Sword Slashes
Upper Body
Stats
• Up to 54 unique wounds per model

• Each wound is only 13% of the memory
  cost of the old system in Left 4 Dead 1

• Vertex shader costs 15 instructions
  – Fill-bound, so rendering perf impacted
    minimally

• Pixel Shader costs 7 instructions
Summary
• Wound models separate from base mesh

• Use pose-space ellipsoids for outer limiting
  cull volume

• Use projected texture for rough edges and
  blood layer

• Additional details about our rendering:
  http://www.valvesoftware.com/publications.html
Thank you!



   Alex Vlachos, Valve
alex@valvesoftware.com

More Related Content

Viewers also liked (17)

20091012_Personal data_02
20091012_Personal data_0220091012_Personal data_02
20091012_Personal data_02
 
Masa Depanku Rizky 6 A
Masa Depanku Rizky 6 AMasa Depanku Rizky 6 A
Masa Depanku Rizky 6 A
 
Progetto etwinning: va' dove ti porta..il mouse
Progetto etwinning: va' dove ti porta..il mouseProgetto etwinning: va' dove ti porta..il mouse
Progetto etwinning: va' dove ti porta..il mouse
 
test
testtest
test
 
E-waste recycling-L
E-waste recycling-LE-waste recycling-L
E-waste recycling-L
 
Np rocks and minerals
Np rocks and mineralsNp rocks and minerals
Np rocks and minerals
 
Garbage west
Garbage westGarbage west
Garbage west
 
Test Nan
Test NanTest Nan
Test Nan
 
브랜드 아울렛 24홀릭 모바일 상품권 구매 매뉴얼
브랜드 아울렛 24홀릭 모바일 상품권 구매 매뉴얼브랜드 아울렛 24홀릭 모바일 상품권 구매 매뉴얼
브랜드 아울렛 24홀릭 모바일 상품권 구매 매뉴얼
 
Präsentation schule
Präsentation schulePräsentation schule
Präsentation schule
 
Komputerku Irsyad 5 B
Komputerku Irsyad 5 BKomputerku Irsyad 5 B
Komputerku Irsyad 5 B
 
Good one
Good oneGood one
Good one
 
test
testtest
test
 
CRM Trends 2015
CRM Trends 2015CRM Trends 2015
CRM Trends 2015
 
Yeni microsoft office power point sunusu
Yeni microsoft office power point sunusuYeni microsoft office power point sunusu
Yeni microsoft office power point sunusu
 
No Panic workshop
No Panic workshopNo Panic workshop
No Panic workshop
 
Komputerku Kalyana Sidra Wardhana 4a
Komputerku Kalyana Sidra Wardhana 4aKomputerku Kalyana Sidra Wardhana 4a
Komputerku Kalyana Sidra Wardhana 4a
 

Similar to Vlachos Gdc10 Left4 Dead2 Wounds

Similar to Vlachos Gdc10 Left4 Dead2 Wounds (9)

october9.ppt
october9.pptoctober9.ppt
october9.ppt
 
Incarnation - Turning Real World Objects into Perfume World
Incarnation - Turning Real World Objects into Perfume WorldIncarnation - Turning Real World Objects into Perfume World
Incarnation - Turning Real World Objects into Perfume World
 
06 image features
06 image features06 image features
06 image features
 
Design Intent.ppt
Design Intent.pptDesign Intent.ppt
Design Intent.ppt
 
Lec14 multiview stereo
Lec14 multiview stereoLec14 multiview stereo
Lec14 multiview stereo
 
Volumetric Lighting for Many Lights in Lords of the Fallen
Volumetric Lighting for Many Lights in Lords of the FallenVolumetric Lighting for Many Lights in Lords of the Fallen
Volumetric Lighting for Many Lights in Lords of the Fallen
 
COMP 4026 Lecture 5 OpenFrameworks and Soli
COMP 4026 Lecture 5 OpenFrameworks and SoliCOMP 4026 Lecture 5 OpenFrameworks and Soli
COMP 4026 Lecture 5 OpenFrameworks and Soli
 
iOS Visual F/X Using GLSL
iOS Visual F/X Using GLSLiOS Visual F/X Using GLSL
iOS Visual F/X Using GLSL
 
OpenGL - Bringing the 3D World into the Android
OpenGL - Bringing the 3D World into the AndroidOpenGL - Bringing the 3D World into the Android
OpenGL - Bringing the 3D World into the Android
 

More from ozlael ozlael

Introduce coco2dx with cookingstar
Introduce coco2dx with cookingstarIntroduce coco2dx with cookingstar
Introduce coco2dx with cookingstar
ozlael ozlael
 
Deferred rendering case study
Deferred rendering case studyDeferred rendering case study
Deferred rendering case study
ozlael ozlael
 
Kgc make stereo game on pc
Kgc make stereo game on pcKgc make stereo game on pc
Kgc make stereo game on pc
ozlael ozlael
 
Hable uncharted2(siggraph%202010%20 advanced%20realtime%20rendering%20course)
Hable uncharted2(siggraph%202010%20 advanced%20realtime%20rendering%20course)Hable uncharted2(siggraph%202010%20 advanced%20realtime%20rendering%20course)
Hable uncharted2(siggraph%202010%20 advanced%20realtime%20rendering%20course)
ozlael ozlael
 

More from ozlael ozlael (20)

Unity & VR (Unity Roadshow 2016)
Unity & VR (Unity Roadshow 2016)Unity & VR (Unity Roadshow 2016)
Unity & VR (Unity Roadshow 2016)
 
뭣이 중헌디? 성능 프로파일링도 모름서 - 유니티 성능 프로파일링 가이드 (IGC16)
뭣이 중헌디? 성능 프로파일링도 모름서 - 유니티 성능 프로파일링 가이드 (IGC16)뭣이 중헌디? 성능 프로파일링도 모름서 - 유니티 성능 프로파일링 가이드 (IGC16)
뭣이 중헌디? 성능 프로파일링도 모름서 - 유니티 성능 프로파일링 가이드 (IGC16)
 
Optimizing mobile applications - Ian Dundore, Mark Harkness
Optimizing mobile applications - Ian Dundore, Mark HarknessOptimizing mobile applications - Ian Dundore, Mark Harkness
Optimizing mobile applications - Ian Dundore, Mark Harkness
 
그래픽 최적화로 가...가버렷! (부제: 배치! 배칭을 보자!) , Batch! Let's take a look at Batching! -...
그래픽 최적화로 가...가버렷! (부제: 배치! 배칭을 보자!) , Batch! Let's take a look at Batching! -...그래픽 최적화로 가...가버렷! (부제: 배치! 배칭을 보자!) , Batch! Let's take a look at Batching! -...
그래픽 최적화로 가...가버렷! (부제: 배치! 배칭을 보자!) , Batch! Let's take a look at Batching! -...
 
유니티 그래픽 최적화, 어디까지 해봤니 (Optimizing Unity Graphics) Unite Seoul Ver.
유니티 그래픽 최적화, 어디까지 해봤니 (Optimizing Unity Graphics) Unite Seoul Ver.유니티 그래픽 최적화, 어디까지 해봤니 (Optimizing Unity Graphics) Unite Seoul Ver.
유니티 그래픽 최적화, 어디까지 해봤니 (Optimizing Unity Graphics) Unite Seoul Ver.
 
유니티 그래픽 최적화, 어디까지 해봤니 (Optimizing Unity Graphics) NDC15 Ver.
유니티 그래픽 최적화, 어디까지 해봤니 (Optimizing Unity Graphics) NDC15 Ver.유니티 그래픽 최적화, 어디까지 해봤니 (Optimizing Unity Graphics) NDC15 Ver.
유니티 그래픽 최적화, 어디까지 해봤니 (Optimizing Unity Graphics) NDC15 Ver.
 
Infinity Blade and beyond
Infinity Blade and beyondInfinity Blade and beyond
Infinity Blade and beyond
 
스티브잡스처럼 프레젠테이션하기
스티브잡스처럼 프레젠테이션하기스티브잡스처럼 프레젠테이션하기
스티브잡스처럼 프레젠테이션하기
 
유니티의 라이팅이 안 이쁘다구요? (A to Z of Lighting)
유니티의 라이팅이 안 이쁘다구요? (A to Z of Lighting)유니티의 라이팅이 안 이쁘다구요? (A to Z of Lighting)
유니티의 라이팅이 안 이쁘다구요? (A to Z of Lighting)
 
Introduce coco2dx with cookingstar
Introduce coco2dx with cookingstarIntroduce coco2dx with cookingstar
Introduce coco2dx with cookingstar
 
Deferred rendering case study
Deferred rendering case studyDeferred rendering case study
Deferred rendering case study
 
Kgc make stereo game on pc
Kgc make stereo game on pcKgc make stereo game on pc
Kgc make stereo game on pc
 
mssao presentation
mssao presentationmssao presentation
mssao presentation
 
Modern gpu optimize blog
Modern gpu optimize blogModern gpu optimize blog
Modern gpu optimize blog
 
Modern gpu optimize
Modern gpu optimizeModern gpu optimize
Modern gpu optimize
 
Bickerstaff benson making3d games on the playstation3
Bickerstaff benson making3d games on the playstation3Bickerstaff benson making3d games on the playstation3
Bickerstaff benson making3d games on the playstation3
 
DOF Depth of Field
DOF Depth of FieldDOF Depth of Field
DOF Depth of Field
 
Hable uncharted2(siggraph%202010%20 advanced%20realtime%20rendering%20course)
Hable uncharted2(siggraph%202010%20 advanced%20realtime%20rendering%20course)Hable uncharted2(siggraph%202010%20 advanced%20realtime%20rendering%20course)
Hable uncharted2(siggraph%202010%20 advanced%20realtime%20rendering%20course)
 
Deferred rendering in_leadwerks_engine[1]
Deferred rendering in_leadwerks_engine[1]Deferred rendering in_leadwerks_engine[1]
Deferred rendering in_leadwerks_engine[1]
 
Deferred shading
Deferred shadingDeferred shading
Deferred shading
 

Recently uploaded

Recently uploaded (20)

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 

Vlachos Gdc10 Left4 Dead2 Wounds

  • 1. Rendering Wounds in Left 4 Dead 2 Alex Vlachos, Valve March 9, 2010
  • 2. Outline • Goals • Technical Constraints • Initial Prototype • Final Solution
  • 3. Left 4 Dead 1 Wounds • Built-in • 5 variations only • Requires texture support • Always Fatal
  • 4. The Pitch Gray Horsfield lives for destruction (Gray is a Visual Effects Artist at Valve, previously at Weta)
  • 5. Goals • Accurate location of wounds • Wounds match weapon strength – Remove limbs, torso, head, half of body • Separate wound geometry & textures • Several active/visible wounds per model – Shipped up to 2 active wounds
  • 6. Technical Constraints • Already at memory limits on the Xbox 360 • Didn’t want heavy CPU setup • Ideally wanted a GPU solution • No additional base meshes except for wound geometry – Better for artists to author – Share wound models among many infected
  • 7. Common Infected Variation • Simplest infected has over 24,000 variations • We didn’t want to add another variable to this
  • 8. Things We Didn’t/Couldn’t Do • Model variations of each infected with all combinations of 1 and 2 wounds • Use different index buffers to cull polygons – not friendly with LOD and low quality wound silhouettes • Auto-generate new polygonal meshes with holes cut for wound models • Author different body parts/sections with different wound variations
  • 9. Initial Prototype • Use pose-space ellipsoids to cull pixels • Fill hole with wound model
  • 10. Culling Inside an Ellipsoid • Vertex Shader calculates relative distance • Interpolate this value and clip / texkill
  • 11. Benefits • No additional vertex buffer data • Still only one draw call for full model • Wounds are a separate draw call with their own textures:
  • 12. Problems • Hard cut looked unnatural • Wound models looked strange because they required a lip around the wound border • Lacked blood on the clothes and skin near the border of the wound • Required an exact geometric fit with the model
  • 13. Projected Texture Experiment Try using a projected texture and use alpha to kill pixels
  • 14. Abdominal Wounds • Projected texture will affect his back • So let’s combine the texture and ellipsoid
  • 15. Blood Layer • The texture projection is aligned with an axis of the ellipse • We multiply the blood layer by a gradient to prevent the blood from spraying too far
  • 16. Vertex Shader Code // Subtract off ellipsoid center float3 vLocalPosition = ( vPreSkinnedPosition.xyz - vEllipsoidCenter.xyz ); // Apply rotation and ellipsoid scale. Ellipsoid basis is the orthonormal basis // of the ellipsoid divided by the per-axis ellipsoid size. float3 vEllipsoidPosition; vEllipsoidPosition.x = dot( vEllipsoidSide.xyz, vLocalPosition.xyz ); vEllipsoidPosition.y = dot( vEllipsoidUp.xyz, vLocalPosition.xyz ); vEllipsoidPosition.z = dot( vEllipsoidForward.xyz, vLocalPosition.xyz ); // Use the length of the position in ellipsoid space as input to texkill/clip float fTexkillInput = length( vEllipsoidPosition.xyz ); // We use the xy of the position in ellipsoid space as the texture uv float2 vTextureCoords = vEllipsoidPosition.xy;
  • 17. Other • Depth-only and shadow render passes – You don’t want phantom shadows • Hi-Z performance issues • Wound models are attached to base skeleton of infected model
  • 18. Multiple Wounds We limited the final solution to 2 active wounds
  • 20. Groin
  • 25. Axe & Sword Slashes
  • 27. Stats • Up to 54 unique wounds per model • Each wound is only 13% of the memory cost of the old system in Left 4 Dead 1 • Vertex shader costs 15 instructions – Fill-bound, so rendering perf impacted minimally • Pixel Shader costs 7 instructions
  • 28. Summary • Wound models separate from base mesh • Use pose-space ellipsoids for outer limiting cull volume • Use projected texture for rough edges and blood layer • Additional details about our rendering: http://www.valvesoftware.com/publications.html
  • 29. Thank you! Alex Vlachos, Valve alex@valvesoftware.com