Illumination and Shading. Rendering Simulation of physical interaction of light and matter. Physically correct shading is too complex –Material layers.

Slides:



Advertisements
Similar presentations
Illumination Lighting and Shading CSE 470/598 Introduction to Computer Graphics Arizona State University Dianne Hansford.
Advertisements

1 Graphics CSCI 343, Fall 2013 Lecture 18 Lighting and Shading.
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.
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.
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.
University of New Mexico
Computer Graphics - Class 10
IMGD 1001: Illumination by Mark Claypool
Lighting and Shading Wen-Chieh (Steve) Lin
(conventional Cartesian reference system)
1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.
7M836 Animation & Rendering
Objectives Learn to shade objects so their images appear three- dimensional Learn to shade objects so their images appear three- dimensional Introduce.
6.1 Vis_04 Data Visualization Lecture 6 - A Rough Guide to Rendering.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Shading I Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
Course Website: Computer Graphics 16: Illumination.
Shading Surface can either (both) 1.Emit light. E.g. light bult 2.Reflect light. E.g. Mirror.
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
Lecture 5: 3D Rendering Pipeline (II) Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering Georgia Institute of Technology.
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.
Shapes Properties Binding Chung Ji Hye.
CSC418 Computer Graphics n Illumination n Lights n Lightinging models.
Rendering Overview CSE 3541 Matt Boggus. Rendering Algorithmically generating a 2D image from 3D models Raster graphics.
Illumination and Shading How to shade surfaces based on the position,orientation,characteristics of the surfaces and the light sources illuminating them.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
Illumination and Shading
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Course Introduction to virtual engineering Óbuda University John von Neumann Faculty of Informatics Institute of Applied Mathematics Lecture and laboratory.
Shading in OpenGL Ed Angel Professor Emeritus of Computer Science University of New Mexico 1 E. Angel and D. Shreiner: Interactive Computer Graphics 6E.
Cameras and Light Chapter 4, The Inventor Mentor.
Lecture Fall 2001 Illumination and Shading in OpenGL Light Sources Empirical Illumination Shading Transforming Normals Tong-Yee Lee.
Specular Reflection Lecture 27 Mon, Nov 10, 2003.
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.
고려대학교 그래픽스 연구실 Cameras and Lights - The Inventor mentor 고려대학교 그래픽스 연구실 민 성환.
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.
Illumination Models. Introduction 1 Illumination model: Given a point on a surface, what is the perceived color and intensity? Known as Lighting Model,
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.
Computer Graphics (fall,2010) School of Computer Science University of Seoul Minho Kim.
Shading To determine the correct shades of color on the surface of graphical objects.
Unit-7 Lighting and Shading
CSE 470 Introduction to Computer Graphics Arizona State University
Illumination and Shading
Fundamentals of Computer Graphics Part 6 Shading
Isaac Gang University of Mary Hardin-Baylor
Illumination and Shading
Last Time Liang-Barsky Details Weiler-Atherton clipping algorithm
Illumination Model 고려대학교 컴퓨터 그래픽스 연구실.
Illumination Model 고려대학교 컴퓨터 그래픽스 연구실.
CS 480/680 Computer Graphics Shading.
Computer Graphics Shading in OpenGL
Lighting Calculations
Presentation transcript:

Illumination and Shading

Rendering Simulation of physical interaction of light and matter. Physically correct shading is too complex –Material layers –Inter-object relations Good approximations are possible –Physical models when CPU available –Heuristics that look good

Light Sources Point source (A) –Light originates from a point –The point may be at infinity –Approximation for light sources whose dimensions are small relative to objects A B C

Light Sources Parallel source –Light rays are parallel –Can be modeled as a light source in infinity –Approximation for far sources A B C

Light Sources Light originates at a finite area –Windows –Fluorescent Sometimes called distributed source A B C

Light Sources Example Parallel light source Point light source

Illumination models Material has following properties –Ambient –Diffuse –Specular

Illumination models Material has following properties –Ambient Compensates for global interactions Assumes non directional light in the environment The shading equation: I = I A K A, I A – ambient light, K A – surface parameter –Diffuse –Specular

