0% found this document useful (0 votes)
2 views50 pages

Unit 6

The document discusses illumination models and surface rendering methods in computer graphics, focusing on how light intensity and color are calculated for realistic 3D scene displays. It covers various components of illumination models, including light sources, surface properties, and different types of reflections such as ambient, diffuse, and specular reflection. Additionally, it describes polygon rendering techniques like constant intensity shading, Gouraud shading, and Phong shading for rendering surfaces accurately.

Uploaded by

prernasingh9804
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views50 pages

Unit 6

The document discusses illumination models and surface rendering methods in computer graphics, focusing on how light intensity and color are calculated for realistic 3D scene displays. It covers various components of illumination models, including light sources, surface properties, and different types of reflections such as ambient, diffuse, and specular reflection. Additionally, it describes polygon rendering techniques like constant intensity shading, Gouraud shading, and Phong shading for rendering surfaces accurately.

Uploaded by

prernasingh9804
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 50

Illumination models

and

Nipun Thapa (Computer Graphics)


surface rendering
Unit 6 methods
1
Illumination and surface rendering model
• Once visible surface has been identified by hidden surface
algorithm, a shading model is used to compute the intensities and
color to display for the surface. For realistic displaying of 3d scene it
is necessary to calculate appropriate color or intensity for that
scene.
• Illumination model or a lighting model is the model for calculating

Nipun Thapa (Computer Graphics)


light intensity at a single surface point. Sometimes also referred to
as a shading model.
• An illumination model is also called lighting model and some times
called as a shading model which is used to calculate the intensity of
light that we should see at a given point on the surface of a object.
• A surface-rendering algorithm uses the intensity calculations from
an illumination model.
Components of Illumination model
2
• Light Sources: type , color, and direction of the light source
• Surface Properties : réflectance, opaque/transparent, shiny/dull.
Illumination And Rendering
• An illumination model in computer graphics
• also called a lighting model or a shading model
• used to calculate the color of an illuminated position on the
surface of an object
• Approximations of the physical laws

Nipun Thapa (Computer Graphics)


• A surface-rendering method determine the pixel colors for all
projected positions in a scene

3
Light Source
• Object that radiates energy are called light sources, such as
sun, lamp, bulb, fluorescent tube etc.
• Sometimes light sources are referred as light emitting object
and light reflectors. Generally light source is used to mean an
object that is emitting radiant energy e.g. Sun.

Nipun Thapa (Computer Graphics)


• Total Reflected Light = Contribution from light sources +
contribution from reflecting surfaces

4
Light Source..
Point Source:
Point source is the simplest light emitter e.g. light bulb.
when light source model is a reasonable approximation for sources
whose dimensions are small compared to the size of objects in a
scene.

Nipun Thapa (Computer Graphics)


Distributed Light Source:
area of source is not small compared to the surfaces in the
scene e.g. Fluorescent lamp

5
Reflection of light:
When light is incident on opaque surface part of it is
reflected and part of it is absorbed.
∴ I = A+R
• The amount of incident light reflected by a surface depends
on the type of material. Shining material reflects more

Nipun Thapa (Computer Graphics)


incident light and dull surface absorbs more of the incident
light. For transparent surfaces, some of the incident light will
be reflected and some will be transmitted through the
material.

6
Distributed light source

• When light is incident on an opaque surface part of it is


reflected and part of it is absorbed.
• Surface that are rough or grainy, tend to scatter the reflected
light in all direction which is called diffuse reflection.

Nipun Thapa (Computer Graphics)


• When light sources create highlights, or bright spots, called
specular reflection

7
Light Source..
• Point source: Simplest model for a light emitter like tungsten
filament bulb
• Distributed light source: The area of the source is not small
compared to the surfaces in the scene like fluorescent light on
any object in a room

Nipun Thapa (Computer Graphics)


• Diffuse reflection: Scatter reflected light in all direction by
rough or grainy surfaces.
• Specular-reflection: highlights or bright spots created by light
source, particularly on shiny surfaces than on dull surfaces.

