shading surface can either (both) 1.emit light. e.g. light bult 2.reflect light. e.g. mirror

15
Shading Surface can either (both) 1.Emit light. E.g. light bult 2.Reflect light. E.g. Mirror

Upload: dinah-turner

Post on 23-Dec-2015

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Shading Surface can either (both) 1.Emit light. E.g. light bult 2.Reflect light. E.g. Mirror

ShadingSurface can either (both)1. Emit light. E.g. light bult2. Reflect light. E.g. Mirror

Page 2: Shading Surface can either (both) 1.Emit light. E.g. light bult 2.Reflect light. E.g. Mirror

ShadingRendering equationCannot solved in general Even by numerical method.

Page 3: Shading Surface can either (both) 1.Emit light. E.g. light bult 2.Reflect light. E.g. Mirror

ShadingApproximation of rendering equation•Radiosity (slow)•Ray tracing (slow)•Phong Reflection Model• similar to ray tracing•Consider only single interaction (between light source & surface)•Two independent parts of the problem

•Light source•Reflection model (between light and material)

Page 4: Shading Surface can either (both) 1.Emit light. E.g. light bult 2.Reflect light. E.g. Mirror

ShadingHow refection model works:1. Light directly to your eyes2. Light reflect from the surface3. Single/multiple interaction between rays

and object.

Page 5: Shading Surface can either (both) 1.Emit light. E.g. light bult 2.Reflect light. E.g. Mirror

ShadingWhen light strikes a surface,•Some of it is abosrbed,•Some of it is reflected.•If the surface is opaque, reflection and absorption account for all the light striking the surface.•Surface is translucent, some light transmitted through the material (& interact with other objects).

Page 6: Shading Surface can either (both) 1.Emit light. E.g. light bult 2.Reflect light. E.g. Mirror

Shading1. An object illuminated by white light appears red

because it absorbs most of the incident light but reflects light in the red range of frequencies.

2. A shiny object appears so because its surface is smooth. Conversely, a dull object has a rough surface.

3. The shading of objects also depends on the orientation of their surfaces, a factor that is characterized by the normal vector at each point.

Page 7: Shading Surface can either (both) 1.Emit light. E.g. light bult 2.Reflect light. E.g. Mirror

Classification of Surface1. Specular surface appear shiny because most of the

light that is reflected is scattered in a narrow range of angle close to the angle of reflection. Mirrors are perfectly specular surfaces.

2. Diffuse surfaces are characterized by reflected light being scattered in all directions. Perfectly diffuse surfaces scatter light equally in all directions and thus appear the same to all viewer.

3. Translucent surfaces allow some light to pentrate the surface and to emerge from another location on the object. This process of refraction characterizes glass and water.

Page 8: Shading Surface can either (both) 1.Emit light. E.g. light bult 2.Reflect light. E.g. Mirror

Light SourceThere are four basic types of light sources:1. Ambient Light.2. Point light3. Spot Lights4. Distance Light.

We describe a source through a three component intensity or luminance function I=[Ir, Ig, Ib]

Page 9: Shading Surface can either (both) 1.Emit light. E.g. light bult 2.Reflect light. E.g. Mirror

Ambient LightIn some rooms, such as in certain classrooms

or kitchens, the lights have been designed and positioned to provide uniform illumination throughout the room. This uniform lighting is called ambient light.

Ia = [Iar, Iag, Iab]

Page 10: Shading Surface can either (both) 1.Emit light. E.g. light bult 2.Reflect light. E.g. Mirror

Point LightAn ideal point source emits light equally in

all direction.

I(p0) = [Ir(p0), Ig(p0), Ib(p0)].

i(p,p0) = I(p0) /|p-p0|2

Or i(p,p0) = I(p0) /a+bd+cd2 where d=|p-p0|

Page 11: Shading Surface can either (both) 1.Emit light. E.g. light bult 2.Reflect light. E.g. Mirror

SpotLightApex: ps

Direction: Ls

Angle:

How rapidly the light intensity drops off: Cose. 0< < .

Notice that cos = sl, l is the direction of the light, s is a vector from apex to the surface. The angle between s and l is . Both s and l are unit length.

Page 12: Shading Surface can either (both) 1.Emit light. E.g. light bult 2.Reflect light. E.g. Mirror

Phong Reflection ModelThe model uses four vectors, l, n, v, r, to

calculate a color for an arbitrary point p on the surface.

l: point from p to the light.N: normal of p on the surfaceV: point from p to the eye.R: reflection vector for the vector from light

to p.

Page 13: Shading Surface can either (both) 1.Emit light. E.g. light bult 2.Reflect light. E.g. Mirror

Phong ModelThe Phong model supports the three types of

material-light interactions: ambient, diffuse, and specular.

Suppose that we have a set of point sources. We assume that each source can have separate ambient, diffuse, and specular components for each of the three primary color.

We need 9 coefficients to characterize these terms at any point p on the surface.

Li=

Page 14: Shading Surface can either (both) 1.Emit light. E.g. light bult 2.Reflect light. E.g. Mirror

Phong ModelFor each point, we have 9 coefficients that we

can place in matrix of reflection terms of the form:

Ri = We can then compute the contribution for each

color source by adding the ambient, diffuse, and specular components.

E.g. The red intensity that we see at p from source i:

Iir = RiraLira +RirdLird+RirsLirs=Iira+Iird+Iirs

Page 15: Shading Surface can either (both) 1.Emit light. E.g. light bult 2.Reflect light. E.g. Mirror