Presentation is loading. Please wait.

Presentation is loading. Please wait.

Illumination Models Chapter 14 Section 14.1 to 14.2

Similar presentations


Presentation on theme: "Illumination Models Chapter 14 Section 14.1 to 14.2"— Presentation transcript:

1 Illumination Models Chapter 14 Section 14.1 to 14.2
Some of the material in these slides may have been adapted from University of Virginia, MIT, MIT, Colby College, and Åbo Akademi University

2 What we will study Not much time is left for graphics
We will study two things Lighting Models Surface Rendering If we have time we will talk about color models

3 Solving the Lighting Problem
We somewhat understand the perception of light (color) We engineered a solution to representing and generating color using computers We need to understand the interplay of light and objects

4 Lighting Remember, we know how to rasterize But …
Given a 3-D triangle and a 3-D viewpoint, we know how to compute pixel positions to represent a shape But … How bright should each pixel be? What color should those pixels be?

5 Lighting If we’re attempting to create a realistic image, we need to simulate the lighting of the surfaces in the scene Fundamentally simulation of physics and optics Computationally intensive As you’ll see, we use a lot of approximations (a.k.a perceptually based hacks) to do this simulation fast enough

6 Images by Henrik Wann Jensen
Definitions Illumination: the transport of energy from light sources to surfaces & points Note: includes direct and indirect illumination Images by Henrik Wann Jensen

7 Definition Illumination Model, A.K.A
Lighting model Shading model In terms of graphics, illumination is the process of computing the luminous intensity (i.e., outgoing light) at a particular 3-D point, usually on a surface In some cases, shading model is defined differently as the process of computing colors

8 Goal of Illumination Model
Must derive computer models for ... Emission at light sources Scattering at surfaces Reception at the camera Desirable features … Concise Efficient to compute “Accurate”

9 Illumination vs. Surface Rendering
Illumination model is an approximate mathematical model used to compute light intensity Surface Rendering: The procedure of applying lighting model to obtain pixel intensities for all projected surfaces in the scene A.K.A. surface shading (or just shading) Realism involves Accurate representation of objects Accurate physical description of light effect on the scene

10 Light Sources vs. Reflecting Surface
Emits light energy Reflecting Surface Does not emit light Reflects light Object may be Both source and reflecting surface Example: Light bulb

11 Light Sources vs. Reflecting Surface
Point source It is source that emits light equally in all directions from a single point Simplest model Dimension of light source is sufficiently small compared to illuminated objects Far light sources The sun can be accurately modeled as a point source

12 Light Sources vs. Reflecting Surface
Distributed light source Light source dimensions are not small enough compared to illuminated objects Modeled as accumulation of point sources on the surface of the light source Accurate model for nearby sources Fluorescent light

13 Light Sources vs. Reflecting Surface
Surface absorbs and reflects incident light Diffuse Reflection Light scattered by rough surface Very rough surfaces tend to mainly diffuse light Surface appears equally bright from all directions Specular Reflection Bright Spot Occurs in addition to the diffuse reflection More pronounced on polished surfaces Diffuse Reflection Specular Reflection

14 Basic Illumination Models
Simple and computationally efficient Light source is considered point source specified by Co-ordinates Intensity color Reasonably good result Intensity is computed based on optical surface properties E.g. Glossy, opaque, transparent Controls the amount of reflection and absorption

15 Ambient Light Objects not directly lit are typically still visible
e.g., the ceiling in this room, undersides of desks This is the result of indirect illumination from emitters, bouncing off intermediate surfaces Too expensive to calculate (in real time), so we use a hack called an ambient light source No spatial or directional characteristics; illuminates all surfaces equally Amount reflected depends on surface properties

16 Ambient Light It is indirect light comes from “everywhere” Idea
Calculate direct light only Set indirect (ambient) light level to a constant Ia Properties of Ambient light: The amount of ambient light incident on every object is a constant for all surfaces and directions No spatial or directional properties The reflected light is constant, independent of viewing direction The intensity of the reflected light depends on surface properties

