Skin Rendering GPU Graphics Gary J. Katz University of Pennsylvania CIS 665 Adapted from David Gosselin’s Power Point and article, Real-time skin rendering,

Slides:



Advertisements
Similar presentations
Exploration of advanced lighting and shading techniques
Advertisements

An Optimized Soft Shadow Volume Algorithm with Real-Time Performance Ulf Assarsson 1, Michael Dougherty 2, Michael Mounier 2, and Tomas Akenine-Möller.
CS123 | INTRODUCTION TO COMPUTER GRAPHICS Andries van Dam © 1/16 Deferred Lighting Deferred Lighting – 11/18/2014.
Technische Universität München Computer Graphics SS 2014 Graphics Effects Rüdiger Westermann Lehrstuhl für Computer Graphik und Visualisierung.
Michael I. Gold NVIDIA Corporation
Frame Buffer Postprocessing Effects in DOUBLE-S.T.E.A.L (Wreckless)
Ray tracing. New Concepts The recursive ray tracing algorithm Generating eye rays Non Real-time rendering.
Understanding the graphics pipeline Lecture 2 Original Slides by: Suresh Venkatasubramanian Updates by Joseph Kider.
Computer graphics & visualization Global Illumination Effects.
The Art and Technology Behind Bioshock’s Special Effects
Course Note Credit: Some of slides are extracted from the course notes of prof. Mathieu Desburn (USC) and prof. Han-Wei Shen (Ohio State University). CSC.
Week 7 - Monday.  What did we talk about last time?  Specular shading  Aliasing and antialiasing.
Week 10 - Monday.  What did we talk about last time?  Global illumination  Shadows  Projection shadows  Soft shadows.
3D Graphics Rendering and Terrain Modeling
9/25/2001CS 638, Fall 2001 Today Shadow Volume Algorithms Vertex and Pixel Shaders.
1. What is Lighting? 2 Example 1. Find the cubic polynomial or that passes through the four points and satisfies 1.As a photon Metal Insulator.
CS6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003 Object-Order vs. Screen-Order Rendering April 24, 2003.
IN4151 Introduction 3D graphics 1 Introduction to 3D computer graphics part 2 Viewing pipeline Multi-processor implementation GPU architecture GPU algorithms.
Global Illumination May 7, Global Effects translucent surface shadow multiple reflection.
7M836 Animation & Rendering
GPUGI: Global Illumination Effects on the GPU
IAT 3551 Computer Graphics Overview Color Displays Drawing Pipeline.
02/04/03 Page 1 Rendering Visibility Lighting Texturing.
Introduction to 3D Graphics John E. Laird. Basic Issues u Given a internal model of a 3D world, with textures and light sources how do you project it.
Computer Graphics Shadows
09/18/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Bump Mapping Multi-pass algorithms.
Shadows Computer Graphics. Shadows Shadows Extended light sources produce penumbras In real-time, we only use point light sources –Extended light sources.
Erdem Alpay Ala Nawaiseh. Why Shadows? Real world has shadows More control of the game’s feel  dramatic effects  spooky effects Without shadows the.
Computer Graphics Mirror and Shadows
Aaron Schultz. Idea: Objects close to a light shadow those far away. Anything we can see from the light’s POV is lit. Everything hidden is dark. Distance.
Ray Tracing and Photon Mapping on GPUs Tim PurcellStanford / NVIDIA.
University of Illinois at Chicago Electronic Visualization Laboratory (EVL) CS 426 Intro to 3D Computer Graphics © 2003, 2004, 2005 Jason Leigh Electronic.
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
Jonathan M Chye Technical Supervisor : Mr Matthew Bett 2010.
-Global Illumination Techniques
09/09/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Event management Lag Group assignment has happened, like it or not.
Week 2 - Friday.  What did we talk about last time?  Graphics rendering pipeline  Geometry Stage.
Advanced Computer Graphics Depth & Stencil Buffers / Rendering to Textures CO2409 Computer Graphics Week 19.
Rendering Overview CSE 3541 Matt Boggus. Rendering Algorithmically generating a 2D image from 3D models Raster graphics.
Week 10 - Wednesday.  What did we talk about last time?  Shadow volumes and shadow mapping  Ambient occlusion.
Computer Graphics The Rendering Pipeline - Review CO2409 Computer Graphics Week 15.
COMPUTER GRAPHICS CSCI 375. What do I need to know?  Familiarity with  Trigonometry  Analytic geometry  Linear algebra  Data structures  OOP.
Taku KomuraComputer Graphics Local Illumination and Shading Computer Graphics – Lecture 10 Taku Komura Institute for Perception, Action.
Advanced Computer Graphics Advanced Shaders CO2409 Computer Graphics Week 16.
Eighty-color-channel lighting Zoltán Márton Cecília Sik Lányi University of Pannonia Egyetem u. 10.
GRAPHICS PIPELINE & SHADERS SET09115 Intro to Graphics Programming.
Advanced Computer Graphics Shadow Techniques CO2409 Computer Graphics Week 20.
Sample Based Visibility for Soft Shadows using Alias-free Shadow Maps Erik Sintorn – Ulf Assarsson – uffe.
Global Illumination. Local Illumination  the GPU pipeline is designed for local illumination  only the surface data at the visible point is needed to.
Visual Appearance Chapter 4 Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology.
Single Pass Point Rendering and Transparent Shading Paper by Yanci Zhang and Renato Pajarola Presentation by Harmen de Weerd and Hedde Bosman.
Local Illumination and Shading
COMPUTER GRAPHICS CS 482 – FALL 2015 SEPTEMBER 29, 2015 RENDERING RASTERIZATION RAY CASTING PROGRAMMABLE SHADERS.
Real-Time Dynamic Shadow Algorithms Evan Closson CSE 528.
Shadows David Luebke University of Virginia. Shadows An important visual cue, traditionally hard to do in real-time rendering Outline: –Notation –Planar.
1 Shadow Rendering Techniques: Hard and Soft Author: Jamiur Rahman Supervisor: Mushfiqur Rouf Department of CSE BRAC University.
The Graphics Pipeline Revisited Real Time Rendering Instructor: David Luebke.
09/23/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Reflections Shadows Part 1 Stage 1 is in.
Computer Graphics Overview
Week 7 - Monday CS361.
Visual Appearance Chapter 4
Graphics Processing Unit
Deferred Lighting.
3D Graphics Rendering PPT By Ricardo Veguilla.
CS451Real-time Rendering Pipeline
Understanding Theory and application of 3D
GPU Graphics Gary J. Katz University of Pennsylvania CIS 665
UMBC Graphics for Games
CS5500 Computer Graphics May 29, 2006
Frame Buffer Applications
Presentation transcript:

