Real Time Skin Rendering

Similar documents
Real Time Skin Rendering

Drawing a Crowd. David Gosselin Pedro V. Sander Jason L. Mitchell. 3D Application Research Group ATI Research

Real-Time Universal Capture Facial Animation with GPU Skin Rendering

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

Bringing Hollywood to Real Time. Abe Wiley 3D Artist 3-D Application Research Group

Applications of Explicit Early-Z Culling

In-Game Special Effects and Lighting

materials, we instead focus on recreating the important visual aspects of these kinds of materials:

Summed-Area Tables. And Their Application to Dynamic Glossy Environment Reflections Thorsten Scheuermann 3D Application Research Group

Self-shadowing Bumpmap using 3D Texture Hardware

Adding Spherical Harmonic Lighting to the Sushi Engine. Chris Oat 3D Application Research Group. ATI Research, Inc.

INFOGR Computer Graphics

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

Multi-View Soft Shadows. Louis Bavoil

Interactive Cloth Simulation. Matthias Wloka NVIDIA Corporation

Computer Graphics (CS 543) Lecture 10: Soft Shadows (Maps and Volumes), Normal and Bump Mapping

CS 130 Final. Fall 2015

Recollection. Models Pixels. Model transformation Viewport transformation Clipping Rasterization Texturing + Lights & shadows

CS 354R: Computer Game Technology

Ambient Occlusion. Ambient Occlusion (AO) "shadowing of ambient light "darkening of the ambient shading contribution

Shaders in Eve Online Páll Ragnar Pálsson

Filtering Cubemaps Angular Extent Filtering and Edge Seam Fixup Methods

Surface Detail Maps with Soft Self- Shadowing. Chris Green, VALVE

DirectX Programming #4. Kang, Seongtae Computer Graphics, 2009 Spring

INFOGR Computer Graphics

03 RENDERING PART TWO

Game Graphics Programmers

Enhancing Traditional Rasterization Graphics with Ray Tracing. March 2015

Graphics Hardware. Instructor Stephen J. Guy

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

Tutorial on GPU Programming #2. Joong-Youn Lee Supercomputing Center, KISTI

Optimizing DirectX Graphics. Richard Huddy European Developer Relations Manager

Deferred Rendering Due: Wednesday November 15 at 10pm

Complex Shading Algorithms

Real-Time Rendering of a Scene With Many Pedestrians

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

Other Rendering Techniques CSE 872 Fall Intro You have seen Scanline converter (+z-buffer) Painter s algorithm Radiosity CSE 872 Fall

GPU Programmable Graphics Pipeline

Lighting and Shading

CGT520 Lighting. Lighting. T-vertices. Normal vector. Color of an object can be specified 1) Explicitly as a color buffer

CS 4620 Program 3: Pipeline

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

Introduction to Visualization and Computer Graphics

Pipeline Operations. CS 4620 Lecture 14

CS 464 Review. Review of Computer Graphics for Final Exam

What for? Shadows tell us about the relative locations. Vienna University of Technology 2

of the NVIDIA Demo Team Eugene d Eon 2008 NVIDIA Corporation.

8 Human Skin Materials and Faking Sub Surface Scattering in Cycles

Programming Graphics Hardware

Render methods, Compositing, Post-process and NPR in NX Render

Computer Graphics. Shadows

Canonical Shaders for Optimal Performance. Sébastien Dominé Manager of Developer Technology Tools

Real-Time Rendering (Echtzeitgraphik) Michael Wimmer

CMSC427 Advanced shading getting global illumination by local methods. Credit: slides Prof. Zwicker

Forward rendering. Unity 5's rendering paths. Which lights get what treatment?

Vertex and Pixel Shaders:

Shadow Techniques. Sim Dietrich NVIDIA Corporation

Computergrafik. Matthias Zwicker. Herbst 2010

Texture Mapping. Michael Kazhdan ( /467) HB Ch. 14.8,14.9 FvDFH Ch. 16.3, , 16.6

Mattan Erez. The University of Texas at Austin

Game Technology. Lecture Physically Based Rendering. Dipl-Inform. Robert Konrad Polona Caserman, M.Sc.

Technical Report. Mesh Instancing

Mali Demos: Behind the Pixels. Stacy Smith

Models and Architectures

Could you make the XNA functions yourself?

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


TSBK03 Screen-Space Ambient Occlusion

Optimized Rendering Techniques Based on Local Cubemaps

CS GAME PROGRAMMING Question bank

Life on the Bleeding Edge: More Secrets of the NVIDIA Demo Team Eugene d Eon NVIDIA Corporation.

SGI OpenGL Shader. Marc Olano SGI

Topic 12: Texture Mapping. Motivation Sources of texture Texture coordinates Bump mapping, mip-mapping & env mapping

