SlideShare a Scribd company logo
1 of 23
TRESSFX
THE FAST AND THE FURRY
AMD AND MICROSOFT DEVELOPER DAY, JUNE 2014, STOCKHOLM
NICOLAS THIBIEROZ
WORLDWIDE GAMING ENGINEERING MANAGER, AMD
| TRESSFX THE FAST AND THE FURRY | AMD AND MICROSOFT GAME DEVELOPER DAY - JUNE 2 2014, STOCKHOLM2
TRESSFX: NEXT-GENERATION HAIR AND FUR RENDERING
 The time for next-gen quality is now
 Tomb Raider pioneered next-gen hair
‒ Includes PS4/XB1
 Users expect this level of quality for next-gen titles
 You need to start thinking about this!
| TRESSFX THE FAST AND THE FURRY | AMD AND MICROSOFT GAME DEVELOPER DAY - JUNE 2 2014, STOCKHOLM3
WHAT MAKES GOOD HAIR/FUR?
Basic Rendering Antialiasing Antialiasing
+ Self Shadowing
Antialiasing
+ Self Shadowing
+ Transparency
Demo
 All three components are a must to ensure high quality
 Transparency in particular is essential to next-gen visuals
‒ Requires an Order-Independent Transparency (OIT) solution
| TRESSFX THE FAST AND THE FURRY | AMD AND MICROSOFT GAME DEVELOPER DAY - JUNE 2 2014, STOCKHOLM4
ISOLINE TESSELLATION FOR HAIR/FUR? 1/2
 Isoline tessellation has two tessellation factors
‒ First is line density (lines per invocation)
‒ Second is line detail (segments per line)
 In theory provides easy LOD system
‒ Variable line density and detail by increasing both tessellation factors based on distance
Tess = (1,1) Tess = (2,1) Tess = (2,2) Tess = (2,3) Tess = (3,3)
| TRESSFX THE FAST AND THE FURRY | AMD AND MICROSOFT GAME DEVELOPER DAY - JUNE 2 2014, STOCKHOLM5
ISOLINE TESSELLATION FOR HAIR/FUR? 2/2
 In practice isoline tessellation is not cost effective for this scenario
 Lines are always 1-pixel thick
‒ Need Geometry Shader to extrude them into triangles for smooth edges
‒ Major impact on performance!
‒ Alternative is to enable MSAA
‒ Most engines are deferred so this causes a large performance impact
‒ No extrusion for smoothing edges and no MSAA = poor quality!
 Bottom line: a pure Vertex Shader solution is faster
‒ Curvature is rarely a problem (dependant on vertices/strands at authoring time)
‒ If needed LOD benefit can be done in Vertex Shader
| TRESSFX THE FAST AND THE FURRY | AMD AND MICROSOFT GAME DEVELOPER DAY - JUNE 2 2014, STOCKHOLM6
TRESSFX RENDERING PIPELINE
 TressFX 2 uses a deferred approach for best performance
Three main steps
 STEP 1: Hair simulation
 STEP 2: Store fragment properties into buffers
 STEP 3: Fetch fragment properties, sort, selective shading and render
‒ Full shading on K-frontmost fragments
‒ “Tail” fragments are shaded with a simpler light equation and shadowing algorithm
| TRESSFX THE FAST AND THE FURRY | AMD AND MICROSOFT GAME DEVELOPER DAY - JUNE 2 2014, STOCKHOLM7
TRESSFX RENDERING PIPELINE
STEP 1: HAIR SIMULATION
CSCSCS
Input Geometry
(SRV)
Post-simulation
geometry (UAV)
Simulation
parameters
Pre-simulation line
segments (model space)
Post-simulation line
segments (world space)
Simulation compute shaders
Edge length constraint
Local shape constraint
Global shape constraint
Not always needed for fur
Model Transform
Collision Shape
Not always needed for fur
External Forces (wind, gravity, etc.)
 Input model is a collection of line segments (each segment composed of up to 64 vertices)
 Optionally divided into “master strands” and “slave strands” to optimize simulation performance
‒ Only master strands are simulated (e.g. 1:4 ratio)
‒ Slave strands use master strand simulation results with added noise
‒ Virtually no difference from full-scale simulation but much better simulation performance!
‒ Master:slave simulation ratio can also vary with distance for even better performance
Demo
| TRESSFX THE FAST AND THE FURRY | AMD AND MICROSOFT GAME DEVELOPER DAY - JUNE 2 2014, STOCKHOLM8
TRESSFX RENDERING PIPELINE
STEP 2: STORE FRAGMENT PROPERTIES INTO BUFFERS
VS
World
space
Index
Buffer
Indexed triangle list
10
1
2
3 2
4
0
5
Extrusion into
triangles
| TRESSFX THE FAST AND THE FURRY | AMD AND MICROSOFT GAME DEVELOPER DAY - JUNE 2 2014, STOCKHOLM9
LINE SEGMENT EXTRUSION INTO TRIANGLES
 A lot of vertices go through rendering high-quality hair or fur!
‒ Geometry processing can therefore be a significant bottleneck
 In previous versions of TressFX extrusion was done in Geometry Shader (don’t do it!) and then VS with Draw()
 Much faster performance was obtained with pure VS solution and precomputed index buffers
‒ Maximizes post vertex cache use!
DrawIndexed() method
Indexed triangle list = { ( 0, 1, 2 ), (2, 1, 3 ), ( 2, 3, 4 ), (4, 3, 5 ), ( … ) };
Line segments Expanded quads
10
1
2
3 2
4
0
5
1,4
Draw() method
Line segments Expanded quads
0
1
2
3,5
6
2,3
7,10
8,9
0
11
Triangle list = { ( 0, 1, 2 ), ( 3, 4, 5 ), ( 6, 7, 8 ), (9, 10, 11 ), ( … ) };
| TRESSFX THE FAST AND THE FURRY | AMD AND MICROSOFT GAME DEVELOPER DAY - JUNE 2 2014, STOCKHOLM10
TRESSFX RENDERING PIPELINE
STEP 2: STORE FRAGMENT PROPERTIES INTO BUFFERS
Antialiasing
VS PS
Homogeneous
clip space
World
space
Index
Buffer
Indexed triangle list
10
1
2
3 2
4
0
5
Extrusion into
triangles
| TRESSFX THE FAST AND THE FURRY | AMD AND MICROSOFT GAME DEVELOPER DAY - JUNE 2 2014, STOCKHOLM11
ANTIALIASING
 Antialiasing (aka “coverage”) using analytical method
‒ This is NOT Multisampling Anti-Aliasing!
 Compute pixel coverage on edges of hair strand triangles and convert it to
an alpha value
 Alpha value fades out based on distance from pixel centre to strand axis
 Similar principle to Emil Persson’s phone wire Anti-Aliasing
http://www.humus.name/Articles/Persson_GraphicsGemsForGames.pdf
| TRESSFX THE FAST AND THE FURRY | AMD AND MICROSOFT GAME DEVELOPER DAY - JUNE 2 2014, STOCKHOLM12
TRESSFX RENDERING PIPELINE
STEP 2: STORE FRAGMENT PROPERTIES INTO BUFFERS
Antialiasing
depth
tangent
coverage
next
VS PS
Homogeneous
clip space
World
space
Null RT
Stencil
PPLL
UAV
Head
UAV
Index
Buffer
Indexed triangle list
10
1
2
3 2
4
0
5
Extrusion into
triangles
| TRESSFX THE FAST AND THE FURRY | AMD AND MICROSOFT GAME DEVELOPER DAY - JUNE 2 2014, STOCKHOLM13
PER-PIXEL LINKED LISTS
 Head UAV
