Computer Graphics Ken-Yi Lee National Taiwan University (the slides are adapted from Bing-Yi Chen and Yung-Yu Chuang)

Slides:



Advertisements
Similar presentations
Computer Graphics - Shading -
Advertisements

Polygon Rendering Flat Rendering Goraud Rendering Uses Phong Reflectance Phong Rendering.
1 Graphics CSCI 343, Fall 2013 Lecture 18 Lighting and Shading.
3D Graphics Rendering and Terrain Modeling
CSPC 352: Computer Graphics
Virtual Realism LIGHTING AND SHADING. Lighting & Shading Approximate physical reality Ray tracing: Follow light rays through a scene Accurate, but expensive.
Light Issues in Computer Graphics Presented by Saleema Amershi.
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.
Based on slides created by Edward Angel
Illumination Model & Surface-rendering Method 박 경 와.
1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 Shading I.
University of New Mexico
Computer Graphics - Class 10
Rendering (彩現 渲染).
IMGD 1001: Illumination by Mark Claypool
Computer Graphics (Fall 2005) COMS 4160, Lecture 16: Illumination and Shading 1
Lighting and Shading Wen-Chieh (Steve) Lin
(conventional Cartesian reference system)
1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.
7M836 Animation & Rendering
Objectives Learn to shade objects so their images appear three- dimensional Learn to shade objects so their images appear three- dimensional Introduce.
6.1 Vis_04 Data Visualization Lecture 6 - A Rough Guide to Rendering.
Coordinate Systems X Y Z (conventional Cartesian reference system) X Y Z.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Shading I Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
Lighting & Shading.
CS 480/680 Computer Graphics Shading I Dr. Frederick C Harris, Jr.
CSC418 Computer Graphics n Raytracing n Shadows n Global Illumination.
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.:
CS 445 / 645: Introductory Computer Graphics
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Shading (introduction to rendering). Rendering  We know how to specify the geometry but how is the color calculated.
COMPUTER GRAPHICS CS 482 – FALL 2014 AUGUST 27, 2014 FIXED-FUNCTION 3D GRAPHICS MESH SPECIFICATION LIGHTING SPECIFICATION REFLECTION SHADING HIERARCHICAL.
Computer Graphics Panos Trahanias ΗΥ358 Spring 2009.
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
CSC418 Computer Graphics n Illumination n Lights n Lightinging models.
CS447/ Realistic Rendering -- Radiosity Methods-- Introduction to 2D and 3D Computer Graphics.
Rendering Overview CSE 3541 Matt Boggus. Rendering Algorithmically generating a 2D image from 3D models Raster graphics.
University of Texas at Austin CS 378 – Game Technology Don Fussell CS 378: Computer Game Technology Basic Rendering Pipeline and Shading Spring 2012.
111/17/ :21 Graphics II Global Rendering and Radiosity Session 9.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
Illumination and Shading
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
CS 325 Introduction to Computer Graphics 03 / 29 / 2010 Instructor: Michael Eckmann.
Graphics Graphics Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.
Lecture Fall 2001 Illumination and Shading in OpenGL Light Sources Empirical Illumination Shading Transforming Normals Tong-Yee Lee.
Local Illumination and Shading
Illumination and Shading Prof. Lizhuang Ma Shanghai Jiao Tong University.
Where We Stand So far we know how to: –Transform between spaces –Rasterize –Decide what’s in front Next –Deciding its intensity and color.
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
Render methods. Contents Levels of rendering Wireframe Plain shadow Gouraud Phong Comparison Gouraud-Phong.
CDS 301 Fall, 2008 From Graphics to Visualization Chap. 2 Sep. 3, 2009 Jie Zhang Copyright ©
OpenGL Shading. 2 Objectives Learn to shade objects so their images appear three-dimensional Introduce the types of light-material interactions Build.
Lighting and Reflection Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
Illumination Models. Introduction 1 Illumination model: Given a point on a surface, what is the perceived color and intensity? Known as Lighting Model,
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
Computer Graphics: Illumination
Computer Graphics (Fall 2006) COMS 4160, Lecture 16: Illumination and Shading 1
Illumination Models and Surface-Rendering Methods CEng 477 Introduction to Computer Graphics.
Illumination and Shading. Illumination (Lighting) Model the interaction of light with surface points to determine their final color and brightness OpenGL.
Illumination and Shading Prof. Lizhuang Ma Shanghai Jiao Tong University.
Chapter 10: Computer Graphics
Chapter 14 Shading Models.
Isaac Gang University of Mary Hardin-Baylor
Illumination and Shading
Chapter 14 Shading Models.
Illumination Model 고려대학교 컴퓨터 그래픽스 연구실.
Illumination Model 고려대학교 컴퓨터 그래픽스 연구실.
CS 480/680 Computer Graphics Shading.
Presentation transcript:

Computer Graphics Ken-Yi Lee National Taiwan University (the slides are adapted from Bing-Yi Chen and Yung-Yu Chuang)

Illumination and Shading  Illumination Models Phong Illumination Model  Shading Models for Polygons  Shadows  Transparency  Global Illumination  Recursive Ray Tracing  Radiosity  The Rendering Pipeline

Illumination Models  Interaction of light with the surface. Viewing Objects (Shape & Color) Light Sources Reflectance

Light Source Models  Real light sources are complicated.  General light sources are difficult to work with. The number of light paths between a light source and a point on the surface may not be only one but infinity.

Simple Light Source Models  Point Light Position and Color (Intensity)  Directional light Direction and Color (Intensity)  Spotlight Direction, Cone angle, Color (Intensity), etc.  Ambient Light Color (Intensity) Less parameters Efficient computation Less parameters Efficient computation

