Color and Light CSCI 4229/5229 Computer Graphics Fall 2016

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

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

ECS 175 COMPUTER GRAPHICS. Ken Joy.! Winter 2014

Comp 410/510 Computer Graphics. Spring Shading

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

CS5620 Intro to Computer Graphics

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 & Shading

Shading I Computer Graphics I, Fall 2008

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

Computer Graphics. Illumination and Shading

Illumination Models & Shading

Illumination and Shading

Light Transport Baoquan Chen 2017

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

Visualisatie BMT. Rendering. Arjan Kok

w Foley, Section16.1 Reading

Introduction to Computer Graphics 7. Shading

Lighting. Figure 10.1

Virtual Reality for Human Computer Interaction

CS 4600 Fall Utah School of Computing

Illumination & Shading: Part 1

Lecture 15: Shading-I. CITS3003 Graphics & Animation

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

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

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

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

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

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

CEng 477 Introduction to Computer Graphics Fall

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

Computer Graphics MTAT Raimond Tunnel

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

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

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

CSE 681 Illumination and Phong Shading

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

CMSC427 Shading Intro. Credit: slides from Dr. Zwicker

Three-Dimensional Graphics V. Guoying Zhao 1 / 55

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

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

Lighting and Shading. Slides: Tamar Shinar, Victor Zordon

CS770/870 Spring 2017 Color and Shading

Shading 1: basics Christian Miller CS Fall 2011

University of Victoria CSC 305 Shading. Brian Wyvill 2016

Reflection and Shading

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

Illumination and Shading

Computer Graphics. Illumination and Shading

Simple Lighting/Illumination Models

Sung-Eui Yoon ( 윤성의 )

Shading. Brian Curless CSE 557 Autumn 2017

CENG 477 Introduction to Computer Graphics. Ray Tracing: Shading

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

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

Why we need shading?

INF3320 Computer Graphics and Discrete Geometry

Lighting and Shading

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

CS 5625 Lec 2: Shading Models

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

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

Shading and Illumination

CPSC 314 LIGHTING AND SHADING

OpenGL Lighting Computer Graphics Spring Frank Palermo

Lighting and Materials

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

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

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

CPSC / Illumination and Shading

CS452/552; EE465/505. Intro to Lighting

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

CS 325 Computer Graphics

Illumination and Shading

Texture Mapping. Images from 3D Creative Magazine

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

Illumination in Computer Graphics

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

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

6. Illumination, Lighting

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

Light Sources. Spotlight model

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

Lecture 1 Image Formation.

Illumination & Shading I

Topics and things to know about them:

Lighting affects appearance

Shading. Brian Curless CSE 457 Spring 2017

Ray Tracing COMP575/COMP770

Computer Graphics: 3-Local Illumination Models

Shading , Fall 2004 Nancy Pollard Mark Tomczak

Ambien Occlusion. Lighting: Ambient Light Sources. Lighting: Ambient Light Sources. Summary

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

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

Illumination and Shading ECE 567

CS3500 Computer Graphics Module: Lighting and Shading

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

Transcription:

Color and Light CSCI 4229/5229 Computer Graphics Fall 2016

Solar Spectrum

Human Trichromatic Color Perception

Color Blindness Present to some degree in 8% of males and about 0.5% of females due to mutation of the X chromosome Example of severe red-green color blindness caused by absence of green cone photo receptors

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 = Cyan No emission = Black Red+Blue = Magenta

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

Surface Normals How light interacts with a surface depends on the angle between the light rays and the surface The vector perpendicular to the surface is called the surface normal or just normal vector For a flat surface the normal is the same for all points on the surface For a curved surface the normal is potentially different at every point

Determining Surface Normals By inspection Cube (parallel to axes) Sphere (radially out) Cone (singularity at top, radially out and up) Torus (radially out from central axis) Cross product of tangental vectors Polygons (difference between vertexes) Analytical derivatives Use normals of actual surface, not polygons used to approximate the surface (see Gouraud shading)

Lighting for Real Time Graphics Add different types of light Ambient: Scattered light from diffuse sources Diffuse: Scattered light from point sources Specular: Directional light from point sources Emission: Light from object itself Local calculations: Light interacts with objects Lighting calculations by component (RGB) Lighting done by vertex Use must specify an appropriate normal

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

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 MC A

Diffuse Reflections Lambertian Reflection Diffuse light scatters in all directions Intensity depends on cosine of the angle of incidence Intensity (N L)MC D

Specular Reflection Light is reflected in a preferred direction Responsible for bright spot on spheres Direction of reflection is R = 2(L N)N L Intensity does not change along R Gets dimmer away from R

Phong Reflection Model Bui Tuong Phong, University of Utah, 1973 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 Jim Blinn, University of Utah, 1978 Also called modified Phong or Fast Phong Half angle H = L+V (renormalize) Simpler and faster Often V = (0,0,1) L constant if far Intensity (N H)S MC

Gouraud Shading Henri Gouraud, University of Utah, 1971 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

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

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

Combined OpenGL Lighting Color = M E +M A C A + (N L)M D C D + (N H) S M S C S Calculated for each light, vertex, RGB Requires normalized (0-1) values User must specify Light color and position Object color and normal

Physics of Non-directional Light 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

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 Controls Enable Lighting Light Sources gllight* Material types glmaterial* Normals glnormal*