CSCE 641 Computer Graphics: Image-based Rendering (cont.) Jinxiang Chai.
1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.
-
date post
21-Dec-2015 -
Category
Documents
-
view
220 -
download
1
Transcript of 1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.
![Page 1: 1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.](https://reader030.fdocuments.in/reader030/viewer/2022032801/56649d545503460f94a31b46/html5/thumbnails/1.jpg)
1
CSCE 641: Computer GraphicsLighting
Jinxiang Chai
![Page 2: 1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.](https://reader030.fdocuments.in/reader030/viewer/2022032801/56649d545503460f94a31b46/html5/thumbnails/2.jpg)
Scan conversion
3D Rendering pipeline
Modeling transformation
lighting
Viewing transformation
Project transformation
Clipping
Image
Transform into 3D world system
Illuminate according to lighting and reflectance
Transform into 3D camera coordinate system
Transform into 2D camera system
Clip primitives outside camera’s view
Draw pixels (includes texturing, hidden surface, etc.)
![Page 3: 1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.](https://reader030.fdocuments.in/reader030/viewer/2022032801/56649d545503460f94a31b46/html5/thumbnails/3.jpg)
Scan conversion
3D Rendering pipeline
Modeling transformation
lighting
Viewing transformation
Project transformation
Clipping
Image
Transform into 3D world system
Illuminate according to lighting and reflectance
Transform into 3D camera coordinate system
Transform into 2D camera system
Clip primitives outside camera’s view
Draw pixels (includes texturing, hidden surface, etc.)
![Page 4: 1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.](https://reader030.fdocuments.in/reader030/viewer/2022032801/56649d545503460f94a31b46/html5/thumbnails/4.jpg)
Outline
Ambient, diffuse and specular light
Light attenuation & spot lights
![Page 5: 1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.](https://reader030.fdocuments.in/reader030/viewer/2022032801/56649d545503460f94a31b46/html5/thumbnails/5.jpg)
Lighting/Illumination
Color is a function of how light reflects from surfaces to the eye
Global illumination accounts for light from all sources as it is transmitted throughout the environment
Local illumination only accounts for light that directly hits a surface and is transmitted to the eye
![Page 6: 1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.](https://reader030.fdocuments.in/reader030/viewer/2022032801/56649d545503460f94a31b46/html5/thumbnails/6.jpg)
Direct and Indirect Light
![Page 7: 1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.](https://reader030.fdocuments.in/reader030/viewer/2022032801/56649d545503460f94a31b46/html5/thumbnails/7.jpg)
Global Illumination II
![Page 8: 1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.](https://reader030.fdocuments.in/reader030/viewer/2022032801/56649d545503460f94a31b46/html5/thumbnails/8.jpg)
Global Illumination II
![Page 9: 1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.](https://reader030.fdocuments.in/reader030/viewer/2022032801/56649d545503460f94a31b46/html5/thumbnails/9.jpg)
Lighting/Illumination
Color is a function of how light reflects from surfaces to the eye
Global illumination accounts for light from all sources as it is transmitted throughout the environment
Local illumination only accounts for light that directly hits a surface and is transmitted to the eye
![Page 10: 1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.](https://reader030.fdocuments.in/reader030/viewer/2022032801/56649d545503460f94a31b46/html5/thumbnails/10.jpg)
Reflection Models
Definition: Reflection is the process by which light incident on a surface interacts with the surface such that it leaves on the incident side without change in frequency.
![Page 11: 1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.](https://reader030.fdocuments.in/reader030/viewer/2022032801/56649d545503460f94a31b46/html5/thumbnails/11.jpg)
Reflection Models
Definition: Reflection is the process by which light incident on a surface interacts with the surface such that it leaves on the incident side without change in frequency.
![Page 12: 1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.](https://reader030.fdocuments.in/reader030/viewer/2022032801/56649d545503460f94a31b46/html5/thumbnails/12.jpg)
Reflection Models
Definition: Reflection is the process by which light incident on a surface interacts with the surface such that it leaves on the incident side without change in frequency.
![Page 13: 1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.](https://reader030.fdocuments.in/reader030/viewer/2022032801/56649d545503460f94a31b46/html5/thumbnails/13.jpg)
Reflection Models
Definition: Reflection is the process by which light incident on a surface interacts with the surface such that it leaves on the incident side without change in frequency.
![Page 14: 1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.](https://reader030.fdocuments.in/reader030/viewer/2022032801/56649d545503460f94a31b46/html5/thumbnails/14.jpg)
Types of Reflection Functions
Ideal Specular Reflection Law Mirror
![Page 15: 1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.](https://reader030.fdocuments.in/reader030/viewer/2022032801/56649d545503460f94a31b46/html5/thumbnails/15.jpg)
Types of Reflection Functions
Ideal Specular Reflection Law Mirror
Ideal Diffuse Lambert’s Law Matte
![Page 16: 1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.](https://reader030.fdocuments.in/reader030/viewer/2022032801/56649d545503460f94a31b46/html5/thumbnails/16.jpg)
Types of Reflection Functions
Ideal Specular Reflection Law Mirror
Ideal Diffuse Lambert’s Law Matte
Specular Glossy Directional diffuse
![Page 17: 1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.](https://reader030.fdocuments.in/reader030/viewer/2022032801/56649d545503460f94a31b46/html5/thumbnails/17.jpg)
Materials
Plastic Metal Matte
From Apodaca and Gritz, Advanced RenderMan
![Page 18: 1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.](https://reader030.fdocuments.in/reader030/viewer/2022032801/56649d545503460f94a31b46/html5/thumbnails/18.jpg)
Illumination Model
Ambient LightUniform light caused by secondary
reflections Diffuse Light
Light scattered equally in all directions Specular Light
Highlights on shiny surfaces
![Page 19: 1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.](https://reader030.fdocuments.in/reader030/viewer/2022032801/56649d545503460f94a31b46/html5/thumbnails/19.jpg)
Ambient Light
A =intensity of ambient light ka= ambient reflection coefficient
Really 3 equations! (Red, Green, Blue) Accounts for indirect illumination Determines color of shadows
AkI a
![Page 20: 1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.](https://reader030.fdocuments.in/reader030/viewer/2022032801/56649d545503460f94a31b46/html5/thumbnails/20.jpg)
Total Illumination
AkI a
![Page 21: 1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.](https://reader030.fdocuments.in/reader030/viewer/2022032801/56649d545503460f94a31b46/html5/thumbnails/21.jpg)
Diffuse Light
Assumes that light is reflected equally in all directions
Handles both local and infinite light sources Infinite distance: L doesn’t changeFinite distance: must calculate L for each
point on surface
LN
Surface
![Page 22: 1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.](https://reader030.fdocuments.in/reader030/viewer/2022032801/56649d545503460f94a31b46/html5/thumbnails/22.jpg)
Diffuse Light
C = intensity of point light source kd = diffuse reflection coefficient
= angle between normal and direction to light
)()cos( NLkCkCI dd
LN
Surface
NL)cos(
![Page 23: 1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.](https://reader030.fdocuments.in/reader030/viewer/2022032801/56649d545503460f94a31b46/html5/thumbnails/23.jpg)
Total Illumination
AkI a
![Page 24: 1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.](https://reader030.fdocuments.in/reader030/viewer/2022032801/56649d545503460f94a31b46/html5/thumbnails/24.jpg)
Total Illumination
)( NLCkAkI da
![Page 25: 1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.](https://reader030.fdocuments.in/reader030/viewer/2022032801/56649d545503460f94a31b46/html5/thumbnails/25.jpg)
Materials
Plastic Metal Matte
From Apodaca and Gritz, Advanced RenderMan
![Page 26: 1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.](https://reader030.fdocuments.in/reader030/viewer/2022032801/56649d545503460f94a31b46/html5/thumbnails/26.jpg)
Specular Light
Perfect, mirror-like reflection of light from surface
Forms highlights on shiny objects (metal, plastic)
LN
Surface
R
E
![Page 27: 1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.](https://reader030.fdocuments.in/reader030/viewer/2022032801/56649d545503460f94a31b46/html5/thumbnails/27.jpg)
Specular Light
C = intensity of point light source ks = specular reflection coefficient
= angle between reflected vector (R) and eye (E)
n = specular coefficient
ns
ns ERkCkCI )()(cos
LN
Surface
ER)cos(
R
E
![Page 28: 1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.](https://reader030.fdocuments.in/reader030/viewer/2022032801/56649d545503460f94a31b46/html5/thumbnails/28.jpg)
Finding the Reflected Vector
L
N
Surface
R
![Page 29: 1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.](https://reader030.fdocuments.in/reader030/viewer/2022032801/56649d545503460f94a31b46/html5/thumbnails/29.jpg)
Finding the Reflected Vector
L
N
Surface
R||L
L
![Page 30: 1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.](https://reader030.fdocuments.in/reader030/viewer/2022032801/56649d545503460f94a31b46/html5/thumbnails/30.jpg)
Finding the Reflected Vector
L
N
Surface
R||L
L
)()cos(|| NLNNL
||LLL
![Page 31: 1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.](https://reader030.fdocuments.in/reader030/viewer/2022032801/56649d545503460f94a31b46/html5/thumbnails/31.jpg)
Finding the Reflected Vector
L
N
Surface
R||L
L
LLR ||
![Page 32: 1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.](https://reader030.fdocuments.in/reader030/viewer/2022032801/56649d545503460f94a31b46/html5/thumbnails/32.jpg)
Finding the Reflected Vector
L
N
Surface
R||L
L
LLLLR |||| 2
![Page 33: 1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.](https://reader030.fdocuments.in/reader030/viewer/2022032801/56649d545503460f94a31b46/html5/thumbnails/33.jpg)
Finding the Reflected Vector
L
N
Surface
R||L
L
LNNLR )(2
![Page 34: 1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.](https://reader030.fdocuments.in/reader030/viewer/2022032801/56649d545503460f94a31b46/html5/thumbnails/34.jpg)
Total Illumination
)( NLCkAkI da
![Page 35: 1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.](https://reader030.fdocuments.in/reader030/viewer/2022032801/56649d545503460f94a31b46/html5/thumbnails/35.jpg)
Total Illumination
nsda ERkNLkCAkI )()(
5n
![Page 36: 1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.](https://reader030.fdocuments.in/reader030/viewer/2022032801/56649d545503460f94a31b46/html5/thumbnails/36.jpg)
Total Illumination
nsda ERkNLkCAkI )()(
50n
![Page 37: 1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.](https://reader030.fdocuments.in/reader030/viewer/2022032801/56649d545503460f94a31b46/html5/thumbnails/37.jpg)
Total Illumination
nsda ERkNLkCAkI )()(
500n
![Page 38: 1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.](https://reader030.fdocuments.in/reader030/viewer/2022032801/56649d545503460f94a31b46/html5/thumbnails/38.jpg)
Multiple Light Sources
Only one ambient term no matter how many lights
Light is additive; add contribution of multiple lights (diffuse/specular components)
![Page 39: 1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.](https://reader030.fdocuments.in/reader030/viewer/2022032801/56649d545503460f94a31b46/html5/thumbnails/39.jpg)
Total Illumination
nsda ERkNLkCAkI )()(
![Page 40: 1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.](https://reader030.fdocuments.in/reader030/viewer/2022032801/56649d545503460f94a31b46/html5/thumbnails/40.jpg)
Total Illumination
i
nisidia ERkNLkCAkI )()(
![Page 41: 1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.](https://reader030.fdocuments.in/reader030/viewer/2022032801/56649d545503460f94a31b46/html5/thumbnails/41.jpg)
Other Lights
Attenuation caused by fog, smoke
Spot lights
![Page 42: 1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.](https://reader030.fdocuments.in/reader030/viewer/2022032801/56649d545503460f94a31b46/html5/thumbnails/42.jpg)
Attenuation
Decrease intensity with distance from light
d = distance to light r = radius of attenuation for light
)1,0max(),( rdrdatt
)1,0max(),( 2
2
rdrdatt
22
21,0max),(r
drdatt 2
2
),( rd
erdatt
![Page 43: 1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.](https://reader030.fdocuments.in/reader030/viewer/2022032801/56649d545503460f94a31b46/html5/thumbnails/43.jpg)
Attenuation
i
in
isidia rdattERkNLkCAkI ),()()(
![Page 44: 1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.](https://reader030.fdocuments.in/reader030/viewer/2022032801/56649d545503460f94a31b46/html5/thumbnails/44.jpg)
Attenuation
i
in
isidia rdattERkNLkCAkI ),()()(
![Page 45: 1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.](https://reader030.fdocuments.in/reader030/viewer/2022032801/56649d545503460f94a31b46/html5/thumbnails/45.jpg)
Spot Lights
Eliminate light contribution outside of a cone
A
L
Surface
![Page 46: 1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.](https://reader030.fdocuments.in/reader030/viewer/2022032801/56649d545503460f94a31b46/html5/thumbnails/46.jpg)
Spot Lights
Eliminate light contribution outside of a cone
A
L
Surface
ALAL
ALspotCoeff
),cos(
0),cos(
![Page 47: 1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.](https://reader030.fdocuments.in/reader030/viewer/2022032801/56649d545503460f94a31b46/html5/thumbnails/47.jpg)
Attenuation
i
in
isidia spotCoeffERkNLkCAkI )()(
![Page 48: 1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.](https://reader030.fdocuments.in/reader030/viewer/2022032801/56649d545503460f94a31b46/html5/thumbnails/48.jpg)
Spot Lights
i
in
isidia spotCoeffERkNLkCAkI )()(
![Page 49: 1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.](https://reader030.fdocuments.in/reader030/viewer/2022032801/56649d545503460f94a31b46/html5/thumbnails/49.jpg)
Spot Lights
i
in
isidia spotCoeffERkNLkCAkI )()(
![Page 50: 1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.](https://reader030.fdocuments.in/reader030/viewer/2022032801/56649d545503460f94a31b46/html5/thumbnails/50.jpg)
Implementation Considerations
L
N
Surface
nsda ERkNLkCAkI )()(
![Page 51: 1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.](https://reader030.fdocuments.in/reader030/viewer/2022032801/56649d545503460f94a31b46/html5/thumbnails/51.jpg)
Implementation Considerations
Typically choose Clamp each color component to [0,1]
i
nisidia ERkNLkCAkI )()(
1 sda kkk
![Page 52: 1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.](https://reader030.fdocuments.in/reader030/viewer/2022032801/56649d545503460f94a31b46/html5/thumbnails/52.jpg)
Opengl Functions
how to set up light sources (light source pos
- light source position and type
- light source colors
- radial-intensity attenuation
- spotlights
how to specify global lighting parameters how to specify surface properties
![Page 53: 1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.](https://reader030.fdocuments.in/reader030/viewer/2022032801/56649d545503460f94a31b46/html5/thumbnails/53.jpg)
Next Lecture
Shading
Texture mapping & others