17 Ambient Light If scene is only lit by Ambient source:
Light Position Not Important Viewer Position Not Important Surface Angle Not Important

18 Diffuse Reflection Ambient Light
Defined by ka, ambient diffuse reflection coefficient Represents portion of reflected light Between 0 and 1 Let a surface be exposed only to ambient light Iambdiff be the intensity of the diffuse reflection at any point on the surface Iambdiff = kaIa where ka [0,1] Ambient Reflection coefficient Ia is the ambient light intensity Produces a flat uninteresting shading

19 Diffuse Reflection Point Source
Want to model diffuse reflection from point sources Ideal Diffuse reflector Light is scattered equally to all directions irrespective of the direction of incident light A.K.A Lambert Reflectors An ideal diffuse reflector, at the microscopic level, is a very rough surface (real-world example: chalk, carpet, rough cloth) Because of these microscopic variations, an incoming ray of light is equally likely to be reflected in any direction over the hemisphere

20 Diffuse Reflection Lambert’s Cosine Law
Ideal diffuse surfaces reflect according to Lambert’s cosine law: The energy reflected by an infinitesimal surface element dA from a light source in a given direction is proportional to the cosine of the angle between that direction and the surface normal q dL dA Surface

21 Diffuse Reflection Lambert’s Cosine Law
Note that the reflected intensity is independent of the viewing direction, but does depend on the surface orientation with regard to the light source

22 Diffuse Reflection Computing Diffuse Reflection
The angle between the surface normal and the incoming light is the angle of incidence: Idiffuse = kd Ilight cos  In practice we use vector arithmetic: Idiffuse = kd Ilight (N • L) where N, L are unit vectors L N

23 Diffuse Reflection Sphere and a Point Source
Because diffuse reflection from point sources varies by angle of incidence, the sphere is NOT uniformly lit Sphere seen at different lighting angles

24 Diffuse Reflection Combining Ambient and Point Source
Let’s assume that the reflection co-efficients of ambient and point sources are different Additional parameter More freedom to adjust lighting of the scene Idiffuse = kaIa + kd Ilight (N • L) where kd, ka [0,1] Remember: Viewer’s angle has no effect

25 Specular Reflection Shiny surfaces exhibit specular reflection
Polished metal Glossy car finish Apple A light shining on a specular surface causes a bright spot known as a specular highlight Where these highlights appear is a function of the viewer’s position, so, unlike diffuse reflection, specular reflectance is view dependent

26 Physics of Reflection on Perfect Surfaces
Reflection follows Snell’s Laws: The incoming ray and reflected ray lie in a plane with the surface normal The angle that the reflected ray forms with the surface normal equals the angle formed by the incoming ray and the surface normal: (l)ight = (r)eflection

27 Geometry of Reflection Perfect Surfaces
Remember that N, L, and R are unit vectors R is the reflection vector We want to calculate R in terms of N and L because N and L are given values N R L qL qR qL=qR

28 Geometry of Reflection Perfect Surfaces
Remember that |N| = |L| = 1 Hence cos(q) = N • L Hence Lcos(q) = Ncos(q) = (N • L)L = (N • L)N N (N.L)N R L cos(qi)N qL qR qL=qR

29 Geometry of Reflection Perfect Surfaces
2(N.L)N N R L qL qR qL=qR

30 Geometry of Reflection Perfect Surfaces
L+R = 2(N.L)N L N R L q qL qR q qL=qR

31 Geometry of Reflection Perfect Surfaces
R = 2(N.L)N  L L+R = 2(N.L)N L N R L qL q qR q qL=qR

32 Non-Ideal Specular Reflection
Snell’s law applies to perfect mirror-like surfaces, but aside from mirrors (and chrome) few surfaces exhibit perfect specularity How can we capture the “softer” reflections of surface that are glossy rather than mirror-like? One option: model the microgeometry of the surface and explicitly bounce rays off of it Or … Use approximate (and far simpler) models…

