Anda di halaman 1dari 18

Illumination & Rendering

Dr. Md. Al-Amin Bhuiyan


Professor, Dept. of Computer Science & Engineering Jahangirnagar University

Illumination
When light energy falls on a surface, it can be absorbed, reflected, or transmitted. Some of the light energy incident on a surface is absorbed and the rest is either reflected or transmitted. If all the incident light energy is absorbed, the object is invisible and is then called a black body. Reflected or transmitted light energy makes an object visible. Rendering is the process of producing realistic images or pictures.

Derive computer models for ...

Emission at light sources and Scattering at surfaces

Wireframe

Without Illumination

Direct Illumination

Overview

Direct Illumination

Emission at light sources Scattering at surfaces Shadows Refractions Inter-object reflections


Direct Illumination

Global Illumination

Overview

The character of the light reflected from the surface of an object depends on the composition, direction, and geometry of the light source, the surface orientation, and the surface properties of the object.

Direct Illumination

Point Light Source

Models Omni-Directional Point Source (E.g., Bulb)


Intensity (I0) Position (px, py, pz) Factors (kc, kl, kq) for attenuation with distance (d)

I0 IL = k c + k 1d + k q d 2

Directional Light Source

Models Point Light Source at Infinity (E.g., Sun)


Intensity (I0) Direction (dx,dy,dz)

No attenuation with distance

I L = I0

Spot Light Source

Models Point Light Source with Direction


Intensity (I0), Position (px, py, pz) Direction (dx, dy, dz) Attenuation

I 0 (D L ) IL = k c + k 1d + k q d 2

Phong Lighting Model

Phong lighting model has proved to be an efficient and to be a close enough approximation to physical reality to produce good rendering under a variety of lighting conditions and material properties. The Phong model supports three types of lightmaterial interactions:

Diffuse reflection Specular reflection Ambient

Ambient Reflection
A surface that is not exposed directly to a light source still will be visible if nearby objects are illuminated. In many situations, such as in classrooms or kitchens, the lights have been designed and positioned to provide uniform illumination throughout the room. This uniform lighting is called ambient light. The amount of ambient light Incident on each object is a constant for all surfaces and over all directions.

Ambient Reflection

The intensity of ambient light Ia is the same at every point on the surface. The amount of reflected is given by the ambient reflection coefficient, Ra=ka. Since only a positive fraction of the light is reflected, we must have

0 Ka 1
and thus

I a = K a La

Here La can be any of the individual light sources, or it can be a global ambient term.

Diffuse Reflection
Diffusely

reflected light can be considered as light that has penetrated below the surface of an object, been absorbed, and then reemitted. Diffusely reflected light is scattered equally in all directions. It depends on angle of incident light

Diffuse Reflection

Lambertian Model (Lamberts cosine law governs the reflection of light from a point source by a perfect diffuser. Lamberts law states that the intensity of light reflected from a perfect diffuser is proportional to the cosine of the angle between the light direction and the normal to the surface. Rd cos where is the angle between the normal at the point of interest N and the direction of light source L. If we add in a reflection coefficient kD representing the fraction of incoming diffuse light that is reflected, we have the diffuse reflection term: I D = k D ( N .L) I L If we wish to incorporate a distance term, to account for attenuation as the light travels a distance d from the source to the surface, we can use the quadratic attenuation term:
I D = K D (N L )I L

kD ID = ( N .L) I L 2 a + bd + cd

Specular Reflection

When we look at an illuminated shiny surface, such as polished metal, an apple, or a persons forehead, we see a highlight, or bright spot, at certain viewing directions. This phenomenon, called specular reflection, is the result of the total or near total, reflection of the incident light in a concentrated region around the specular reflection angle.

Specularly reflected light is reflected from the outer surface of the object. If we employ only ambient and diffuse reflections, our images will be shaded and will appear dull, somewhat look like chalk. What we are missing are the highlights that we see reflected from shiny objects. These highlights usually show a color different from the color of the reflected ambient and diffuse light.

Specular Reflection

Whereas a diffuse surface is rough, a specular surface is smooth. The smoother the surface is, the more it resembles a mirror. Modeling specular surfaces realistically can be complex because the pattern by which the light is scattered is not symmetric. It depends on the wavelength of the incident light and it changes with the reflection angle. I S = K S LS cos

Specular Reflection

The amount of light that the viewer sees depends on the angle between R, the direction of reflection and v, the direction of the viewer. The Phong model uses the equation I = K L cos
S S S

The coefficient Ks is the fraction of the incoming specular light that is reflected. The exponent is a shininess coefficient. Thus the Phong mode for specular term: I = K L max((R.V ) ,0)
S S S

We can add a distance term and write as

I=

1 K D LD max(( I .N ),0) + K S LS max(( R.V ) ,0) + K a La 2 a + bd + cd

This formula is computed for each light source and for each primary colors.

Ambient Term

Represents Reflection of All Indirect Illumination

Surface Illumination Calculation

Single Light Source:

I = I E + K A I AL + K D (N L )I L + K S (V R ) I L
n

Surface Illumination Calculation

Multiple Light Sources:

I = I E + K A I AL + i ( K D ( N Li )I i + K S (V R i ) I i )
n