illumination models
play

Illumination Models realistic images, we must simulate the - PowerPoint PPT Presentation

1 2 Motivation : In order to produce Illumination Models realistic images, we must simulate the appearance of surfaces under and various lighting conditions. Shading Illumination Models : Given the illumination incident at a point on


  1. 1 2 • Motivation : In order to produce Illumination Models realistic images, we must simulate the appearance of surfaces under and various lighting conditions. Shading • Illumination Models : Given the illumination incident at a point on a surface, what is reflected? ������ ������ 1

  2. 3 4 Illumination Model From Illumination Models to Rendering Parameters • Lighting effects are described with • Illumination models is used to calculate models that consider the interaction of the intensity of light that is reflected at light sources with object surfaces. a given point on a surface. • The factors determining the lighting • Rendering methods use the intensity effects are: calculations from the illumination model to determine the light intensity at all – The light source parameters: pixels in the image. • Positions. – Considers light propagation between • Electromagnetic Spectrum. surfaces in the scene. • Shape. – The surface parameters • Position. • Reflectance properties. • Position of near by surfaces. – The eye (camera) parameters • Position. • Sensor spectrum sensitivities. ������ ������ 2

  3. 5 6 Light Source Models Illumination Models C B • Simplified and fast methods for A calculating surfaces intensities. • Calculations are based on optical properties of surfaces and the lighting conditions (no reflected • Point Source (A): All light rays originate sources nor shadows). at a point and radially diverging. • Light sources are considered to be – A reasonable approximation for sources point sources. whose dimensions are small compared to the • A reasonably good approximation object size. for most scenes. • Parallel source (B): Light rays are all parallel. May be modeled as a point source at infinity (the sun). • Distributed source (C): All light rays originate at a finite area in space. – A nearby sources such as fluorescent light. ������ ������ 3

  4. 7 8 Examples: Ambient light reflections Ambient Light • Assume there is some non-directional light in the environment (background light). • The amount of ambient light incident on each object is a constant for all surfaces and over all directions. • The reflected intensity I amb of any point on the surface is: I amb =K a I a I a - the ambient light intensity. K a ∈ [0,1] - the surface ambient reflectivity. • In principle I a and K a are functions of color, so we have I Ramb , I Gamb, I Bamb ������ ������ 4

  5. 9 10 A B Diffuse Reflection • Diffuse (Lambertian) surfaces are rough or grainy (like clay, soil, fabric). • This is because a surface (A) perpendicular to the light direction is • The surface appears equally bright more illuminated than a surface (B) at from all viewing directions. an oblique angle. • The reflected intensity I diff of any point on the surface is: I diff =K d I p cos( θ )=K d I p (N ⋅ L) • The brightness at each point is proportional to cos( θ ): I p - the point light intensity. May appear as attenuated source f att (r)I P L K d ∈ [0,1] - the surface diffuse N θ reflectivity. N - the surface normal. L - the light direction. ������ ������ 5

  6. 11 12 Diffuse reflections from different light directions Ambient surface Diffuse surface ������ ������ 6

  7. 13 14 • Commonly, there are two types of 0.2 0.5 1.0 light sources: K d – A background ambient light. – A point light source. 0.2 • The updated illumination equation is this case is: I=I diff +I amb =K d I p N ⋅ L + K a I a 0.5 • Note this is the model for one color and it should be duplicated for each channel: I R , I G , I B . 1.0 K a ������ ������ 7

  8. 15 16 Specular Reflection • The Phong Model : Reflected specular intensity falls off as • Shiny and glossy surfaces (like metal, some power of cos ( φ ): plastic) with highlights . • Reflectance intensity changes with I spec =K s I p cos n ( φ )=K s I p (R ⋅ V) n reflected angle. • For an ideal specular surface (mirror) K s - the surface specular reflectivity. the light is reflected in only one n - specular-reflection parameter, direction - R. determining the deviation from ideal • However, most objects are not ideal specular surface (for mirror n= ∞ ). mirrors (glossy objects) and they reflect in the immediate vicinity of R . N N L R L R φ φ V N N V L R L R θ θ θ θ φ V Dull surface Shiny surface Small n Large n Ideal specular surface non-ideal specular surface ������ ������ 8

  9. 17 18 • The updated illumination equation Plots of cos n ( φ ) for several specular combined with diffuse reflection is: parameter n. I= I amb +I diff +I spec = K a I a + I p (K d N ⋅ L+K s (R ⋅ V) n ) 1 0.8 • If several light sources are placed in 0.6 the scene: 0.4 I= I amb + Σ k (I k diff +I k spec ) 0.2 0 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 n=1 n=8 n=64 ������ ������ 9

  10. 19 20 Several reflections with different specular parameters 0.2 0.5 1.0 K s n=50 0.2 0.5 n=10 1.0 n=3 K d ������ ������ 10

  11. 21 22 Polygon Rendering Methods • Given a freeform surface, one usually approximates the surface as a Diffuse polyhedra. surface • How do we calculate in practice the illumination at each point on the surface? • Applying the illumination model at each surface point is computationally expensive. With additional specular component ������ ������ 11

  12. 23 24 Flat Shading Gouraud Shading • A single intensity is calculated for each • Renders the polygon surface by surface polygon. linearly interpolating intensity • A fast and simple method. values across the surface. • Gives reasonable result only if all of the following assumptions are valid: The algorithm : – The object is really a polyhedron. 1. Determine the average unit normal – Light source is far away from the surface at each polygon vertex. so that N•L is constant over each polygon. – Viewing position is far away from the 2. Apply an illumination model to surface so that V•R is constant over each each vertex to calculate the vertex polygon. intensity. 3. Linearly interpolate the vertex intensities over the surface polygon. ������ ������ 12

  13. 25 26 Step no 3 Step no 1 y I 3 I 1 I P scan line I 4 I 5 I 2 x The normal N v of a vertex is an average − − y y y y of all neighboring normals: = + I 4 2 I 1 4 I − − 4 1 2 y y y y ∑ 1 2 1 2 N − − k y y y y = + = I 5 2 I 3 5 I N k − − 5 2 3 V y y y y ∑ 3 2 3 2 N k − − k x x x x = + 5 p p 4 I I I − − p 4 5 x x x x 5 4 5 4 ������ ������ 13

  14. 27 28 Phong Shading Gouraud Shading of a sphere • A more accurate method is for rendering a polygon surface is to interpolate normal vectors, and then apply the illumination model to each surface point. The algorithm : 1. Determine the average unit normal at each polygon vertex. 2. Linearly interpolate the vertex normals over the surface polygon. 3. Apply the illumination model along each scan line to calculate pixel intensities for each surface point. ������ ������ 14

  15. 29 30 Phong Shading of a sphere Flat Gouraud Phong ������ ������ 15

  16. 31 Flat Shading Gouraud Shading Phong Shading ������ 16

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend