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

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

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

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

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

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 #7: Lights. Jürgen P. Schulze, Ph.D. University of California, San Diego Spring Quarter 2015

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

Comp 410/510 Computer Graphics. Spring Shading

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

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

Illumination & Shading

Computer Graphics. Illumination and Shading

Shading I Computer Graphics I, Fall 2008

CPSC 314 LIGHTING AND SHADING

Illumination Models & Shading

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

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

w Foley, Section16.1 Reading

CS5620 Intro to Computer Graphics

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

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

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

ECS 175 COMPUTER GRAPHICS. Ken Joy.! Winter 2014

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

Shading. Brian Curless CSE 557 Autumn 2017

Lecture 15: Shading-I. CITS3003 Graphics & Animation

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

Illumination & Shading: Part 1

Shading 1: basics Christian Miller CS Fall 2011

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

Introduction to Computer Graphics 7. Shading

Color and Light CSCI 4229/5229 Computer Graphics Fall 2016

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

Shading. Brian Curless CSE 457 Spring 2017

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

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

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

Illumination and Shading

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

CEng 477 Introduction to Computer Graphics Fall

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

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

CS 5625 Lec 2: Shading Models

Pipeline Operations. CS 4620 Lecture 10

Complex Shading Algorithms

Lighting and Shading. Slides: Tamar Shinar, Victor Zordon

CS-184: Computer Graphics. Today

Computer Graphics. Illumination and Shading

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

CS 4600 Fall Utah School of Computing

Why we need shading?

Sung-Eui Yoon ( 윤성의 )

Rendering Light Reflection Models

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

Virtual Reality for Human Computer Interaction

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

Three-Dimensional Graphics V. Guoying Zhao 1 / 55

Lecture 17: Shading in OpenGL. CITS3003 Graphics & Animation

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

Rendering Light Reflection Models

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

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

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

Pipeline Operations. CS 4620 Lecture 14

CSE 681 Illumination and Phong Shading

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

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

Visualisatie BMT. Rendering. Arjan Kok

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

Illumination in Computer Graphics

Light Reflection Models

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

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

Shading and Illumination

