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

CMSC427 Shading Intro. Credit: slides from Dr. Zwicker

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

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

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

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

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

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

Comp 410/510 Computer Graphics. Spring Shading

Computer Graphics. Illumination and 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

Illumination & Shading

w Foley, Section16.1 Reading

CPSC 314 LIGHTING AND SHADING

Shading. Brian Curless CSE 557 Autumn 2017

CS5620 Intro to Computer Graphics

Illumination Models & Shading

CS 5625 Lec 2: Shading Models

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

Shading I Computer Graphics I, Fall 2008

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

ECS 175 COMPUTER GRAPHICS. Ken Joy.! Winter 2014

Illumination & Shading: Part 1

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

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

Shading 1: basics Christian Miller CS Fall 2011

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

Complex Shading Algorithms

Lecture 15: Shading-I. CITS3003 Graphics & Animation

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.

Shading. Brian Curless CSE 457 Spring 2017

Illumination and Shading

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

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

Introduction to Computer Graphics 7. Shading

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

Sung-Eui Yoon ( 윤성의 )

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

Color and Light CSCI 4229/5229 Computer Graphics Fall 2016

CEng 477 Introduction to Computer Graphics Fall

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

Shading & Material Appearance

CS 4600 Fall Utah School of Computing

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

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

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

CS-184: Computer Graphics. Today

CSE 681 Illumination and Phong Shading

Lighting and Materials

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

Illumination. Illumination CMSC 435/634

Rendering Light Reflection Models

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

Virtual Reality for Human Computer Interaction

Computer Graphics. Illumination and Shading

Simple Lighting/Illumination Models

Illumination in Computer Graphics

Rendering Light Reflection Models

CENG 477 Introduction to Computer Graphics. Ray Tracing: Shading

Pipeline Operations. CS 4620 Lecture 10

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

Visualisatie BMT. Rendering. Arjan Kok

Lighting and Shading. Slides: Tamar Shinar, Victor Zordon

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

Lighting affects appearance

Light Reflection Models

Shading and Illumination

Why we need shading?

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

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

Lecture 17: Shading in OpenGL. CITS3003 Graphics & Animation

Three-Dimensional Graphics V. Guoying Zhao 1 / 55

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

Lighting affects appearance

rendering equation computer graphics rendering equation 2009 fabio pellacini 1

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

Radiance. Radiance properties. Radiance properties. Computer Graphics (Fall 2008)

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

BRDF Computer Graphics (Spring 2008)

Illumination & Shading

Introduction to Visualization and Computer Graphics

Light Transport Baoquan Chen 2017

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

Pipeline Operations. CS 4620 Lecture 14

CPSC / Illumination and Shading

CS6670: Computer Vision

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

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

Overview. Radiometry and Photometry. Foundations of Computer Graphics (Spring 2012)

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

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

TSBK 07! Computer Graphics! Ingemar Ragnemalm, ISY

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

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

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

Illumination and Shading

Transcription:

Computergrafik Matthias Zwicker Universität Bern Herbst 2009 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 2010! (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 Radiometry Physical units to measure light energy Based on the ray optics model http://en.wikipedia.org/wiki/ray_%28optics%29 Light modeledasrays Ray is idealized narrow beam of light No wave effects, like interference or diffraction Diffraction pattern from square aperture Radiance Energy carried along a narrow beam of light Limit of energy passing through a small area in a small bundle of s, divided by area and solid angle spanned by bundle of s Ray density Spectralradiance: Energy at each wavelength Units Irradiance Energy per area: energy going through a small area, divided by size of area Radiancesummedupoverall s Units Local illumination Goal: model reflection of light at surfaces Bial reflectance distribution function (BRDF) Given light, viewing, obtain fraction of light reflected towards the viewer For any pair of light/viewing s! For different wavelenghts (or R, G, B) separately BRDF completely describes appearance of material For each pair of light/view, BRDF gives fraction of reflected light 2

BRDFs Given incident and outgoing s BRDF is fraction of incident irradiance arriving from small beam of s over radiance reflected in outgoing Units Incident irradiance from small beam of s Reflected radiance 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 BRDFs Analytical models Try to describe phyiscal properties of materials using mathematical expressions Many models proposed in graphics http://en.wikipedia.org/wiki/bial_reflectance_distribution_function http://en.wikipedia.org/wiki/cook-torrance / iki/c k http://en.wikipedia.org/wiki/oren-nayar_diffuse_model Most of them too complicated for interactive rendering Simplified model BRDF is sum of diffuse, specular, and ambient components Each is simple analytical function Covers a large class of real surfaces Model is not physically accurate! diffuse specular ambient Simplified model BRDF is sum of diffuse, specular, and ambient components Each is simple analytical function Covers a large class of real surfaces Model is not physically accurate! diffuse specular ambient Diffuse reflection Ideal diffuse material reflects light equally in all s View-independent Surface looks the same independent d of viewing i Matte, not shiny materials Paper Unfinished wood Unpolished stone Diffuse sphere Diffuse reflection 3

Diffuse materials 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/ 4

Simplified model BRDF is sum of diffuse, specular, and ambient components Each is simple analytical function Covers a large class of real surfaces Model is not physically accurate! 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 Glossy materials Specular reflection Ideal specular reflection is mirror reflection Perfectly smooth surface Incoming light ray is bounced in single Angle of incidence equals angle of reflection Law of reflection Angle of incidence equals angle of reflection Glossy materials Many materials not quite perfect mirrors Glossy materials have blurry reflection of light source Glossy teapot with highlights from many light sources 5

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 Rough Very rough 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 6

Simplified model BRDF is sum of diffuse, specular, and ambient components Each is simple analytical function Covers a large class of real surfaces Model is not physically accurate! diffuse specular ambient 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 Notes All colors, reflection coefficients have separate values for R,G,B Usually, ambient = diffuse coefficient diffuse specular ambient For metals, specular = diffuse coefficient Highlight is color of material For plastics, specular coefficient = (x,x,x) Highlight is color of light Today Light sources Light sources can have complex properties Introduction Local shading models Light sources strategies 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 7

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 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 Light source Receiving surface Point lights Simple model for light bulbs Point that radiates light in all s equally Point lights p c src Light source 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? c l v c l Receiving surface v Incident light Strength Attenuation 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 Not physically accurate Spotlights Like point source, but intensity depends on Parameters Position, the location of the source Spot, the center axis of the light Falloff parameters how broad the beam is (cone angle) how light tapers off at edges of he beam (cosine exponent) 8

Spotlights Spotlights Light source Receiving surface Photograph of spotlight Spotlights in OpenGL Today Introduction Local shading models Light sources strategies 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 Image Per-triangle shading Known as flat shading Evaluate shading once per triangle using pertriangle normal Advantages Fast Disadvantages Faceted appearance Per-vertex shading Known as Gouraud shading (Henri Gouraud 1971) Per-vertex normals Interpolate vertex colors across triangles OpenGL default Advantages Fast Smoother than flat shading Disadvantages Problems with small highlights 9

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 Gouraud vs. per-pixel shading Gouraud has problems with highlights Could use more triangles Gouraud Per-pixel, same 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 What about textures? How to combine colors stored in textures and lighting computations? Interpret textures as shading coefficients Usually, texture used as ambient and diffuse reflectance coefficient k d, k a Textures provide spatially varying BRDFs Each point on surface has different BRDF parameters, different appearance 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 10