‒ Each pixel location has a “head pointer” to a linked list in the PPLL UAV
 PPLL UAV
‒ As new fragments are rendered, they are added to the next open location in the PPLL (using UAV counter)
‒ A link is created to the fragment pointed to by the head pointer
‒ Head pointer then points to the new fragment
// Retrieve current pixel count and increase counter
uint uPixelCount = LinkedListUAV.IncrementCounter();
uint uOldStartOffset;
// Exchange indices in LinkedListHead texture corresponding to pixel location
InterlockedExchange(LinkedListHeadUAV[address], uPixelCount, uOldStartOffset);
// Append new element at the end of the Fragment and Link Buffer
Element.uNext = uOldStartOffset;
LinkedListUAV[uPixelCount] = Element;
depth
tangent
coverage
next
PPLL
UAV
Head
UAV
 Memory requirements can be large!
‒ Width * Height * Average overdraw * sizeof (PPLL structure)
‒ Can use tiling approach in memory-constrained situations
| TRESSFX THE FAST AND THE FURRY | AMD AND MICROSOFT GAME DEVELOPER DAY - JUNE 2 2014, STOCKHOLM14
TRESSFX RENDERING PIPELINE
STEP 3: FETCH FRAGMENTS, SORT, SELECTIVE SHADING AND RENDER
VS PS
Stencil
Head
UAV
PPLL
UAV
Lighting
Full Screen
Quad/Triangle
| TRESSFX THE FAST AND THE FURRY | AMD AND MICROSOFT GAME DEVELOPER DAY - JUNE 2 2014, STOCKHOLM15
LIGHTING
 Different options available
‒ Kajiya-Kay hair lighting model
‒ Marshner model
‒ Anything else that looks good!
 Fragment properties storage requirements may limit your
options!
 TressFX 2 sample uses an approximation of the Marchner
technique when rendering two highlights
‒ Unique fragment properties: depth, tangent vector
Primary Highlights
Secondary Highlights
| TRESSFX THE FAST AND THE FURRY | AMD AND MICROSOFT GAME DEVELOPER DAY - JUNE 2 2014, STOCKHOLM16
TRESSFX RENDERING PIPELINE
STEP 3: FETCH FRAGMENTS, SORT, SELECTIVE SHADING AND RENDER
VS PS
Stencil
Head
UAV
PPLL
UAV
Lighting Shadows
Full Screen
Quad/Triangle
| TRESSFX THE FAST AND THE FURRY | AMD AND MICROSOFT GAME DEVELOPER DAY - JUNE 2 2014, STOCKHOLM17
SHADOWS
 Three different cases
 Hair self-shadowing
‒ Essential component to give next-gen volumetric quality look
‒ Simplified Deep Shadow Map technique
 Hair casting shadows on body & environment
‒ Body: Need a very soft look at close range (blur shadow map)
‒ Environment: render (possibly simplified) hair geometry into cascaded shadow map
 Environment casting shadows on hair
‒ Sample environment shadow map at hair fragment rendering time
| TRESSFX THE FAST AND THE FURRY | AMD AND MICROSOFT GAME DEVELOPER DAY - JUNE 2 2014, STOCKHOLM18
TRESSFX RENDERING PIPELINE
STEP 3: FETCH FRAGMENTS, SORT, SELECTIVE SHADING AND RENDER
VS PS
Stencil
Head
UAV
PPLL
UAV K frontmost fragment:
full shading, sorting
and manual blending
Lighting Shadows
Full Screen
Quad/Triangle
Tail fragments:
cheap shading,
no sorting and
manual blending
| TRESSFX THE FAST AND THE FURRY | AMD AND MICROSOFT GAME DEVELOPER DAY - JUNE 2 2014, STOCKHOLM19
SELECTIVE FRAGMENT SHADING
THIS IS WHERE THE MEAT OF THE CODE OCCURS!
// Go through the rest of the linked list, and keep closest k fragments but
// not in sorted order
[allow_uav_condition]
for(int l=0; l < g_iMaxFragments; l++)
{
if(pointer == NULLPOINTER) break;
int id = 0;
float max_depth = 0;
// Find the furthest node in array
[unroll]for(int i=0; i<KBUFFER_SIZE; i++)
{
float fDepth = kBuffer[i].depth;
if(max_depth < fDepth)
{
max_depth = fDepth; id = i;
}
}
// get the start of the linked list from the head pointer
uint pointer = LinkedListHeadSRV[In.vPosition.xy];
// Copy first K fragments from PPLL into KBuffer[]
NODE Kbuffer[KBUFFER_SIZE];
for(int p=0; p<KBUFFER_SIZE; p++)
{
if (pointer != NULLPOINTER)
{
kBuffer[p] = LinkedListSRV[pointer];
pointer = LinkedListSRV[pointer].uNext;
}
}
// If linked list node is nearer than the furthest one in the local array
// exchange the node in the local array for the one in the linked list
NODE Node = LinkedListSRV[pointer];
if (max_depth > Node.depth)
{
SWAP(Node, Kbuffer[i]);
}
// Do simple shading and shadowing for nodes not part of the K closest fragments
fragmentcolor = ComputeSimpleShading(Node);
// Out of order blending
fcolor.xyz = mad(-fcolor.xyz, fragmentColor.w, fcolor.xyz) +
fragmentColor.xyz * fragmentColor.w;
fcolor.w = mad(-fcolor.w, fragmentColor.w, fcolor.w);
// Retrieve next node pointer
pointer = LinkedListSRV[pointer].uNext;
}
// Blend the k nearest layers of fragments from back to front, where k = KBUFFER_SIZE
for(int j=0; j<KBUFFER_SIZE; j++)
{
int id = 0;
float max_depth = 0;
// Find the furthest node in the array
for(int i=0; i<KBUFFER_SIZE; i++)
{
float fDepth = kBuffer[i].depth;
if(max_depth < fDepth)
{
max_depth = fDepth; id = i;
}
}
// Take this node out of the next search
Node = KBuffer[id]; KBuffer[id] = (NODE)0;
// Do high quality shading and shadowing
fragmentcolor = ComputeHighQualityshading(Node);
// Blend fragment color
fcolor.xyz = mad(-fcolor.xyz, fragmentColor.w, fcolor.xyz) +
fragmentColor.xyz * fragmentColor.w;
fcolor.w = mad(-fcolor.w, fragmentColor.w, fcolor.w);
}
return fcolor;
| TRESSFX THE FAST AND THE FURRY | AMD AND MICROSOFT GAME DEVELOPER DAY - JUNE 2 2014, STOCKHOLM20
TRESSFX RENDERING PIPELINE
STEP 3: FETCH FRAGMENTS, SORT, SELECTIVE SHADING AND RENDER
VS PS
Stencil
Head
UAV
PPLL
UAV
Render target
K frontmost fragment:
full shading, sorting
and manual blending
Lighting Shadows
Full Screen
Quad/Triangle
Tail fragments:
cheap shading,
no sorting and
manual blending
| TRESSFX THE FAST AND THE FURRY | AMD AND MICROSOFT GAME DEVELOPER DAY - JUNE 2 2014, STOCKHOLM21
TRESSFX PERFORMANCE
FAST AND FURRY
 High number of fragments required for quality look
 Main bottleneck is shading all those fragments
