Advanced rendering techniques 4/2/02. Rendering for animation The big difference: real time vs. off-line Real time: sacrifice quality for performance.

Slides:



Advertisements
Similar presentations
Ray tracing. New Concepts The recursive ray tracing algorithm Generating eye rays Non Real-time rendering.
Advertisements

Graphics Pipeline.
Computer graphics & visualization Global Illumination Effects.
3D Graphics Rendering and Terrain Modeling
Virtual Realism LIGHTING AND SHADING. Lighting & Shading Approximate physical reality Ray tracing: Follow light rays through a scene Accurate, but expensive.
Part I: Basics of Computer Graphics
Illumination Model & Surface-rendering Method 박 경 와.
1Notes  Assignment 1 is out, due October 12  Inverse Kinematics  Evaluating Catmull-Rom splines for motion curves  Wednesday: may be late (will get.
CS6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003 Object-Order vs. Screen-Order Rendering April 24, 2003.
Computer Graphics (Fall 2005) COMS 4160, Lecture 16: Illumination and Shading 1
(conventional Cartesian reference system)
Ray Casting Ray-Surface Intersections Barycentric Coordinates Reflection and Transmission [Shirley, Ch.9] Ray Tracing Handouts Ray Casting Ray-Surface.
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
Global Illumination May 7, Global Effects translucent surface shadow multiple reflection.
7M836 Animation & Rendering
Ray Tracing Outline For each pixel { Shoot ray r from eye to center of pixel with trace( r ) } function trace( r ) For each object { Find object with closest.
Paper by Alexander Keller
Shading Languages By Markus Kummerer. Markus Kummerer 2 / 19 State of the Art Shading.
CS6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003 RenderMan & Its Shading Language.
Basic Ray Tracing CMSC 435/634. Visibility Problem Rendering: converting a model to an image Visibility: deciding which objects (or parts) will appear.
Fundamentals of Computer Graphics Part 6 Shading prof.ing.Václav Skala, CSc. University of West Bohemia Plzeň, Czech Republic ©2002 Prepared with Angel,E.:
1 Perception, Illusion and VR HNRS 299, Spring 2008 Lecture 19 Other Graphics Considerations Review.
COMP 175: Computer Graphics March 24, 2015
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
Programmable Pipelines. Objectives Introduce programmable pipelines ­Vertex shaders ­Fragment shaders Introduce shading languages ­Needed to describe.
Computer graphics & visualization REYES Render Everything Your Eyes Ever Saw.
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.
Programmable Pipelines. 2 Objectives Introduce programmable pipelines ­Vertex shaders ­Fragment shaders Introduce shading languages ­Needed to describe.
University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell Texture Mapping.
-Global Illumination Techniques
Project Raytracing. Content Goals Idea of Raytracing Ray Casting – Therory – Practice Raytracing – Theory – Light model – Practice Output images Conclusion.
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.
Computer Science Term 1, 2006 Tutorial 5 The Final Exam.
Rendering Overview CSE 3541 Matt Boggus. Rendering Algorithmically generating a 2D image from 3D models Raster graphics.
Basic Ray Tracing CMSC 435/634. Visibility Problem Rendering: converting a model to an image Visibility: deciding which objects (or parts) will appear.
Stream Processing Main References: “Comparing Reyes and OpenGL on a Stream Architecture”, 2002 “Polygon Rendering on a Stream Architecture”, 2000 Department.
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.
1 Perception and VR MONT 104S, Fall 2008 Lecture 21 More Graphics for VR.
Graphics Graphics Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
Ray Tracing Fall, Introduction Simple idea  Forward Mapping  Natural phenomenon infinite number of rays from light source to object to viewer.
MIT EECS 6.837, Durand and Cutler The Graphics Pipeline: Projective Transformations.
CS559: Computer Graphics Final Review Li Zhang Spring 2010.
COMPUTER GRAPHICS CS 482 – FALL 2015 SEPTEMBER 29, 2015 RENDERING RASTERIZATION RAY CASTING PROGRAMMABLE SHADERS.
Where We Stand So far we know how to: –Transform between spaces –Rasterize –Decide what’s in front Next –Deciding its intensity and color.
Real-Time Dynamic Shadow Algorithms Evan Closson CSE 528.
RENDERING : Global Illumination
CSE 681 Introduction to Ray Tracing. CSE 681 Ray Tracing Shoot a ray through each pixel; Find first object intersected by ray. Image plane Eye Compute.
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.
Computer Graphics Ken-Yi Lee National Taiwan University (the slides are adapted from Bing-Yi Chen and Yung-Yu Chuang)
Basic Ray Tracing CMSC 435/634.
© University of Wisconsin, CS559 Spring 2004
Photorealistic Rendering vs. Interactive 3D Graphics
Programmable Pipelines
Deferred Lighting.
3D Graphics Rendering PPT By Ricardo Veguilla.
ATCM 6317 Procedural Animation
Unit-7 Lighting and Shading
The Graphics Rendering Pipeline
Understanding Theory and application of 3D
© University of Wisconsin, CS559 Fall 2004
(c) 2002 University of Wisconsin
(c) 2002 University of Wisconsin
Image.
CS5500 Computer Graphics May 29, 2006
Illumination Model 고려대학교 컴퓨터 그래픽스 연구실.
Presentation transcript:

Advanced rendering techniques 4/2/02

Rendering for animation The big difference: real time vs. off-line Real time: sacrifice quality for performance Hardware support necessary Use polygons and scanline rendering Use simple lighting models  Phong+diffuse+ambient New hardware might change this Applications: interactive systems Games Walkthroughs

Off-line rendering Primary goal: get the “right” appearance Less concern about time Done in software – great flexibility Not only triangles Not only Phong Can use different rendering techniques Raytracing Radiosity REYES

Ray tracing The idea: follow light propagation through the scene Algorithm: Shoot a ray through eye position and pixel center Determine the first surface it intersects with Compute surface color: Shoot new rays to light sources (shadow rays) If blocked, no contribution Account for surface reflection, light and viewing direction

Recursive ray tracing If surface is a mirror: Shoot new ray in mirror direction Repeat the process If surface is diffuse: Terminate Alternative: shoot a ray in random direction Called pathtracing – very slow Always terminate once contribution is small Rays carry light energy

Stochastic supersampling Ray through the pixel center – aliasing artifacts Increase number of rays per pixel, average results supersampling Better if point is chosen randomly Stochastic sampling  Turn regular artifacts into noise

Advantages / disadvantages Mirror reflections / refractions are easy Arbitrary surface reflectance properties BRDFs Diffuse interreflections are difficult Can be very slow Need extra acceleration datastructures  Grids, octrees, etc. With these, speed is ok on modern machines Scanline performance: number of objects Raytracing performance: image resolution

Radiosity Assumption: all surfaces are Lambertian Uniformly diffuse Split all surfaces into patches Chose a point on each patch Light reflected from a patch at a point = linear combination of light from other points Coefficients depends on mutual arrangement

Radiosity Write equations of light transfer Compute patch-to-patch transfer coefficients Form factors Solve this system Get patch color at one point Interpolate to get color everywhere on the patch

Radiosity Lots of different algorithms to: Split surfaces into patches  Respecting shadow boundaries, etc. Compute form factors Solve radiosity system of equations  Efficient methods for special “sparse” systems  Take into account only significant energy exchanges Some form is implemented in Blender

Advantages / disadvantages Very nice images of diffuse environments A rather complex algorithm Form factor computation is slow Does not handle mirrors Some form of raytracing is needed Currently somewhat decreasing in popularity

REYES system Champion in longevity Created in mid-80s by what now Pixar Basis for RenderMan – standard rendering tool for movie industry 1993 Academy award (“Oscar”) Major ideas: Splitting and dicing of primitives Surface shaders

Splitting and dicing Determine if a primitive is on the screen Compute primitive size on the screen Use bounding boxes Split if the size is “too large” Dicing – conversion to a “grid” Tesselation into mycropolygons  Size is about 1 pixel Their vertices are shaded

Shader concept Primitives have shaders attached to it Shader – program which determines relevant parameters Not only surface color (surface shaders) Displacement shaders Light shaders Volume shaders Imager shaders (BMRT only)

Visible surface determination Determine which pixels are affected by micropol. Each pixel has list of sample positions Stochastic point samples Test which are covered by a micropol. Each sample has associated visible point list Includes depth and transparency Once done, determine pixel color

Enhanced REYES Memory usage problem Visible point lists are huge Use buckets – small pixel regions Sort primitives into buckets Process one bucket at a time Occlusion culling Sort primitives by depth in each bucket Process close objects first

RenderMan / BMRT 4/4/02

RenderMan rendering interface RenderMan also specifies a rendering interface Independent of implementation REYES system in Pixar’s RenderMan Raytracing in BMRT Mostly transparent for the user Analog: OpenGL is an interface Hardware support – driver hides the details Software implementation (Mesa)

RenderMan interface Scene description file.rib (RenderMan interface bytestream) Compiled shaders.slc – used by RenderMan directly Shading language High level C-like language.sl – run a compiler to convert into.slc

Using RenderMan It is run from a command line Run “setenv” first to set up paths rgl – fast OpenGL previewer Good for geometry/lights/camera positioning Usage: rgl ribname.rib slc - shader language compiler : slc shadername.sl Produces shadername.slc Need to do this for all shaders used

Using RenderMan rendrib is the renderer rendrib ribname.rib Creates output according to rib specs Use –d to get display output directly -d 16 to get multiresolution approximation Raytracing complex scenes can be slow Debug shaders on simple geometry

.rib file anatomy Global options Frame block Next frame block Another world block World block Attributes, lights, primitives Changed options Image options Camera options

Parameter declarations Can declare parameters with Declare “name” “declaration” declaration is an analog of type  class type actually Type = float, color, vertex, vector, normal, point, string, matrix This is global In-line decraration – only in particular command “ class type name ”

Attribute blocks Everything between AttributeBegin and AttributeEnd Inherits attribute state of the parent Manipulates it, assigns to geometric primitives Attribute state: color/shaders attached Transformation matrices TransformBegin / TransformEnd push/pop transform matrices

Transformations Applies to local coord system Rotate angle vx vy vz Scale sx sy sz Skew angle vx vy vz ax ay az ConcatTransform matrix Identity Transform matrix

Special coord systems Camera space Origin at the camera, Z+ in front, Y+ is up Left-handed !!! Created with  Projection type parameterlist Everything else is relative to it Before WorldBegin – form world-to-camera matrix Each object/shader created according to current transform matrix Coord system is stored as “object” / “shader” space

Geometry Quadrics: Sphere, cylinder, cone, paraboloid, hyperboloid, disk, torus Polygons and meshes: Polygon, GeneralPolygon, PointsPolygon, PointsGeneralPolygon Parametric patches and NURBS: Basis, Patch, PatchMesh, NuPatch Other: trim curves, subdivision meshes, CSG

Primitive variables Attached to geometric primitives Can be referred to directly: “P”, “Pw”, “N”, “Cs”, “Os”, “st” These are: Position in 3D (P), and in hc (Pw) Normal (N) Surface color (Cs) and opacity (Os) Texture coords (st)

Shaders In.rib file, created by: Surface “shadername” parameterlist Displacement “shadername” parameterlist Parameters are passed to the shader program Written in special shading language Has access to some global variables Sets some global variables Final surface color Ci and opacity Oi Can also modify position P and normal N  Displacement shader

A simple shader Surface metal (float Ka = 1, Ks = 1; float roughness =.1;) { normal Nf = faceforward (normalize(N),I); vector V = -normalize(I); Ci = Cs * (Ka*ambient() + Ks*specular(Nf,V,roughness)); Oi = Os; Ci *= Oi; }

Simple shader usage In.rib file the usage will be: AttributeBegin Translate Color Surface "metal" "roughness" [0.3] "Ks" [1.5] ReadArchive "vase.rib" AttributeEnd

Simple shader notes Global variables: N, I, Oi, Os, Ci, Cs Sets final surface color Ci Cs is from.rib file Parameters Ka, Ks, roughness are from shader parameterlist in.rib Shader language functions: Uses default ambient() and specular(…) to do actual computation  There is also diffuse(…) Normalize(), faceforward()

Lights and illumination Can access light information in illumination loops color diffuse (normal Nn){ extern point P; color C=0; illuminance(P,Nn,PI/2){ C+=Cl*(Nn. Normalize(L)) } return C; } Loops over all visible lights from P which are within PI/2 from Nn

BMRT BMRT implements RenderMan interface But it is a raytracer Extra features available color trace(point from; vector dir) returns incoming light from dir Also Fulltrace, rayhittest, visibility, etc. RayTrace(…) – stochastic supersampling Easy to do reflections

Simple shader using raytracing color MaterialShinyMetal (normal Nf; color basecolor; float Ka, Kd, Ks, roughness, Kr, blur; uniform float twosided; DECLARE_ENVPARAMS;) { extern point P; extern vector I; extern normal N; float kr = Kr;

…continued if (twosided == 0 && N.I > 0) kr = 0; vector IN = normalize(I), V = -IN; vector R = reflect (IN, Nf); return basecolor * (Ka*ambient() + Kd*diffuse(Nf) + Ks*specular(Nf,V,roughness) + SampleEnvironment (P, R, kr, blur, ENVPARAMS)); }

Notes on raytracing shader Mostly as before SampleEnvironment calls RayTrace Also includes environment mapping See reflections.h ENVPARAMS is a bunch of stuff controlling ray tracing / env. mapping Number of samples, env.map name, etc.

Concluding notes Real power of RenderMan is in its flexibility Want complex appearance – just write a shader function Hundreds of parameters for complex shaders Will see more on procedural techniques later in the course Including possibilities for some interesting shaders Assignment 5 asks you to play with shaders And write a few of your own…