8
Illumination models:
Illumination models are used to calculate light intensities
that we should see at a given point on the surface of an object.
Lighting calculations are based on the optical properties of
surfaces, the background lighting conditions and the light source
specifications. All light sources are considered to be point

Nipun Thapa (Computer Graphics)


sources, specified with a co-ordinate position and an intensity
value (color). Some illumination models are:
1. Ambient Light
2. Diffuse Reflection
3. Specular Reflection and phong model

9
Some useful concept

Nipun Thapa (Computer Graphics)


10
1. Ambient light:
• This is a simplest illumination model
• We can think of this model, which has no external light
source-self-luminous objects. A surface that is not exposed
directly to light source still will be visible if nearby objects are
illuminated.

Nipun Thapa (Computer Graphics)


• The combination of light reflections form various surfaces to
produce a uniform illumination is called ambient light or
background light.
• Also called background light
• Ambient light means the light that is already present in a
scene, before any additional lighting is added. It usually refers
to natural light, either outdoors or coming through windows
etc. It can also mean artificial lights such as normal room
11
lights.
1. Ambient light:

Nipun Thapa (Computer Graphics)


12
1. Ambient light …
• Multiple reflection of nearby (light-reflecting) objects yields a
uniform illumination
• A form of diffuse reflection independent of the viewing direction
and the spatial orientation of a surface
• Ambient light has no spatial or directional characteristics and

Nipun Thapa (Computer Graphics)


amount on each object is a constant for all surfaces and all
directions. In this model, illumination can be expressed by an
illumination equation in variables associated with the point on the
object being shaded. The equation expressing this simple model is

I=Ka
Where I is the resulting intensity and Ka is the object’s intrinsic 13
intensity.
1. Ambient light …
• If we assume that ambient light impinges equally on all
surface from all direction, then

I = Ia Ka

Nipun Thapa (Computer Graphics)


Where Ia is intensity of ambient light.
Ka is object’s intrinsic intensity.
The amount of light reflected from an object's surface is
determined by Ka , the ambient-reflection coefficient.Ka ranges
from 0 to 1. 14
2. Diffuse Reflection
• Objects illuminated by ambient light are uniformly illuminated
across their surfaces even though light are more or less bright
in direct proportion of ambient intensity.
• Surfaces are rough
• Incident light is scattered with equal intensity in all directions

Nipun Thapa (Computer Graphics)


• Surfaces appear equally bright from all direction.
• Such surfaces are called ideal diffuse reflectors (also referred
to as Lambertian reflectors)

15
2. Diffuse Reflection…
• Illuminating object by a point light source, whose rays
enumerate uniformly in all directions from a single point. The
object's brightness varies form one part to another, depending
on the direction of and distance to the light source.
• Color of an object is determined by the color of the diffuse

Nipun Thapa (Computer Graphics)


reflection of the incident light.
• If any object surface is red then there is a diffuse reflection for
red component of light and all other components are
absorbed by the surface.

16
2. Diffuse Reflection…
The diffuse-reflection coefficient, or diffuse reflectivity,
kd (varying from 0 to 1) define the fractional amount of the
incident light that is diffusely reflected.
The parameter kd (actually function of surface
color)depends on the reflecting properties of material so for

Nipun Thapa (Computer Graphics)


highly reflective surfaces, the kd nearly equal to 1.
If a surface is exposed only to ambient light, we can
express the intensity of the diffuse reflection at any point on the
surface as:
Iamb,Diff = kd . Ia, (where Ia = intensity of ambient light)

17
2. Diffuse Reflection…
If N is the unit normal vector to a surface and L is the unit
direction vector to the point light source from a position on the
surface then cos θ = N.L ( Lambertian Cosine Law) and the diffuse
reflection equation for single point source illumination is:

IL, diff = kd . IL cos θ = kd IL (N.L)

Nipun Thapa (Computer Graphics)


18
2. Diffuse Reflection…
We can combine the ambient and point source intensity
calculations to obtain an expression for the total diffuse
reflection. Thus, we can write the total diffuse reflection
equation as:

Nipun Thapa (Computer Graphics)


IDiff = kd . Ia + kd IL (N.L)

ambient Diffuse for single point

