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

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

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

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

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

CMSC427 Shading Intro. Credit: slides from Dr. Zwicker

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

CSE 167: Lecture #8: Lighting. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2011

CSE 167: Introduction to Computer Graphics Lecture #5: Illumination Model

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

CSE 167: Lecture #8: GLSL. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012

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

Comp 410/510 Computer Graphics. Spring Shading

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

Illumination & Shading

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

Shading I Computer Graphics I, Fall 2008

WHY WE NEED SHADING. Suppose we build a model of a sphere using many polygons and color it with glcolor. We get something like.

Lecture 15: Shading-I. CITS3003 Graphics & Animation

ECS 175 COMPUTER GRAPHICS. Ken Joy.! Winter 2014

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

Computer Graphics. Illumination and Shading

Shading. Brian Curless CSE 557 Autumn 2017

CS230 : Computer Graphics Lighting and Shading. Tamar Shinar Computer Science & Engineering UC Riverside

CPSC 314 LIGHTING AND SHADING

Shading. Why we need shading. Scattering. Shading. Objectives

Illumination Models & Shading

CSE 681 Illumination and Phong Shading

Illumination & Shading: Part 1

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

w Foley, Section16.1 Reading

Shading 1: basics Christian Miller CS Fall 2011

Illumination and Shading

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

CS5620 Intro to Computer Graphics

Color and Light CSCI 4229/5229 Computer Graphics Fall 2016

Shading. Reading. Pinhole camera. Basic 3D graphics. Brian Curless CSE 557 Fall Required: Shirley, Chapter 10

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

Introduction to Computer Graphics 7. Shading

Lighting and Shading. Slides: Tamar Shinar, Victor Zordon

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

Virtual Reality for Human Computer Interaction

Surface shading: lights and rasterization. Computer Graphics CSE 167 Lecture 6

Why we need shading?

Rendering: Reality. Eye acts as pinhole camera. Photons from light hit objects

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

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

Illumination in Computer Graphics

CS-184: Computer Graphics. Today

Introduction. Lighting model Light reflection model Local illumination model Reflectance model BRDF

Shading. Brian Curless CSE 457 Spring 2017

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

Computer Graphics. Illumination and Shading

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

Lighting. Figure 10.1

Light Sources. Spotlight model

Simple Lighting/Illumination Models

Three-Dimensional Graphics V. Guoying Zhao 1 / 55

Raytracing CS148 AS3. Due :59pm PDT

Problem Set 4 Part 1 CMSC 427 Distributed: Thursday, November 1, 2007 Due: Tuesday, November 20, 2007

Illumination and Shading

CS 5625 Lec 2: Shading Models

CEng 477 Introduction to Computer Graphics Fall

CS 4600 Fall Utah School of Computing

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

CENG 477 Introduction to Computer Graphics. Ray Tracing: Shading

Sung-Eui Yoon ( 윤성의 )

Today we will start to look at illumination models in computer graphics

CPSC / Illumination and Shading

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

Turn on the Lights: Reflectance

Shading & Material Appearance

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

Complex Shading Algorithms

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

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

Lighting and Materials

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

Visualisatie BMT. Rendering. Arjan Kok

Homework #2. Shading, Ray Tracing, and Texture Mapping

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

surface: reflectance transparency, opacity, translucency orientation illumination: location intensity wavelength point-source, diffuse source

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

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

Lighting affects appearance

Interactive Real-Time Raycasting

Graphics and Visualization

CS-184: Computer Graphics. Announcements. Lecture #3: Shading. 03-Shading.key - January 28, 2014

Lighting affects appearance

Shading, lighting, & BRDF Theory. Cliff Lindsay, PHD

TSBK 07! Computer Graphics! Ingemar Ragnemalm, ISY

Deferred Rendering Due: Wednesday November 15 at 10pm

Lecture 17: Shading in OpenGL. CITS3003 Graphics & Animation

Reflection and Shading

Lighting. To do. Course Outline. This Lecture. Continue to work on ray programming assignment Start thinking about final project

Illumination and Shading

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

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

Light Reflection Models

Raytracing. COSC 4328/5327 Scott A. King

Transcription:

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

Announcements Thursday in class: midterm #1 Closed book Material to study includes everything until including today Friday 2pm: late grading project #1 2

Lecture Overview Illumination OpenGL Light Sources Directional Lights Point Lights Spot Lights 3

Shading Compute interaction of light with surfaces Requires simulation of physics Global illumination Multiple bounces of light Computationally expensive, minutes per image Used in movies, architectural design, etc. 4

Global Illumination 5

Interactive Applications No physics-based simulation Simplified models Reproduce perceptually most important effects Local illumination Only one bounce of light between light source and viewer 6 One bounce of light Surface

Rendering Pipeline Scene data Modeling and viewing transformation Shading Projection Scan conversion, visibility Position object in 3D Determine colors of vertices Per vertex shading Map triangles to 2D Draw triangles Per pixel shading 7 Image

Local Illumination Gives material its color Light can be reflected by Mirror White wall Glossy metal etc. 8

Local Illumination Model reflection of light at surfaces Assumption: no subsurface scattering Bidirectional reflectance distribution function (BRDF) Given light direction, viewing direction, how much light is reflected towards the viewer For any pair of light/viewing directions! 9

Local Illumination Simplified model Sum of 3 components Covers a large class of real surfaces diffuse specular ambient 10

