7M836 Animation & Rendering

Slides:



Advertisements
Similar presentations
1 Graphics CSCI 343, Fall 2013 Lecture 18 Lighting and Shading.
Advertisements

Lecture 14 Illumination II – Global Models
CSPC 352: Computer Graphics
Virtual Realism LIGHTING AND SHADING. Lighting & Shading Approximate physical reality Ray tracing: Follow light rays through a scene Accurate, but expensive.
Graphics Graphics Korea University cgvr.korea.ac.kr Illumination Model 고려대학교 컴퓨터 그래픽스 연구실.
1 Computer Graphics By : Mohammed abu Lamdy ITGD3107 University of Palestine Supervision: Assistant Professor Dr. Sana’a Wafa Al-Sayegh.
Lighting and Illumination Lighting is the major problem in computer graphics, for either realism or real-time compositions- harder than modeling Consider.
Light Issues in Computer Graphics Presented by Saleema Amershi.
Illumination and Shading
1. What is Lighting? 2 Example 1. Find the cubic polynomial or that passes through the four points and satisfies 1.As a photon Metal Insulator.
Based on slides created by Edward Angel
1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 Shading I.
Computer Graphics - Class 10
Rendering (彩現 渲染).
IMGD 1001: Illumination by Mark Claypool
Computer Graphics (Fall 2005) COMS 4160, Lecture 16: Illumination and Shading 1
Lighting and Shading Wen-Chieh (Steve) Lin
(conventional Cartesian reference system)
3/23/2005 © Dr. Zachary Wartell 1 Illumination Models and Surface- Rendering Methods.
1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.
Objectives Learn to shade objects so their images appear three- dimensional Learn to shade objects so their images appear three- dimensional Introduce.
1 7M836 Animation & Rendering Global illumination, radiosity Arjan Kok
1 7M836 Animation & Rendering Global illumination, ray tracing Arjan Kok
6.1 Vis_04 Data Visualization Lecture 6 - A Rough Guide to Rendering.
Coordinate Systems X Y Z (conventional Cartesian reference system) X Y Z.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Shading I Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
Illumination and Shading. Illumination (Lighting) Model the interaction of light with surface points to determine their final color and brightness OpenGL.
LIGHTING Part One - Theory based on Chapter 6. Lights in the real world Lights bounce off surfaces and reflect colors, scattering light in many directions.
CS 480/680 Computer Graphics Shading I Dr. Frederick C Harris, Jr.
Fundamentals of Computer Graphics Part 6 Shading prof.ing.Václav Skala, CSc. University of West Bohemia Plzeň, Czech Republic ©2002 Prepared with Angel,E.:
CS 445 / 645: Introductory Computer Graphics
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Shading (introduction to rendering). Rendering  We know how to specify the geometry but how is the color calculated.
COMPUTER GRAPHICS CS 482 – FALL 2014 AUGUST 27, 2014 FIXED-FUNCTION 3D GRAPHICS MESH SPECIFICATION LIGHTING SPECIFICATION REFLECTION SHADING HIERARCHICAL.
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
CSC418 Computer Graphics n Illumination n Lights n Lightinging models.
CS447/ Realistic Rendering -- Radiosity Methods-- Introduction to 2D and 3D Computer Graphics.
Rendering Overview CSE 3541 Matt Boggus. Rendering Algorithmically generating a 2D image from 3D models Raster graphics.
Taku KomuraComputer Graphics Local Illumination and Shading Computer Graphics – Lecture 10 Taku Komura Institute for Perception, Action.
University of Texas at Austin CS 378 – Game Technology Don Fussell CS 378: Computer Game Technology Basic Rendering Pipeline and Shading Spring 2012.
Illumination and Shading
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Graphics Graphics Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.
CS 445 / 645 Introduction to Computer Graphics Lecture 15 Shading Shading.
Lecture Fall 2001 Illumination and Shading in OpenGL Light Sources Empirical Illumination Shading Transforming Normals Tong-Yee Lee.
Local Illumination and Shading
Illumination and Shading Prof. Lizhuang Ma Shanghai Jiao Tong University.
Where We Stand So far we know how to: –Transform between spaces –Rasterize –Decide what’s in front Next –Deciding its intensity and color.
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
Render methods. Contents Levels of rendering Wireframe Plain shadow Gouraud Phong Comparison Gouraud-Phong.
OpenGL Shading. 2 Objectives Learn to shade objects so their images appear three-dimensional Introduce the types of light-material interactions Build.
Lighting and Reflection Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
David Luebke3/16/2016 CS 551 / 645: Introductory Computer Graphics David Luebke
Illumination Models. Introduction 1 Illumination model: Given a point on a surface, what is the perceived color and intensity? Known as Lighting Model,
CS552: Computer Graphics Lecture 33: Illumination and Shading.
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
Computer Graphics Ken-Yi Lee National Taiwan University (the slides are adapted from Bing-Yi Chen and Yung-Yu Chuang)
Computer Graphics: Illumination
Illumination Models and Surface-Rendering Methods CEng 477 Introduction to Computer Graphics.
Illumination and Shading. Illumination (Lighting) Model the interaction of light with surface points to determine their final color and brightness OpenGL.
Illumination and Shading Prof. Lizhuang Ma Shanghai Jiao Tong University.
Basic Ray Tracing CMSC 435/634.
Unit-7 Lighting and Shading
Fundamentals of Computer Graphics Part 6 Shading
CS5500 Computer Graphics May 29, 2006
Illumination and Shading
Illumination Model 고려대학교 컴퓨터 그래픽스 연구실.
Illumination Model 고려대학교 컴퓨터 그래픽스 연구실.
CS 480/680 Computer Graphics Shading.
Presentation transcript:

7M836 Animation & Rendering Illumination models, light sources, reflection shading Arjan Kok a.j.f.kok@tue.nl

Visible surface determination Graphics pipeline Geometric model Viewing Camera parameters Visible surface determination Light sources, materials Shading Rasterize Raster display

Illumination Illumination model Illumination (and therefore color) of point on surface is determined by simulation of light in scene Illumination model is approximation of real light transport Shading method determines for which points illumination is computed determines how illumination for other points is computed

Illumination models Model(s) needed for Emission of light Distribution of light in scene Desired model requirement Accurate Efficient to compute

Illumination models Local illumination Direct illumination Emission of light sources Scattering at surfaces Global illumination Shadows Refraction Interreflection (Ray tracing + Radiosity)

Light source IL (x, y, z, θ, φ, λ) Intensity of energy of light source L arriving at point (x, y, z) from direction (θ, φ) with wavelength λ Complex Simpler model needed (x,y,z)

Point light source Emits light equally in all directions Parameters Intensity I0 Position P (px,py,pz) Attenuation factor (kc, kl, kq) for distance (d) to light source d P

Point light source

Direction light source Emits light in one direction Can be regarded as point light source at infinity E.g. sun Parameters Intenslity I0 Direction D (dx,dy,dz) IL = I0 D

Directional light source

Spot light source Point light source with direction E.g. Spot light Parameters Intensity I0 Position P (px,py,pz) Direction D (dx,dy,dz) “Hotspot” angle θ Maximum angle φ Exponent e d P D γ θ φ

Spot light source if γ ≤ θ if θ < γ ≤ φ if φ < γ Attenuation factor θ φ

Spot light source

Spot light source

Other light sources Linear light sources Area sources Spherical lights …

Reflection Rs (θ, φ, γ, ψ, λ) Amount of energy, arriving from direction (θ, φ), that is reflected in direction (γ, ψ) with wavelength λ Ideal Describe this function for all combinations of θ, φ, γ, ψ and λ Impossible, simpler model(s) needed (θ, φ) (γ, ψ) λ

Reflection model Total intensity on point reflected in certain direction is determined by: Diffusely reflected light Specularly reflected light Emission (for light sources) Reflection of ambient light Intensity not computed for all wavelengths λ, only for R, G and B

Diffuse reflection Incoming light is reflected equally in all directions Amount of reflected light depends only on angle of incident light viewer surface

Diffuse reflection Lambert’ law: Reflected energy from a surface is proportional to the cosine of the angle of direction of incoming light and normal of surface Id = kdILcos(θ) kd is diffuse reflection coefficient  viewer surface

Specular reflection Models reflections of shiny surfaces 

Specular reflection Shininess depends on roughness surface Incident light is reflected unequally in all directions Reflection strongest near mirror angle very shiny less shiny

Specular reflection / Phong Light intensity observed by viewer depends on angle of incident light and angle to viewer Phong model: Is = ksILcosn(α) ks is specular reflection coefficient n is specular reflection exponent   α