Illumination Models  Interaction of light with the surface. Reflectance Light Sources

Interaction of Light with a Point Incident Light Reflected Light Normal Surface Refracted Light Absorption Reflection Refraction

Reflectance Models smooth surfacerough surface

Simple Reflectance Models  Specular Reflectance  Diffuse Reflectance (Lambertian)

[Recap] Illumination Models  Interaction of light with the surface. Viewing Objects (Shape & Color) Light Sources Reflectance

Direct/Indirect Lighting Direct LightingDirect + Indirect Lighting

Local/Global Illumination  Local Illumination Only consider the relationship between light sources and a single primitive  When you calculate the illumination, you won’t need the information of any other primitive.  Global Illumination Consider the relationship between light sources and all primitives  When you calculate the illumination, you should take other primitives into account.

Phong Illumination Model  A local illumination model that can be computed rapidly  Three components: Ambient (Indirect lighting) Diffuse Specular ambientdiffuse specular

Ambient Component  The component approximates the indirect lighting by a constant.  : ambient light intensity (color)  : ambient reflection coefficient (0 ~ 1)  : color of the object Light Source PropertyMaterial Property

Diffuse Component  The component describes the diffuse reflection of rough surfaces.  : intensity (color) of the point light source  : diffuse reflection coefficient (0 ~ 1)  : color of the object θ N Lambertian Cosine Law

Examples Diffuse reflection component with different ambient and diffuse reflection components with different and

Specular Reflectance

Specular Component  The component describes the specular reflection of smooth (shiny/glossy) surfaces.  : intensity (color) of the point light source  : specular reflection coefficient (0 ~ 1)  : shininess N R V L

Shininess ( ) n=1 n=2 n=3 n=10

Examples

Comparison diffusediffuse + specular

Phong Illumination Model ambientdiffuse specular ambientdiffusespecular

Light Source Attenuation  Light source attenuation determines how fast the light intensity (color) decreases with distance.  : attenuation factor  : constant, linear, and quadratic attenuation coefficient  : distance from light source to object

Phong Illumination Model N R V L θ

Reflection Vector ( )

The Halfway Vector ( ) (Blinn-Phong)

Multiple Light Sources  If there are light sources, then

Shading Models for Polygons  Why we need shading ?  Shading models: Flat Shading Gouraud Shading Phong Shading

Flat Shading  Same normal, light vector and view vector across whole polygon Compute illumination only once for each polygon

Gouraud Shading  Interpolate the intensities computed at vertices

Intensity Interpolation

Comparison Flat Shading Gouraud Shading

Smoothed Normal Vector Gouraud Shading Phong Shading

 Interpolate the normal vectors of vertices, and compute illumination at each pixel

Normal Interpolation

Gouraud v.s. Phong Shading GouraudPhongGouraudPhong

Flat Shading

Gouraud Shading

Phong Shading

Texture Mapping = Pattern Mapping

Bump Mapping & Displacement Mapping Copyright©2003, Microsoft

The Rendering Pipeline  Local Illumination Pipelines z-buffer and Gouraud shading z-buffer and Phong shading list-priority algorithm and Phong shading

Rendering Pipeline for z-buffer & Gouraud shading (OpenGL) Viewing transformation db traversal Modeling transformation Trivial accept / reject LightingClipping Divide by W, map to 3D viewport RasterizationDisplay

Rendering Pipeline for z-buffer & Phong shading (OpenGL with GLSL) Viewing transformation db traversal Modeling transformation Trivial accept / reject Clipping Divide by W, map to 3D viewport Rasterization (with lighting) Display

Rendering Pipeline for list-priority algorithm & Phong shading Viewing transformation db traversal Modeling transformation Trivial accept / reject Clipping Divide by W, map to 3D viewport Rasterization (with lighting) Display Preliminary visible-surface determination New db New db traversal

Global Effects  Some global effects are very important to visual quality. Therefore, we may want to utilize the existing rendering pipeline (local illumination model) to add (approximated) global effects. Use multiple passes with per-pixel buffers  Common global effects : Shadow Transparency

Shadows   How to determine ? Shadow mapping  Not accurate enough Shadow volumes  Performance issues

Scan-Line Generation of Shadows Viewer Light Current scan line A A’A’ B a b c d

Shadow Volumes Light Object A B C shadow polygons

Shadow Volumes z x A B C V

Transparency  Blending  Z-buffer Turn off

Global Illumination  Popular methods: Ray Tracing  Static view  View-dependent effect Radiosity  Static light (diffuse scene) from Wikipedia

Ray Tracing

Recursive Ray Tracing  Only consider three directions: Perfect reflected ray Perfect refracted ray Shadow ray Perfect reflected ray Shadow ray Perfect refracted ray

Reflection

Ray Tracing Results

Monte Carlo Ray Tracing  Randomly select one direction: Tracing ray Shadow ray

Ray Tracing Results

Radiosity  Split the scene into many patches  Simulate light transmission between every patch pair. Assume diffuse reflectance

The Radiosity Equation (1)  : radiosity of patch : rate at which light is emitted from patch : reflectivity of patch : form factor (configuration factor) : area of patch  since  thus

The Radiosity Equation (2)  rearranging terms  therefore  progressive refinement

Computing Form Factors visible or invisible 1 0

Hemisphere

Hemicube

Rendering Pipeline for radiosity & Gouraud shading (OpenGL) Viewing transformation db traversal Modeling transformation Trivial accept / reject Clipping Divide by W, map to 3D viewport RasterizationDisplay Vertex intensity calculation using radiosity method New db New db traversal

Rendering Pipeline for ray tracing db traversal Modeling transformation Ray tracingDisplay