SlideShare a Scribd company logo
Dynamic Wounds on Animated Characters
in UE4
Michał Kłoś, Layopi Games
Game Industry Conference 2017
Download Slides
About me
Now Shader/VFX Artist Lead at Layopi Games
Lead Native Dev at VR Global
Unity & Web Dev at TK Games
Agenda
• Intro to wounds in games
• Popular methods
• Effect features and problems
• Effect meets profiling and gameplay
• Final comparison
Intro to wounds in games
Intro to wounds in games
Wounds and dismemberment:
• Mortal Kombat
• Metal Gear Solid
• Dead Space
• Fallout
• Shadow Warrior 2
• Shadow of Mordor
and many more …
https://www.youtube.com/watch?v=RIUYi9JuMKQ
Fallout
Mortal Kombat
Dead Space
Shadow Warrior 2
Metal Gear Solid
Intro to wounds in games
Why game need wounds:
• Visual feedback to damage
• Minimize UI, Healthbars
• Give satisfaction from combat
• Juiciness: persistence
Intro to wounds in games
Does your effect make sense? Need to follow character and game design!
vs vs
Intro to wounds in games
Alternatives?
Fixed presets
… why not combine both?
Hellblade: Senua's Sacrifice
www.youtube.com/watch?v=5aAgBAO9Lwc
Intro to wounds in games
Popular methods:
• Ryan Brucks Unwraped Capture
• Tom Loomans PreSkinned Position
?
Dedicated system fitting:
• Creative and Art Director’s
Vision
• Game Requirements
Intro to wounds in games
Popular methods:
• Ryan Brucks Unwraped Capture
• Tom Loomans PreSkinned Position
?
Dedicated system fitting:
• Creative and Art Director’s
Vision
• Game Requirements
Case study: fighting with blades
Decal projection makes it slide on animated meshes, it is bad!
Material with masked damage even allows for animation of strokes, we want this!
Popular methods
Vlachos 2010, Rendering Wounds in Left 4 Dead 2, Valve
https://alex.vlachos.com/graphics/Vlachos-GDC10-Left4Dead2Wounds.pdf
Vlachos 2010, Rendering Wounds in Left 4 Dead 2, Valve
https://alex.vlachos.com/graphics/Vlachos-GDC10-Left4Dead2Wounds.pdf
Their problems
• Memory limits
• Performance Constraints
• Character variations
• LOD
• Avoid mesh generation
Vlachos 2010, Rendering Wounds in Left 4 Dead 2, Valve
https://youtu.be/5_G79LJ_l2Y
Vlachos 2010, Rendering Wounds in Left 4 Dead 2, Valve
https://www.youtube.com/watch?v=CHbnP5SAMzI
Vlachos 2010, Rendering Wounds in Left 4 Dead 2, Valve
https://alex.vlachos.com/graphics/Vlachos-GDC10-Left4Dead2Wounds.pdf
Popular Methods
• Ryan Brucks Unwraped Capture
• Tom Loomans Preskinned Position
Popular Methods
Problems
• Calculate mask on surface of animated geometry
• Keep updatable mask between frames
Popular Methods
• Ryan Brucks Unwraped Capture
• Requires SceneCapture
• Each masked pixel need captured position
• Copy animation or use animated mesh
• Tom Loomans Preskinned Position
Popular Methods
• Ryan Brucks Unwraped Capture
• Requires SceneCapture
• Each masked pixel need captured position
• Copy animation or use animated mesh
• Tom Loomans Preskinned Position
• Hit calculation done in Rest Pose
• Hit need transformation into Rest Pose
ex. Bone Transform from Trace
Popular Methods
Ryan Brucks Unwraped Capture explained
Ryan Brucks Unwraped Capture explained
Ryan Brucks Unwraped Capture explained
Popular Methods
Ryan Brucks Unwraped Capture explained
Ryan Brucks Unwraped Capture explained
Ryan Brucks Unwraped Capture explained
Unique UV, outtake on texture morph animation that happens when UVs are mirrored
Tom Loomans PreSkinned Position explained
Red: Animated Bone Transform, Green: RestPose Transform, Blue: Inverse Animartion + RestPose Transform
Tom Loomans PreSkinned Position explained
Effect features and problems
Effect Features and Problems
• Blending with character material
• Fitting shape of obstacle
• Dotted on fast movement of obstacle
• Variable number of obstacles and draw calls
• Impact of hit
• Hits from random limb collisions
MaterialAttributes Functions, Blending with mask
Ryan Brucks Unwraped Capture, Require 2 RenderTargets per each Character
Effect Features and Problems
Fitting shape of obstacle
Signed Distance Fields (SDF)
What info gives us SDF?
Signed Distance Fields (SDF), What info gives us SDF? https://www.shadertoy.com/view/ldK3zD
Effect Features and Problems
Fitting shape of obstacle
http://iquilezles.org/www/articles/distfunctions/distfunctions.htm
float sdSphere ( vec3 p, float r ) {
return length(p)-r;
}
Effect Features and Problems
Fitting shape of obstacle
http://iquilezles.org/www/articles/distfunctions/distfunctions.htm
float sdCapsule (vec3 p, vec3 a, vec3 b, float r) {
vec3 pa = p-a, ba = b-a;
float h = clamp(dot(pa,ba)/dot(ba,ba), 0.0, 1.0);
return length(pa-ba*h)-r;
}
Appear dotted on fast movement of obstacle
Effect Features and Problems
Appear dotted on fast movement of obstacle
Keep info from previous frame
Sphere + Sphere = Capsule
Capsule + Capsule = Quad
+
+
=
=
Effect Features and Problems
http://iquilezles.org/www/articles/distfunctions/distfunctions.htm
float dot2(in vec3 v) { return dot(v,v); }
float udQuad (vec3 p, vec3 a, vec3 b, vec3 c, vec3 d) {
vec3 ba = b-a; vec3 pa = p-a; vec3 cb = c-b; vec3 pb = p-b;
vec3 dc = d-c; vec3 pc = p-c; vec3 ad = a-d; vec3 pd = p-d;
vec3 nor = cross(ba, ad);
return sqrt((sign(dot(cross(ba,nor),pa))
+sign(dot(cross(cb,nor),pb))
+sign(dot(cross(dc,nor),pc))
+sign(dot(cross(ad,nor),pd)) < 3.0)
? min(min(min(dot2(
ba*clamp(dot(ba,pa)/dot2(ba),0.0,1.0)-pa),
dot2(cb*clamp(dot(cb,pb)/dot2(cb),0.0,1.0)-pb)),
dot2(dc*clamp(dot(dc,pc)/dot2(dc),0.0,1.0)-pc)),
dot2(ad*clamp(dot(ad,pd)/dot2(ad),0.0,1.0)-pd))
: dot(nor,pa)*dot(nor,pa)/dot2(nor) );
}
Effect Features and Problems
http://iquilezles.org/www/articles/distfunctions/distfunctions.htm
Effect Features and Problems
Splines?
Read bone animation trail from SkeletalMeshComponent?
Interpolate 2+ frames?
Did not tried
https://www.shadertoy.com/view/XdB3Ww
Effect Features and Problems
Variable number of obstacles and draw calls
Draw sum of all of them at once and count instructions
Editor do not support Material Parameters Arrays
but Global Shaders do.
Variable number of obstacles and draw calls
Effect Features and Problems
Impact of the hit
Brush like feeling vs Impact - what gives impact
Trigger stroke with Collision Trace
Trigger stroke with Collision Trace
Effect Features and Problems
Impact from random limb collisions
Animation notify with info about currently active limb for damage
Animation notify with info about currently active limb for damage
Effect Features and Problems
Multiple Characters at once
Mesh occlusion - Extents Size
Effect meet profiling and gameplay
Effect meets profiling and gameplay
Profiling and 1ms budget for VFX
UE profiling tools
SceneCapture vs RenderMaterialToTexture Performance
RenderTarget performance vs quality
WorldSpace vs LocalSpace
Blueprint for sequencer, easy to debug
Blueprint for sequencer, easy to debug
Effect meets profiling and gameplay
Stress Test Scene (i7, 16 GB RAM, GTX 970 1080p)
Stress Test Scene (i7, 16 GB RAM, GTX 970 1080p)
Stress Test Scene (i7, 16 GB RAM, GTX 970 1080p)
Stress Test Scene (i7, 16 GB RAM, GTX 970 1080p)
Effect meets profiling and gameplay
Stress Test Scene (i7, 16 GB RAM, GTX 970 1080p)
Numbers per MaskRenderTarget resolution:
2048 x 2048 px (RGB8, 16 MB),
SceneCapture 5.22 ms per Character
MaskRenderTarget 0.35 ms per obstacle
1024 x 1024 px (RGB8, 4 MB),
SceneCapture 1.77 ms per Character
MaskRenderTarget 0.09 ms per obstacle
512 x 512 px (RGB8, 1 MB),
SceneCapture 1.02 ms per Character
MaskRenderTarget 0.025 ms per obstacle
Effect meets profiling and gameplay
Solution:
Transform Hit to Rest Pose instead of SceneCapture
Effect need texture mask done with DrawMaterialToRenderTarget
but it draws on quad with no info about Rest Pose
...so bake RestPose to texture at start and sample each time
Effect meets profiling and gameplay
Interface for gameplay
Enqueue calls each frame and restrict limit
Service with Logic - Component with State approach,
easy to plug to character
Feed with WorldSpace vs LocalSpace
Interface for gameplay, stuctures and components
Interface for gameplay, WorldToLocal Character transformation
Interface for gameplay, MaskRenderer execution
Effect meets profiling and gameplay
Alternatives:
• Global Shaders
• ShaderDemoPlugin by Temaran
• Pixel Shader Example
• Compute Shader Example
Fork it!
Effect meets profiling and gameplay
www.unrealengine.com/en-US/blog/how-to-add-global-shaders-to-ue4
// MyTest.usf
// Simple pass-through vertex shader
void MainVS( in float4 InPosition : ATTRIBUTE0, out float4 Output : SV_POSITION ) {
Output = InPosition;
}
// Simple solid color pixel shader
float4 MyColor; float4 MainPS() : SV_Target0 {
return MyColor;
}
Global Shaders, finally!
Effect meets profiling and gameplay
ShaderDemoPlugin by Temaran
ShaderDemoPlugin by Temaran, Shader class declaration
ShaderDemoPlugin by Temaran, Uniform Structs declarations
ShaderDemoPlugin by Temaran, usage in code
ShaderDemoPlugin by Temaran, adding render command to RHI
Final comparison
Final Comparison
vs
RestPose stays in budget SceneCapture does not
Demo
Demo
Demo
Takeaways
• Make sure your effects meet design of game and characters
• Effects give visual feedback to game events
• SceneCapture renders whole scene with lights and shadows
• SceneCapture may be performed only at start or even offline saved as asset
• Rest pose is best approach for calculations
• DrawMaterialToRenderTarget is rather cheap
Questions?
Thank you
@_spolsh
github.com/sp0lsh
michal.m.klos@gmail.com