Specular reflection / Phong increasing ks increasing n

Emission Emission IE represents light that is emanated directly by surface Used for light sources Emission ≠ 0

Ambient light Even thought parts of scene are not directly lit by light sources, they can still be visible Because of indirect illumination “Ambient” light IA is an approach to this indirect illumination Ambient light is independent of light sources and viewer position Conbtribution of ambient light I = kAIA kA is ambient reflection coefficient IA is ambient intensitity (constant over scene) Indirect illumination can be computed much better: e.g. radiosity

Total illumination Phong model Total intensity Itotal at point P seen by viewer is α0 θ0 θ1 α1

Total illumination Phong model In previous formula kA, kD dependent on wavelength (different values for R, G and B) Often division into color and reflection coefficient of surface where: 0 ≤ kA, kD, kS ≤ 1 CA is ambient reflected color of surface CD is diffuse reflected color of surface Cs is specular reflected color of surface

Only emission and ambient

Including diffuse reflection

Including specular reflection

Illumination model More advanced models: Allows for angle between incident light and surface normal for specular reflection (Fresnel’s law) Better models for surface roughness Beter model for wavelength dependent reflection

Shading Illumination model computes illumination for a point on surface But how do we compute the illumination for all points on all (visible) surfaces? Shading methods: Flat shading Gouraud shading Phong shading

Flat shading Determine illumination for one point on polygon Use this illumination for all points on polygon Disadvantages: Does not account for changing direction to light source over polygon Does not account for changing direction to eye over polygon Discontinuity at polygon boundaries (when curved surface approximated by polygon mesh

Flat shading

Gouraud shading Based on interpolation of illumination values Compute illumination for vertices of polygon Algorithm for all vertices of polygon get vertex normal compute vertex illumination using this normal for all pixels in projection of polygon compute pixel illumination by interpolation of vertex illumination

Gouraud shading ys IA IB I1 IP I2 I3

Gouraud shading

Gouraud shading Advantages Interpolation is simple, hardware implementation Continuous shading over curved surfaces possible Disadvantages Subtle illumination effects (e.g. highlights) require high subdivision of surface in very small polygons

Phong shading Based on normal interpolation Compute illumination for each point of polygon Algorithm for each vertex of polygon get vertex normal for each pixel in projection of polygon compute point normal by interpolation of vertex normals compute illumination using interpolated normal

Phong shading

Phong shading Advantages Nice highlights Disadvantages Computational expensive Normal interpolation and application of illumination model for each pixel

Shading samengevat

Shading Flat shading 1x application of illumination model per polygon 1 color per polygon Gouraud shading 1x application of illumination model per vertex Interpolated colors Phong shading 1x application of illumination model per pixel Nice highlights Increase computation time Increase quality

Visible surface determination Grafische pijplijn Geometric model Viewing Camera parameters Visible surface determination Light sources, materials Shading Rasterize Raster display

Z-buffer & Gouraud shading modeling transformation trivial accept/reject lighting viewing transformation clipping projection z-buffer display

Z-buffer & Phong shading modeling transformation trivial accept/reject viewing transformation clipping projection z-buffer lighting display

What is still missing? Shadows Area light sources “Real” mirroring Transparency Indirect diffuse reflection Influence of atmosphere

Shadow Illumination with shadows Si = 0 if light of source i is blocked = 1 if light of source i is not blocked Several methods to compute shadow Shadow buffer Ray casting Shadow volumes ..

Shadow buffer Based on z-buffer algorithm Rendering in 2 steps Z-buffer from light source (= shadow buffer) to compute shadows During “normal” rendering, when computing illumination of point read from shadow buffer if point is lit by light source

Shadow buffer – step 1 “Render” scene with light source position as viewpoint and store depth results in depth buffer sbuffer(x,y) = minimum z-value after projection of all polygons on (x,y) 3 5 _ 3 5 z

Shadow buffer – step 2 At rendering, when computing illumination of point (x,y,z), transform point into light source coordinate system, resulting in point (x’,y’,z’) Si = 1 als z’ <= sbuffer(x’,y’) = 0 als z’ > sbuffer(x’,y’) 3 5 _ S=0 S=1

What is still missing? Area light sources “Real” mirroring Transparency Indirect diffuse reflection Influence of atmosphere