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

Similar documents
Color and Light CSCI 4229/5229 Computer Graphics Fall 2016

Comp 410/510 Computer Graphics. Spring Shading

ECS 175 COMPUTER GRAPHICS. Ken Joy.! Winter 2014

CS5620 Intro to Computer Graphics

Shading I Computer Graphics I, Fall 2008

Illumination & Shading

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

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

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

Illumination Models & Shading

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

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

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

Light Transport Baoquan Chen 2017

Computer Graphics. Illumination and Shading

Lecture 15: Shading-I. CITS3003 Graphics & Animation

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

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

w Foley, Section16.1 Reading

Lighting. Figure 10.1

Virtual Reality for Human Computer Interaction

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

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

Introduction to Computer Graphics 7. Shading

Visualisatie BMT. Rendering. Arjan Kok

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

CSE 681 Illumination and Phong Shading

CS 4600 Fall Utah School of Computing

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

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

Illumination and Shading

Illumination & Shading: Part 1

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

Three-Dimensional Graphics V. Guoying Zhao 1 / 55

CEng 477 Introduction to Computer Graphics Fall

CS 5625 Lec 2: Shading Models

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

Reflection and Shading

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

Why we need shading?

Color and Shading. Color. Shapiro and Stockman, Chapter 6. Color and Machine Vision. Color and Perception

Shading. Brian Curless CSE 557 Autumn 2017

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

Illumination and Shading

INF3320 Computer Graphics and Discrete Geometry

CMSC427 Shading Intro. Credit: slides from Dr. Zwicker

Lighting and Shading. Slides: Tamar Shinar, Victor Zordon

CS770/870 Spring 2017 Color and Shading

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

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

Texture Mapping. Images from 3D Creative Magazine

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

Computer Graphics MTAT Raimond Tunnel

Sung-Eui Yoon ( 윤성의 )

University of Victoria CSC 305 Shading. Brian Wyvill 2016

CPSC / Illumination and Shading

CENG 477 Introduction to Computer Graphics. Ray Tracing: Shading

Computer Graphics. Illumination and Shading

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

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

Lighting and Shading

Global Illumination CS334. Daniel G. Aliaga Department of Computer Science Purdue University

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

Illumination and Shading

Illumination in Computer Graphics

Shading. Brian Curless CSE 457 Spring 2017

Shading 1: basics Christian Miller CS Fall 2011

Lighting and Materials

Simple Lighting/Illumination Models

CS452/552; EE465/505. Intro to Lighting

Illumination & Shading I

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