Local Illumination Simplified model Sum of 3 components Covers a large class of real surfaces diffuse specular ambient 11

Diffuse Reflection Ideal diffuse material reflects light equally in all directions View-independent Matte, not shiny materials Paper Unfinished wood Unpolished stone 12

Diffuse Reflection Beam of parallel rays shining on a surface Area covered by beam varies with the angle between the beam and the normal The larger the area, the less incident light per area Incident light per unit area is proportional to the cosine of the angle between the normal and the light rays Object darkens as normal turns away from light Lambert s cosine law (Johann Heinrich Lambert, 1760) Diffuse surfaces are also called Lambertian surfaces n n n 13

Diffuse Reflection Given Unit (normalized!) surface normal n Unit (normalized!) light direction L Material diffuse reflectance (material color) k d Light color (intensity) c l Diffuse color c d is: 14 Proportional to cosine between normal and light

Diffuse Reflection Notes Parameters k d, c l are r,g,b vectors Need to compute r,g,b values of diffuse color c d separately Parameters in this model have no precise physical meaning c l : strength, color of light source k d : fraction of reflected light, material color 15

Diffuse Reflection Provides visual cues Surface curvature Depth variation Lambertian (diffuse) sphere under different lighting directions 16

Local Illumination Simplified model Sum of 3 components Covers a large class of real surfaces diffuse specular ambient 17

Specular Reflection Shiny surfaces Polished metal Glossy car finish Plastics Specular highlight Blurred reflection of the light source Position of highlight depends on viewing direction Specular highlight 18

Specular Reflection Ideal specular reflection is mirror reflection Perfectly smooth surface Incoming light ray is bounced in single direction Angle of incidence equals angle of reflection 19

Projection of vector on another vector 20

Law of Reflection Angle of incidence equals angle of reflection 21

Specular Reflection Many materials are not perfect mirrors Glossy materials 22 Glossy teapot

Glossy Materials Assume surface composed of small mirrors with random orientation (micro-facets) Smooth surfaces Micro-facet normals close to surface normal Sharp highlights Rough surfaces Micro-facet normals vary strongly Blurry highlight 23 Polished Smooth Rough Very rough

Glossy Surfaces Expect most light to be reflected in mirror direction Because of micro-facets, some light is reflected slightly off ideal reflection direction Reflection Brightest when view vector is aligned with reflection Decreases as angle between view vector and reflection direction increases 24

Phong Shading Model Developed by Bui Tuong Phong in1973 Specular reflectance coefficient k s Phong exponent p Greater p means smaller (sharper) highlight 25

Phong Shading Model 26

Blinn Shading Model (Jim Blinn, 1977) Modification of Phong Shading Model Defines unit halfway vector Halfway vector represents normal of micro-facet that would lead to mirror reflection to the eye 27

Blinn Shading Model The larger the angle between micro-facet orientation and normal, the less likely Use cosine of angle between them Shininess parameter s Very similar to Phong Model 28

Local Illumination Simplified model Sum of 3 components Covers a large class of real surfaces diffuse specular ambient 29

Ambient Light In real world, light is bounced all around scene Could use global illumination techniques to simulate Simple approximation Add constant ambient light at each point: k a c a Ambient light color: c a Ambient reflection coefficient: k a Areas with no direct illumination are not completely dark 30

Complete Blinn-Phong Shading Model Blinn-Phong model with several light sources I All colors and reflection coefficients are vectors with 3 components for red, green, blue diffuse specular ambient 31

Lecture Overview Illumination OpenGL Light Sources Directional Lights Point Lights Spot Lights 32

Light Sources Real light sources can have complex properties Geometric area over which light is produced Anisotropy (directionally dependent) Reflective surfaces act as light sources (indirect light) In OpenGL we have to use a drastically simplified model to allow real-time rendering 33

Types of Light Sources At each point on surfaces we need to know Direction of incoming light (the L vector) Intensity of incoming light (the c l values) Three light types: Directional: from a specific direction Point light source: from a specific point Spotlight: from a specific point with intensity that depends on direction 34

Lecture Overview Illumination Light Sources Directional Lights Point Lights Spot Lights 35

Directional Light Light from a distant source Light rays are parallel Direction and intensity are the same everywhere As if the source were infinitely far away Good approximation of sunlight Specified by a unit length direction vector, and a color 36 Light source Receiving surface

Lecture Overview Illumination Light Sources Directional Lights Point Lights Spot Lights 37

Point Lights Similar to light bulbs Infinitely small point radiates light equally in all directions Light vector varies across receiving surface What is light intensity over distance proportional to? Intensity drops off proportionally to the inverse square of the distance from the light Reason for inverse square falloff: Surface area A of sphere: A = 4 π r 2 38

Point Light Math p c src Light source At any point v on the surface: c l v c l Receiving surface v Attenuation: 39

Light Attenuation Adding constant factor k to denominator for better control Quadratic attenuation: k*(p-v) 2 Most computationally expensive, most physically correct Linear attenuation: k*(p-v) Less expensive, less accurate Constant attenuation: k Fastest computation, least accurate 40

Lecture Overview Illumination Light Sources Directional Lights Point Lights Spot Lights 41

Spotlights Like point light, but intensity depends on direction Parameters Position: location of light source Spot direction: center axis of light source Intensity falloff: Beam width (cone angle) The way the light tapers off at the edges of the beam (cosine exponent) 42

Spotlights Light source Receiving surface 43