• No results found

Illumination Models & Surface-Rendering Methods

N/A
N/A
Protected

Academic year: 2021

Share "Illumination Models & Surface-Rendering Methods"

Copied!
35
0
0

Loading.... (view fulltext now)

Full text

(1)

Computer Graphics

(2)

2 2

Chapter 14

Chapter 14

Illumination Models & Surface-Rendering

Illumination Models & Surface-Rendering

Methods

Methods

Computer Graphics

(3)

Chapter 14

Chapter 14

Illumination Models & Surface-Rendering

Illumination Models & Surface-Rendering

Methods

Methods

Computer Graphics

(4)

3 3

Illumination Models &

Illumination Models &

Surface-Rendering Methods

Rendering Methods

••

 Illumination

 Illumination model 

model 

 or a

 or a

lighting model 

lighting model 

is

is

the model for calculating light intensity at a

the model for calculating light intensity at a

single surface point.

single surface point.

••

 Surface rendering 

 Surface rendering 

is a procedure for

is a procedure for

applying a lighting model to obtain piel

applying a lighting model to obtain piel

intensities for all the pro!ected surface

intensities for all the pro!ected surface

 positions in a scene.

(5)

Surface rendering

Surface rendering

•• Surface rendering can be performed by applying Surface rendering can be performed by applying thethe illumination model to e#ery #isible surface point$ or illumination model to e#ery #isible surface point$ or the rendering can be accomplished by interpolating the rendering can be accomplished by interpolating intensities across the surface from a small set of

intensities across the surface from a small set of illumination-model calculations.

illumination-model calculations.

•• Scan-line algorithms use interpolation schemes.Scan-line algorithms use interpolation schemes. •• Ray tracing algorithms in#o%e the illuminationRay tracing algorithms in#o%e the illumination

model at each piel position. model at each piel position.

•• Surface-rendering procedures are termedSurface-rendering procedures are termed surface- surface-shading methods

(6)

Illumination models

'i#en the parameters(

• the optical properties of surfaces

)opa*ue+transparent$ shiny+dull$ surface-teture, • the relati#e positions of the surfaces in a scene •  the color and positions of the light sources

• the position and orientation of the #ieing plane. Illumination models calculate the intensity pro!ected

from a particular surface point in a specified #ieing direction.

(7)

0ecture lane

• 0ight Sources

• asic Illumination Models

mbient 0ight

4iffuse Reflection

Specular Reflection & hong Model

5ombine 4iffuse & Specular Reflections

ith Multiple 0ight Sources

(8)

6

0ight Sources

• 7hen e #ie an opa*ue nonluminous ob!ect$ e see reflected light from the surfaces of the ob!ect. • 8he total reflected light is the sum of the

contributions from light sources and other reflecting surfaces in the scene.

• 0ight sources 9 light-emitting sources.

(9)

0ight Sources

0ight Source Reflecting Surfaces Fig. 1

0ight #ieed from an opa*ue surface is in general a combination of reflected light from a light source and reflections of light reflections from other surfaces.

(10)

;

oint 0ight Source

• 8he rays emitted from a point

light radially di#erge from the source.

• pproimation for sources that are small compared to

the si<e of ob!ects in the scene.

•  point light source is a fair approimation to a local light source such as a light bulb.

• 8he direction of the light to each point on a

surface changes hen a point light source is used.

Fig. 2

(11)

4istributed 0ight Source

•  nearby source$ such as

the long fluoresent light. • ll of the rays from a

directional+distributed light source ha#e the same direction$ and no  point of origin.

• It is as if the light source as infinitely far aay from the surface that it is illuminating.

• Sunlight is an eample of an infinite light source.

Fig. 3

(12)

11

Materials

• 7hen light is incident on an opa*ue

surface$ part of it is reflected and part is

absorbed.

• Shiny materials reflect more of the incident

light$ and dull surface absorb more of the

incident light.

• >or an illuminated transparent surface$

some of the incident light ill be reflected

and some ill be transmitted through the

material.

(13)

4iffuse reflection

• 'rainy surfaces scatter the reflected light in all directions. 8his scattered light is called diffuse reflection.

• 8he surface appears e*ually bright from all #ieing directions.

• 7hat e call the color of an ob!ect is the color of the diffuse reflection of the incident light.

Fig. 4

(14)

13

Specular reflection

• 0ight sources create highlights$ bright spots$

called

specular reflection

. More

 pronounced on shiny surfaces than on dull.

Fig. 5

(15)

asic Illumination Models

0ighting calculations are based on(

• ?ptical properties of surfaces$ such as

glossy$ matte$ opa*ue$ and transparent. 8his

controls the amount of reflection and

absorption of incident light.

• 8he bac%ground lighting conditions.

• 8he light-source specifications. ll light

sources are considered to be point sources$

specified ith a coordinate position and

(16)

1

mbient 0ight

• @#en though an ob!ect in a scene is not directly lit it ill still be #isible. 8his is because light is reflected from nearby ob!ects. • mbient light has no spatial or

directional characteristics.

• 8he amount of ambient light incident on each ob!ect is a constant for all surfaces and o#er all directions.

• 8he amount of ambient light that is reflected by an ob!ect is independent of the ob!ects position or orientation and depends only on the optical properties of the surface.

Fig. 6

(17)

mbient 0ight

• 8he le#el of ambient light in a scene is a parameter  I a $ and each surface illuminated ith this constant

#alue.

• Illumination e*uation for ambient light is  I 9 k a I a

here

 I  is the resulting intensity

 I a is the incident ambient light intensity k a is the ob!ectAs basic intensity$ ambient-reflection coefficient .

(18)

16

(19)

1:

4iffuse Reflection

• 4iffuse reflections are constant o#er each surface in a scene$ independent of the #ieing direction.

• 8he amount of the incident light that is diffusely

reflected can be set for each surface ith parameter k $ the diffuse-reflection coefficient $ or diffuse

reflectivity. = ≤ k ≤ 1

 near 1 B highly reflecti#e surface

 near = B surface that absorbs most of the  incident light

(20)

1;

4iffuse Reflection

@#en though there is e*ual light scattering in all direction from a surface$ the brightness of the surface does depend on the orientation of the surface relati#e to the light

source(

)a, )b,