More Related Content

PPTX
大規模タイトルにおけるエフェクトマテリアル運用 (SQEX大阪: 林武尊様) #UE4DD
エピック・ゲームズ・ジャパン Epic Games Japan
 
PDF
待望のUE4新機能 ナイアガラでプログラマブルVFX
エピック・ゲームズ・ジャパン Epic Games Japan
 
PDF
[UE4]マテリアルの注意すべきこと!~テクスチャロードとSwitch~
com044
 
PDF
アーティストの為のプロファイル入門!~楽しいRenderDocの使い方~
エピック・ゲームズ・ジャパン Epic Games Japan
 
PDF
GPU最適化入門
Takahiro KOGUCHI
 
PPTX
[CEDEC2018] UE4で多数のキャラクターを生かすためのテクニック
エピック・ゲームズ・ジャパン Epic Games Japan
 
PDF
UE5制作事例 “The Market of Light” ~Nanite/Lumenへの挑戦~
historia_Inc
 
大規模タイトルにおけるエフェクトマテリアル運用 (SQEX大阪: 林武尊様) #UE4DD
エピック・ゲームズ・ジャパン Epic Games Japan
 
待望のUE4新機能 ナイアガラでプログラマブルVFX
エピック・ゲームズ・ジャパン Epic Games Japan
 