Simple Lighting/Illumination Models

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

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 Shading Computer Graphics I Lecture 7. Light Sources Phong Illumination Model Normal Vectors [Angel, Ch

CPSC / Illumination and Shading

TSBK 07! Computer Graphics! Ingemar Ragnemalm, ISY

Illumination. Illumination CMSC 435/634

Lighting and Shading

Light Transport Baoquan Chen 2017

Lessons Learned from HW4. Shading. Objectives. Why we need shading. Shading. Scattering

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

CS Illumination and Shading. Slide 1

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

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

Illumination & Shading I

Introduction to Visualization and Computer Graphics

Shading & Material Appearance

Lighting affects appearance

Lighting affects appearance

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

Illumination and Shading

Shading. CSE 457 Winter 2015

Illumination and Shading

Light Sources. Spotlight model

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

Transcription:

Computergrafik Thomas Buchberger, Matthias Zwicker Universität Bern Herbst 2008 Today Introduction Local shading models Light sources strategies Compute interaction of light with surfaces Requires simulation of physics Global illumination Multiple bounces of light Computationally expensive, minutes per image Movies, architectural design, etc. Global illumination Rendering algorithms, Winter 2009! (non-teapot images by Henrik Wann Jensen) 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 Rendering pipeline Scene data Modeling and viewing transformation Projection Different options for shading in rendering pipeline Determine colors of vertices Per vertex shading One bounce of light Surface Scan conversion, visibility Image while drawing triangles Per pixel shading 1

Today Introduction Local shading models Light sources strategies Local illumination What is giving a material its color? How is light reflected by a Mirror White sheet of paper Blue sheet of paper Glossy metal Local illumination Goal: model reflection of light at surfaces Bial reflectance distribution function (BRDF) Given light, viewing, how much light is reflected towards the viewer For any pair of light/viewing s! For R, G, B separately BRDF completely describes appearance of material BRDFs How to define and store BRDFs that represent physical materials? Physical measurements Gonioreflectometer: robot with light source and camera Measures reflection for each light/camera Store measurements in table Too much data, too slow for interactive applications Light source Material sample Camera Cornell University Gonioreflectometer Simplified model BRDF is sum of 3 components Each component is simple analytical function Covers a large class of real surfaces Simplified model BRDF is sum of 3 components Each component is simple analytical function Covers a large class of real surfaces diffuse specular ambient diffuse specular ambient 2

Diffuse reflection Ideal diffuse material reflects light equally in all s View-independent Surface looks the same independent d of viewing i Diffuse reflection Matte, not shiny materials Paper Unfinished wood Unpolished stone Diffuse sphere Lambert s cosine law 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 Diffuse surfaces are also called Lambertian surfaces n n n Diffuse sphere Diffuse reflection Given Unit surface normal Unit light Material diffuse reflectance (material color) Light color (intensity) Diffuse color Diffuse reflection Notes Parameters are r,g,b vectors Compute r,g,b values of diffuse color separately Parameters in this model have no precise physical meaning strength, color of light source fraction of reflected light, material color Cosine between normal and light Diffuse reflection Provides visual cues Surface curvature Depth variation Lambertian (diffuse) sphere under different lighting s OpenGL/jogl Lights (gllight*) Values for light (0,0,0) is black, (1,1,1) is white OpenGL Values for diffuse reflection Fraction of reflected light Consult OpenGL book Online http://fly.cc.fer.hr/%7eunreal/theredbook/ 3

Simplified model BRDF is sum of 3 components Each component is simple analytical function Covers a large class of real surfaces Specular reflection Shiny surfaces Polished metal Glossy car finish Plastics Specular highlight diffuse specular ambient Blurred reflection of the light source Position of highlight depends on viewing Sphere with specular highlight Specular reflection Ideal specular reflection is mirror reflection Law of reflection Angle of incidence equals angle of reflection Perfectly smooth surface Incoming light ray is bounced in single Angle of incidence equals angle of reflection Glossy materials Many materials not quite perfect mirrors Glossy materials have blurry reflection of light source Physical model Assume surface composed of small mirrors with random orientation (microfacets) Smooth surfaces Microfacet normals close to surface normal Sharp highlights Rough surfaces Microfacet normals vary strongly Leads to blurry highlight Polished Smooth Glossy teapot with highlights from many light sources Rough Very rough 4

Physical model Expect most light to be reflect in mirror Because of microfacets, some light is reflected slightly off ideal reflection Reflection Brightest when view vector is aligned with reflection Decreases as angle between view vector and reflection increases Phong model Simple implementation of the physical model Specular reflectance coefficient Phong exponent Higher, smaller (sharper) highlight Phong model Blinn model (Jim Blinn, 1977) Alternative to Phong model Define unit halfway vector Halfway vector represents normal of microfacet that would lead to mirror reflection to the eye Blinn model The larger the angle between microfacet orientation and normal, the less likely Use cosine of angle between them Shininess parameter Very similar to Phong Simplified model BRDF is sum of 3 components Each component is simple analytical function Covers a large class of real surfaces diffuse specular ambient 5

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 Ambient light Ambient reflection coefficient Areas with no direct illumination are not completely dark Complete model Blinn model with several light sources i diffuse specular ambient Notes All colors, reflection coefficients have separate values for R,G,B Usually, ambient = diffuse coefficient For metals, specular = diffuse coefficient Today Introduction Local shading models Light sources strategies Highlight is color of material For plastics, specular coefficient = (x,x,x) Highlight is color of light Light sources Light sources can have complex properties Geometric area over which light is produced Anisotropy in Variation in color Reflective surfaces act as light sources Interactive rendering is based on simple, standard light sources Light sources At each point on surfaces need to know Direction of incoming light (the L vector) Strength of incoming light (the c l values) Standard light sources in OpenGL Directional: from a specific Point light source: from a specific point Spotlight: from a specific point with intensity that depends on the 6

Directional light Light from a distant source Light rays are parallel Direction and strength constant everywhere in 3D scene As if the source were infinitely far away Good approximation to sunlight Specified by a unit length vector, and a color Point lights Simple model for light bulbs Point that radiates light in all s equally Light vector varies across the surface Intensity drops off proportionally to the inverse square of the distance from the light Intuition for inverse square falloff? Light source Receiving surface Point lights Attenuation p c src Light source c l v c l Receiving surface v Sometimes, it is desirable to modify the inverse square falloff behavior of point lights Common (OpenGL) model for distance attenuation c c l = src k c + k l p v + k q p v 2 Incident light Strength Not physically accurate Spotlights Like point source, but intensity depends on Parameters Position, the location of the source Spotlights Light source Spot, the center axis of the light Receiving surface Falloff parameters how broad the beam is (cone angle) how light tapers off at edges of he beam (cosine exponent) 7

Spotlights Today Introduction Local shading models Light sources strategies Photograph of spotlight Spotlights in OpenGL Per-triangle, -vertex, -pixel shading May compute shading operations Once per triangle Once per vertex Once per pixel Scene data Modeling and viewing transformation Projection Rasterization, visibility Per-triangle shading Known as flat shading Evaluate shading once per triangle Advantages Fast Disadvantages Faceted appearance Image Per-vertex shading Known as Gouraud shading (Henri Gouraud 1971) Interpolate vertex colors across triangles OpenGL default Advantages Fast Smoother than flat shading Disadvantages Problems with small highlights Per-pixel shading Also known as Phong interpolation (not to be confused with Phong illumination model) Rasterizer interpolates normals across triangles Illumination model evaluated at each pixel Implemented using programmable shaders (next week) Advantages Higher quality than Gouraud shading Disadvantages Much slower 8

Gouraud vs. per-pixel shading Gouraud has problems with highlights Could use more triangles What about shadows? Standard shading assumes light sources are always visible Does not determine if light is blocked Does not produce shadows Shadows require additional work Later in the course Gouraud Per-pixel Summary Local illumination (single bounce) is computed using BRDF BRDF captures appearance of a material Amount of reflected light for each pair of light/viewing s Simplified model for BRDF consists of diffuse + Phong/Blinn + ambient Lambert s law for diffuse surfaces Microfacet model for specular part Ambient to approximate multiple bounces Light source models Directional Point, spot, inverse square fall-off Different shading strategies Per triangle, Gouraud, per pixel Next time Programmable shaders 9