Computer Graphics. Illumination and Shading

Similar documents
CPSC / Illumination and Shading

CS5620 Intro to Computer Graphics

Illumination and Shading

Rendering. Illumination Model. Wireframe rendering simple, ambiguous Color filling flat without any 3D information

Lecture 15: Shading-I. CITS3003 Graphics & Animation

CPSC 314 LIGHTING AND SHADING

Illumination Models & Shading

ECS 175 COMPUTER GRAPHICS. Ken Joy.! Winter 2014

Visualisatie BMT. Rendering. Arjan Kok

Computer Graphics (CS 4731) Lecture 16: Lighting, Shading and Materials (Part 1)

Shading. Shading = find color values at pixels of screen (when rendering a virtual 3D scene).

Computer Graphics (CS 543) Lecture 7b: Intro to lighting, Shading and Materials + Phong Lighting Model

Today. Global illumination. Shading. Interactive applications. Rendering pipeline. Computergrafik. Shading Introduction Local shading models

Introduction Rasterization Z-buffering Shading. Graphics 2012/2013, 4th quarter. Lecture 09: graphics pipeline (rasterization and shading)

w Foley, Section16.1 Reading

Illumination & Shading: Part 1

CSE 167: Introduction to Computer Graphics Lecture #6: Lights. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2016

Introduction to Computer Graphics 7. Shading

Topic 9: Lighting & Reflection models 9/10/2016. Spot the differences. Terminology. Two Components of Illumination. Ambient Light Source

Topic 9: Lighting & Reflection models. Lighting & reflection The Phong reflection model diffuse component ambient component specular component

Today. Global illumination. Shading. Interactive applications. Rendering pipeline. Computergrafik. Shading Introduction Local shading models

Shading. Introduction to Computer Graphics Torsten Möller. Machiraju/Zhang/Möller/Fuhrmann

TSBK 07! Computer Graphics! Ingemar Ragnemalm, ISY

Shading and Illumination

Comp 410/510 Computer Graphics. Spring Shading

Local Illumination. CMPT 361 Introduction to Computer Graphics Torsten Möller. Machiraju/Zhang/Möller

Illumination & Shading

CS Illumination and Shading. Slide 1

Shading I Computer Graphics I, Fall 2008

Illumination and Shading

CS 381 Computer Graphics, Fall 2008 Midterm Exam Solutions. The Midterm Exam was given in class on Thursday, October 23, 2008.

Reading. Shading. An abundance of photons. Introduction. Required: Angel , 6.5, Optional: Angel 6.4 OpenGL red book, chapter 5.

Reflection and Shading

Pipeline Operations. CS 4620 Lecture Steve Marschner. Cornell CS4620 Spring 2018 Lecture 11

Objectives. Introduce Phong model Introduce modified Phong model Consider computation of required vectors Discuss polygonal shading.

CS770/870 Spring 2017 Color and Shading

Recollection. Models Pixels. Model transformation Viewport transformation Clipping Rasterization Texturing + Lights & shadows

Virtual Reality for Human Computer Interaction

Pipeline Operations. CS 4620 Lecture 14

Computer Graphics. Shading. Based on slides by Dianna Xu, Bryn Mawr College

9. Illumination and Shading

How do we draw a picture?

Mach band effect. The Mach band effect increases the visual unpleasant representation of curved surface using flat shading.

Computer Graphics. Illumination and Shading

CS130 : Computer Graphics Lecture 8: Lighting and Shading. Tamar Shinar Computer Science & Engineering UC Riverside

S U N G - E U I YO O N, K A I S T R E N D E R I N G F R E E LY A VA I L A B L E O N T H E I N T E R N E T

Complex Shading Algorithms

Introduction to Visualization and Computer Graphics

Lighting and Shading. Slides: Tamar Shinar, Victor Zordon

Computer Vision Systems. Viewing Systems Projections Illuminations Rendering Culling and Clipping Implementations