‒ Not per-pixel linked list traversal!
 Selective shading approach allows significant performance savings with minor or negligible quality tradeoffs
Technique Cost
Out of order, no shading 1.31 ms
Out of order, shading 2.80 ms
Deferred PPLL, selective shading 2.13 ms
Shading cost is
~ 1.5 ms
24% faster
Fur model with ~130,000 fur strands
Running on AMD Radeon 7970 @ 1080p
Distance Sim LOD
Disabled
Sim LOD
Enabled
Close range 1.01 ms 1.01 ms
Medium range 1.01 ms 0.70 ms
Long range 1.01 ms 0.37 ms
Simulation LOD
 Distance-adaptive Shading and Simulation LOD further improves performance
 “K frontmost fragments” value can inversely scale with distance
Distance Shading LOD
Disabled
Shading LOD
Enabled
Close range 3.26 ms 3.26 ms
Medium range 3.23 ms 1.77 ms
Long range 2.52 ms 0.64 ms
Shading LOD
| TRESSFX THE FAST AND THE FURRY | AMD AND MICROSOFT GAME DEVELOPER DAY - JUNE 2 2014, STOCKHOLM22
CONCLUSION AND QUESTIONS?
 Next-gen hair/fur look at real-time performance is possible now!
 Fast:
‒ Variable ratio master/slave compute simulations
‒ Vertex Shader extrusion of segments into triangles (do not use tessellation + GS)
‒ Deferred rendering with selective shading
‒ Distance-based shading and simulation LOD
‒ Optimized shaders!
 Furry:
 Full and free access to TressFX 2 SDK sample, code and documentation at:
http://developer.amd.com/tools-and-sdks/graphics-development/amd-radeon-sdk/
@NThibieroznicolas.thibieroz@amd.com
| TRESSFX THE FAST AND THE FURRY | AMD AND MICROSOFT GAME DEVELOPER DAY - JUNE 2 2014, STOCKHOLM23
DISCLAIMER & ATTRIBUTION
The information presented in this document is for informational purposes only and may contain technical inaccuracies, omissions and typographical errors.
The information contained herein is subject to change and may be rendered inaccurate for many reasons, including but not limited to product and roadmap
changes, component and motherboard version changes, new model and/or product releases, product differences between differing manufacturers, software
changes, BIOS flashes, firmware upgrades, or the like. AMD assumes no obligation to update or otherwise correct or revise this information. However, AMD
reserves the right to revise this information and to make changes from time to time to the content hereof without obligation of AMD to notify any person of
such revisions or changes.
AMD MAKES NO REPRESENTATIONS OR WARRANTIES WITH RESPECT TO THE CONTENTS HEREOF AND ASSUMES NO RESPONSIBILITY FOR ANY
INACCURACIES, ERRORS OR OMISSIONS THAT MAY APPEAR IN THIS INFORMATION.
AMD SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE. IN NO EVENT WILL AMD BE
LIABLE TO ANY PERSON FOR ANY DIRECT, INDIRECT, SPECIAL OR OTHER CONSEQUENTIAL DAMAGES ARISING FROM THE USE OF ANY INFORMATION
CONTAINED HEREIN, EVEN IF AMD IS EXPRESSLY ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
ATTRIBUTION
© 2013 Advanced Micro Devices, Inc. All rights reserved. AMD, the AMD Arrow logo and combinations thereof are trademarks of Advanced Micro Devices,
Inc. in the United States and/or other jurisdictions. Other names are for informational purposes only and may be trademarks of their respective owners.

More Related Content

What's hot

김혁, <드래곤 하운드>의 PBR과 레이트레이싱 렌더링 기법, NDC2019
김혁, <드래곤 하운드>의 PBR과 레이트레이싱 렌더링 기법, NDC2019김혁, <드래곤 하운드>의 PBR과 레이트레이싱 렌더링 기법, NDC2019
김혁, <드래곤 하운드>의 PBR과 레이트레이싱 렌더링 기법, NDC2019
devCAT Studio, NEXON
 

What's hot (20)

김혁, <드래곤 하운드>의 PBR과 레이트레이싱 렌더링 기법, NDC2019
김혁, <드래곤 하운드>의 PBR과 레이트레이싱 렌더링 기법, NDC2019김혁, <드래곤 하운드>의 PBR과 레이트레이싱 렌더링 기법, NDC2019
김혁, <드래곤 하운드>의 PBR과 레이트레이싱 렌더링 기법, NDC2019
 
제노블레이도 2 ray marching을사용한 구름 표현
제노블레이도 2 ray marching을사용한 구름 표현제노블레이도 2 ray marching을사용한 구름 표현
제노블레이도 2 ray marching을사용한 구름 표현
 
4K Checkerboard in Battlefield 1 and Mass Effect Andromeda
4K Checkerboard in Battlefield 1 and Mass Effect Andromeda4K Checkerboard in Battlefield 1 and Mass Effect Andromeda
4K Checkerboard in Battlefield 1 and Mass Effect Andromeda
 
リアルタイムレイトレーシング時代を生き抜くためのデノイザー開発入門
リアルタイムレイトレーシング時代を生き抜くためのデノイザー開発入門リアルタイムレイトレーシング時代を生き抜くためのデノイザー開発入門
リアルタイムレイトレーシング時代を生き抜くためのデノイザー開発入門
 
【Unite Tokyo 2018】『崩壊3rd』開発者が語るアニメ風レンダリングの極意
【Unite Tokyo 2018】『崩壊3rd』開発者が語るアニメ風レンダリングの極意【Unite Tokyo 2018】『崩壊3rd』開発者が語るアニメ風レンダリングの極意
【Unite Tokyo 2018】『崩壊3rd』開発者が語るアニメ風レンダリングの極意
 
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
 
NDC2016 프로젝트 A1의 AAA급 캐릭터 렌더링 기술
NDC2016 프로젝트 A1의 AAA급 캐릭터 렌더링 기술NDC2016 프로젝트 A1의 AAA급 캐릭터 렌더링 기술
NDC2016 프로젝트 A1의 AAA급 캐릭터 렌더링 기술
 
Checkerboard Rendering in Dark Souls: Remastered by QLOC
Checkerboard Rendering in Dark Souls: Remastered by QLOCCheckerboard Rendering in Dark Souls: Remastered by QLOC
Checkerboard Rendering in Dark Souls: Remastered by QLOC
 
Holy smoke! Faster Particle Rendering using Direct Compute by Gareth Thomas
Holy smoke! Faster Particle Rendering using Direct Compute by Gareth ThomasHoly smoke! Faster Particle Rendering using Direct Compute by Gareth Thomas
Holy smoke! Faster Particle Rendering using Direct Compute by Gareth Thomas
 
UE4のライティング解体新書~効果的なNPRのためにライティングの仕組みを理解しよう~
UE4のライティング解体新書~効果的なNPRのためにライティングの仕組みを理解しよう~UE4のライティング解体新書~効果的なNPRのためにライティングの仕組みを理解しよう~
UE4のライティング解体新書~効果的なNPRのためにライティングの仕組みを理解しよう~
 