[UE4]マテリアルの注意すべきこと!~テクスチャロードとSwitch~
com044
 
アーティストの為のプロファイル入門!~楽しいRenderDocの使い方~
エピック・ゲームズ・ジャパン Epic Games Japan
 
GPU最適化入門
Takahiro KOGUCHI
 
[CEDEC2018] UE4で多数のキャラクターを生かすためのテクニック
エピック・ゲームズ・ジャパン Epic Games Japan
 
UE5制作事例 “The Market of Light” ~Nanite/Lumenへの挑戦~
historia_Inc
 

What's hot (20)

PDF
UE4.14.0 Forward Shadingのエンジン改造でセルシェードやってみた
com044
 
PPTX
マテリアルとマテリアルインスタンスの仕組みと問題点の共有 (Epic Games Japan: 篠山範明) #UE4DD
エピック・ゲームズ・ジャパン Epic Games Japan
 
PDF
初心者向け UE4 映像制作での シーケンサー と Movie Render Queue の使い方
エピック・ゲームズ・ジャパン Epic Games Japan
 
PDF
UE4を使った クロスシミュレーションと、 ハイエンド・モバイルゲーム制作の奥義を伝授!
エピック・ゲームズ・ジャパン Epic Games Japan
 
PPTX
マジシャンズデッド ポストモーテム ~マテリアル編~ (株式会社Byking: 鈴木孝司様、成相真治様) #UE4DD
エピック・ゲームズ・ジャパン Epic Games Japan
 