Skin Rendering GPU Graphics Gary J. Katz University of Pennsylvania CIS 665 Adapted from David Gosselin’s Power Point and article, Real-time skin rendering, ShaderX article

Overview  Background  Offline rendering  Texture space lighting  Blur and dilation  Shadows  Specular with shadows

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

Rough skin Cross Section Air Epidermis Dermis Incoming Light Outgoing Light

Offline Rendering Approach from Matrix Reloaded  Render a 2D light map  Simulate subsurface diffusion in image domain (different for each color component) The illumination of skin is rendered to a texture map Map is blended to simulate the effect of subsurface scattering  Used traditional ray tracing for areas where light can pass all the way through (Ears)  Render a 2D light map  Simulate subsurface diffusion in image domain (different for each color component) The illumination of skin is rendered to a texture map Map is blended to simulate the effect of subsurface scattering  Used traditional ray tracing for areas where light can pass all the way through (Ears)

Algorithm 1. Create shadow map from the point of view of the key light 2. Render diffuse illumination to a 2D light map 3. Dilate the boundaries and blur the light map to approximate subsurface scattering 4. Render final mesh (use the blurred light map for diffuse illumination) Geometry Write distance from light into shadow map Light in texture space Sample texture space light Back Buffer Blur Structure for texture space algorithm

 From “The Matrix Reloaded”  From Sushi Engine (ATI) Texture Space Subsurface Scattering Current skin in Real Time

