Real-Time Hair Simulation and Rendering on the GPU. Louis Bavoil

Similar documents
Real-Time Hair Rendering on the GPU NVIDIA

Deep Opacity Maps. Cem Yuksel and John Keyser Texas A&M University

DirectX10 Effects. Sarah Tariq

A Trip Down The (2011) Rasterization Pipeline

DirectX10 Effects and Performance. Bryan Dudash

2.11 Particle Systems

Motivation MGB Agenda. Compression. Scalability. Scalability. Motivation. Tessellation Basics. DX11 Tessellation Pipeline

Next-Generation Graphics on Larrabee. Tim Foley Intel Corp

CS GPU and GPGPU Programming Lecture 2: Introduction; GPU Architecture 1. Markus Hadwiger, KAUST

Deep Opacity Maps. Cem Yuksel 1 and John Keyser 2. Department of Computer Science, Texas A&M University 1 2

The Application Stage. The Game Loop, Resource Management and Renderer Design

How to Work on Next Gen Effects Now: Bridging DX10 and DX9. Guennadi Riguer ATI Technologies

Approximating Subdivision Surfaces with Gregory Patches for Hardware Tessellation

Dominic Filion, Senior Engineer Blizzard Entertainment. Rob McNaughton, Lead Technical Artist Blizzard Entertainment

Department of Computer Engineering 3D Graphics in Games and Movies

Many rendering scenarios, such as battle scenes or urban environments, require rendering of large numbers of autonomous characters.

Rendering Grass with Instancing in DirectX* 10

Real-Time Volumetric Smoke using D3D10. Sarah Tariq and Ignacio Llamas NVIDIA Developer Technology

Morphological: Sub-pixel Morhpological Anti-Aliasing [Jimenez 11] Fast AproXimatte Anti Aliasing [Lottes 09]

The Rasterization Pipeline

D3D11 Tessellation. Sarah Tariq NVIDIA

Rendering. Converting a 3D scene to a 2D image. Camera. Light. Rendering. View Plane

8/5/2012. Introduction. Transparency. Anti-Aliasing. Applications. Conclusions. Introduction

Rendering Grass Terrains in Real-Time with Dynamic Lighting. Kévin Boulanger, Sumanta Pattanaik, Kadi Bouatouch August 1st 2006

Spring 2009 Prof. Hyesoon Kim

CS4620/5620: Lecture 14 Pipeline

Particle Shadows & Cache-Efficient Post-Processing. Louis Bavoil & Jon Jansen Developer Technology, NVIDIA

DX10, Batching, and Performance Considerations. Bryan Dudash NVIDIA Developer Technology

Introduction to the Direct3D 11 Graphics Pipeline

This work is about a new method for generating diffusion curve style images. Although this topic is dealing with non-photorealistic rendering, as you

Enhancing Traditional Rasterization Graphics with Ray Tracing. March 2015

Per-Face Texture Mapping for Realtime Rendering. Realtime Ptex

Beginning Direct3D Game Programming: 1. The History of Direct3D Graphics

Approximate Catmull-Clark Patches. Scott Schaefer Charles Loop

Pipeline Operations. CS 4620 Lecture 10

Pipeline Operations. CS 4620 Lecture 14

Hair Self Shadowing and Transparency Depth Ordering Using Occupancy maps

Volumetric Particle Shadows. Simon Green

EECE 478. Learning Objectives. Learning Objectives. Rasterization & Scenes. Rasterization. Compositing

Applications of Explicit Early-Z Culling

Real - Time Rendering. Pipeline optimization. Michal Červeňanský Juraj Starinský

GUERRILLA DEVELOP CONFERENCE JULY 07 BRIGHTON

Fur Shader GRAPHICS PROGRAMMING 2

Soft Particles. Tristan Lorach

TSBK03 Screen-Space Ambient Occlusion

Visualization Computer Graphics I Lecture 20

Height Fields and Contours Scalar Fields Volume Rendering Vector Fields [Angel Ch. 12] April 23, 2002 Frank Pfenning Carnegie Mellon University