PDF
猫でも分かる Control Rig UE4.25 版
エピック・ゲームズ・ジャパン Epic Games Japan
 
PDF
バイキング流UE4活用術 ~BPとお別れするまでの18ヶ月~
エピック・ゲームズ・ジャパン Epic Games Japan
 
PDF
メカアクションゲーム『DAEMON X MACHINA』 信念と血と鋼鉄の開発事例
エピック・ゲームズ・ジャパン Epic Games Japan
 
PDF
UE4におけるエフェクトの為のエンジン改造事例
エピック・ゲームズ・ジャパン Epic Games Japan
 
PPTX
UE4のスレッドの流れと Input Latency改善の仕組み
エピック・ゲームズ・ジャパン Epic Games Japan
 
PDF
60fpsアクションを実現する秘訣を伝授 解析編
エピック・ゲームズ・ジャパン Epic Games Japan
 
PDF
60fpsアクションを実現する秘訣を伝授 基礎編
エピック・ゲームズ・ジャパン Epic Games Japan
 
PDF
NPRキャラクターレンダリング総結集!今こそ更なる高みを目指して | UNREAL FEST EXTREME 2020 WINTER
エピック・ゲームズ・ジャパン Epic Games Japan
 
PPTX
Unreal engine4を使ったVRコンテンツ製作で 120%役に立つtips集+GDC情報をご紹介
エピック・ゲームズ・ジャパン Epic Games Japan
 
PDF
UE4を使った映像制作 (UE4 Character Art Dive Online)
エピック・ゲームズ・ジャパン Epic Games Japan
 
PDF
UE4における大規模背景制作事例(データメンテナンス・大技設定編 )
エピック・ゲームズ・ジャパン Epic Games Japan
 
PDF
UE4 Performance and Profiling | Unreal Dev Day Montreal 2017 (日本語訳)
エピック・ゲームズ・ジャパン Epic Games Japan
 
PDF
UE4 Volumetric Fogで 空間を演出する!
com044
 
PDF
【Unite Tokyo 2018】『崩壊3rd』開発者が語るアニメ風レンダリングの極意
UnityTechnologiesJapan002
 
PPTX
マテリアルエディタで作るVFX
Akihito Chiba
 
UE4.14.0 Forward Shadingのエンジン改造でセルシェードやってみた
com044
 
マテリアルとマテリアルインスタンスの仕組みと問題点の共有 (Epic Games Japan: 篠山範明) #UE4DD
エピック・ゲームズ・ジャパン Epic Games Japan
 
初心者向け UE4 映像制作での シーケンサー と Movie Render Queue の使い方
エピック・ゲームズ・ジャパン Epic Games Japan
 
UE4を使った クロスシミュレーションと、 ハイエンド・モバイルゲーム制作の奥義を伝授!
エピック・ゲームズ・ジャパン Epic Games Japan
 
マジシャンズデッド ポストモーテム ~マテリアル編~ (株式会社Byking: 鈴木孝司様、成相真治様) #UE4DD
エピック・ゲームズ・ジャパン Epic Games Japan
 
猫でも分かる Control Rig UE4.25 版
エピック・ゲームズ・ジャパン Epic Games Japan
 
バイキング流UE4活用術 ~BPとお別れするまでの18ヶ月~
エピック・ゲームズ・ジャパン Epic Games Japan
 
メカアクションゲーム『DAEMON X MACHINA』 信念と血と鋼鉄の開発事例
エピック・ゲームズ・ジャパン Epic Games Japan
 
UE4におけるエフェクトの為のエンジン改造事例
エピック・ゲームズ・ジャパン Epic Games Japan
 
UE4のスレッドの流れと Input Latency改善の仕組み
エピック・ゲームズ・ジャパン Epic Games Japan
 
60fpsアクションを実現する秘訣を伝授 解析編
エピック・ゲームズ・ジャパン Epic Games Japan
 