Creating the Shadow Map 1. Compute view-projection matrix to render from point of view of light  Use a frustum that tightly bounds the bounding sphere of the geometry 2. Use bounding sphere of head to ensure the most texture space is used 3. Store the depth values in the alpha channel 4. Vertex shader passes depth to the pixel shader. 5. Pixel Shader outputs interpolated depth

Creating the Shadow Map  Translucent Shadows Use a second pass 1. Render translucent geometry 1. Have z-testing turned on 2. Have z-writing turned off 2. Accumulate opacity of the samples on the RGB channels of the shadow map texture using additive blending

Computing Shadows from Map  If the sample is not shadowed by a translucent object its diffuse contribution is attenuated by the value in the alpha channel Opaque geometry shadows itself Translucent geometry shadows opaque geometry

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

Render to Light Map The Algorithm  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  Only use bump map for the specular lighting pass

Rendering Diffuse Illumination Creating the 2D Light Map  Vertex Shader Sets the output positions to be the texture coordinates of the vertices 1. Moves Texture Coordinates from [0,1] to [-1, 1] 2. Computes position of the vertex from point of view of light in the resized [0,1] space and passes result to pixel shader for depth test Example Light Map // Vertex Shader Code o.pos.xy = i.texCoord*2.0 – 1.0; o.pos.z = 0.0; o.pos.w = 1.0;

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

Rendering Diffuse Illumination Creating the 2D Light Map  Pixel Shader Computes diffuse contribution of light that is attenuated by the shadow Example Light Map // Pixel Shader Code // if light is not in shadow If(lightPos.z < textureMap[x,y] && dot(Normal,Light) > 0) { // compute translucency alpha = textureMap[x,y]^ShadowCoeficient shadowFactor = lerp(occluded, white, alpha); } else shadowFactor = occluded; diffuse = shadowFactor * saturate(dot(Normal, Light) * lightColor)

Blur  Used to simulate the subsurface component of skin lighting  Used a grow-able Poisson disc filter  Read the kernel size from a texture  Allows varying the subsurface effect Higher for places like ears/nose Lower for places like cheeks

Blur Size Map and Blurred Lit Texture Created by the artist

Blur All work is done in the pixel shader 1. Poisson distribution is created (hard-coded in shader) 2. Read center sample and blur kernel size from alpha channel 3. Scale other samples by the kernel size 4. Sum the samples and divide by the kernel size 5. Set the alpha channel with the blur size to allow for further blurring passes

Texture Boundary Dilation The Problem: Boundary artifacts are create when fetching from the light map Solution: Dilate the texture prior to blurring Put image from textbook here

Texture Boundary Dilation  Modify the Poisson disk filter shader  Check whether a given sample is just outside the boundary of useful data  If outside, copy from an interior neighboring sample instead  More expensive, but only used in first blurring pass

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 // compute luminance of light map sample float lum = dot(float3(.2125,.7154,.0721), cLightMap.rgb); // possibly scale and bias lum here depending on the light setup // multiply specular by lum specular *= lum;

Specular Shadow Dim Results Specular Without ShadowsSpecular With Shadows

Acceleration Techniques  Frustrum Culling Before rendering the light map clear z-buffer to 1 Perform texture space rendering pass where the z value is set to 0 for all rendered samples On all further texture space passes  set the z value to 0 in the vertex shader  Set the z test to ‘equal’ If the model lies outside the view frustrum the hardware early-z culling will prevent the pixels from being processed

Acceleration Techniques  Backface Culling Dot product of view vector and normal is computed in vertex shader  If frontfacing a 0 is written to the z-buffer  Else pixel is clipped, leaving z-buffer untouched  Note: bias result of dot product by.3 to have slightly backfaced samples not culled Insert image from textbook here

Acceleration Techniques  Distance Culling If model is very far away from camera  Z value is set to 1  Light map from previous rendered frame is used  Specular illumination is still computed  All acceleration techniques can be performed in one pass

Demo