Computer Graphics: 3-Local Illumination Models

Similar documents
Computer Graphics: 5-The Graphics Pipeline

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

CS5620 Intro to Computer Graphics

CS770/870 Spring 2017 Color and Shading

Computer Graphics. Illumination and Shading

Illumination & Shading: Part 1

w Foley, Section16.1 Reading

Computer Graphics. Illumination and Shading

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

Illumination Models & Shading

CPSC 314 LIGHTING AND SHADING

Visualisatie BMT. Rendering. Arjan Kok

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

Illumination and Shading

University of Victoria CSC 305 Shading. Brian Wyvill 2016

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

ECS 175 COMPUTER GRAPHICS. Ken Joy.! Winter 2014

Illumination and Shading

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

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 2016

Simple Lighting/Illumination Models

Shading I Computer Graphics I, Fall 2008

CS Illumination and Shading. Slide 1

CEng 477 Introduction to Computer Graphics Fall

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

CS 325 Computer Graphics

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

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

Lecture 15: Shading-I. CITS3003 Graphics & Animation

Reflection and Shading

Shading. Brian Curless CSE 557 Autumn 2017

CPSC / Illumination and Shading

1.6 Rough Surface Scattering Applications Computer Graphic Shading and Rendering

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

Computer Graphics: 7-Polygon Rasterization, Clipping

CSE 681 Illumination and Phong Shading

CMSC427 Shading Intro. Credit: slides from Dr. Zwicker

Illumination in Computer Graphics

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

From Graphics to Visualization

Color and Light CSCI 4229/5229 Computer Graphics Fall 2016

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

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

Sung-Eui Yoon ( 윤성의 )

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

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

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

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

Comp 410/510 Computer Graphics. Spring Shading

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)

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

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

Lighting and Shading

CS 5625 Lec 2: Shading Models

Illumination & Shading

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

Lighting and Shading. Slides: Tamar Shinar, Victor Zordon

Rendering Light Reflection Models

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

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

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

How do we draw a picture?

Light Transport Baoquan Chen 2017

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

Ø Sampling Theory" Ø Fourier Analysis Ø Anti-aliasing Ø Supersampling Strategies" Ø The Hall illumination model. Ø Original ray tracing paper

Illumination & Shading I

Illumination. Michael Kazhdan ( /657) HB Ch. 14.1, 14.2 FvDFH 16.1, 16.2

Illumination Models and Shading

Computer Graphics MTAT Raimond Tunnel

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

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

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

Graphics for VEs. Ruth Aylett

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

Introduction to Visualization and Computer Graphics

Local Reflection Models

Shading and Illumination

Lighting and Materials

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

Interactive Real-Time Raycasting

Virtual Reality for Human Computer Interaction

Raytracing CS148 AS3. Due :59pm PDT

Shading. Brian Curless CSE 457 Spring 2017

Ray-Tracing. Misha Kazhdan

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

7: Rendering (1) COMP Computer Graphics and Image Processing. Local illumination model. Global illumination model. Direct Direct.

Introduction to Computer Graphics 7. Shading

Level of Details in Computer Rendering

Interpolation using scanline algorithm

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

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

Shading Techniques Denbigh Starkey

Pipeline Operations. CS 4620 Lecture 10

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

Raytracing. COSC 4328/5327 Scott A. King

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

Illumination. The slides combine material from Andy van Dam, Spike Hughes, Travis Webb and Lyn Fong

Transcription:

Computer Graphics: 3-Local Illumination Models Prof. Dr. Charles A. Wüthrich, Fakultät Medien, Medieninformatik Bauhaus-Universität Weimar caw AT medien.uni-weimar.de

Introduction After having illustrated how to draw polygons onto the screen, it is time to deal with computing the exact color that should be used. In Computer Graphics, we mostly have to deal with surfaces The aim of producing photorealistic images is to simulate the interaction between light and the surfaces in a 3D environment We will first develop the models for achromatic light, and successively see how they can be extended to deal with colour

Illumination models There are two types of illumination models Local illumination models:" Light reflected by a surface (and therefore its colour) is dependent only on the surfxace itself and the direct light sources Global illumination models:" Light reflected by a surface is dependent only on the surface itself, the direct light sources, and light which is reflected by the other surfaces on the environment towards the current surface We will do global models later in the course

To illuminate a surface, light is needed Two major models for light sources Point light sources By putting point light source at one can simulate solar light Diffusion cone can be restricted to simulate spotlights (use additional filter function for dimming light) Area light sources (distributed) Lights

Illumination models For any object in the environment, a shading function describing how its surface reacts to light is necessary For the enviroment, an illumination model is used, which determines what parts of the shading functions are used while rendering the scene This illumination model is expressed through an illumination equation Given a surface and an illumination model, through the illumination equation the color of its projected pixels on the screen can be computed For local illumination, the Illumination Equation is composed of different terms, each adding realism to the scene

Ambient light In local illuminaton models, ambient light is used to model the light that does not come directly from a light source i.e. under the table This is the basic colour of an object, to which the other components will be added Illumination equation:" I=k a I a " where k a : says how much of ambient light is reflected by the object" (Î [0,1]) I a : Instensity of ambient light, equal for whole environment Copyright Marko Meister, Bauhaus-University Weimar