60fpsアクションを実現する秘訣を伝授 基礎編
エピック・ゲームズ・ジャパン Epic Games Japan
 
NPRキャラクターレンダリング総結集!今こそ更なる高みを目指して | UNREAL FEST EXTREME 2020 WINTER
エピック・ゲームズ・ジャパン Epic Games Japan
 
Unreal engine4を使ったVRコンテンツ製作で 120%役に立つtips集+GDC情報をご紹介
エピック・ゲームズ・ジャパン Epic Games Japan
 
UE4を使った映像制作 (UE4 Character Art Dive Online)
エピック・ゲームズ・ジャパン Epic Games Japan
 
UE4における大規模背景制作事例(データメンテナンス・大技設定編 )
エピック・ゲームズ・ジャパン Epic Games Japan
 
UE4 Performance and Profiling | Unreal Dev Day Montreal 2017 (日本語訳)
エピック・ゲームズ・ジャパン Epic Games Japan
 
UE4 Volumetric Fogで 空間を演出する!
com044
 
【Unite Tokyo 2018】『崩壊3rd』開発者が語るアニメ風レンダリングの極意
UnityTechnologiesJapan002
 
マテリアルエディタで作るVFX
Akihito Chiba
 
Ad

Similar to Dynamic Wounds on Animated Characters in UE4 (20)

PDF
Vlachos Gdc10 Left4 Dead2 Wounds
ozlael ozlael
 
PDF
GDC 2010 Left4Dead2 Wounds
Alex Vlachos
 
PDF
APB Customisation System
msciglio
 
PPTX
Historica Fantasia, Development Blog 06, ShaderForge Character Shader
Matumit Sombunjaroen
 
PDF
Improved Alpha-Tested Magnification for Vector Textures and Special Effects
ナム-Nam Nguyễn
 
PPTX
4,000 Adams at 90 Frames Per Second | Yi Fei Boon
Jessica Tams
 
PDF
Uncharted 2: Character Pipeline
Naughty Dog
 
ODP
4Developers 2015: Gamedev-grade debugging - Leszek Godlewski
PROIDEA
 
PDF
Umbra Ignite 2015: Alex Evans – Learning from failure – prototypes, R&D, iter...
Umbra Software
 
PDF
Uncharted3 effect technique
MinGeun Park
 
PDF
Gamedev-grade debugging
Leszek Godlewski
 
PDF
Buttefly
Renaldas Zioma
 
PPTX
The Technology behind Shadow Warrior, ZTG 2014
Jarosław Pleskot
 
PPTX
Lessons learned from RENOIR - GAME ACCESS ‘16
Martin Pernica
 
PDF
ANYFACE*: Create Film Industry-Quality Facial Rendering & Animation Using Mai...
Intel® Software
 
PPT
Destruction Masking in Frostbite 2 using Volume Distance Fields
Electronic Arts / DICE
 
PDF
Autodesk Mudbox
Naughty Dog
 
PDF
IRJET- Technical Graphic Showcase
IRJET Journal
 
PPSX
Getting the-best-out-of-d3 d12
mistercteam
 
PPTX
Create Amazing VFX with the Visual Effect Graph
Unity Technologies
 
Vlachos Gdc10 Left4 Dead2 Wounds
ozlael ozlael
 
GDC 2010 Left4Dead2 Wounds
Alex Vlachos
 
APB Customisation System
msciglio
 
Historica Fantasia, Development Blog 06, ShaderForge Character Shader
Matumit Sombunjaroen
 
Improved Alpha-Tested Magnification for Vector Textures and Special Effects
ナム-Nam Nguyễn
 
4,000 Adams at 90 Frames Per Second | Yi Fei Boon
Jessica Tams
 
Uncharted 2: Character Pipeline
Naughty Dog
 
4Developers 2015: Gamedev-grade debugging - Leszek Godlewski
PROIDEA
 
Umbra Ignite 2015: Alex Evans – Learning from failure – prototypes, R&D, iter...
Umbra Software
 
Uncharted3 effect technique
MinGeun Park
 
Gamedev-grade debugging
Leszek Godlewski
 
Buttefly
Renaldas Zioma
 
The Technology behind Shadow Warrior, ZTG 2014
Jarosław Pleskot
 
Lessons learned from RENOIR - GAME ACCESS ‘16
Martin Pernica
 
ANYFACE*: Create Film Industry-Quality Facial Rendering & Animation Using Mai...
Intel® Software
 
Destruction Masking in Frostbite 2 using Volume Distance Fields
Electronic Arts / DICE
 