Fig. 8

 surface perpendicular to the direction of t he incident light )a, is more illuminated than an e*ual-si<ed surface at an obli*ue angle )b, to the incoming light direction.

(21)

4iffuse Reflection

• s the angle beteen the surface normal

and the incoming light direction increases$

les of the incident light falls on the surface.

• 7e denote the

angle of incidence

 beteen

the incoming light direction and the surface

normal as

θ 

. 8hus$ the amount of

illumination depends on cos

θ 

. If the

incoming light from the source is

 perpendicular to the surface at a particular

 point$ that point is fully illuminated.

(22)

21

4iffuse Reflection

If I l is the intensity of the point

0ight source$ then the diffuse reflection e*uation for a point on the surface can be ritten as

 I l,diff  9 k  I cosθ 

or 

 I l,diff  9 k d  I l )C.0,

here

N is the unit normal #ector to a surface and L is the

unit direction #ector to the point light source from a  position on the surface.

Fig. 9

ngle of incidenceθ  beteen the unit light-source

direction #ectorL and the unit surface normal N.

N L

8o 0ight Source

(23)

4iffuse Reflection

>igure 1= illustrates the illumination ith

diffuse reflection$ using #arious #alues of 

 parameter k 

 beteen = and1.

Fig. 10

(24)

23

4iffuse Reflection

7e can combine the ambient and point-source

intensity calculations to obtain an epression for the total diffuse reflection.

 I diff  9 k a I a+k d  I l )N.L,

here both k a and k d  depend on surface material

 properties and are assigned #alues in the range from = to 1.

Fig. 11

Series of pictures of sphere illuminated by ambient and diffuse reflection model.  I a 9 I  9 1.=$ k  9 =." and k a #alues )=.=$ =.1$ =.3=$ =."$ =./=,.

(25)
(26)

2

Specular Reflection and the

hong Model

 Specular reflection is the result of total$ or near total$

reflection of the incident light in a concentrated region

around the specular-reflection angle.

• Shiny surfaces ha#e a narro specular-reflection range. • 4ull surfaces ha#e a ider reflection range.

(27)

Specular Reflection

>igure 13 shos the specular reflection

direction at a point on the

illuminated surface. In this figure$ • R  represents the unit #ector in

the direction of specular reflection • L B unit #ector directed toard the

 point light source

•  B unit #ector pointing to the #ieer from the surface position • ngle Φ  is the #ieing angle relati#e to the specular-reflection

direction R .

Fig. 13

Modeling specular reflection.

N L 8o 0ight Source θ  θ  R   Φ 

(28)

26

hong Model

 Phong model is an empirical model for calculating the specular-reflection range(

• Sets the intensity of specular reflection proportional to cosnsΦ 

• ngle Φ  assigned #alues in the range =o to ;=o$ so that

cosΦ  #alues from = to 1

•  Specular-reflection parameter  n s is determined by the type of surface$

•  Specular-reflection coefficient  k  s e*ual to some #alue in the range = to 1 for each surface.

(29)

hong Model

• Dery shiny surface is modeled ith a large #alue for n s

)say$ 1== or more,

• Small #alues are used for duller surfaces.

•  >or perfect reflector )perfect mirror,$ n s is infinite

N L

Shiny Surface )0arge n s,

N L R  4ull Surface )Small n s, Fig. 14

(30)

2;

hong Model

cosnsΦ 

Φ 

Fig. 15

lots of cosnsΦ  for se#eral #alues of specular parameter n  s.

(31)

hong Model

hong specular-reflection model(

 I 

 spec

 9 k 

 s

 I 

l

cos

nsΦ 

Since

and

R

are unit

#ectors in the #ieing

and specular-reflection

directions$ e can

calculate the #alue of

cos

nsΦ 

 ith the dot

 product

.

.

 I 

 spec

 9 k 

 s

 I 

l

)

.

,

ns

Fig. 13

Modeling specular reflection.

N L 8o 0ight Source θ  θ  R   Φ 

(32)

31

hong Model

R E 0 9 )2C

.

0,C

R 9 )2C

.

0,C-0

N L R  N.L L Fig. 16

(33)

hong Model

N L R   Φ  Fig. 17

Falfay #ector! along the bisector of the angle beteen L and.

!

α 

 9

Φ 

 / 2

F 9 )0 E D,+G)0 E D,G

 I 

 spec

 9 k 

 s

 I 

l

)

N

.

!

,

ns

(34)

33

Specular Reflection - @ample

(35)

5ombine 4iffuse & Specular

Reflections

>or a single point light source$ e can model

the combined diffuse and specular reflections

from a point on an illuminated surface as

 I 9 I 

diff 

 E I 

 spec

9 k 

a

 I 

a

E k 

 I 

)

N

.

L

, E k 

References

Related documents