19
Lambert’s Cosine Law:
The intensity of diffuse reflection due to ambient light is;
Iadiff = kaIa
The radiant energy from any small surface dA in any direction relative
to surface normal is proportional to cos 𝜃. That is, brightness depends only on
the angle θ between the light direction L and the surface normal N.
∴ Light intensity α cos 𝜃.

Nipun Thapa (Computer Graphics)


If Il is the intensity of the point light
source and kd is the diffuse reflection coefficient,
then the diffuse reflection for single point-
source can be written as;
Ιpdiff = kdIl cosθ
Ιpdiff = kdΙl (Ν ∙L) Fig: Angle of incidence θ between the
unit light-source direction vector L and
the unit surface normal

∴ Total diffuse reflection (Idiff) = Diff ( due to ambient light)+Diff. due to pt.source.
Idiff = Iadiff + Ιpdiff 20
Idiff = kaIa + kdΙl (Ν ∙L)
3. Specular reflection and phong model
• When we look at an illuminated shiny surface, such as
polished metal, a person's forehead, we see a highlight or
bright spot, at certain viewing direction. Such phenomenon is
called specular reflection.
• It is the result of total or near total reflection of the incident

Nipun Thapa (Computer Graphics)


light in a concentrated region around the " specular reflection
angle = angle of incidence".
• Perfect reflector (mirror) reflects all lights to the direction
where angle of reflection is identical to the angle of incidence
• It accounts for the highlight

21
Nipun Thapa (Computer Graphics)
22
3. Specular reflection and phong model
Let SR angle = angle of incidence as in
figure.
N- unit vector normal to surface at
incidence point
R- unit vector in the direction of

Nipun Thapa (Computer Graphics)


ideal specular reflection.
L- unit vector directed to words
point light source.
V- unit vector pointing to the
viewer from surface.
Ø− the viewing angle relative to the
specular reflection direction. 23
3. Specular reflection and phong model
• For ideal reflector (perfect mirror), incident light is reflected only in
the specular reflection direction.
V & R concide (Ø = 0)
• Shiny surface have narrow Ø and dull surface wider Ø .
• An empirical model for calculating specular-reflection range

Nipun Thapa (Computer Graphics)


developed by Phong Bui Tuong-called Phong specular reflection
model (or simply Phong model), sets the intensity of specular
reflection proportional to cosns Ø 0 to 90 0 .
• Specular reflection parameter ns is determined by type of surface
• Intensity of specular reflection depends upon material properties of
the surface and ɵ . Other factors such as the polarization and color
of the incident light.
• - For monochromatic specular intensity variations can approximated
24
by SR coefficient w(ɵ)
3. Specular reflection and phong model

Nipun Thapa (Computer Graphics)


25
3. Specular reflection and phong model
• Fresnal's law of reflection describe specular reflection
intensity with and using w(ɵ ) , Phong specular reflection
model as
I spec = w(ɵ) IL cosns Ø

Nipun Thapa (Computer Graphics)


• Where Il is intensity of light source. is viewing angle relative to SR
direction R. For a glass, we can replace w(ɵ) with constant Ks
specular reflection coefficient.

So,
I spec = Ks IL cosns Ø
= Ks IL (V.R)ns since cosØ = V.R 26
3. Specular reflection and phong model

Nipun Thapa (Computer Graphics)


27
Nipun Thapa (Computer Graphics)
28
Nipun Thapa (Computer Graphics)
29
Nipun Thapa (Computer Graphics)
30
Intensity Attenuation
As radiant energy from a point light source travels
through space, its amplitude is attenuated by the factor 1/d2,
where d is the distance that the light has traveled.
This means that a surface close to the light source (small
d) receives higher incident intensity from the source than a

Nipun Thapa (Computer Graphics)


distant surface (large d).
Therefore to produce realistic lighting effects,
illumination model should take intensity attenuation into
account. Otherwise we are likely to illuminate all surfaces with
same intensity.
• For a point light source attenuation factor is 1/d2.
• And for a distributed light source attenuation factor is given by 31
inverse quadratic attenuation function, f(d) =1/(a0 + a1d+a2d2).
Intensity Attenuation