【Unity道場 建築スペシャル】はじめてのUnity
【Unity道場 建築スペシャル】はじめてのUnity【Unity道場 建築スペシャル】はじめてのUnity
【Unity道場 建築スペシャル】はじめてのUnity
 
UE4.17で入る新機能を一気に紹介・解説!
UE4.17で入る新機能を一気に紹介・解説!UE4.17で入る新機能を一気に紹介・解説!
UE4.17で入る新機能を一気に紹介・解説!
 
OpenGL 4.4 - Scene Rendering Techniques
OpenGL 4.4 - Scene Rendering TechniquesOpenGL 4.4 - Scene Rendering Techniques
OpenGL 4.4 - Scene Rendering Techniques
 
UE4でプロシージャル田植え(UE4 Environment Art Dive)
UE4でプロシージャル田植え(UE4 Environment Art Dive)UE4でプロシージャル田植え(UE4 Environment Art Dive)
UE4でプロシージャル田植え(UE4 Environment Art Dive)
 
UE4でTranslucencyやUnlitに影を落としたい!
UE4でTranslucencyやUnlitに影を落としたい!UE4でTranslucencyやUnlitに影を落としたい!
UE4でTranslucencyやUnlitに影を落としたい!
 
60fpsアクションを実現する秘訣を伝授 解析編
60fpsアクションを実現する秘訣を伝授 解析編60fpsアクションを実現する秘訣を伝授 解析編
60fpsアクションを実現する秘訣を伝授 解析編
 
"有翼のフロイライン Wing of Darkness"と歩むUE4の世界
"有翼のフロイライン Wing of Darkness"と歩むUE4の世界"有翼のフロイライン Wing of Darkness"と歩むUE4の世界
"有翼のフロイライン Wing of Darkness"と歩むUE4の世界
 
Real-time content creation with UE4 ray tracing
Real-time content creation with UE4 ray tracingReal-time content creation with UE4 ray tracing
Real-time content creation with UE4 ray tracing
 
Precomputed Voxelized-Shadows for Large-scale Scene and Many lights
Precomputed Voxelized-Shadows for Large-scale Scene and Many lightsPrecomputed Voxelized-Shadows for Large-scale Scene and Many lights
Precomputed Voxelized-Shadows for Large-scale Scene and Many lights
 
ゲームデータの圧縮・解凍ツール Oodle 最新情報 - RAD ゲームツールズ - GTMF 2018 TOKYO
ゲームデータの圧縮・解凍ツール Oodle 最新情報 - RAD ゲームツールズ - GTMF 2018 TOKYOゲームデータの圧縮・解凍ツール Oodle 最新情報 - RAD ゲームツールズ - GTMF 2018 TOKYO
ゲームデータの圧縮・解凍ツール Oodle 最新情報 - RAD ゲームツールズ - GTMF 2018 TOKYO
 

Viewers also liked

Rendering Battlefield 4 with Mantle by Yuriy ODonnell
Rendering Battlefield 4 with Mantle by Yuriy ODonnellRendering Battlefield 4 with Mantle by Yuriy ODonnell
Rendering Battlefield 4 with Mantle by Yuriy ODonnell
AMD Developer Central
 

Viewers also liked (20)

DX12 & Vulkan: Dawn of a New Generation of Graphics APIs
DX12 & Vulkan: Dawn of a New Generation of Graphics APIsDX12 & Vulkan: Dawn of a New Generation of Graphics APIs
DX12 & Vulkan: Dawn of a New Generation of Graphics APIs
 
Webinar: Whats New in Java 8 with Develop Intelligence
Webinar: Whats New in Java 8 with Develop IntelligenceWebinar: Whats New in Java 8 with Develop Intelligence
Webinar: Whats New in Java 8 with Develop Intelligence
 
Inside XBox- One, by Martin Fuller
Inside XBox- One, by Martin FullerInside XBox- One, by Martin Fuller
Inside XBox- One, by Martin Fuller
 
Rendering Battlefield 4 with Mantle by Johan Andersson - AMD at GDC14
Rendering Battlefield 4 with Mantle by Johan Andersson - AMD at GDC14Rendering Battlefield 4 with Mantle by Johan Andersson - AMD at GDC14
Rendering Battlefield 4 with Mantle by Johan Andersson - AMD at GDC14
 
The Small Batch (and other) solutions in Mantle API, by Guennadi Riguer, Mant...
The Small Batch (and other) solutions in Mantle API, by Guennadi Riguer, Mant...The Small Batch (and other) solutions in Mantle API, by Guennadi Riguer, Mant...
The Small Batch (and other) solutions in Mantle API, by Guennadi Riguer, Mant...
 
Rendering Battlefield 4 with Mantle by Yuriy ODonnell
Rendering Battlefield 4 with Mantle by Yuriy ODonnellRendering Battlefield 4 with Mantle by Yuriy ODonnell
Rendering Battlefield 4 with Mantle by Yuriy ODonnell
 
Gcn performance ftw by stephan hodes
Gcn performance ftw by stephan hodesGcn performance ftw by stephan hodes
Gcn performance ftw by stephan hodes
 
DirectGMA on AMD’S FirePro™ GPUS
DirectGMA on AMD’S  FirePro™ GPUSDirectGMA on AMD’S  FirePro™ GPUS
DirectGMA on AMD’S FirePro™ GPUS
 
Computer Vision Powered by Heterogeneous System Architecture (HSA) by Dr. Ha...
Computer Vision Powered by Heterogeneous System Architecture (HSA) by  Dr. Ha...Computer Vision Powered by Heterogeneous System Architecture (HSA) by  Dr. Ha...
Computer Vision Powered by Heterogeneous System Architecture (HSA) by Dr. Ha...
 
Low-level Shader Optimization for Next-Gen and DX11 by Emil Persson
Low-level Shader Optimization for Next-Gen and DX11 by Emil PerssonLow-level Shader Optimization for Next-Gen and DX11 by Emil Persson
Low-level Shader Optimization for Next-Gen and DX11 by Emil Persson
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
Productive OpenCL Programming An Introduction to OpenCL Libraries with Array...
Productive OpenCL Programming An Introduction to OpenCL Libraries  with Array...Productive OpenCL Programming An Introduction to OpenCL Libraries  with Array...
Productive OpenCL Programming An Introduction to OpenCL Libraries with Array...
 
Media SDK Webinar 2014
Media SDK Webinar 2014Media SDK Webinar 2014
Media SDK Webinar 2014
 
Introduction to Direct 3D 12 by Ivan Nevraev
Introduction to Direct 3D 12 by Ivan NevraevIntroduction to Direct 3D 12 by Ivan Nevraev
Introduction to Direct 3D 12 by Ivan Nevraev
 
Direct3D12 and the Future of Graphics APIs by Dave Oldcorn
Direct3D12 and the Future of Graphics APIs by Dave OldcornDirect3D12 and the Future of Graphics APIs by Dave Oldcorn
Direct3D12 and the Future of Graphics APIs by Dave Oldcorn
 
Leverage the Speed of OpenCL™ with AMD Math Libraries
Leverage the Speed of OpenCL™ with AMD Math LibrariesLeverage the Speed of OpenCL™ with AMD Math Libraries
Leverage the Speed of OpenCL™ with AMD Math Libraries
 