Learn the fundamentals of shader writing in unity in this complete tutorial series.

Graphics Performance Optimisation. John Spitzer Director of European Developer Technology

Topic 11: Texture Mapping 11/13/2017. Texture sources: Solid textures. Texture sources: Synthesized

Wednesday, July 24, 13

Parallax Bumpmapping. Whitepaper

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


Today. Rendering algorithms. Rendering algorithms. Images. Images. Rendering Algorithms. Course overview Organization Introduction to ray tracing

rendering rasterization based rendering pipelined architecture, parallel mostly triangles (lines and points possible too)

Topic 11: Texture Mapping 10/21/2015. Photographs. Solid textures. Procedural

Computer Graphics (CS 543) Lecture 10: Normal Maps, Parametrization, Tone Mapping

AGDC Per-Pixel Shading. Sim Dietrich

Lecturer Athanasios Nikolaidis

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

COMP 4801 Final Year Project. Ray Tracing for Computer Graphics. Final Project Report FYP Runjing Liu. Advised by. Dr. L.Y.

Render-To-Texture Caching. D. Sim Dietrich Jr.

Recall: Indexing into Cube Map

Evolution of GPUs Chris Seitz

Computer Graphics. Lecture 14 Bump-mapping, Global Illumination (1)

Dual-Paraboloid Shadow Mapping. A paper by Stefan Brabec, Thomas Annen, Hans-Peter Seidel Presented By Patrick Wouterse, Selmar Kok

Computer Graphics. Si Lu. Fall uter_graphics.htm 11/22/2017

Rendering Algorithms: Real-time indirect illumination. Spring 2010 Matthias Zwicker

Models and Architectures. Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico

Abstract. 2 Description of the Effects Used. 1 Introduction Phong Illumination Bump Mapping

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

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

Computer Graphics 10 - Shadows

Transcription:

Real Time Skin Rendering David Gosselin 3D Application Research Group ATI Research, Inc.

Overview Background Texture space lighting Blur and dilation Adding shadows Specular with shadows Demo 2

Why Skin is Hard Most lighting from skin comes from sub-surface scattering Skin color mainly from epidermis Pink/red color mainly from blood in dermis Lambertian model designed for hard surfaces with little sub-surface scattering so it doesn t work real well for skin 3

Rough Skin Cross Section Air Epidermis Dermis Bone, muscle, guts, etc. 4

Basis for Our Approach SIGGRAPH 2003 sketch Realistic Human Face Rendering for The Matrix Reloaded Rendered a 2D light map Simulate subsurface diffusion in image domain (different for each color component) Used traditional ray tracing for areas where light can pass all the way through (e.g.. Ears) 5

Texture Space Subsurface Scattering From Realistic Human Face Rendering for The Matrix Reloaded @ SIGGRAPH 2003 From Sushi Engine Current skin in Real Time 6

Texture Space Lighting for Real Time Render diffuse lighting into an off-screen texture using texture coordinates as position Blur the off-screen diffuse lighting Read the texture back and add specular lighting in subsequent pass We only used bump map for the specular lighting pass 7

Texture Coordinates as Position Need to light as a 3D model but draw into texture By passing texture coordinates as position the rasterizer does the unwrap Compute light vectors based on 3D position and interpolate 8

Basic Approach Light in Texture Space Blur Geometry Sample texture space light Back Buffer 9