Diffuse reflection: Lambert Law Suppose one has a directed light source (point or sunlight) Some materials reflect the light equally in all directions Example: chalk Lambert observed that the more the incident angle to a surface parts from the surface normal, the darker the colour of the surface He also noticed, that objects show the same intensity even if the viewer is moving around The reason is that viewers percieve the same amount of light per angle on the retina, no matter what their viewing angle Reflected light intensity must therefore be dependent from the projection of the light vector onto the normal to the surface L θ N

Diffuse reflection: Lambert Law Thus, the total reflected light is given by " " I diff,lam =I P k d cosθ" " where I P : Intensity of incident light at surface k d : diffuse reflection coefficient of the material Î [0,1] Θ: angle between normal to surface and direction of incident light Or, by using normalized vectors N and L" " I diff,lam =I P k d (N L)

Diffuse reflection: Lambert Law Copyright Marko Meister, Bauhaus-University Weimar

Ambient + Diffuse Illumination The two lighting models presented above can be combined " " I diff =I a k a + I P k d cosθ" " to obtain an illumination equation that encompasses both illumination methods presented

Ambient + Diffuse Illumination Copyright Marko Meister, Bauhaus-University Weimar

" Light source attenuation In fact, light does not travel through space keeping its illuminating power at the same level. Farther objects get less light than closer ones, because it is partially absorbed by particles in the air If constant light intensity is used, then one would get a kind of illumination which is similar to the sunlight To solve this problem, an attenuation factor is added to the illumination equation, decreasing light intensity with distance from the light source The resulting illumination equation is" " I = I " aka + fatti pkd N L where the attenuation factor is: 1 f = " or" " att ( ) 2 d L which gives a too hard decay of light 1 fatt = 2 Max( c d + c d +,1) 1 L 2 L c3 where the coefficients are chosen ad hoc"

Adding colour In order to add colour, the computation of the illumination function is repeated three times, one for each of the colour components RGB. The illumination equation is therefore repeated for each one of the three components, and colur components are computed separately In general, for a wavelength λ in the visible spectrum, we have that I λ = I aλkaodλ + fatti pλkdodλ ( N L)

Specular highlights In real life, most surfaces are glossy, and not matte Think for ex. at an apple Gloss is due to the non-plainness at the microscopic level of surfaces (microfacet theory), and do micro reflecting surfaces of the material Since their distribution is approximately gaussian, then most mirror like reflected light is reflected in direction of the specular reflection, and some is scattered in other directions diffuse glossy specular

Specular highlights Around the direction of the viewer, reflection rays are scattered and generate a highlight Empirically, scattering decay from the direction of the viewer can be seen to behave similarly as the power of the cosinus of the angle α L θ N θ R α V 1 cos α 1 cos 8 α 1 cos 64 α 0 0 90 0 0 90 0 0 90

Specular light Heuristic model proposed by Phong Bui-Tuong Add term for specular highlight to equation" " " " where k s = specular reflection constant of surface (R V) n =cos n α L θ N θ R α V

Specular highlights Applying Phong illumination allows to obtain quite convincing images Note: these illumination models are implemented in hardware nowadays

Specular highlights Copyright Marko Meister, Bauhaus-University Weimar

Multiple lights Adding multiple light sources to the illumination model in an environment is simple: Just add contributions due to the single lights This, of course, doubles the comptations in the case of two lights

Shading polygonal models In theory, given the Illumination equations, every surface is representable. For each surface pont, just compute illumination at that point, and map it to the screen However, this is mostly very computationally intensive In the last step before rendering, surfaces are therefore transformed into polygonal models by discretizing their surface The problem by polygonal models is that the elements are flat

Flat shading For each polygon in the mesh, compute illumination equation Render the whole polygon with the obtained colour" (using the scanline algorithm for example) Results are already good for giving an idea of the shape However, all polygonal facets are seeable, and this is mostly unwanted Courtesy Stephen Chenney, University of Wiscounsin at Madison

Gouraud shading To avoid this problem, Gouraud in 1971 proposed a method to smooth polygonal surface rendering The idea is to compute normal vectors at vertices of each polygon" (average adjacent polygon normals " N=N 1 +N 2 +N 3 +N 4 ) compute illumination at vertices linearly interpolate colour values along the edges of the polygons linearly interpolate colour values between edges to find out colour at a given point Bilinear interpolation I 1 I 4 N N 1 2 N N 3 N 4 I 2 I' I" I'=tI 2 +(1-t)I 1 I I 3 I"=tI 2 +(1-t)I 3 I=tI'+(1-t)I"

Gouraud shading Courtesy Stephen Chenney, University of Wiscounsin at Madison Gouraud shading gives smooth surfaces Sometimes highlights are missed

Phong shading Phong proposed an improvement to Gouraud s idea Phong interpolates between normals and not between colour to find the normal at a point inside the polygon Note that both interpolations (Phong, Gouraud) have three components to compute Only once known the interpolation normal at the point, illumination is computed at each point Much more computationally intensive than Gouraud N 1 N 4 N N 1 2 N N' N 3 N 4 N N 2 N" N 3 N'=tN 2 +(1-t)N 1 N"=tN 2 +(1-t)N 3 N=tN'+(1-t)N"

Comparing shading methods Courtesy Stephen Chenney, University of Wiscounsin at Madison

Comparing shading methods

End +++ Ende - The end - Finis - Fin - Fine +++ Ende - The end - Finis - Fin - Fine +++