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

What's hot

Dissecting the Rendering of The Surge
Dissecting the Rendering of The SurgeDissecting the Rendering of The Surge
Dissecting the Rendering of The SurgePhilip Hammer
 
[Ndc12] 누구나 알기쉬운 hdr과 톤맵핑 박민근
[Ndc12] 누구나 알기쉬운 hdr과 톤맵핑 박민근[Ndc12] 누구나 알기쉬운 hdr과 톤맵핑 박민근
[Ndc12] 누구나 알기쉬운 hdr과 톤맵핑 박민근MinGeun Park
 
Five Rendering Ideas from Battlefield 3 & Need For Speed: The Run
Five Rendering Ideas from Battlefield 3 & Need For Speed: The RunFive Rendering Ideas from Battlefield 3 & Need For Speed: The Run
Five Rendering Ideas from Battlefield 3 & Need For Speed: The RunElectronic Arts / DICE
 
Gdc2012 frames, sparsity and global illumination
Gdc2012 frames, sparsity and global illumination Gdc2012 frames, sparsity and global illumination
Gdc2012 frames, sparsity and global illumination Manchor Ko
 
Past, Present and Future Challenges of Global Illumination in Games
Past, Present and Future Challenges of Global Illumination in GamesPast, Present and Future Challenges of Global Illumination in Games
Past, Present and Future Challenges of Global Illumination in GamesColin Barré-Brisebois
 
[IGC2018] 왓스튜디오 방영훈 - 놀면서공부하기
[IGC2018] 왓스튜디오 방영훈 - 놀면서공부하기[IGC2018] 왓스튜디오 방영훈 - 놀면서공부하기
[IGC2018] 왓스튜디오 방영훈 - 놀면서공부하기강 민우
 
NPRキャラクターレンダリング総結集!今こそ更なる高みを目指して | UNREAL FEST EXTREME 2020 WINTER
NPRキャラクターレンダリング総結集!今こそ更なる高みを目指して | UNREAL FEST EXTREME 2020 WINTERNPRキャラクターレンダリング総結集!今こそ更なる高みを目指して | UNREAL FEST EXTREME 2020 WINTER
NPRキャラクターレンダリング総結集!今こそ更なる高みを目指して | UNREAL FEST EXTREME 2020 WINTERエピック・ゲームズ・ジャパン Epic Games Japan
 
Creating A Character in Uncharted: Drake's Fortune
Creating A Character in Uncharted: Drake's FortuneCreating A Character in Uncharted: Drake's Fortune
Creating A Character in Uncharted: Drake's FortuneNaughty Dog
 
Horizon Zero Dawn: A Game Design Post-Mortem
Horizon Zero Dawn: A Game Design Post-MortemHorizon Zero Dawn: A Game Design Post-Mortem
Horizon Zero Dawn: A Game Design Post-MortemGuerrilla
 
Killzone Shadow Fall: Creating Art Tools For A New Generation Of Games
Killzone Shadow Fall: Creating Art Tools For A New Generation Of GamesKillzone Shadow Fall: Creating Art Tools For A New Generation Of Games
Killzone Shadow Fall: Creating Art Tools For A New Generation Of GamesGuerrilla
 
Practical Spherical Harmonics Based PRT Methods
Practical Spherical Harmonics Based PRT MethodsPractical Spherical Harmonics Based PRT Methods
Practical Spherical Harmonics Based PRT MethodsNaughty Dog
 
Parallel Graphics in Frostbite - Current & Future (Siggraph 2009)
Parallel Graphics in Frostbite - Current & Future (Siggraph 2009)Parallel Graphics in Frostbite - Current & Future (Siggraph 2009)
Parallel Graphics in Frostbite - Current & Future (Siggraph 2009)Johan Andersson
 
Next generation graphics programming on xbox 360
Next generation graphics programming on xbox 360Next generation graphics programming on xbox 360
Next generation graphics programming on xbox 360VIKAS SINGH BHADOURIA
 
Cascades Demo Secrets
Cascades Demo SecretsCascades Demo Secrets
Cascades Demo Secretsicastano
 

What's hot (20)

Dissecting the Rendering of The Surge
Dissecting the Rendering of The SurgeDissecting the Rendering of The Surge
Dissecting the Rendering of The Surge
 
[Ndc12] 누구나 알기쉬운 hdr과 톤맵핑 박민근
[Ndc12] 누구나 알기쉬운 hdr과 톤맵핑 박민근[Ndc12] 누구나 알기쉬운 hdr과 톤맵핑 박민근
[Ndc12] 누구나 알기쉬운 hdr과 톤맵핑 박민근
 
Game Concept
Game ConceptGame Concept
Game Concept
 