Autodesk Mudbox
Naughty Dog
 
IRJET- Technical Graphic Showcase
IRJET Journal
 
Getting the-best-out-of-d3 d12
mistercteam
 
Create Amazing VFX with the Visual Effect Graph
Unity Technologies
 
Ad

Recently uploaded (20)

PDF
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
Artjoker Software Development Company
 
PDF
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
PDF
Architecture of the Future (09152021)
EdwardMeyman
 
PDF
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
PDF
REPORT: Heating appliances market in Poland 2024
SPIUG
 
PDF
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
PDF
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
PPTX
How to Build a Scalable Micro-Investing Platform in 2025 - A Founder’s Guide ...
Third Rock Techkno
 
PDF
BLW VOCATIONAL TRAINING SUMMER INTERNSHIP REPORT
codernjn73
 
PDF
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
PDF
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
PDF
Brief History of Internet - Early Days of Internet
sutharharshit158
 
PPT
Coupa-Kickoff-Meeting-Template presentai
annapureddyn
 
PDF
Beyond Automation: The Role of IoT Sensor Integration in Next-Gen Industries
Rejig Digital
 
PDF
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
PDF
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
PPTX
IoT Sensor Integration 2025 Powering Smart Tech and Industrial Automation.pptx
Rejig Digital
 
PDF
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
PDF
This slide provides an overview Technology
mineshkharadi333
 
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
Artjoker Software Development Company
 
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
Architecture of the Future (09152021)
EdwardMeyman
 
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
REPORT: Heating appliances market in Poland 2024
SPIUG
 
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
How to Build a Scalable Micro-Investing Platform in 2025 - A Founder’s Guide ...
Third Rock Techkno
 
BLW VOCATIONAL TRAINING SUMMER INTERNSHIP REPORT
codernjn73
 
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
Brief History of Internet - Early Days of Internet
sutharharshit158
 
Coupa-Kickoff-Meeting-Template presentai
annapureddyn
 
Beyond Automation: The Role of IoT Sensor Integration in Next-Gen Industries
Rejig Digital
 
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
IoT Sensor Integration 2025 Powering Smart Tech and Industrial Automation.pptx
Rejig Digital
 
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
This slide provides an overview Technology
mineshkharadi333
 