An Introduction to OpenCL™ Programming with AMD GPUs - AMD & Acceleware Webinar
An Introduction to OpenCL™ Programming with AMD GPUs - AMD & Acceleware WebinarAn Introduction to OpenCL™ Programming with AMD GPUs - AMD & Acceleware Webinar
An Introduction to OpenCL™ Programming with AMD GPUs - AMD & Acceleware Webinar
 
GS-4106 The AMD GCN Architecture - A Crash Course, by Layla Mah
GS-4106 The AMD GCN Architecture - A Crash Course, by Layla MahGS-4106 The AMD GCN Architecture - A Crash Course, by Layla Mah
GS-4106 The AMD GCN Architecture - A Crash Course, by Layla Mah
 
Inside XBOX ONE by Martin Fuller
Inside XBOX ONE by Martin FullerInside XBOX ONE by Martin Fuller
Inside XBOX ONE by Martin Fuller
 
AMD and the new “Zen” High Performance x86 Core at Hot Chips 28
AMD and the new “Zen” High Performance x86 Core at Hot Chips 28AMD and the new “Zen” High Performance x86 Core at Hot Chips 28
AMD and the new “Zen” High Performance x86 Core at Hot Chips 28
 

Similar to TressFX The Fast and The Furry by Nicolas Thibieroz