33 Non-Ideal Specular Reflection
Hypothesis: most light reflects according to Snell’s Law But because of microscopic surface variations, some light may be reflected in a direction slightly off the ideal reflected ray Hypothesis: as we move from the ideal reflected ray, some light is still reflected We have angular falloff

34 Non-Ideal Specular Reflection
An illustration of this angular falloff: How might we model this falloff?

35 Specular Reflection Phong’s Model
Let V be the viewing Vector Let f be the angle between the viewing vector V and the reflection vector R Let q be the light incident angle The intensity at a viewing a angle f is proportional to [cos(f)] ns v

36 Specular Reflection Phong’s Model
ns is the specular reflection parameter Close to 0 for dull surfaces Remember diffuse reflection !! Larger for shiny surfaces (e.g. 100) For a perfect mirror, what is the value of ns? [cos(f)] ns f

37 Shiny Vs Dull Surface

38 Specular Reflection Phong’s Model
Fresnel’s laws from physics: the light is not reflected 100% (some is absorbed, some reflected back). The amount of absorption is dependent on the incident angle q Use the specular reflection co-efficeint W(q) to quantify this: Ispec = W(q)Il Final form of Phong’s model Depends on Incident light angle Depends on Viewer’s angle

39 Specular Reflection Phong’s Model
As we can see, W(q) is almost constant W(q) is usually approximated by by a constant ks Approximate Phong’s model Using Vector Arithmetic…

40 Specular Reflection Phong’s Model Examples
These spheres illustrate the Phong model as L and nshiny are varied Varying L Varying nshiny Which sphere is most shiny?

41 Combining Everything We want simple analytic model: From:
diffuse reflection + specular reflection From: Multiple Light Sources Ambient light Surface

42 Combining Everything Single Light Source
q q L f V Surface

43 Combining Everything Single Light Source
Sum diffuse, specular, and ambient

44 Combining Everything Multiple Light Source
Surface

45 Attenuation If the light source is at distance d
Light power loses its amplitude with 1/d2 Problem: simple point-source illumination model does not always produce realistic pictures with 1/d2 Objects are usually illuminated from multiple sources Model too simple to represent lighting effect too much intensity variations when d is small very little variation when d is large. Simple solution: Use linear or quadratic attenuation function…

46 Attenuation Use the a0, a1, and a2 to adjust the seen E.g.
Adjust a0 to prevent f(d) from becoming too large when d is small Adjust the a0, a1, and a2 so that the light intensity does not go above the maximum allowed levels of the display device Combined illumination model for m point sources…

47 Color Consideration We can assume that any color consists of 3 components: Red, Green, and Blue Different reflection coefficient per color Different attenuation function per color For example, for the blue color, We will talk about color models in detail if we have time

48 Transparency Intensity equations must be modified to include contributions from light passing through the surface. Both diffuse and specular transmission can take place at the surfaces of a transparent object I.e. Light passes through the abject is also subjected to and specular like transmission Realistic transparency effects are modeled by considering light refraction.

49 Transparency Refraction
Snell’s Law N L Qi T Qr hr hi Refractive index is a function of the color

50 Transparency Refraction
T is the unit vector in the refraction direction qr

51 Transparency Refraction
What we see is what comes out of the transparent object N L Qi T Qr hr hi T` The path is shifted

52 Transparency Simplifying Refraction
Computing the path shift is expensive Assume that there is no shift  hi = hr  Qi = Qr We still have to account for reflection off the transparent object Partial light absorption when passing through the transparent object Let kt be the transparency factor Hence (1-kt)is the opacity factor I = (1-kt)Irefl + ktItrans Where I is the combined viewed light intensity of the point P on the surface P Irefl Itrans

53 Shadow Different from Shading Basic idea
Apply hidden surface method with light source at view position Shadowed surface = surface cannot be seen from the light source Apply shading pattern to these areas How to generate shading pattern E.g. apply only ambient light and combine it with texture We will talk about texture if we have time

54


Download ppt "Illumination Models Chapter 14 Section 14.1 to 14.2"

Similar presentations


Ads by Google