Pipeline Operations. CS 4620 Lecture Steve Marschner. Cornell CS4620 Spring 2018 Lecture 11

The Graphics Pipeline

Sculpting 3D Models. Glossary

Could you make the XNA functions yourself?

Real - Time Rendering. Graphics pipeline. Michal Červeňanský Juraj Starinský

Spring 2011 Prof. Hyesoon Kim

Programmable Shaders for Deformation Rendering

Atmospheric Reentry Geometry Shader

GPU-Accelerated Deep Shadow Maps

CS230 : Computer Graphics Lecture 4. Tamar Shinar Computer Science & Engineering UC Riverside

GPU-Accelerated Deep Shadow Maps for Direct Volume Rendering

Chapter IV Fragment Processing and Output Merging. 3D Graphics for Game Programming

Enabling immersive gaming experiences Intro to Ray Tracing

Stochastic Transparency. Eric Enderton Erik Sintorn Pete Shirley David Luebke

11/1/13. Visualization. Scientific Visualization. Types of Data. Height Field. Contour Curves. Meshes

Visualization. CSCI 420 Computer Graphics Lecture 26

Volume Graphics Introduction

Multi-View Soft Shadows. Louis Bavoil

Programmable GPUS. Last Time? Reading for Today. Homework 4. Planar Shadows Projective Texture Shadows Shadow Maps Shadow Volumes

The Vegetation of Horizon Zero Dawn. Gilbert Sanders Principal Artist, Guerrilla Games

Rain. Sarah Tariq

CS427 Multicore Architecture and Parallel Computing

GPU-Based Visualization of AMR and N-Body Dark Matter Simulation Data. Ralf Kähler (KIPAC/SLAC)

Previously... contour or image rendering in 2D

Real-Time Reyes Programmable Pipelines and Research Challenges

Lecture 4: Geometry Processing. Kayvon Fatahalian CMU : Graphics and Imaging Architectures (Fall 2011)

Applications of Explicit Early-Z Z Culling. Jason Mitchell ATI Research

CSE 167: Introduction to Computer Graphics Lecture #5: Rasterization. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2015

Rasterization Overview

PROFESSIONAL. WebGL Programming DEVELOPING 3D GRAPHICS FOR THE WEB. Andreas Anyuru WILEY. John Wiley & Sons, Ltd.

Point based global illumination is now a standard tool for film quality renderers. Since it started out as a real time technique it is only natural

Gettin Procedural. Jeremy Shopf 3D Application Research Group

Synthesis of Textures with Intricate Geometries using BTF and Large Number of Textured Micropolygons. Abstract. 2. Related studies. 1.

Adaptive Point Cloud Rendering

3D Rendering Pipeline

Craig Peeper Software Architect Windows Graphics & Gaming Technologies Microsoft Corporation

RSX Best Practices. Mark Cerny, Cerny Games David Simpson, Naughty Dog Jon Olick, Naughty Dog

Visualization Computer Graphics I Lecture 20

Enhancing Traditional Rasterization Graphics with Ray Tracing. October 2015

graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1

BCC Linear Wipe. When the Invert Wipe Checkbox is selected, the alpha channel created by the wipe inverts.

Rendering Objects. Need to transform all geometry then

graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1

Graphics Hardware. Graphics Processing Unit (GPU) is a Subsidiary hardware. With massively multi-threaded many-core. Dedicated to 2D and 3D graphics

Abstract. Introduction. Kevin Todisco

Lecture 13: Reyes Architecture and Implementation. Kayvon Fatahalian CMU : Graphics and Imaging Architectures (Fall 2011)

Practical Techniques for Ray Tracing in Games. Gareth Morgan (Imagination Technologies) Aras Pranckevičius (Unity Technologies) March, 2014

After the release of Maxwell in September last year, a number of press articles appeared that describe VXGI simply as a technology to improve

Constant-Memory Order-Independent Transparency Techniques

Towards Supporting Volumetric Data in FurryBall GPU Renderer

Projective Shadows. D. Sim Dietrich Jr.

Direct Rendering. Direct Rendering Goals