Illumination models Material has following properties –Ambient –Diffuse Represents matt (non shining) surfaces Known as Lambert model Reflects lights in all directions Reflected light is proportional to I = I D K D –Specular L N

Illumination models Material has following properties –Ambient –Diffuse –Specular Shiny (metallic) surfaces reflect light in preferred direction Ideal shiny surface reflects only in one direction R Phong specularity exponent (no physical basis) n L R V

Illumination models Material has following properties –Ambient –Diffuse –Specular Computing R  

Illumination Equation Definitions –N – point normal –V – viewing direction –L – lighting direction –R – reflection direction –D – diffuse, A – ambient, S – specular –I – intensity –K – surface coefficient, –θ – angle between V and L –α – angle between V and R n L R V

Illumination comparison Ambient Diffuse Specular, n = 100 Specular, n = 8

Shading Constant Gouraud Phong

Shading Constant –Color each polygon according to its normal Gouraud Phong

Shading Constant Gouraud –Compute exact colors for vertexes –Interpolate colors for interior pixels of polygon –We can miss specular highlights Phong

Shading Constant Gouraud Phong (default Inventor model) –Compute normals for vertexes –Interpolate normals for interior pixels –Compute color according to pixel normal

Shading Example

Interpolation scanline

Lights in Inventor Light node in Inventor determines –What the light illuminates (following nodes) –Where it is located (affected by current transformation) Light sources are cumulative SoTransformSeparator –Light should not be under standard separator –You can separate only light transformation –Only the light position can be changed

Light Nodes SoLight fields –On (SoSFBool) If the source is turned on / off –Intensity (SOSFFloat) 0 – minimum 1 – maximum –color (SOSFColor) Color of the light

Light Nodes SoPointLight (Point Source) – location (SoSFVec3f) 3D location of a point light source affected by current geometric transformation

Light Nodes SoDirectionalLight (Parallel source) –direction (SOSFVec3f) Direction of rays Affected by current transformation

Light Nodes SoSpotLight –A point light restricted to a cone – location (SoSFVec3f) 3D location of a point light source affected by current geometric transformation – direction (SoSFVec3f) primary direction of illumination – dropOffRate (SoSFFloat) rate at which the light intensity drops off from the primary direction. 0.0 = constant intensity 1.0 = sharpest drop-off

Light Nodes cutOffAngle (SoSFFloat) –angle, in radians, where the intensity is 0.0 –measured from one cone edge to the other

Light Nodes Directional lights are the fastest Spotlights are the slowest To increase speed use fewer lights

Multiple Lights Example The example contains: –A red stationary directional light –A green light moved back and forth by SoShuttle

Example // Add a directional light SoDirectionalLight *myDirLight = new SoDirectionalLight; myDirLight->direction.setValue(0, -1, -1); myDirLight->color.setValue(1, 0, 0); // red root->addChild(myDirLight); // Add shuttle and point light SoShuttle *myShuttle = new SoShuttle; myTransformSeparator->addChild(myShuttle); myShuttle->translation0.setValue(-2, -1, 3); myShuttle->translation1.setValue( 1, 2, -3); SoPointLight *myPointLight = new SoPointLight; myTransformSeparator->addChild(myPointLight); myPointLight->color.setValue(0, 1, 0); // green

Surface Material Opaque surface –Light is reflected and absorbed Transparent surface –Light is reflected and transmitted SoMaterial contains –transparrency (SoMFFloat) 0.0 for opaque 1.0 for transparent

Surface material The amount reflected depends on material –Shiny reflect more Intensive brightness in one direction –Rough reflect less Equally bright from all directions SoMaterial contains –shininess (SoMFFloat) 0.0 for diffuse 1.0 for metallic –diffuseColor (SoMFColor) K D –specularColor (SoMFColor) K S

Ambient light Models inter-object relations The object is illuminated with the same light everywhere One equation for each channel R,G,B. SoEnvironment contains –ambientIntensity ( SoSFFloat) I A –ambientColor (SoSFColor) K AE (environment) SoMaterial contains –ambientColor (SoSFColor) K AM (material) K A = K AE *K AM

Ray Tracing

Radiosity Direct IlluminationGlobal Illumination

Radiosity