Rendering & Compositing

Slides:



Advertisements
Similar presentations
Exploration of advanced lighting and shading techniques
Advertisements

CS123 | INTRODUCTION TO COMPUTER GRAPHICS Andries van Dam © 1/16 Deferred Lighting Deferred Lighting – 11/18/2014.
Ray tracing. New Concepts The recursive ray tracing algorithm Generating eye rays Non Real-time rendering.
Computer graphics & visualization Global Illumination Effects.
Real-Time Rendering Self-Shadowing
Week 9 - Wednesday.  What did we talk about last time?  Fresnel reflection  Snell's Law  Microgeometry effects  Implementing BRDFs  Image based.
Chapter 5 Develop a PSA & Commercial Using Premiere Pro & After Effects CS6.
1Notes  Assignment 1 is out, due October 12  Inverse Kinematics  Evaluating Catmull-Rom splines for motion curves  Wednesday: may be late (will get.
(conventional Cartesian reference system)
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,
1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.
CS6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003 RenderMan & Its Shading Language.
1cs426-winter-2008 Notes  RenderMan resources up on the website  We will be using Pixie this term Check on the website soon (installed on CS linux.
09/18/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Bump Mapping Multi-pass algorithms.
RenderMan (Shading Language: Concepts)
COMP 261 Lecture 14 3D Graphics 2 of 2. Doing better than 3x3? Translation, scaling, rotation are different. Awkward to combine them. Use homogeneous.
GPU Programming Robert Hero Quick Overview (The Old Way) Graphics cards process Triangles Graphics cards process Triangles Quads.
Programmable Pipelines. Objectives Introduce programmable pipelines ­Vertex shaders ­Fragment shaders Introduce shading languages ­Needed to describe.
Programmable Pipelines. 2 Objectives Introduce programmable pipelines ­Vertex shaders ­Fragment shaders Introduce shading languages ­Needed to describe.
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.
Kansas State University Department of Computing and Information Sciences CIS 736: Advanced Computer Graphics Monday, 24 April 2006 Shaun Budhram (Slides.
RenderMan Introduction CS 551/645 Fall Evaluate Me! Please visit the SEAS main website and use the ‘Course Evaluations’ button to rate this class.
Programmable Pipelines Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts Director, Arts Technology Center University.
Global Illumination. Local Illumination  the GPU pipeline is designed for local illumination  only the surface data at the visible point is needed to.
Real-Time Depth Buffer Based Ambient Occlusion
Rendering & Compositing Jeremy Huddleston Companion Maya/Renderman/Shake Data:
Ray Tracing Fall, Introduction Simple idea  Forward Mapping  Natural phenomenon infinite number of rays from light source to object to viewer.
COMPUTER GRAPHICS CS 482 – FALL 2015 SEPTEMBER 29, 2015 RENDERING RASTERIZATION RAY CASTING PROGRAMMABLE SHADERS.
Advanced rendering techniques 4/2/02. Rendering for animation The big difference: real time vs. off-line Real time: sacrifice quality for performance.
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
Ambient Occlusion Patrick Cozzi University of Pennsylvania CIS Fall 2013.
Layered Media / Subsurface Scattering (1)
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
1© 2009 Autodesk Hardware Shade – Presenting Your Designs Hardware and Software Shading HW Shade Workflow Tessellation Quality Settings Lighting Settings.
Compositing and Rendering
Visualization of Scanned Cave Data with Global Illumination
- Introduction - Graphics Pipeline
Review Game 2.
Discrete Techniques.
Real-Time Soft Shadows with Adaptive Light Source Sampling
© University of Wisconsin, CS559 Spring 2004
Photorealistic Rendering vs. Interactive 3D Graphics
Chapter X Advanced Texturing
Visualization Shading
Programmable Pipelines
Rendering, Cameras & Lighting
Chapter 13: Let There Be Light: Lighting Your Shot
Introducing Blender.
Deferred Lighting.
ATCM 6317 Procedural Animation
Unit-7 Lighting and Shading
Assignment 8 Chess Game.
CS451Real-time Rendering Pipeline
Introducing Blender.
Introducing Blender.
GPU Graphics Gary J. Katz University of Pennsylvania CIS 665
Lighting.
Chapter XVI Texturing toward Global Illumination
UMBC Graphics for Games
Fundamentals of Computer Graphics Part 6 Shading
Computer Graphics 4Practical Lesson
Patrick Cozzi University of Pennsylvania CIS Fall 2012
Programmable Shading May 15, 2006.
Procedural Animation Lecture 2: 3D & Houdini basics
Last Time Liang-Barsky Details Weiler-Atherton clipping algorithm
V-RAY FOR 3DS MAX Global Illumination for Interior Scenes
CIS 441/541: Introduction to Computer Graphics Lecture 15: shaders
Frame Buffer Applications
Artistic Rendering Final Project Initial Proposal
Directional Occlusion with Neural Network
Presentation transcript:

Rendering & Compositing Jeremy Huddleston Companion Maya/Renderman/Shake Data: http://cloud.cs.berkeley.edu/~cnm/lectures/S09

Helpful Resources Misc CG Tutorials with a CS-slant http://www.fundza.com RMS 3.0 Documentation http://cloud.cs.berkeley.edu/~cnm/pixar/docs/RMS_3 The RenderMan Shading Language Guide http://amzn.to/ecLmyp

Ambient Occlusion (1/4) Percentage of hemisphere around a point which is occluded by other objects. Usually rendered out as the percent not occluded for visualization:

Ambient Occlusion (2/4) Enable Ray Tracing! ConeAngle: Samples: Rays are cast out from the point being shaded through a cone with this characteristic angle (measured from the central axis to the edge). Default = pi / 2 => Hemisphere Samples: The number of rays to cast at each point. MaxDist: Objects over this far away are considered to not occlude the point.

Ambient Occlusion (3/4) Method: Choose between using occlusion() and gather(). gather() is computationally more expensive but offers better results. occlusion() uses the knowledge that small changes in P result in small changes in occlusion to produce a good approximation.

Ambient Occlusion (4/4) surface amboccl(uniform float samples = 32; uniform float useFastOccl = 0; uniform float maxdist = 1e30; uniform float coneangle = PI/2) { normal Nf = faceforward(normalize(N), I); float occ; if(useFastOccl != 0) { occ = occlusion(P, Nf, samples, "maxdist", maxdist, "coneangle", coneangle, "distribution", "cosine"); } else { float hits = 0; gather("illuminance", P, Nf, coneangle, samples, "distribution”, "cosine", "maxdist", maxdist) { hits += 1; } occ = hits / samples; Ci = 1 - occ; Oi = 1; Cs: Surface Color (input color) N: Normal at point Ci: Final surface color (output color) faceforward() returns a copy of the surface normal forced to face the incident ray (same as view vector if no ray tracing) (I)

MtoR Demo Shader Compilation Shader -> Slim Remderman Globals which shader shader amboccl.sl

Scene File Organization Use references and versioning Save versioned files as _###.ma suffix AND the latest one also as _latest.ma Always reference _latest.ma Shading/lighting files reference master lighting file Master lighting file references animation file Animation file references geometry file

Object Sets (1/3) MtoR can use Maya sets to determine which objects to render Renderman Globals->Accel: Create sets early (in your geometry file), so you have consistency in later files

Object Sets (2/3) For each set you render, change: Renderman Globals->Display->Display Name Renderman Globals->Accel->Select By Set This is easily scriptable in MEL: mtor control getvalue -sync; string $prefix="cornell_keyfill_"; string $sets[] = {"Cone", "Torus", "Cube”, "Box"}; for($set in $sets) { string $dspyName = $prefix + $set; string $setName = $set + "Set"; mtor control setvalue -rg dspyName -value $dspyName; mtor control setvalue -rg selectedSet -value $setName; mtor control renderspool; }

Object Sets (3/3) RFM can do the same thing with the settings in RenderMan Controls->Final

Shaders for Secondary Displays Declare extra output channels by using the ‘varying’ keyword: surface testsurf(output varying color half=0;) { half = Cs * 0.5; Ci = Cs; Oi = Os; }

MtoR Secondary Displays You can select additional channels (like the one defined in the previous slide) to output with the Renderman Globals.

Light Groups (1/2) Save light contributions from different light sources to different files in a single pass. Write custom light shaders that take an extra parameter to set which group they belong to. light pointlight_grouped(float intensity = 1; color lightcolor = 1; float falloff= 0; point from = point "shader" (0,0,0); uniform float group_id = 0;) { illuminate (from) { Cl = intensity * lightcolor; if(falloff == 1) { Cl *= 1.0 / length(L); } else if (falloff == 2) { Cl *= 1.0 / (L . L); }

Light Groups (2/2) Write custom surface shaders that take advantage of the light’s group_id parameter (this is a simplified version of the swissPhong.sl shader): surface matte_indexed (float Kd = 1; float Ka = 1; output varying color light_amb = 0; output varying color light_0 = 0; output varying color light_1 = 0;) { color lt_ar[2] = {0, 0}; normal Nf = faceforward (normalize(N),I); light_amb = ambient(); Ci = Cs * Ka * light_amb; Ci += Cs * Kd * diffuse_indexed(Nf, lt_ar); Oi = Os; Ci *= Oi; light_0 = lt_ar[0]; light_1 = lt_ar[1]; } color diffuse_indexed( normal Nn; output color lt_ar[4];) { color C = 0; extern point P; illuminance (P, Nn, PI/2) { uniform float id=0; lightsource (”group_id", id); float scale=(normalize(L).Nn); color curCol = Cl * scale; C += curCol; lt_ar[id] += curCol; } return C;

Shadows (1/4) Step 1: Replace point lights with spot lights. Point lights require 6 shadow maps! Step 2: Create your light shaders. Step 3: Apply a shadowmap to your light shader:

Shadows (2/4) Step 4: Turn off laziness to force shadowmap to be built. If you choose ‘Use Global’, you can control laziness from Renderman Globals->Accel. Step 5: Explicitly set the file parameter, so the same shadow map is used for each object set. Step 6: Turn off file cleanup, so the shadow map doesn’t get deleted: RMGlobals->Spool->Job Setup Under Cleanup, make sure ‘map’ is disabled.

Shadows (3/4) Step 7: Apply the shadow shader to all objects: surface shadow_surface() { illuminance (P) { Ci = Cl; Oi = 1; } Step 8: Render to produce your shadow map. Step 9: Turn on laziness, so the map won’t get recomputed. Step 10: Render object sets as normal

Shadows (4/4)

General Render Settings (1/2) Do image-space processing in comp Avoid quantize, dither, blur etc. If you want to anti-alias, increase resolution and store the data for your compositor For storing the z-buffer, do one of: Use “mayaiff” or “openexr” file type witn “rgbaz” Use “rgba” for one pass and “rgbz” for others Do standalone depth layers (use a varying output)

General Render Settings (2/2) Set RM Globals->Reyes->Shading Rate below 1.0 for final render and around 10.0 for testing. Short on disk space? Spool->Job Setup->RIB Generation->Deferred Spool->Job Setup->RIB Format->gzipped-ascii

Misc Tips of the Trads Keyframe or lock EVERYTHING Don’t Autokeyframe Always save maya scenes as ascii. It’s MEL Easier to recover corruption or backport Text processors: sed, grep, etc.

Shake Demo Dither Viewing Z Shot Compositing