Five Rendering Ideas from Battlefield 3 & Need For Speed: The Run
Five Rendering Ideas from Battlefield 3 & Need For Speed: The RunFive Rendering Ideas from Battlefield 3 & Need For Speed: The Run
Five Rendering Ideas from Battlefield 3 & Need For Speed: The Run
 
Gdc2012 frames, sparsity and global illumination
Gdc2012 frames, sparsity and global illumination Gdc2012 frames, sparsity and global illumination
Gdc2012 frames, sparsity and global illumination
 
UE4を使った映像制作 (UE4 Character Art Dive Online)
UE4を使った映像制作 (UE4 Character Art Dive Online)UE4を使った映像制作 (UE4 Character Art Dive Online)
UE4を使った映像制作 (UE4 Character Art Dive Online)
 
Past, Present and Future Challenges of Global Illumination in Games
Past, Present and Future Challenges of Global Illumination in GamesPast, Present and Future Challenges of Global Illumination in Games
Past, Present and Future Challenges of Global Illumination in Games
 
[IGC2018] 왓스튜디오 방영훈 - 놀면서공부하기
[IGC2018] 왓스튜디오 방영훈 - 놀면서공부하기[IGC2018] 왓스튜디오 방영훈 - 놀면서공부하기
[IGC2018] 왓스튜디오 방영훈 - 놀면서공부하기
 
NPRキャラクターレンダリング総結集!今こそ更なる高みを目指して | UNREAL FEST EXTREME 2020 WINTER
NPRキャラクターレンダリング総結集!今こそ更なる高みを目指して | UNREAL FEST EXTREME 2020 WINTERNPRキャラクターレンダリング総結集!今こそ更なる高みを目指して | UNREAL FEST EXTREME 2020 WINTER
NPRキャラクターレンダリング総結集!今こそ更なる高みを目指して | UNREAL FEST EXTREME 2020 WINTER
 
Creating A Character in Uncharted: Drake's Fortune
Creating A Character in Uncharted: Drake's FortuneCreating A Character in Uncharted: Drake's Fortune
Creating A Character in Uncharted: Drake's Fortune
 
Horizon Zero Dawn: A Game Design Post-Mortem
Horizon Zero Dawn: A Game Design Post-MortemHorizon Zero Dawn: A Game Design Post-Mortem
Horizon Zero Dawn: A Game Design Post-Mortem
 
D2 Hdr
D2 HdrD2 Hdr
D2 Hdr
 
Killzone Shadow Fall: Creating Art Tools For A New Generation Of Games
Killzone Shadow Fall: Creating Art Tools For A New Generation Of GamesKillzone Shadow Fall: Creating Art Tools For A New Generation Of Games
Killzone Shadow Fall: Creating Art Tools For A New Generation Of Games
 
Practical Spherical Harmonics Based PRT Methods
Practical Spherical Harmonics Based PRT MethodsPractical Spherical Harmonics Based PRT Methods
Practical Spherical Harmonics Based PRT Methods
 
Adobe Lightroom
Adobe LightroomAdobe Lightroom
Adobe Lightroom
 
Parallel Graphics in Frostbite - Current & Future (Siggraph 2009)
Parallel Graphics in Frostbite - Current & Future (Siggraph 2009)Parallel Graphics in Frostbite - Current & Future (Siggraph 2009)
Parallel Graphics in Frostbite - Current & Future (Siggraph 2009)
 
Next generation graphics programming on xbox 360
Next generation graphics programming on xbox 360Next generation graphics programming on xbox 360
Next generation graphics programming on xbox 360
 
Visual Effects (VFX)
Visual Effects (VFX)Visual Effects (VFX)
Visual Effects (VFX)
 
初心者向け UE4 映像制作での シーケンサー と Movie Render Queue の使い方
初心者向け UE4 映像制作での シーケンサー と Movie Render Queue の使い方初心者向け UE4 映像制作での シーケンサー と Movie Render Queue の使い方
初心者向け UE4 映像制作での シーケンサー と Movie Render Queue の使い方
 
Cascades Demo Secrets
Cascades Demo SecretsCascades Demo Secrets
Cascades Demo Secrets
 

Similar to GDC 2010 Left4Dead2 Wounds

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 WorldYung-Luen Lan
 
06 image features
06 image features06 image features
06 image featuresankit_ppt
 
Lec14 multiview stereo
Lec14 multiview stereoLec14 multiview stereo
Lec14 multiview stereoBaliThorat1
 
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 FallenBenjamin Glatzel
 
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 SoliMark Billinghurst
 
iOS Visual F/X Using GLSL
iOS Visual F/X Using GLSLiOS Visual F/X Using GLSL
iOS Visual F/X Using GLSLDouglass Turner
 
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 AndroidDroidConTLV
 

Similar to GDC 2010 Left4Dead2 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
 

GDC 2010 Left4Dead2 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