Global Illumination. CSCI 420 Computer Graphics Lecture 18. BRDFs Raytracing and Radiosity Subsurface Scattering Photon Mapping [Ch

Global Illumination. Global Illumination. Direct Illumination vs. Global Illumination. Indirect Illumination. Soft Shadows.

Illumination. Illumination CMSC 435/634

Lighting & 3D Graphics. Images from 3D Creative Magazine

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

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

Photorealism: Ray Tracing

CPSC 314 LIGHTING AND SHADING

Lighting. To do. Course Outline. This Lecture. Continue to work on ray programming assignment Start thinking about final project

Shading and Illumination

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

OpenGL Lighting Computer Graphics Spring Frank Palermo

Chapter 10. Surface-Rendering Methods. Somsak Walairacht, Computer Engineering, KMITL

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

CSCI 4620/8626. Computer Graphics Illumination Models and Surface Rendering Methods (Chapter 17)

Turn on the Lights: Reflectance

Lighting affects appearance

CS 325 Computer Graphics

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

6. Illumination, Lighting

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

Light Sources. Spotlight model

Global Illumination. Global Illumination. Direct Illumination vs. Global Illumination. Indirect Illumination. Soft Shadows.

Illumination and Shading ECE 567

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

CS Computer Graphics: Illumination and Shading I

CS Computer Graphics: Illumination and Shading I

Shading , Fall 2004 Nancy Pollard Mark Tomczak

Transcription:

Color and Light CSCI 4229/5229 Computer Graphics Summer 2008

Solar Spectrum

Human Trichromatic Color Perception

Are A and B the same?

Color perception is relative

Transmission,Absorption&Reflection Light source generates radiation with specific energy-frequency spectrum Opaque objects absorb some frequencies and reflect others Translucent objects absorb some frequencies and transmit others Apparent color depends on the spectrum that remains when it reaches the eye

Color Examples White source -> red glass -> white paper = red White source -> white paper -> red glass = red Red source -> white paper = red White source -> red glass -> green paper = dark Red source -> green glass = dark

RGB Color Approximates how humans see Additive color Red+Green = Yellow Red+Green+Blue = White Green+Blue = MagentaNo emission = Black Red+Blue = Cyan

CMY/CMYK Color Printing color Subtractive Color Yellow+Magenta = Red Yellow+Cyan = Green Cyan+Magenta = Blue Yellow+Cyan+Magenta = Black No ink = White Black helps make darker colors and true black

HSV Color Color Progression model Hue (color) Saturation (intensity) Value (brightness) Useful in translating values to range of colors

Color in the Real World Sunlight is essentially white Incandescent light is yellowish Fluorescent light is mostly blue-green Reflected light depends on the surroundings Wall, ceiling and floor color Large objects Filtered light Light is often bounced off multiple objects before it reaches the eye

Local vs. Global Lighting Global lighting Traces how light bounces off successive objects Recursive Ray tracing and Radiosity Not currently practical for real time graphics Local lighting Separates light sources into direct and ambient Calculates intensity based only on vectors Many possible simplifications Requires special action to generate shadows

Color and Materials Mirrors reflect (almost) all light Highly directional Metals, glazed ceramics, calm water,... Mostly directional, some diffuse Plastics, unglazed ceramics, turbulent water,... Some directional, mostly diffuse Natural materials (leaves, leather, skin,...) Predominantly diffuse

Phong Reflection Model L light source N normal vector for surface R reflected light R = 2(L N)N L V viewer (eye) Intensity (V R) S MC S shininess M material reflection coefficient C color if light source Calculated independently for R,G,B

Blinn-Phong Reflection Model Also called modified Phong or Fast Phong Simpler and faster Half angle H = L+V (renormalize) Intensity (N H ) S MC

Gouraud Shading Calculate lighting effects only at vertices True Gouraud shading calculates vertex normal as the average of the normals of adjoining polygons Interpolate lighting effects (colors) across the surface of the polygon Potentially significant computational savings over calculating lighting effects for each pixel

Non-directional Reflection Point source light Radiates in all directions Intensity decays inversely proportional to r 2 Absorption could attenuate light faster Diffuse surface reflection Radiates in normal hemisphere Reflected from rough (matte) surface Also absorbed and re-emitted light

Global Ambient OpenGL Light Types Ambient light not from any specific light source Ambient Light from all directions associated with source Diffuse Light reflecting in all directions Specular Light reflecting in preferred direction Emission Light emanating from each object

Local Light Calculations Light is additive Color intensity is the sum of all light sources and types (ambient, specular,...) Colors are added by component (R,G,B separately) Color intensity varies with the cosine of angles Color hue changes as relative component intensities change Light behaves algebraically Intensity varies essentially linear Shadows can be made by subtracting light

Specular Reflection Light is reflected in a preferred direction Responsible for bright spot on spheres OpenGL uses Blinn-Phong shading Intensity (N H )S MC S

Diffuse Reflections Diffuse light scatters in all directions Intensity depends on cosine of the angle of incidence Intensity (N L )MCD

Ambient Light Light comes from all directions and is reflected in all directions The color and intensity of ambient light represents the net result of multiple reflections Color of walls illuminated by white light Color of canopy in forest Intensity MCA

Emission Light Object radiates light in all directions Color and intensity independent of incident light Typically used to represent internally lit objects Since all calculations are LOCAL the light from internally lit objects does not light up the scene Intensity CE (which is a property of the material)

Hints on Using Lights Stick to a single light Use white lights (R=G=B= =1) Specify one ambient light (global or primary) Intensity should be in the 0.1 to 0.3 range. Diffuse (soft) light should always be present, intensity 1. Specular (hard) light creates highlights, sparkles, etc.

Hints on Using Materials Changing color on materials is simpler than changing the color of light Use the same color for ambient and diffuse Materials are typically one of matte, high diffuse color and low specular plastic, with high diffuse color and white specular metal, with low diffuse and high specular color Color is determined by specular for metals, diffuse for other materials

Hints on Surface Normals Surface normals are required for lighting glu and glut objects calculate these Normals are perpendicular to polygons Normals are transformed with verteces Normals must be unit length (watch scaling) glenable(gl_normalize) enforces this

OpenGL Lighting Enable Lighting Light Sources gllight* Material types glmaterial* Normals glnormal*