Nipun Thapa (Computer Graphics)


32
Color Consideration

Nipun Thapa (Computer Graphics)


33
Transparency

Nipun Thapa (Computer Graphics)


34
Transparency

Nipun Thapa (Computer Graphics)


35
Shadow

Nipun Thapa (Computer Graphics)


36
Shadow
• Shadow can help to create realism. Without it, a cup, e.g., on a
table may look as if the cup is floating in the air above the
table.
• By applying hidden-surface methods with pretending that the
position of a light source is the viewing position, we can find

Nipun Thapa (Computer Graphics)


which surface sections cannot be "seen" from the light source
=> shadow areas.
• We usually display shadow areas with ambient-light intensity
only.

37
Polygon Rendering Method
(Surface Shading Method)
• Objects usually polygon-mesh approximation
• Illumination model is applied to fill the interior of polygons
• Curved surfaces are approximated with polygon meshes
• But polyhedra that are not curved surfaces are also modeled with
polygon meshes

Nipun Thapa (Computer Graphics)


• Two ways of polygon surface rendering:
1. Single intensity for all points in a polygon
2. Interpolation of intensities for each point in a polygon
• Methods:
1. Constant Intensity Shading
2. Gouraud Shading
3. Phong Shading 38
1. Constant Intensity Shading

Nipun Thapa (Computer Graphics)


39
2. Gouraud Shading

Nipun Thapa (Computer Graphics)


40
2. Gouraud Shading…..
• For Gouraud shading, the intensity at
point 4 is linearly interpolated from the
intensities at vertices 1 and 2. p
• The intensity at point 5 is linearly
interpolated from intensities at vertices

Nipun Thapa (Computer Graphics)


2 and 3.
• An interior point p is then assigned an
intensity value that is linearly
interpolated from intensities at positions
4 and 5.

41
2. Gouraud Shading…..
Advantages:
Removes discontinuities of intensity at the edge
compared to constant shading model

Nipun Thapa (Computer Graphics)


Limitations:
Highlights on the surface are sometimes displayed with
anomalous(irregular) shapes and linear intensity interpolation
can cause bright or dark intensity streaks, called Mach Bands to
appear on the surfaces. Mach bands can be reduced by dividing
the surface into a greater number of polygon faces or Phong
shading (requires more calculation). 42
Surface Rendering

Nipun Thapa (Computer Graphics)


43
Nipun Thapa (Computer Graphics)
44
3.Phong Shading
• A more accurate method for rendering a polygon surface is
Phong shading, or normal vector interpolation shading which
first interpolate normal vectors, and then apply the
illumination model to each surface point. It displays more
realistic highlights on a surface and greatly reduces the Mach-

Nipun Thapa (Computer Graphics)


band effect.
• A polygon surface is rendered using Phong shading by carrying
out the following steps:
• Determine the average unit normal vector at each polygon
vertex.
• Linearly interpolate the vertex normals over the surface of the
polygon.
• Apply an illumination model along each scan line to calculate
projected pixel intensities for the surface points. 45
3.Phong Shading
The normal vector N for the
scan-line intersection point along the
edge between vertices 1 and 2 can be
obtained by vertically interpolating
between edge endpoint normal:

Nipun Thapa (Computer Graphics)


Incremental methods are used to evaluate normal between scan lines
and along each individual scan line (as in Gouraud). At each pixel position along
a scan line the illumination model is applied to determine the surface intensity
at that point. Intensity calculations using an approximated normal vector at
each point along the scan line produce more accurate results than the direct 46
interpolation of intensities, as in Gouraud shading but it requires considerable
more calculations.
3.Phong Shading

Nipun Thapa (Computer Graphics)


47
Gouraud Vs Phong Shading
• Gouraud shading is faster than Phong shading
• Phong shading is more accurate

Nipun Thapa (Computer Graphics)


48
Gouraud Vs Phong Shading
• Gouraud shading is faster than Phong shading
• Phong shading is more accurate

Nipun Thapa (Computer Graphics)


49
Finished !!!

Nipun Thapa (Computer Graphics)


50

You might also like