Dynamic Wounds on Animated Characters in UE4

  • 1. Dynamic Wounds on Animated Characters in UE4 Michał Kłoś, Layopi Games Game Industry Conference 2017
  • 3. About me Now Shader/VFX Artist Lead at Layopi Games Lead Native Dev at VR Global Unity & Web Dev at TK Games
  • 4. Agenda • Intro to wounds in games • Popular methods • Effect features and problems • Effect meets profiling and gameplay • Final comparison
  • 5. Intro to wounds in games
  • 6. Intro to wounds in games Wounds and dismemberment: • Mortal Kombat • Metal Gear Solid • Dead Space • Fallout • Shadow Warrior 2 • Shadow of Mordor and many more … https://www.youtube.com/watch?v=RIUYi9JuMKQ
  • 12. Intro to wounds in games Why game need wounds: • Visual feedback to damage • Minimize UI, Healthbars • Give satisfaction from combat • Juiciness: persistence
  • 13. Intro to wounds in games Does your effect make sense? Need to follow character and game design! vs vs
  • 14. Intro to wounds in games Alternatives? Fixed presets … why not combine both?
  • 16. Intro to wounds in games Popular methods: • Ryan Brucks Unwraped Capture • Tom Loomans PreSkinned Position ? Dedicated system fitting: • Creative and Art Director’s Vision • Game Requirements
  • 17. Intro to wounds in games Popular methods: • Ryan Brucks Unwraped Capture • Tom Loomans PreSkinned Position ? Dedicated system fitting: • Creative and Art Director’s Vision • Game Requirements Case study: fighting with blades
  • 18. Decal projection makes it slide on animated meshes, it is bad!
  • 19. Material with masked damage even allows for animation of strokes, we want this!
  • 21. Vlachos 2010, Rendering Wounds in Left 4 Dead 2, Valve https://alex.vlachos.com/graphics/Vlachos-GDC10-Left4Dead2Wounds.pdf
  • 22. Vlachos 2010, Rendering Wounds in Left 4 Dead 2, Valve https://alex.vlachos.com/graphics/Vlachos-GDC10-Left4Dead2Wounds.pdf Their problems • Memory limits • Performance Constraints • Character variations • LOD • Avoid mesh generation
  • 23. Vlachos 2010, Rendering Wounds in Left 4 Dead 2, Valve https://youtu.be/5_G79LJ_l2Y
  • 24. Vlachos 2010, Rendering Wounds in Left 4 Dead 2, Valve https://www.youtube.com/watch?v=CHbnP5SAMzI
  • 25. Vlachos 2010, Rendering Wounds in Left 4 Dead 2, Valve https://alex.vlachos.com/graphics/Vlachos-GDC10-Left4Dead2Wounds.pdf
  • 26. Popular Methods • Ryan Brucks Unwraped Capture • Tom Loomans Preskinned Position
  • 27. Popular Methods Problems • Calculate mask on surface of animated geometry • Keep updatable mask between frames
  • 28. Popular Methods • Ryan Brucks Unwraped Capture • Requires SceneCapture • Each masked pixel need captured position • Copy animation or use animated mesh • Tom Loomans Preskinned Position
  • 29. Popular Methods • Ryan Brucks Unwraped Capture • Requires SceneCapture • Each masked pixel need captured position • Copy animation or use animated mesh • Tom Loomans Preskinned Position • Hit calculation done in Rest Pose • Hit need transformation into Rest Pose ex. Bone Transform from Trace
  • 30. Popular Methods Ryan Brucks Unwraped Capture explained
  • 31. Ryan Brucks Unwraped Capture explained
  • 32. Ryan Brucks Unwraped Capture explained
  • 33. Popular Methods Ryan Brucks Unwraped Capture explained
  • 34. Ryan Brucks Unwraped Capture explained
  • 35. Ryan Brucks Unwraped Capture explained
  • 36. Unique UV, outtake on texture morph animation that happens when UVs are mirrored
  • 37. Tom Loomans PreSkinned Position explained
  • 38. Red: Animated Bone Transform, Green: RestPose Transform, Blue: Inverse Animartion + RestPose Transform
  • 39. Tom Loomans PreSkinned Position explained
  • 41. Effect Features and Problems • Blending with character material • Fitting shape of obstacle • Dotted on fast movement of obstacle • Variable number of obstacles and draw calls • Impact of hit • Hits from random limb collisions
  • 43. Ryan Brucks Unwraped Capture, Require 2 RenderTargets per each Character
  • 44. Effect Features and Problems Fitting shape of obstacle Signed Distance Fields (SDF) What info gives us SDF?
  • 45. Signed Distance Fields (SDF), What info gives us SDF? https://www.shadertoy.com/view/ldK3zD
  • 46. Effect Features and Problems Fitting shape of obstacle http://iquilezles.org/www/articles/distfunctions/distfunctions.htm float sdSphere ( vec3 p, float r ) { return length(p)-r; }
  • 47. Effect Features and Problems Fitting shape of obstacle http://iquilezles.org/www/articles/distfunctions/distfunctions.htm float sdCapsule (vec3 p, vec3 a, vec3 b, float r) { vec3 pa = p-a, ba = b-a; float h = clamp(dot(pa,ba)/dot(ba,ba), 0.0, 1.0); return length(pa-ba*h)-r; }
  • 48. Appear dotted on fast movement of obstacle
  • 49. Effect Features and Problems Appear dotted on fast movement of obstacle Keep info from previous frame Sphere + Sphere = Capsule Capsule + Capsule = Quad + + = =
  • 50. Effect Features and Problems http://iquilezles.org/www/articles/distfunctions/distfunctions.htm float dot2(in vec3 v) { return dot(v,v); } float udQuad (vec3 p, vec3 a, vec3 b, vec3 c, vec3 d) { vec3 ba = b-a; vec3 pa = p-a; vec3 cb = c-b; vec3 pb = p-b; vec3 dc = d-c; vec3 pc = p-c; vec3 ad = a-d; vec3 pd = p-d; vec3 nor = cross(ba, ad); return sqrt((sign(dot(cross(ba,nor),pa)) +sign(dot(cross(cb,nor),pb)) +sign(dot(cross(dc,nor),pc)) +sign(dot(cross(ad,nor),pd)) < 3.0) ? min(min(min(dot2( ba*clamp(dot(ba,pa)/dot2(ba),0.0,1.0)-pa), dot2(cb*clamp(dot(cb,pb)/dot2(cb),0.0,1.0)-pb)), dot2(dc*clamp(dot(dc,pc)/dot2(dc),0.0,1.0)-pc)), dot2(ad*clamp(dot(ad,pd)/dot2(ad),0.0,1.0)-pd)) : dot(nor,pa)*dot(nor,pa)/dot2(nor) ); }
  • 51. Effect Features and Problems http://iquilezles.org/www/articles/distfunctions/distfunctions.htm
  • 52. Effect Features and Problems Splines? Read bone animation trail from SkeletalMeshComponent? Interpolate 2+ frames? Did not tried https://www.shadertoy.com/view/XdB3Ww
  • 53. Effect Features and Problems Variable number of obstacles and draw calls Draw sum of all of them at once and count instructions Editor do not support Material Parameters Arrays but Global Shaders do.
  • 54. Variable number of obstacles and draw calls
  • 55. Effect Features and Problems Impact of the hit Brush like feeling vs Impact - what gives impact Trigger stroke with Collision Trace
  • 56. Trigger stroke with Collision Trace
  • 57. Effect Features and Problems Impact from random limb collisions Animation notify with info about currently active limb for damage
  • 58. Animation notify with info about currently active limb for damage
  • 59. Effect Features and Problems Multiple Characters at once Mesh occlusion - Extents Size
  • 60. Effect meet profiling and gameplay
  • 61. Effect meets profiling and gameplay Profiling and 1ms budget for VFX UE profiling tools SceneCapture vs RenderMaterialToTexture Performance RenderTarget performance vs quality WorldSpace vs LocalSpace
  • 62. Blueprint for sequencer, easy to debug
  • 63. Blueprint for sequencer, easy to debug
  • 64. Effect meets profiling and gameplay Stress Test Scene (i7, 16 GB RAM, GTX 970 1080p)
  • 65. Stress Test Scene (i7, 16 GB RAM, GTX 970 1080p)
  • 66. Stress Test Scene (i7, 16 GB RAM, GTX 970 1080p)
  • 67. Stress Test Scene (i7, 16 GB RAM, GTX 970 1080p)
  • 68. Effect meets profiling and gameplay Stress Test Scene (i7, 16 GB RAM, GTX 970 1080p) Numbers per MaskRenderTarget resolution: 2048 x 2048 px (RGB8, 16 MB), SceneCapture 5.22 ms per Character MaskRenderTarget 0.35 ms per obstacle 1024 x 1024 px (RGB8, 4 MB), SceneCapture 1.77 ms per Character MaskRenderTarget 0.09 ms per obstacle 512 x 512 px (RGB8, 1 MB), SceneCapture 1.02 ms per Character MaskRenderTarget 0.025 ms per obstacle
  • 69. Effect meets profiling and gameplay Solution: Transform Hit to Rest Pose instead of SceneCapture Effect need texture mask done with DrawMaterialToRenderTarget but it draws on quad with no info about Rest Pose ...so bake RestPose to texture at start and sample each time
  • 70. Effect meets profiling and gameplay Interface for gameplay Enqueue calls each frame and restrict limit Service with Logic - Component with State approach, easy to plug to character Feed with WorldSpace vs LocalSpace
  • 71. Interface for gameplay, stuctures and components
  • 72. Interface for gameplay, WorldToLocal Character transformation
  • 73. Interface for gameplay, MaskRenderer execution
  • 74. Effect meets profiling and gameplay Alternatives: • Global Shaders • ShaderDemoPlugin by Temaran • Pixel Shader Example • Compute Shader Example Fork it!
  • 75. Effect meets profiling and gameplay www.unrealengine.com/en-US/blog/how-to-add-global-shaders-to-ue4 // MyTest.usf // Simple pass-through vertex shader void MainVS( in float4 InPosition : ATTRIBUTE0, out float4 Output : SV_POSITION ) { Output = InPosition; } // Simple solid color pixel shader float4 MyColor; float4 MainPS() : SV_Target0 { return MyColor; } Global Shaders, finally!
  • 76. Effect meets profiling and gameplay ShaderDemoPlugin by Temaran
  • 77. ShaderDemoPlugin by Temaran, Shader class declaration
  • 78. ShaderDemoPlugin by Temaran, Uniform Structs declarations
  • 80. ShaderDemoPlugin by Temaran, adding render command to RHI
  • 82. Final Comparison vs RestPose stays in budget SceneCapture does not
  • 83. Demo
  • 84. Demo
  • 85. Demo
  • 86. Takeaways • Make sure your effects meet design of game and characters • Effects give visual feedback to game events • SceneCapture renders whole scene with lights and shadows • SceneCapture may be performed only at start or even offline saved as asset • Rest pose is best approach for calculations • DrawMaterialToRenderTarget is rather cheap