3/1/2010. Acceleration Techniques V1.2. Goals. Overview. Based on slides from Celine Loscos (v1.0)

Transcription:

Real-Time Hair Simulation and Rendering on the GPU Sarah Tariq Louis Bavoil

Results 166 simulated strands 0.99 Million triangles Stationary: 64 fps Moving: 41 fps 8800GTX, 1920x1200, 8XMSAA

Results 166 simulated strands 2.1Million triangles Stationary: 24fps Moving: 17.5fps 8800GTX, 1280x1024, 2x SSAA, 8XMSAA

Main Contributions A system that t runs entirely on the GPU Simulation on GPU Tessellation and interpolation on GPU Robust inter hair forces Detection and avoidance of interpolant hair collisions D3D11 tessellation based implementation

Previous work A number of people have done and are doing impressive things in realistic real time hair: Dual Scattering Approximation for Fast Multiple Scattering in Hair. Zinke and Yuksel A practical self-shadowing shadowing algorithm for interactive hair animation. Bertails et al. Algorithms for Hardware Accelerated Hair Rendering. Tae- Yong Kim Real-Time Approximate Sorting for Self Shadowing and Transparency in Hair Rendering. Sintron and Assarsson Deep Opacity Maps. Yuksel and Keyser

Process Import Guide Hair Simulate Guide Tessellate and Render Final Hair Hair Interpolate Guide Hair

Simulation

Simulation Hair simulated as a particle constraint t system Hair vertices are simulated as particles Links between hair vertices are treated as Distance constraints these constraints maintain hair length Angular forces at each hair vertex maintain hair shape We have 2D angular forces (ignoring i the twist t dimension) i Collision constraints keep hair particles outside obstacles

Representation All the guide hair vertices are appended d together th to form one Vertex Buffer (VB) Guide hair 0 Guide hair 1 Fixed vertex (root) Fixed vertex (root) Fixed vertex (root)

Dynamics on the GPU Simulation is done using the Vertex Shader and Stream Output t write directly from the Vertex Shader to another Vertex Buffer, skipping rasterization Ping-Pong between two guide hair VBs Bind VB1, run a vertex shader on it, Stream Out the vertices to VB2 Bind VB2, run next vertex shader on it, Stream Out to VB2 Continue

Example: Distance Constraints A distance constraint t DC(P, Q) between two particles P and Q is enforced by moving them away or towards each other: P Q P Q P Q Distance at rest

Example: Distance Constraints To satisfy a distance constraint we need to move the positions of two vertices Use Geometry Shader Input two vertices Output the modified positions of these vertices after satisfying their distance constraint

Example: Distance Constraints Since particles are subject to multiple constraints we cannot satisfy them all in parallel First batch of constraints Iterate Second batch of constraints

Example: Distance Constraints Render Geometry Shader Stream Out Render Geometry Shader Stream Out

Example: Inter-hair collisions Inter-hair collisions i dealt with in grid based framework Hair strands and obstacles (like head/body) voxelized into a low res grid Hair vertices pushed out of high density areas

Example: Inter-hair collisions Force is applied in the direction of the negative gradient of the density blur the voxelized density, then for each vertex falling in a high density area find the gradient of the density field at that point This approach tries to achieve volume preserving quality of inter-hair collisions

Inter-Hair Collision Forces Visualizing density Final Rendering Before After Before After

Wind Forces Wind forces simulated using semi-lagrangian fluid simulation on a coarse grid Voxelized hair and mesh also added to grid as obstacles to wind

Tessellation and Interpolation ti

Tessellation Simulated Vertices Smoothly Tessellated Hair

Interpolation Multi Strand Interpolation Clump Based Interpolation

Interpolation Multi strand Interpolation Clump Based Interpolation Combination

Curly Hair Encode additional curl offsets into constant buffers These offsets are added to the clump offsets Can either be created procedurally, or artists can create example curls and the offsets can be derived from those

Modulate density and thickness across scalp Green: Local density of hair For e.g. Clump based hair has higher density near the front of the scalp Red: Local thickness of hair Multi Strand For e.g. Clump based hair has less thickness of hair near the front of the scalp Clump Based