Lighting and Shading Computer Graphics I Lecture 7. Light Sources Phong Illumination Model Normal Vectors [Angel, Ch

Today s class. Simple shadows Shading Lighting in OpenGL. Informationsteknologi. Wednesday, November 21, 2007 Computer Graphics - Class 10 1

CSE 167: Introduction to Computer Graphics Lecture #7: Lights. Jürgen P. Schulze, Ph.D. University of California, San Diego Spring Quarter 2015

Lighting/Shading III. Week 7, Wed Mar 3

Shading 1: basics Christian Miller CS Fall 2011

CEng 477 Introduction to Computer Graphics Fall

CS 325 Computer Graphics

CMSC427 Shading Intro. Credit: slides from Dr. Zwicker

CSE 167: Lecture #7: Color and Shading. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2011

Global Illumination. CMPT 361 Introduction to Computer Graphics Torsten Möller. Machiraju/Zhang/Möller

Pipeline Operations. CS 4620 Lecture 10

Shading. Brian Curless CSE 457 Spring 2017

Rendering Light Reflection Models

Computer Graphics: 3-Local Illumination Models

Lecture 17: Shading in OpenGL. CITS3003 Graphics & Animation

Lights, Surfaces, and Cameras. Light sources emit photons Surfaces reflect & absorb photons Cameras measure photons

Illumination and Shading

CSE 167: Introduction to Computer Graphics Lecture #6: Lights. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2014

University of British Columbia CPSC 314 Computer Graphics Sep-Dec Tamara Munzner (guest lecturing) Lighting/Shading

Illumination & Shading I

Lets assume each object has a defined colour. Hence our illumination model is looks unrealistic.

Lighting Models. CS116B Chris Pollett Mar 21, 2004.

Illumination in Computer Graphics

Chapter 10. Surface-Rendering Methods. Somsak Walairacht, Computer Engineering, KMITL

Reading. Shading. Introduction. An abundance of photons. Required: Angel , Optional: OpenGL red book, chapter 5.

Interpolation using scanline algorithm

Shading / Light. Thanks to Srinivas Narasimhan, Langer-Zucker, Henrik Wann Jensen, Ravi Ramamoorthi, Hanrahan, Preetham

Objectives Shading in OpenGL. Front and Back Faces. OpenGL shading. Introduce the OpenGL shading methods. Discuss polygonal shading

Computer Graphics. Illumination Models and Surface-Rendering Methods. Somsak Walairacht, Computer Engineering, KMITL

CSE 681 Illumination and Phong Shading

CS 4600 Fall Utah School of Computing

Illumination Model. The governing principles for computing the. Apply the lighting model at a set of points across the entire surface.

Shading Intro. Shading & Lighting. Light and Matter. Light and Matter

03 RENDERING PART TWO

Color and Light CSCI 4229/5229 Computer Graphics Fall 2016

CS 5625 Lec 2: Shading Models

-=Bui Tuong Phong's Lighting=- University of Utah, but with shaders. Anton Gerdelan Trinity College Dublin

Graphics Hardware and Display Devices

Simple Lighting/Illumination Models

Models and Architectures

Introduction to Computer Graphics. Farhana Bandukwala, PhD Lecture 14: Light Interacting with Surfaces

Sung-Eui Yoon ( 윤성의 )

Illumination and Shading

The Rasterizer Stage. Texturing, Lighting, Testing and Blending

OpenGl Pipeline. triangles, lines, points, images. Per-vertex ops. Primitive assembly. Texturing. Rasterization. Per-fragment ops.

Color and Light. CSCI 4229/5229 Computer Graphics Summer 2008

Overview. Shading. Shading. Why we need shading. Shading Light-material interactions Phong model Shading polygons Shading in OpenGL

Deferred Rendering Due: Wednesday November 15 at 10pm

C O M P U T E R G R A P H I C S. Computer Graphics. Three-Dimensional Graphics V. Guoying Zhao 1 / 65

Graphics for VEs. Ruth Aylett

Transcription:

Rendering Pipeline modelling of geometry transformation into world coordinates placement of cameras and light sources transformation into camera coordinates backface culling projection clipping w.r.t. view volume hidden surface removale (hsr) rasterization illumination and shading

Rendering Pipeline modelling of geometry transformation into world coordinates placement of cameras and light sources transformation into camera coordinates backface culling projection hidden surface removale (hsr)

Rendering Pipeline modelling of geometry transformation into world coordinates placement of cameras and light sources transformation into camera coordinates backface culling projection hidden surface removale (hsr) rasterization illumination and shading

Overview illumination models light sources light interaction with surfaces Phong illumination model shading application of illumination models to rendering polygons and pixel-by-pixel efficiency vs. quality flat, Gouraud, Phong shading

Illumination Models General Introduction Phong Illumination Model

Illumination Models real world: surfaces emit, absorb, reflect, and scatter light light intensity and color dependent on surface position and orientation w.r.t. the light source light is usually reflected or refracted several times usually several sources of light final intensity/color at a point is sum of several light paths ending at that point Angel (2000)

Illumination Models computer graphics world: mathematical description necessary leads to equation using integrals: the rendering equation it s usually not solvable we need approximation! simplifying light sources simplifying materials simplifying computation speed-up

Coombe et al., 2004 Illumination Models description of the factors that influence the color and light intensity at a point global illumination models: considering all objects of a scene to compute light at a specific point e.g., radiosity and raytracing

Illumination Models local illumination models: i.e., traditional rendering only object-light interaction, pipeline approach heuristic approximation, simpler than global Phong illumination model & polygonal shading

Light Sources in point light source: has only position and no size, sends light equally in all directions point in 3D & intensity Angel (2000)

Light Sources in spot light source: point light source sending out a cone of light with light intensity decreasing towards cone border point + vector in 3D, angle, attenuation intensity defined by cosine function depending on angle from center ray, exponent Angel (2000)

Light Sources in directional light source: sends directed, parallel light rays, has no position vector in 3D & intensity Angel (2000)

Light Sources in Angel (2000) point light spot light directional light

Light Sources in results from simplification to point light sources? sharp contrast between light and shade, no gradual change (penumbra) aerial light sources have to be approximated by several point lights to have a penumbra Angel (2000)

Light Sources in light attenuation light intensity reduces with growing distance theoretically: I ~ 1/d² reality does not follow exactly this why? CG: I ~ 1/(a+bd+cd²), often only linear: a,c = 0 light color heuristic: color modeled using RGB values approximation because light behavior depends on wave length examples?

Light Interaction with Surfaces angle θ between L & N determines diffuse reflection reflection angle equals θ angle Φ between R & V determines perceived brightness maximal reflection if R = V (Φ = 0) L θ N R Φ L vector to light source N surface normal vector R reflected light ray V vector to viewer/observer V

Light Interaction with Surfaces directed reflection: reflection only for small Φ: smooth surfaces examples? physical reality non-symmetric reflection around R materials with anisotropic reflection (reflection depends on angle Φ AND direction of L w.r.t. surface) L N R Φ V

Light Interaction with Surfaces light attenuation depending on angle between R and V: shininess modeled using cosine function and exponent: I ~ cos (Φ) e metals: e 100 e=2 e=1 L N R Φ V e=5

Light Interaction with Surfaces diffuse reflection: equal reflection in all directions on rough surfaces, depends only on θ and not observer examples? due to light scattering on rough surfaces on randomly oriented microscopic facets Angel (2000)

Light Interaction with Surfaces diffuse reflection modeled according to Lambert s law by cosine function: I ~ cos θ = L N for normalized L, N because light distributes over larger area Angel (2000) θ = 0º max. intensity θ = 90º 0 intensity L θ N R V

Filip et al. (2013) Light Interaction with Surfaces combined effects of diffuse and directed reflection make up material properties in reality very complex function, can be captured with BRDFs (Bidirectional Reflectance Distribution Function) Bender/Brill (2003)

Phong Illumination Model (1973) most common CG model for illumination (by Bùi Tường Phong): I Phong = I a + I d + I s ambient light: base illumination of scene simulates light scattering on objects necessary because repeated diffuse reflection is not considered in local illumination model depends on color of all objects in scene should always be kept very small diffuse light: light from diffuse reflection specular light: light from directed reflection

Phong Illumination Model I 1 bd e Phong Lak a Ld k d(l N) Lsk s(r V) 2 a cd N L R V L vector to light source N surface normal vector R reflected light ray V vector to viewer/observer has to be evaluated for all light sources and for each of the base colors

Phong Illumination Model I 1 bd e Phong Lak a Ld k d(l N) Lsk s(r V) 2 a cd light and k-parameter factors computed once per color channel: r, g, b raytracer example: Light [pos x-z].8.8.4 Material 1.0.8.0.2.8.3 1 other ways possible light color (r, g, b) L a = L d = L s material color (r, g, b): factors to compute e basis for deriving k a & k d actual k a, k d, & k s ; sometimes direct k s factor

Phong Illumination Model perfectly specular, mixed, perfectly diffuse: imperfect specular and ideally diffuse reflection as 3D functions (BRDFs): Angel (2000) Bender/Brill (2003)

Phong Illumination Model 3D reflection functions for θ=10, 45, 70 Bender/Brill (2003)

Phong Illumination Model 3D reflection functions for different specular exponents: e = 2, 20, 100 Bender/Brill (2003)

Shading Techniques Flat Shading Gouraud Shading Phong Shading

Shading of Polygonal Models status: we can approximate color at a point goal: we want to render the whole model constraint: efficiency and quality approach: shade all pixels of a triangle based on color computation at a few points three techniques: flat shading Gouraud shading Phong shading ( Phong illumination)

Flat Shading no interpolation all pixels same color two methods: one point per triangle/quad average of triangle s/quad s vertices low quality: single primitives easily visible fast computation & easy implementation

Flat Shading no interpolation all pixels same color two methods: one point per triangle/quad average of triangle s/quad s vertices low quality: single primitives easily visible fast computation & easy implementation

Flat Shading no interpolation all pixels same color two methods: one point per triangle/quad average of triangle s/quad s vertices low quality: single primitives easily visible fast computation & easy implementation

Flat Shading no interpolation all pixels same color two methods: one point per triangle/quad average of triangle s/quad s vertices low quality: single primitives easily visible fast computation & easy implementation

Flat Shading: Edge Perception discontinuities easily visible and distracting reason in human perception contrast are enhanced by visual system perceived brightness differences are bigger than the physical reality Mach band effect Angel (2000)

Gouraud Shading (1971) computation of colors at all vertices linear interpolation of colors over primitive more computation but better quality than flat shading usually implemented in graphics hardware highlights problematic: highlight shapes and highlights in the middle of triangles

Gouraud Shading (1971) computation of colors at all vertices linear interpolation of colors over primitive more computation but better quality than flat shading usually implemented in graphics hardware highlights problematic: highlight shapes and highlights in the middle of triangles

Gouraud Shading (1971) computation of colors at all vertices linear interpolation of colors over primitive more computation but better quality than flat shading usually implemented in graphics hardware highlights problematic: highlight shapes and highlights in the middle of triangles

Gouraud Shading (1971) computation of colors at all vertices linear interpolation of colors over primitive more computation but better quality than flat shading usually implemented in graphics hardware highlights problematic: highlight shapes and highlights in the middle of triangles

Gouraud Shading: Vertex Normals prerequisite: normal vectors at vertices need to be interpolated from face normals n n n 1 1 n n 2 2 n n 3 3 n n 4 4 requires data structure supporting crossreferencing of vertices, normals, faces etc. otherwise (no normal interpolation)?

Phong Shading (1973) linear interpolation of normals for each pixel color computation for each pixel separately best quality, highlights are shown correctly but computationally more expensive problems:

Phong Shading (1973) linear interpolation of normals for each pixel color computation for each pixel separately best quality, highlights are shown correctly but computationally more expensive problems:

Phong Shading (1973) linear interpolation of normals for each pixel color computation for each pixel separately best quality, highlights are shown correctly but computationally more expensive problems:

Phong Shading (1973) linear interpolation of normals for each pixel color computation for each pixel separately best quality, highlights are shown correctly but computationally more expensive problems:

Phong Shading (1973) linear interpolation of normals for each pixel color computation for each pixel separately best quality, highlights are shown correctly but computationally more expensive problems: polygons still visible at silhouettes traditionally not implemented in hardware (nowadays not a problem with shaders)

Phong Shading: Normal Interpolation first: normal vector interpolation along edges on per-scanline basis second: normal vector interpolation between edges along scanlines on per-pixel basis Angel (2003)

Phong Shading: Normal Interpolation alternative: quadratic interpolation (van Overveld and Wyvill, 1997)

Polygonal Shading when in the pipeline? typically last step together with rasterization and z-buffering problem: normals would be perspectively projected normals not perpendicular to surface anymore light position w.r.t. surface may change determine illumination before projection! shading after projection

Polygonal Shading: Comparison comparison on a by-pixel basis: flat shading Gouraud shading Phong shading

Polygonal Shading: Comparison Flat Gouraud Phong N I 2 N 2 N 3 I 2 N 2 N 3 I N 1 N 1 I 3 I 3 one color value for entire polygon I 1 one color value per vertex & interpolation inside the triangle I 1 vertex normals interpolated and one color value per pixel

Summary Phong illumination model: heuristic to compute color at one surface point ambient, diffuse, and specular components only computes direct (local) illumination three shading methods to color polygons flat, Gouraud, and Phong shading not physically based speed vs. quality tradeoff illumination computation in camera coordinates (before projection)!