The Intersection of Game Engines & GPUs: Current & Future (Graphics Hardware ...
The Intersection of Game Engines & GPUs: Current & Future (Graphics Hardware ...The Intersection of Game Engines & GPUs: Current & Future (Graphics Hardware ...
The Intersection of Game Engines & GPUs: Current & Future (Graphics Hardware ...
Johan Andersson
 
Frostbite Rendering Architecture and Real-time Procedural Shading & Texturing...
Frostbite Rendering Architecture and Real-time Procedural Shading & Texturing...Frostbite Rendering Architecture and Real-time Procedural Shading & Texturing...
Frostbite Rendering Architecture and Real-time Procedural Shading & Texturing...
Johan Andersson
 
Minko - Targeting Flash/Stage3D with C++ and GLSL
Minko - Targeting Flash/Stage3D with C++ and GLSLMinko - Targeting Flash/Stage3D with C++ and GLSL
Minko - Targeting Flash/Stage3D with C++ and GLSL
Minko3D
 
Threading Successes 06 Allegorithmic
Threading Successes 06   AllegorithmicThreading Successes 06   Allegorithmic
Threading Successes 06 Allegorithmic
guest40fc7cd
 
Gdc 14 bringing unreal engine 4 to open_gl
Gdc 14 bringing unreal engine 4 to open_glGdc 14 bringing unreal engine 4 to open_gl
Gdc 14 bringing unreal engine 4 to open_gl
changehee lee
 
Minko stage3d workshop_20130525
Minko stage3d workshop_20130525Minko stage3d workshop_20130525
Minko stage3d workshop_20130525
Minko3D
 

Similar to TressFX The Fast and The Furry by Nicolas Thibieroz (20)

DirectX 11 Rendering in Battlefield 3
DirectX 11 Rendering in Battlefield 3DirectX 11 Rendering in Battlefield 3
DirectX 11 Rendering in Battlefield 3
 
[Unite Seoul 2020] Mobile Graphics Best Practices for Artists
[Unite Seoul 2020] Mobile Graphics Best Practices for Artists[Unite Seoul 2020] Mobile Graphics Best Practices for Artists
[Unite Seoul 2020] Mobile Graphics Best Practices for Artists
 
The Intersection of Game Engines & GPUs: Current & Future (Graphics Hardware ...
The Intersection of Game Engines & GPUs: Current & Future (Graphics Hardware ...The Intersection of Game Engines & GPUs: Current & Future (Graphics Hardware ...
The Intersection of Game Engines & GPUs: Current & Future (Graphics Hardware ...
 
Frostbite Rendering Architecture and Real-time Procedural Shading & Texturing...
Frostbite Rendering Architecture and Real-time Procedural Shading & Texturing...Frostbite Rendering Architecture and Real-time Procedural Shading & Texturing...
Frostbite Rendering Architecture and Real-time Procedural Shading & Texturing...
 
How I learned to stop worrying and love the dark silicon apocalypse.pdf
How I learned to stop worrying and love the dark silicon apocalypse.pdfHow I learned to stop worrying and love the dark silicon apocalypse.pdf
How I learned to stop worrying and love the dark silicon apocalypse.pdf
 
FGS 2011: Making A Game With Molehill: Zombie Tycoon
FGS 2011: Making A Game With Molehill: Zombie TycoonFGS 2011: Making A Game With Molehill: Zombie Tycoon
FGS 2011: Making A Game With Molehill: Zombie Tycoon
 
Minko - Targeting Flash/Stage3D with C++ and GLSL
Minko - Targeting Flash/Stage3D with C++ and GLSLMinko - Targeting Flash/Stage3D with C++ and GLSL
Minko - Targeting Flash/Stage3D with C++ and GLSL
 
Evolution of the modern graphics architectures with a focus on GPUs | Turing1...
Evolution of the modern graphics architectures with a focus on GPUs | Turing1...Evolution of the modern graphics architectures with a focus on GPUs | Turing1...
Evolution of the modern graphics architectures with a focus on GPUs | Turing1...
 
Unite 2013 optimizing unity games for mobile platforms
Unite 2013 optimizing unity games for mobile platformsUnite 2013 optimizing unity games for mobile platforms
Unite 2013 optimizing unity games for mobile platforms
 
How to Improve Visual Rendering Quality in VR - Unite Copenhagen 2019
How to Improve Visual Rendering Quality in VR - Unite Copenhagen 2019How to Improve Visual Rendering Quality in VR - Unite Copenhagen 2019
How to Improve Visual Rendering Quality in VR - Unite Copenhagen 2019
 
Threading Successes 06 Allegorithmic
Threading Successes 06   AllegorithmicThreading Successes 06   Allegorithmic
Threading Successes 06 Allegorithmic
 
The Rendering Pipeline - Challenges & Next Steps
The Rendering Pipeline - Challenges & Next StepsThe Rendering Pipeline - Challenges & Next Steps
The Rendering Pipeline - Challenges & Next Steps
 
Rendering Technologies from Crysis 3 (GDC 2013)
Rendering Technologies from Crysis 3 (GDC 2013)Rendering Technologies from Crysis 3 (GDC 2013)
Rendering Technologies from Crysis 3 (GDC 2013)
 
FORECASTING MUSIC GENRE (RNN - LSTM)
FORECASTING MUSIC GENRE (RNN - LSTM)FORECASTING MUSIC GENRE (RNN - LSTM)
FORECASTING MUSIC GENRE (RNN - LSTM)
 
Technical data PULSAR Thermal imaging sights Apex | Optics Trade
Technical data PULSAR Thermal imaging sights Apex | Optics TradeTechnical data PULSAR Thermal imaging sights Apex | Optics Trade
Technical data PULSAR Thermal imaging sights Apex | Optics Trade
 
FPGA Conference 2021: Breaking the TOPS ceiling with sparse neural networks -...
FPGA Conference 2021: Breaking the TOPS ceiling with sparse neural networks -...FPGA Conference 2021: Breaking the TOPS ceiling with sparse neural networks -...
FPGA Conference 2021: Breaking the TOPS ceiling with sparse neural networks -...
 
Gdc 14 bringing unreal engine 4 to open_gl
Gdc 14 bringing unreal engine 4 to open_glGdc 14 bringing unreal engine 4 to open_gl
Gdc 14 bringing unreal engine 4 to open_gl
 
Technology (1)
Technology (1)Technology (1)
Technology (1)
 
Hardware implementation of the serpent block cipher using fpga technology
Hardware implementation of the serpent block cipher using fpga technologyHardware implementation of the serpent block cipher using fpga technology
Hardware implementation of the serpent block cipher using fpga technology
 
Minko stage3d workshop_20130525
Minko stage3d workshop_20130525Minko stage3d workshop_20130525
Minko stage3d workshop_20130525
 

More from AMD Developer Central

More from AMD Developer Central (10)

RapidFire - the Easy Route to low Latency Cloud Gaming Solutions - AMD at GDC14
RapidFire - the Easy Route to low Latency Cloud Gaming Solutions - AMD at GDC14RapidFire - the Easy Route to low Latency Cloud Gaming Solutions - AMD at GDC14
RapidFire - the Easy Route to low Latency Cloud Gaming Solutions - AMD at GDC14
 
Mantle and Nitrous - Combining Efficient Engine Design with a modern API - AM...
Mantle and Nitrous - Combining Efficient Engine Design with a modern API - AM...Mantle and Nitrous - Combining Efficient Engine Design with a modern API - AM...
Mantle and Nitrous - Combining Efficient Engine Design with a modern API - AM...
 
Mantle - Introducing a new API for Graphics - AMD at GDC14
Mantle - Introducing a new API for Graphics - AMD at GDC14Mantle - Introducing a new API for Graphics - AMD at GDC14
Mantle - Introducing a new API for Graphics - AMD at GDC14
 
Direct3D and the Future of Graphics APIs - AMD at GDC14
Direct3D and the Future of Graphics APIs - AMD at GDC14Direct3D and the Future of Graphics APIs - AMD at GDC14
Direct3D and the Future of Graphics APIs - AMD at GDC14
 
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
 
Keynote (Tony King-Smith) - Silicon? Check. HSA? Check. All done? Wrong! - by...
Keynote (Tony King-Smith) - Silicon? Check. HSA? Check. All done? Wrong! - by...Keynote (Tony King-Smith) - Silicon? Check. HSA? Check. All done? Wrong! - by...
Keynote (Tony King-Smith) - Silicon? Check. HSA? Check. All done? Wrong! - by...
 
Keynote (Nandini Ramani) - The Role of Java in Heterogeneous Computing & How ...
Keynote (Nandini Ramani) - The Role of Java in Heterogeneous Computing & How ...Keynote (Nandini Ramani) - The Role of Java in Heterogeneous Computing & How ...
Keynote (Nandini Ramani) - The Role of Java in Heterogeneous Computing & How ...
 
Keynote (Mike Muller) - Is There Anything New in Heterogeneous Computing - by...
Keynote (Mike Muller) - Is There Anything New in Heterogeneous Computing - by...Keynote (Mike Muller) - Is There Anything New in Heterogeneous Computing - by...
Keynote (Mike Muller) - Is There Anything New in Heterogeneous Computing - by...
 
Keynote (Dr. Lisa Su) - Developers: The Heart of AMD Innovation - by Dr. Lisa...
Keynote (Dr. Lisa Su) - Developers: The Heart of AMD Innovation - by Dr. Lisa...Keynote (Dr. Lisa Su) - Developers: The Heart of AMD Innovation - by Dr. Lisa...
Keynote (Dr. Lisa Su) - Developers: The Heart of AMD Innovation - by Dr. Lisa...
 
Keynote (Johan Andersson) - Mantle for Developers - by Johan Andersson, Techn...
Keynote (Johan Andersson) - Mantle for Developers - by Johan Andersson, Techn...Keynote (Johan Andersson) - Mantle for Developers - by Johan Andersson, Techn...
Keynote (Johan Andersson) - Mantle for Developers - by Johan Andersson, Techn...
 

Recently uploaded

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Recently uploaded (20)

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...
 
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...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
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
 
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
 
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...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
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
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
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
 
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
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
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
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
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
 

TressFX The Fast and The Furry by Nicolas Thibieroz

  • 1. TRESSFX THE FAST AND THE FURRY AMD AND MICROSOFT DEVELOPER DAY, JUNE 2014, STOCKHOLM NICOLAS THIBIEROZ WORLDWIDE GAMING ENGINEERING MANAGER, AMD
  • 2. | TRESSFX THE FAST AND THE FURRY | AMD AND MICROSOFT GAME DEVELOPER DAY - JUNE 2 2014, STOCKHOLM2 TRESSFX: NEXT-GENERATION HAIR AND FUR RENDERING  The time for next-gen quality is now  Tomb Raider pioneered next-gen hair ‒ Includes PS4/XB1  Users expect this level of quality for next-gen titles  You need to start thinking about this!
  • 3. | TRESSFX THE FAST AND THE FURRY | AMD AND MICROSOFT GAME DEVELOPER DAY - JUNE 2 2014, STOCKHOLM3 WHAT MAKES GOOD HAIR/FUR? Basic Rendering Antialiasing Antialiasing + Self Shadowing Antialiasing + Self Shadowing + Transparency Demo  All three components are a must to ensure high quality  Transparency in particular is essential to next-gen visuals ‒ Requires an Order-Independent Transparency (OIT) solution
  • 4. | TRESSFX THE FAST AND THE FURRY | AMD AND MICROSOFT GAME DEVELOPER DAY - JUNE 2 2014, STOCKHOLM4 ISOLINE TESSELLATION FOR HAIR/FUR? 1/2  Isoline tessellation has two tessellation factors ‒ First is line density (lines per invocation) ‒ Second is line detail (segments per line)  In theory provides easy LOD system ‒ Variable line density and detail by increasing both tessellation factors based on distance Tess = (1,1) Tess = (2,1) Tess = (2,2) Tess = (2,3) Tess = (3,3)
  • 5. | TRESSFX THE FAST AND THE FURRY | AMD AND MICROSOFT GAME DEVELOPER DAY - JUNE 2 2014, STOCKHOLM5 ISOLINE TESSELLATION FOR HAIR/FUR? 2/2  In practice isoline tessellation is not cost effective for this scenario  Lines are always 1-pixel thick ‒ Need Geometry Shader to extrude them into triangles for smooth edges ‒ Major impact on performance! ‒ Alternative is to enable MSAA ‒ Most engines are deferred so this causes a large performance impact ‒ No extrusion for smoothing edges and no MSAA = poor quality!  Bottom line: a pure Vertex Shader solution is faster ‒ Curvature is rarely a problem (dependant on vertices/strands at authoring time) ‒ If needed LOD benefit can be done in Vertex Shader
  • 6. | TRESSFX THE FAST AND THE FURRY | AMD AND MICROSOFT GAME DEVELOPER DAY - JUNE 2 2014, STOCKHOLM6 TRESSFX RENDERING PIPELINE  TressFX 2 uses a deferred approach for best performance Three main steps  STEP 1: Hair simulation  STEP 2: Store fragment properties into buffers  STEP 3: Fetch fragment properties, sort, selective shading and render ‒ Full shading on K-frontmost fragments ‒ “Tail” fragments are shaded with a simpler light equation and shadowing algorithm
  • 7. | TRESSFX THE FAST AND THE FURRY | AMD AND MICROSOFT GAME DEVELOPER DAY - JUNE 2 2014, STOCKHOLM7 TRESSFX RENDERING PIPELINE STEP 1: HAIR SIMULATION CSCSCS Input Geometry (SRV) Post-simulation geometry (UAV) Simulation parameters Pre-simulation line segments (model space) Post-simulation line segments (world space) Simulation compute shaders Edge length constraint Local shape constraint Global shape constraint Not always needed for fur Model Transform Collision Shape Not always needed for fur External Forces (wind, gravity, etc.)  Input model is a collection of line segments (each segment composed of up to 64 vertices)  Optionally divided into “master strands” and “slave strands” to optimize simulation performance ‒ Only master strands are simulated (e.g. 1:4 ratio) ‒ Slave strands use master strand simulation results with added noise ‒ Virtually no difference from full-scale simulation but much better simulation performance! ‒ Master:slave simulation ratio can also vary with distance for even better performance Demo
  • 8. | TRESSFX THE FAST AND THE FURRY | AMD AND MICROSOFT GAME DEVELOPER DAY - JUNE 2 2014, STOCKHOLM8 TRESSFX RENDERING PIPELINE STEP 2: STORE FRAGMENT PROPERTIES INTO BUFFERS VS World space Index Buffer Indexed triangle list 10 1 2 3 2 4 0 5 Extrusion into triangles
  • 9. | TRESSFX THE FAST AND THE FURRY | AMD AND MICROSOFT GAME DEVELOPER DAY - JUNE 2 2014, STOCKHOLM9 LINE SEGMENT EXTRUSION INTO TRIANGLES  A lot of vertices go through rendering high-quality hair or fur! ‒ Geometry processing can therefore be a significant bottleneck  In previous versions of TressFX extrusion was done in Geometry Shader (don’t do it!) and then VS with Draw()  Much faster performance was obtained with pure VS solution and precomputed index buffers ‒ Maximizes post vertex cache use! DrawIndexed() method Indexed triangle list = { ( 0, 1, 2 ), (2, 1, 3 ), ( 2, 3, 4 ), (4, 3, 5 ), ( … ) }; Line segments Expanded quads 10 1 2 3 2 4 0 5 1,4 Draw() method Line segments Expanded quads 0 1 2 3,5 6 2,3 7,10 8,9 0 11 Triangle list = { ( 0, 1, 2 ), ( 3, 4, 5 ), ( 6, 7, 8 ), (9, 10, 11 ), ( … ) };
  • 10. | TRESSFX THE FAST AND THE FURRY | AMD AND MICROSOFT GAME DEVELOPER DAY - JUNE 2 2014, STOCKHOLM10 TRESSFX RENDERING PIPELINE STEP 2: STORE FRAGMENT PROPERTIES INTO BUFFERS Antialiasing VS PS Homogeneous clip space World space Index Buffer Indexed triangle list 10 1 2 3 2 4 0 5 Extrusion into triangles
  • 11. | TRESSFX THE FAST AND THE FURRY | AMD AND MICROSOFT GAME DEVELOPER DAY - JUNE 2 2014, STOCKHOLM11 ANTIALIASING  Antialiasing (aka “coverage”) using analytical method ‒ This is NOT Multisampling Anti-Aliasing!  Compute pixel coverage on edges of hair strand triangles and convert it to an alpha value  Alpha value fades out based on distance from pixel centre to strand axis  Similar principle to Emil Persson’s phone wire Anti-Aliasing http://www.humus.name/Articles/Persson_GraphicsGemsForGames.pdf
  • 12. | TRESSFX THE FAST AND THE FURRY | AMD AND MICROSOFT GAME DEVELOPER DAY - JUNE 2 2014, STOCKHOLM12 TRESSFX RENDERING PIPELINE STEP 2: STORE FRAGMENT PROPERTIES INTO BUFFERS Antialiasing depth tangent coverage next VS PS Homogeneous clip space World space Null RT Stencil PPLL UAV Head UAV Index Buffer Indexed triangle list 10 1 2 3 2 4 0 5 Extrusion into triangles
  • 13. | TRESSFX THE FAST AND THE FURRY | AMD AND MICROSOFT GAME DEVELOPER DAY - JUNE 2 2014, STOCKHOLM13 PER-PIXEL LINKED LISTS  Head UAV ‒ Each pixel location has a “head pointer” to a linked list in the PPLL UAV  PPLL UAV ‒ As new fragments are rendered, they are added to the next open location in the PPLL (using UAV counter) ‒ A link is created to the fragment pointed to by the head pointer ‒ Head pointer then points to the new fragment // Retrieve current pixel count and increase counter uint uPixelCount = LinkedListUAV.IncrementCounter(); uint uOldStartOffset; // Exchange indices in LinkedListHead texture corresponding to pixel location InterlockedExchange(LinkedListHeadUAV[address], uPixelCount, uOldStartOffset); // Append new element at the end of the Fragment and Link Buffer Element.uNext = uOldStartOffset; LinkedListUAV[uPixelCount] = Element; depth tangent coverage next PPLL UAV Head UAV  Memory requirements can be large! ‒ Width * Height * Average overdraw * sizeof (PPLL structure) ‒ Can use tiling approach in memory-constrained situations
  • 14. | TRESSFX THE FAST AND THE FURRY | AMD AND MICROSOFT GAME DEVELOPER DAY - JUNE 2 2014, STOCKHOLM14 TRESSFX RENDERING PIPELINE STEP 3: FETCH FRAGMENTS, SORT, SELECTIVE SHADING AND RENDER VS PS Stencil Head UAV PPLL UAV Lighting Full Screen Quad/Triangle
  • 15. | TRESSFX THE FAST AND THE FURRY | AMD AND MICROSOFT GAME DEVELOPER DAY - JUNE 2 2014, STOCKHOLM15 LIGHTING  Different options available ‒ Kajiya-Kay hair lighting model ‒ Marshner model ‒ Anything else that looks good!  Fragment properties storage requirements may limit your options!  TressFX 2 sample uses an approximation of the Marchner technique when rendering two highlights ‒ Unique fragment properties: depth, tangent vector Primary Highlights Secondary Highlights
  • 16. | TRESSFX THE FAST AND THE FURRY | AMD AND MICROSOFT GAME DEVELOPER DAY - JUNE 2 2014, STOCKHOLM16 TRESSFX RENDERING PIPELINE STEP 3: FETCH FRAGMENTS, SORT, SELECTIVE SHADING AND RENDER VS PS Stencil Head UAV PPLL UAV Lighting Shadows Full Screen Quad/Triangle
  • 17. | TRESSFX THE FAST AND THE FURRY | AMD AND MICROSOFT GAME DEVELOPER DAY - JUNE 2 2014, STOCKHOLM17 SHADOWS  Three different cases  Hair self-shadowing ‒ Essential component to give next-gen volumetric quality look ‒ Simplified Deep Shadow Map technique  Hair casting shadows on body & environment ‒ Body: Need a very soft look at close range (blur shadow map) ‒ Environment: render (possibly simplified) hair geometry into cascaded shadow map  Environment casting shadows on hair ‒ Sample environment shadow map at hair fragment rendering time
  • 18. | TRESSFX THE FAST AND THE FURRY | AMD AND MICROSOFT GAME DEVELOPER DAY - JUNE 2 2014, STOCKHOLM18 TRESSFX RENDERING PIPELINE STEP 3: FETCH FRAGMENTS, SORT, SELECTIVE SHADING AND RENDER VS PS Stencil Head UAV PPLL UAV K frontmost fragment: full shading, sorting and manual blending Lighting Shadows Full Screen Quad/Triangle Tail fragments: cheap shading, no sorting and manual blending
  • 19. | TRESSFX THE FAST AND THE FURRY | AMD AND MICROSOFT GAME DEVELOPER DAY - JUNE 2 2014, STOCKHOLM19 SELECTIVE FRAGMENT SHADING THIS IS WHERE THE MEAT OF THE CODE OCCURS! // Go through the rest of the linked list, and keep closest k fragments but // not in sorted order [allow_uav_condition] for(int l=0; l < g_iMaxFragments; l++) { if(pointer == NULLPOINTER) break; int id = 0; float max_depth = 0; // Find the furthest node in array [unroll]for(int i=0; i<KBUFFER_SIZE; i++) { float fDepth = kBuffer[i].depth; if(max_depth < fDepth) { max_depth = fDepth; id = i; } } // get the start of the linked list from the head pointer uint pointer = LinkedListHeadSRV[In.vPosition.xy]; // Copy first K fragments from PPLL into KBuffer[] NODE Kbuffer[KBUFFER_SIZE]; for(int p=0; p<KBUFFER_SIZE; p++) { if (pointer != NULLPOINTER) { kBuffer[p] = LinkedListSRV[pointer]; pointer = LinkedListSRV[pointer].uNext; } } // If linked list node is nearer than the furthest one in the local array // exchange the node in the local array for the one in the linked list NODE Node = LinkedListSRV[pointer]; if (max_depth > Node.depth) { SWAP(Node, Kbuffer[i]); } // Do simple shading and shadowing for nodes not part of the K closest fragments fragmentcolor = ComputeSimpleShading(Node); // Out of order blending fcolor.xyz = mad(-fcolor.xyz, fragmentColor.w, fcolor.xyz) + fragmentColor.xyz * fragmentColor.w; fcolor.w = mad(-fcolor.w, fragmentColor.w, fcolor.w); // Retrieve next node pointer pointer = LinkedListSRV[pointer].uNext; } // Blend the k nearest layers of fragments from back to front, where k = KBUFFER_SIZE for(int j=0; j<KBUFFER_SIZE; j++) { int id = 0; float max_depth = 0; // Find the furthest node in the array for(int i=0; i<KBUFFER_SIZE; i++) { float fDepth = kBuffer[i].depth; if(max_depth < fDepth) { max_depth = fDepth; id = i; } } // Take this node out of the next search Node = KBuffer[id]; KBuffer[id] = (NODE)0; // Do high quality shading and shadowing fragmentcolor = ComputeHighQualityshading(Node); // Blend fragment color fcolor.xyz = mad(-fcolor.xyz, fragmentColor.w, fcolor.xyz) + fragmentColor.xyz * fragmentColor.w; fcolor.w = mad(-fcolor.w, fragmentColor.w, fcolor.w); } return fcolor;
  • 20. | TRESSFX THE FAST AND THE FURRY | AMD AND MICROSOFT GAME DEVELOPER DAY - JUNE 2 2014, STOCKHOLM20 TRESSFX RENDERING PIPELINE STEP 3: FETCH FRAGMENTS, SORT, SELECTIVE SHADING AND RENDER VS PS Stencil Head UAV PPLL UAV Render target K frontmost fragment: full shading, sorting and manual blending Lighting Shadows Full Screen Quad/Triangle Tail fragments: cheap shading, no sorting and manual blending
  • 21. | TRESSFX THE FAST AND THE FURRY | AMD AND MICROSOFT GAME DEVELOPER DAY - JUNE 2 2014, STOCKHOLM21 TRESSFX PERFORMANCE FAST AND FURRY  High number of fragments required for quality look  Main bottleneck is shading all those fragments ‒ Not per-pixel linked list traversal!  Selective shading approach allows significant performance savings with minor or negligible quality tradeoffs Technique Cost Out of order, no shading 1.31 ms Out of order, shading 2.80 ms Deferred PPLL, selective shading 2.13 ms Shading cost is ~ 1.5 ms 24% faster Fur model with ~130,000 fur strands Running on AMD Radeon 7970 @ 1080p Distance Sim LOD Disabled Sim LOD Enabled Close range 1.01 ms 1.01 ms Medium range 1.01 ms 0.70 ms Long range 1.01 ms 0.37 ms Simulation LOD  Distance-adaptive Shading and Simulation LOD further improves performance  “K frontmost fragments” value can inversely scale with distance Distance Shading LOD Disabled Shading LOD Enabled Close range 3.26 ms 3.26 ms Medium range 3.23 ms 1.77 ms Long range 2.52 ms 0.64 ms Shading LOD
  • 22. | TRESSFX THE FAST AND THE FURRY | AMD AND MICROSOFT GAME DEVELOPER DAY - JUNE 2 2014, STOCKHOLM22 CONCLUSION AND QUESTIONS?  Next-gen hair/fur look at real-time performance is possible now!  Fast: ‒ Variable ratio master/slave compute simulations ‒ Vertex Shader extrusion of segments into triangles (do not use tessellation + GS) ‒ Deferred rendering with selective shading ‒ Distance-based shading and simulation LOD ‒ Optimized shaders!  Furry:  Full and free access to TressFX 2 SDK sample, code and documentation at: http://developer.amd.com/tools-and-sdks/graphics-development/amd-radeon-sdk/ @NThibieroznicolas.thibieroz@amd.com
  • 23. | TRESSFX THE FAST AND THE FURRY | AMD AND MICROSOFT GAME DEVELOPER DAY - JUNE 2 2014, STOCKHOLM23 DISCLAIMER & ATTRIBUTION The information presented in this document is for informational purposes only and may contain technical inaccuracies, omissions and typographical errors. The information contained herein is subject to change and may be rendered inaccurate for many reasons, including but not limited to product and roadmap changes, component and motherboard version changes, new model and/or product releases, product differences between differing manufacturers, software changes, BIOS flashes, firmware upgrades, or the like. AMD assumes no obligation to update or otherwise correct or revise this information. However, AMD reserves the right to revise this information and to make changes from time to time to the content hereof without obligation of AMD to notify any person of such revisions or changes. AMD MAKES NO REPRESENTATIONS OR WARRANTIES WITH RESPECT TO THE CONTENTS HEREOF AND ASSUMES NO RESPONSIBILITY FOR ANY INACCURACIES, ERRORS OR OMISSIONS THAT MAY APPEAR IN THIS INFORMATION. AMD SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE. IN NO EVENT WILL AMD BE LIABLE TO ANY PERSON FOR ANY DIRECT, INDIRECT, SPECIAL OR OTHER CONSEQUENTIAL DAMAGES ARISING FROM THE USE OF ANY INFORMATION CONTAINED HEREIN, EVEN IF AMD IS EXPRESSLY ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. ATTRIBUTION © 2013 Advanced Micro Devices, Inc. All rights reserved. AMD, the AMD Arrow logo and combinations thereof are trademarks of Advanced Micro Devices, Inc. in the United States and/or other jurisdictions. Other names are for informational purposes only and may be trademarks of their respective owners.

Editor's Notes

  1. Simplified Deep Shadow Map technique: take the difference in depth from shadow map depth and fragment depth. The larger this difference the deeper (darker) the shadow. Also uses additional variables.