Texture Lighting Vertex Shader VsOutput main (VsInput i) { // Compute output texel position VsOutput o; o.pos.xy = i.texcoord*2.0-1.0; o.pos.z = 1.0; o.pos.w = 1.0; // Pass along texture coordinates o.texcoord = i.texcoord; // Skin float4x4 mskinning = SiComputeSkinningMatrix (i.weights, i.indices); float4 pos = mul (i.pos, mskinning); pos = pos/pos.w; o.normal = mul (i.normal, mskinning); // Compute Object light vectors // etc.... 10

Texture Lighting Pixel Shader float4 main (PsInput i) : COLOR { // Compute Object Light 0 float3 vnormal = normalize (i.normal); float3 lightcolor = 2.0 * SiGetObjectAmbientLightColor(0); float3 vlight = normalize (i.oalightvec0); float NdotL = SiDot3Clamp (vnormal, vlight); float3 diffuse = saturate (NdotL * lightcolor); // Compute Object Light 1 & 2... } float4 o; o.rgb = diffuse; float4 cbump = tex2d (tbump, i.texcoord); o.a = cbump.a; // Save off blur size return o; 11

Texture Lighting Results Traditional Lighting Texture Space Lighting 12

Blur Used to simulate the subsurface component of skin lighting Used a grow-able Poisson disc filter (more details on this filter later) Read the kernel size from a texture Allows varying the subsurface effect Higher for places like ears/nose Lower for places like cheeks 13

Blur Size Map and Blurred Lit Texture Blur Kernel Size Result Texture Space Lighting 14

Shadows Use shadow maps Apply shadows during texture lighting Get free blur Soft shadows Simulates subsurface interaction Lower precision/size requirements Reduces artifacts Only doing shadows from one key light 15

Shadow Maps Create projection matrix to generate map from the light s point of view Use bounding sphere of head to ensure the most texture space is used Write depth from light into off-screen texture Test depth values in pixel shader 16

Texture Lighting With Shadows Write distance from light into shadow map Geometry Light in Texture Space Blur Sample texture space light Back Buffer 17

Shadow Map Vertex Shader float4x4 msilightprojection; // Light projection matrix VsOutput main (VsInput i) { VsOutput o; // Compose skinning matrix float4x4 mskinning = SiComputeSkinningMatrix(i.weights, i.indices); // Skin position/normal and multiply by light matrix float4 pos = mul (i.pos, mskinning); o.pos = mul (pos, msilightprojection); } // Compute depth (Pixel Shader is just pass through) float dv = o.pos.z/o.pos.w; o.depth = float4(dv, dv, dv, 1); return o; 18

Texture Lighting Vertex Shader with Shadows VsOutput main (VsInput i) { // Same lead in code as before... } // Compute texture coordintates for shadow map o.poslight = mul(pos, msilightkingpin); o.poslight /= o.poslight.w; o.poslight.xy = (o.poslight.xy + 1.0f)/2.0f; o.poslight.y = 1.0f-o.posLight.y; o.poslight.z -= 0.01f; return o; 19

Texture Lighting Pixel Shader with Shadows sampler tshadowmap; float faceshadowfactor; float4 main (PsInput i) : COLOR { // Same lead in code... // Compute Object Light 0 float3 lightcolor = 2.0 * SiGetObjectAmbientLightColor(0); float3 vlight = normalize (i.oalightvec0); float NdotL = SiDot3Clamp (vnormal, vlight); float VdotL = SiDot3Clamp (-vlight, vview); float4 t = tex2d(tshadowmap, i.poslight.xy); float lfac = faceshadowfactor; if (i.poslight.z < t.z) lfac = 1.0f; float3 diffuse = lfac * saturate ((fresnel*vdotl+ndotl)*lightcolor); }...// The rest of the shader is the same as before 20

Shadow Map and Shadowed Lit Texture Shadow Map (depth) Shadows in Texture Space 21

Result with Shadows 22

Specular Use bump map for specular lighting Per-pixel exponent Need to shadow specular Hard to blur shadow map directly Modulate specular from shadowing light by luminance of texture space light Darkens specular in shadowed areas but preserves lighting in unshadowed areas 23

Normal Map Compression New Feature! New texture format in new ATI chip Exposed in Direct3D using FOURCC: ATI2 Two-channels (x and y) Each channel is compressed separately Each uses a block like a DXT5 alpha block Derive Z in pixel shader + 1 x 2 y Useful for tangent-space normal maps Can be used for any 2-channel texture 2 24

Final Pixel Shader (with specular) sampler tbase; sampler tbump; sampler ttexturelit; float4 vbumpscale; float speculardim; float4 main (PsInput i) : COLOR { // Get base and bump map float4 cbase = tex2d (tbase, i.texcoord.xy); float3 cbump = tex2d (tbump, i.texcoord.xy); // Get bumped normal float3 vnormal = SiConvertColorToVector (cbump); vnormal.z = vnormal.z * vbumpscale.x; vnormal = normalize (vnormal); 25

Final Pixel Shader // View, reflection, and specular exponent float3 vview = normalize (i.viewvec); float3 vreflect = SiReflect (vview, vnormal); float exponent = cbase.a*vbumpscale.z + vbumpscale.w; // Get "subsurface" light from lit texture. float2 itx = i.texcoord.xy; itx.y = 1-i.texCoord.y; float4 clight = tex2d (ttexturelit, itx); float3 diffuse = clight*cbase; 26

Final Pixel Shader // Compute Object Light 0 float3 lightcolor = 2.0 * SiGetObjectAmbientLightColor(0); float3 vlight = normalize (i.oalightvec0); float RdotL = SiDot3Clamp (vreflect, vlight); float shadow = SiGetLuminance (clight.rgb); shadow = pow(shadow,2); float3 specular = saturate(pow(rdotl,exponent)*lightcolor) *shadow; // Compute Object Light 1 & 2 (same as above but no // shadow term)... } // Final color float4 o; o.rgb = diffuse + specular*speculardim; o.a = 1.0; return o; 27

Specular Shadow Dim Results Specular Without Shadows Specular With Shadows 28

Demo 29

Questions? 30