Interactive Cinematic Shading Where are we? Fabio Pellacini Dartmouth College.

Slides:



Advertisements
Similar presentations
The OpenRT Application Programming Interface - Towards a Common API for Interactive Ray Tracing – OpenSG 2003 Darmstadt, Germany Andreas Dietrich Ingo.
Advertisements

Exploration of advanced lighting and shading techniques
CS123 | INTRODUCTION TO COMPUTER GRAPHICS Andries van Dam © 1/16 Deferred Lighting Deferred Lighting – 11/18/2014.
Sven Woop Computer Graphics Lab Saarland University
Graphics Pipeline.
Computer graphics & visualization Global Illumination Effects.
Week 9 - Monday.  What did we talk about last time?  BRDFs  Texture mapping and bump mapping in shaders.
Zhao Dong 1, Jan Kautz 2, Christian Theobalt 3 Hans-Peter Seidel 1 Interactive Global Illumination Using Implicit Visibility 1 MPI Informatik Germany 2.
Chunhui Yao 1 Bin Wang 1 Bin Chan 2 Junhai Yong 1 Jean-Claude Paul 3,1 1 Tsinghua University, China 2 The University of Hong Kong, China 3 INRIA, France.
Advanced Rendering MATERIALS, POSTEFFECTS AND SCENE COMPOSITION GDC
Real-Time Rendering TEXTURING Lecture 02 Marina Gavrilova.
GCAFE 28 Feb Real-time REYES Jeremy Sugerman.
Scalability with many lights II (row-column sampling, visibity clustering) Miloš Hašan.
Rendering with Environment Maps Jaroslav Křivánek, KSVI, MFF UK
Week 9 - Wednesday.  What did we talk about last time?  Fresnel reflection  Snell's Law  Microgeometry effects  Implementing BRDFs  Image based.
1Notes  Assignment 1 is out, due October 12  Inverse Kinematics  Evaluating Catmull-Rom splines for motion curves  Wednesday: may be late (will get.
Real-Time Rendering Paper Presentation Imperfect Shadow Maps for Efficient Computation of Indirect Illumination T. Ritschel T. Grosch M. H. Kim H.-P. Seidel.
Rasterization and Ray Tracing in Real-Time Applications (Games) Andrew Graff.
(conventional Cartesian reference system)
3D Graphics Processor Architecture Victor Moya. PhD Project Research on architecture improvements for future Graphic Processor Units (GPUs). Research.
Real-Time High Quality Rendering COMS 6160 [Fall 2004], Lecture 4 Shadow and Environment Mapping
Matrix Row-Column Sampling for the Many-Light Problem Miloš Hašan (Cornell University) Fabio Pellacini (Dartmouth College) Kavita Bala (Cornell University)
Shading Languages By Markus Kummerer. Markus Kummerer 2 / 19 State of the Art Shading.
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Copyright © 2006 by The McGraw-Hill Companies,
The Story So Far The algorithms presented so far exploit: –Sparse sets of images (some data may not be available) –User help with correspondences (time.
CS 445 / 645: Introductory Computer Graphics
ICheat: A Representation for Artistic Control of Cinematic Lighting Juraj ObertJaroslav Křivánek Daniel Sýkora Fabio Pellacini Sumanta Pattanaik
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
Today More raytracing stuff –Soft shadows and anti-aliasing More rendering methods –The text book is good on this –I’ll be using images from the CDROM.
Interactive Virtual Relighting and Remodelling of Real Scenes C. Loscos 1, MC. Frasson 1,2,G. Drettakis 1, B. Walter 1, X. Granier 1, P. Poulin 2 (1) iMAGIS*
GPU Shading and Rendering Shading Technology 8:30 Introduction (:30–Olano) 9:00 Direct3D 10 (:45–Blythe) Languages, Systems and Demos 10:30 RapidMind.
Shading. What is Shading? Assigning of a color to a pixel in the final image. So, everything in shading is about how to select and combine colors to get.
Interactive Rendering of Meso-structure Surface Details using Semi-transparent 3D Textures Vision, Modeling, Visualization Erlangen, Germany November 16-18,
Computer Graphics An Introduction. What’s this course all about? 06/10/2015 Lecture 1 2 We will cover… Graphics programming and algorithms Graphics data.
Chris Kerkhoff Matthew Sullivan 10/16/2009.  Shaders are simple programs that describe the traits of either a vertex or a pixel.  Shaders replace a.
A Crash Course in HLSL Matt Christian.
09/09/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Event management Lag Group assignment has happened, like it or not.
Ray Tracing Chapter CAP4730: Computational Structures in Computer Graphics.
1 Rendering Geometry with Relief Textures L.Baboud X.Décoret ARTIS-GRAVIR/IMAG-INRIA.
Rendering Overview CSE 3541 Matt Boggus. Rendering Algorithmically generating a 2D image from 3D models Raster graphics.
03/24/03© 2003 University of Wisconsin Last Time Image Based Rendering from Sparse Data.
Real-Time Relighting Digital Image Synthesis Yung-Yu Chuang 1/10/2008 with slides by Ravi Ramamoorthi, Robin Green and Milos Hasan.
Advanced Computer Graphics Advanced Shaders CO2409 Computer Graphics Week 16.
Real-time Graphics for VR Chapter 23. What is it about? In this part of the course we will look at how to render images given the constrains of VR: –we.
Adaptive Display Algorithmfor Interactive Frame Rates.
All-Frequency Shadows Using Non-linear Wavelet Lighting Approximation Ren Ng Stanford Ravi Ramamoorthi Columbia SIGGRAPH 2003 Pat Hanrahan Stanford.
Advanced Illumination Models Chapter 7 of “Real-Time Rendering, 3 rd Edition”
Image-Based Rendering of Diffuse, Specular and Glossy Surfaces from a Single Image Samuel Boivin and André Gagalowicz MIRAGES Project.
A Few Things about Graphics Jian Huang Computer Science University of Tennessee.
- Laboratoire d'InfoRmatique en Image et Systèmes d'information
Advanced Computer Graphics Spring 2014 K. H. Ko School of Mechatronics Gwangju Institute of Science and Technology.
Emerging Technologies for Games Deferred Rendering CO3303 Week 22.
Subject Name: Computer Graphics Subject Code: Textbook: “Computer Graphics”, C Version By Hearn and Baker Credits: 6 1.
Ray Tracing Fall, Introduction Simple idea  Forward Mapping  Natural phenomenon infinite number of rays from light source to object to viewer.
Single Pass Point Rendering and Transparent Shading Paper by Yanci Zhang and Renato Pajarola Presentation by Harmen de Weerd and Hedde Bosman.
COMPUTER GRAPHICS CS 482 – FALL 2015 SEPTEMBER 29, 2015 RENDERING RASTERIZATION RAY CASTING PROGRAMMABLE SHADERS.
Real-Time Dynamic Shadow Algorithms Evan Closson CSE 528.
1cs426-winter-2008 Notes. 2 Atop operation  Image 1 “atop” image 2  Assume independence of sub-pixel structure So for each final pixel, a fraction alpha.
Introduction to Parametric Curve and Surface Modeling.
Siggraph 2009 RenderAnts: Interactive REYES Rendering on GPUs Kun Zhou Qiming Hou Zhong Ren Minmin Gong Xin Sun Baining Guo JAEHYUN CHO.
1 Real-Time High-Quality View-dependent Texture Mapping using Per-Pixel Visibility Damien Porquet Jean-Michel Dischler Djamchid Ghazanfarpour MSI Laboratory,
Visualization Shading
Deferred Lighting.
The Graphics Rendering Pipeline
© University of Wisconsin, CS559 Fall 2004
(c) 2002 University of Wisconsin
UMBC Graphics for Games
RADEON™ 9700 Architecture and 3D Performance
Computer Graphics Introduction to Shaders
CIS 441/541: Introduction to Computer Graphics Lecture 15: shaders
Presentation transcript:

Interactive Cinematic Shading Where are we? Fabio Pellacini Dartmouth College

Cinematic Rendering non interactive: [Pellacini et al 2005] – geometric complexity 10 5 high-order primitives 10 6 shaded points – shader complexity ~10 3 individual shaders ~10 5 instructions ~5 GB textures

Cinematic Rendering artists want interactive preview previewing animation – crude models and appearance often good enough previewing lighting/shading – need highest quality possible – scalability in games has similar problems/solutions

Problem Statement given a production scene – geometry/shading specified in a prod. renderer render at guaranteed interactive rates – changing only shader parameters – fix view and geometry

Cinematic Relighting cinematic lighting is complex – major cost in movie production – poor interactive artists feedback relighting engines used for better feedback – take advance of static geometry and materials

Where are we? first systems appearing – tuned for particular productions by efficiently supporting the right subset of possible shading – prove that high quality is possible interactively – used in real productions: [Pellacini et al. 2005]

Where are we? Far far away… designed for lighting operations only – but would like to extend to any shading require careful tuning of shaders – often manual simplification/translation do not support all lighting primitives – raytracing, global illumination, DSOs, …

Relighting Engines Primer fundamental assumptions – fixed geometry – fixed camera basic algorithm principle: deferred shading – precompute visibility from camera viewpoint – precompute non-changing partial shading values – recompute shaders as parameters are edited

Shading Slicing and Caching given a shader of the form compute and store caches for each change, re-execute residual shader color shader(fixed[],changing[]) { caches[] = computeCaches(fixed); return computeResidual(caches, changing); }

Example simple lighting model – Phong direct illumination cache material and geometry values – computed in surface shader – e.g.: position, normal, diffuse, specular, etc… compute each light using caching

Shader Slicing and Caching where to caches? what to cache? how to execute residual shaders?

Caching Domain problem: where to store caches? solution: object surfaces – mesh vertices or textures solution: image samples – image pixels – standard deferred shading

Image Space Caching pros: guaranteed framerate – does not depend on geometric complexity cons: aliasing – can only store one/few samples per pixels otherwise caches become really large – hard to get handle hairs, motion blur, dof, etc…

Object Space Caching pros: allows for fully quality images – by using high quality filtering – exactly matches some renderers (Renderman) cons: recompute filtering – depends on geometry: cannot guarantee framerate – does not scale to fine geometry (hairs) – need a lot of samples for motion blur / dof

Caching Domain currently: image space caching research: faster object space and/or smaller image space

Shader Slicing problem: how to determine what to cache? – most shaders are not in the form shown before solution: manual slicing – artists write shader code in a “deferred form” solution: automatic slicing – compiler automatically determines what to cache

Manual Slicing pros: always works – code is written to match the caching mechanism cons: reduce coding flexibility – want to write code without worrying about caching – old shaders need to be rewritten cons: does not work if caching is changed – changing caching method might break the code

Automatic Slicing pros: compiler determines what to cache – [Guenter et al. 1995] – always correct cons: maybe not be optimal (memory) – store/compute ratio is hard to optimize very important to reduce cache sizes

Shader Slicing problem: cache sizes too large – lighting model requires too many material params solution: lossless slicing – previous methods we discussed solution: lossy slicing – remove some cache by simplifying lighting model

Lossy Slicing Example layered surface shader examples: rust on metal – [Pellacini et al. 2005] for each layer i finalColor = combineIntoFinalColor( computeLayer(layerParams[i],light) );

Lossy Slicing Example lossless caching memory/computation for each layer – but correct layerCache[i] = computeCache(layerParams[i]); for each layer i finalColor = combineIntoFinalColor( computeLayer(layerCache[i],light) );

Lossy Slicing Example lossy caching guarantees interactivity – but not correct for each layer i finalCache = combineIntoFinalCache( computeCache(layerParam[i]) ); finalColor = computeLayer(finalCache)

Shader Slicing currently: software relighting – automatic slicing / not realtime currently: GPU-based relighting – manual lossy slicing / realtime research: efficient and automatic GPU-based slicing

Residual Execution how to execute residual shaders – CPU: easy to do, but may not be fast enough – GPU: much harder, but faster will talk about this one

Residual Execution problem: residual shaders written in CPU language – how to translate them to GPU? solution: manual translation – artists manually create GPU version of shader solution: automatic translation – compiler translate shader versions

Manual Translation pros: works cons: takes time cons: does not scale to new GPUs – cannot adapt to new capabilities – same problem as games – but harder since lots of legacy shading code

Automatic Translation pros: compiler determines translation – various systems attempts to do this for Renderman cons: cannot support all CPU shading – does not know what to do in this case – covered later cons: might not be as efficient – computation structured differently on GPUs – CPU languages do not convey it well enough

Automatic Translation Renderman string operations – used for state binding: textures, matrices, etc. example: Ci = texture(“textureName”); problem: not a language transformation – GPU renderer has to load all possible textures

Automatic Translation Renderman shader plugins – any binary library that exposes interface – used heavily for all sort of things problem: cannot automatically translate – for example, allows for disk access from a shader

Automatic Translation Renderman derivatives – used to compute shading antialiasing problem: cannot automatically translate – unless GPU renderer has the same geometry than Renderman and uses multiple passes

Automatic Translation Renderman raytracing – used for shadow, reflection, indirect illumination problem: not supported efficiently on GPU – provide an external ray engine e.g. [Pellacini et al. 2005] problem: requires synching with CPU while shading

Shader Translation currently: manual translation – automatic translation does not cover the language currently: language extensions for GPU – Renderman, MentalRay, … research: automate translation – more of an engineering/compiler problem though

Residual Translation problem: residual might be too large – cannot guarantee interactivity solution: manual simplification – artists create shader simplifications solution: automatic simplification – automatically simplify shaders (not a compiler extension)

Manual Simplification pros: works somewhat – cannot tell how well it simplifies cons: (really) takes too much time – for large shaders, it is trial and error cons: (really) does not scale to new GPUs – performance evaluated on particular GPUs – same issue as game shader LODs

Automatic Simplification

Algorithm Overview input shader code 2·x + 1 Input Shader

Algorithm Overview apply simplification rules … 2·x + 1 const  exp → exp Input Shader Simplification Rules

Algorithm Overview … to generate candidates 2·x + 1 const  exp → exp 2·x2·xx + 1 Input Shader Simplification Rules Candidates

Algorithm Overview error is computed for each candidate 2·x + 1 const  exp → exp 2·x2·xx + 1 err (2·x + 1,x + 1)err(2·x + 1, 2·x) Input Shader Simplification Rules Candidates Error

Algorithm Overview choose lowest-error candidate 2·x + 1 const  exp → exp 2·x2·x x + 1 err (2·x + 1,x + 1)err(2·x + 1, 2·x) Input Shader Simplification Rules Candidates Error

Simplification Rules captures most simplifications const  exp → exp exp → average(exp) for-loop → drop 1 instance

Error Metric average image difference – uniform params: define domain – texture params: define texture set – varying params: define “mesh” set allow for changing parameters

Simplification Example #51,e=.35

Automatic Simplification pros: determine “optimal” simplification – can try many more options than a person cons: does not scale to large shaders – not sure how close to the “best possible” cons: no solution to simplify data and code – [Olano et al. 2003] simplifies texture – [Pellacini 2005] simplified code – but hard to find a complete solution

Residual Simplification currently: manual simplification for GPUs currently: no simplification for CPU relighting research: better simplification – numerical-vs-structural

Where are we? realtime relighting is possible – manually translated/simplified shaders on GPUs – not many advanced lighting effects but new work on the way indirect illumination [Hasan et al. 2006] – essentially production “customized” some approximations/solution only works for some productions

What can we not do? moving camera / dynamic scenes hairs / volumes really long and arbitrary CPU shaders dynamic indirect illumination this is future work for us research folks!

What did we learn? long/arbitrary shaders might not be needed – [Pellacini et al. 2005] shows that really simplified shaders look almost right

What did we learn? shaders do not express right abstractions – impossible to derive new algorithms since shaders are arbitrary – but are perfect for low-level GPU programming

What did we learn? (sadly) manual optimizations work – even for “simple” shaders: automatic translation, simplification, optimization not fruitful enough – they will never work for complex lighting/geometry effects (indirect, hair) since it requires changing the algorithm, not the code

What did we learn? current goal: interactive renderer approximates offline better goal: offline renderer beautifies interactive – long term think about interactive rendering only – have the batch renderer make a “cleaner” picture