illumination models
play

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

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


  1. • Motivation : In order to produce Illumination Models realistic images, we must simulate and the appearance of surfaces under various lighting conditions. Shading • Illumination Models : Given the illumination incident at a point on a surface, what is reflected? Image from http://radsite.lbl.gov/radiance/gallery/image/63b7.jpg • The reflected light which is perceived is a combination of multiple light sources • The surface properties also have a significant effect on the object color • OpenGL simulates the lighting conditions with equasions that: • Approximate reality • Are easy to implement • Software renderers can calculate more realistic calculations 1 2 3 Light Source Models Illumination Model • Illumination models is used to calculate the intensity of light that is reflected at a given point on a surface. C Parameters B • Rendering methods use the intensity calculations from the illumination model to determine the light intensity at all A • Lighting effects are described with pixels in the image, by possibly, considering light propagation models that consider the interaction of between surfaces in the scene. light sources with object surfaces. • The factors determining the lighting effects are: • Point Source (A): All light rays originate – The light source parameters: at a point and radially diverging. • Positions. – A reasonable approximation for sources • Electromagnetic Spectrum. whose dimensions are small compared to the • Shape. object size. – The surface parameters • Parallel source (B): Light rays are all • Position. parallel. May be modeled as a point • Reflectance properties. source at infinity (the sun). • Position of near by surfaces. • Distributed source (C): All light rays – The eye (camera) parameters originate at a finite area in space. • Position. • Sensor spectrum sensitivities. Lighthouse image from http://www.midwinter.com/~piaw/gallery/pigeonpointlighthouse.htm – A nearby sources such as fluorescent light. 4 5 6 1

  2. Illumination Models Diffuse Reflection Phong Shading Model • Simplified and fast methods for • Diffuse (Lambertian) surfaces are calculating surfaces intensities. rough or grainy (like clay, soil, fabric). 1. ambient • Calculations are based on optical 2. diffuse • The surface appears equally bright properties of surfaces and the from all viewing directions. 3. specular lighting conditions (no reflected • The three components are computed sources nor shadows). independently and (weighted) summed • Light sources are considered to be point sources. • A reasonably good approximation • The brightness at each point is for most scenes. proportional to cos( � ): L N � 7 8 9 A B Ambient Ambient surface surface • This is because a surface (A) perpendicular to the light direction is more illuminated than a surface (B) at 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) I p - the point light intensity. Diffuse K d � [0,1] - the surface diffuse Diffuse surface reflectivity. surface N - the surface normal. L - the light direction. 10 11 12 2

  3. Diffuse reflections from different • Commonly, there are two types of K d 0 0.3 0.6 light sources: light directions – A background ambient light. – A point light source. 0.3 • 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 . 0.7 K a 13 14 15 Specular Reflection • The Phong Model : Reflected specular intensity falls off as • Shiny and glossy surfaces (like metal, Specular light 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. • Specular light is also directional, but scatters in a preferred direction • For an ideal specular surface (mirror) K s - the surface specular reflectivity. • "Shiny materials" have a high specularity the light is reflected in only one • Matte materials have low specularity 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 16 17 18 3

  4. Several reflections with different specular parameters Plots of cos n ( � ) for several specular 0.2 0.5 0.8 parameter n. K s n=50 1 0 0.8 0.6 0.4 0.3 n=10 0.2 0 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 n=1 0.7 n=3 n=8 n=64 K d 19 20 21 Ambient Light • Assume there is some non-directional Ambient Light light in the environment (background light). • The amount of ambient light incident Ambient illumination is light that’s been scattered so much by the environment that its direction is on each object is a constant for all impossible to determine: it seems to come from surfaces and over all directions. 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 22 23 24 4

  5. Examples: Ambient light reflections • The updated illumination equation Ambient combined with diffuse reflection is: surface I= I amb +I diff +I spec = K a I a + I p (K d N � L+K s (R � V) n ) • If several light sources are placed in the scene: Diffuse I= I amb + � k (I k diff +I k spec ) surface Commonly, there are two types of light sources: A background ambient light. A point light source. Diffuse + Specular 25 26 27 Composition of Light Sources Composition of Light Sources Summary • Diffuse light comes from a single direction – Brighter if it strikes a surface directly – Scatters equally • Specular light is also directional, but scatters in a preferred direction – "Shiny materials" have a high specularity – Matte materials have low specularity • Ambient light compensate for not considering reflection from other surfaces 30 5

  6. The Highlight Vector The Highlight Vector The Highlight Vector First, let see how to compute the vector R, given L and N. H = L+V R = (2L*N)N - L (2L*N)N H*N ~~ V*R 2L -L H N R L R = (2L*N)N - L V N N L L R R Assuming L and V are constant per surface, H is constant per surface for the given view. Thus, we avoid computing R. The actual size of the angle can be compensated by the glossiness R is relatively expensive, and we can do better: factor n. 31 32 33 6

Recommend


More recommend