Process Create a tessellated t dummy hair and render it N times, where N is the number of final hairs In the VS, load from Buffers storing simulated strand attributes Constant attributes like strand texcoords, length, width etc Variable attributes like vertex positions coordinate Variable attributes like vertex positions, coordinate frames etc

Process Stream out the data after each stage to minimize i i re-computation Tessellate the simulated strands and Stream out Interpolate the tessellated strands and Stream out Render final hair for shading to shadow map Render final hair for rendering Each stage uses data computed and streamed out from previous stage

Additional Optimization details To get a nicer look you use Alpha to Coverage, however using it disables earlyz if you are also writing and reading depth To get earlyz do a depth pre pass before, and during the final rendering just test depth without writing it Don t use the GS for creating hair strands Can use the GS for expanding the lines to triangles but Can use the GS for expanding the lines to triangles but performance gain depends on pipeline load

Avoiding interpolated hair collisions Interpolating between multiple guide strands can lead to some hair going through collision obstacles Interpolated hair intersect collision volumes Fixing collisions without doing extra simulation

Avoiding interpolated hair collisions Interpolated hair Interpolated hair Collision object Simulated Hair Single Hair Interpolation Multi-Hair Interpolation

Avoiding interpolant collisions Blending zone where both methods are used Snap these vertices to their clump based positions No Collision Avoidance Modifying only penetrating vertices Our Method

Avoiding interpolated hair collisions

Avoiding interpolated hair collisions Render each interpolated hair strand to one pixel Output the vertex ID if the vertex is colliding, else a large number Total number of patches Maximum number of interpolated hair per patch 3 2 2 3 Use Minimum blending 3 2 2 3

Rendering

Shadows Material Model: Opaque hair Essential Requirements No flickering, smooth shadows Soft Shadows Do PCF with multiple taps in VS Help reduce temporal/spatial aliasing Calculate shadows in VS and interpolate across hair length to further reduce aliasing i 1 tap 36 taps

Shadows Material Model: Translucent Hair [Yuksel and Keyser 08], [Kim and Neuman 01], [ Lokovic and Veach 01] We do absorption weighted PCF Similar to [Halen 06] Weigh the PCF sample by the distance to occluder No absorption weighting With absorption weighting

LOD Can use the size of a projected segment to decide on the LOD Low LOD levels would use less number of lines, less segments per line, and thicker lines

LOD Can also use artist defined LOD Artists can create different looks for different LOD of the hairstyle. For example a lower LOD can have large strips just on the top of the head along the part of the hair. Near These LODs can then be transcribed into textures The Hull Shader will lerp between appropriate LOD textures to decide on the line density, and line thickness Far

Using Dx11 Tessellation Engine

Tessellation Pipeline Direct3D11 extends Direct3D10 with Input Assembler support for programmable tessellation Vertex Shader Two new shader stages: Hull Shader (HS) Domain Shader (DS) One fixed function stage: Tessellator (TS) Hull Shader TS Domain Shader Geometry Shader Setup/Raster

ISO Lines Input an arbitrary patch For each patch output a number of lines with many segments per line The number of lines output per patch and the number of segments per line are user controlled and can be different per patch The positions of the vertices of the line segments are shader evaluated Render as lines, or expand in the GS

Interpolating and Tessellating hair With Tessellation engine we can create tessellated and interpolated hair on the fly Benefits: Easy and intuitive More programmable Can create geometry only where needed Reduce detail where not needed Continuous LOD

Pipeline Input Output HS TS DS GS PS Calculate LODs Generate topology Calculate vertex attributes Expand lines to quads Shade Simulated Guide Hair Tessellated, Interpolated, Rendered Hair

Alternative Pipeline HS TS DS SO Simulated Guide Hair Calculate LODs Generate topology Calculate vertex attributes HS TS DS GS PS Tessellated Guide Hair Calculate LODs Generate topology Calculate vertex attributes Expand lines to quads Shade

Thank you!