Page 189 - DCAP504_Computer Graphics
P. 189

Computer Graphics



                          If L, N, R, and V are all unit vectors then L * N = cos(θ) and R * V= cos (φ). We can re-write the above
                          formula as
                                                   k
                          I=Iaka+Ip (kd L * N + ks(R * V) )


                                      The value of R can be calculated with the term L * N.


                          The above mentioned formulae can be generally used along with the RGB color model. Thus, the
                          intensity of a light can be written in the form of an RGB color vector which can be represented as I = (I r,
                          I g, I b). The reflection co-efficients can also be expressed as 3-D vectors.

                                             The reflection coefficient k d  = (0.7, 0.7,  0.3) defines  a surface that  appears
                                             yellowish when illuminated with white light.

                          The ambient reflection coefficient I c, can simply be similar to the reflection co-efficient k d. The three
                          components of I c are often made equal since the color of the reflection of a light source is usually the
                          same as the color of the light source itself. When white light is used the formula for a single point source
                          can be written as
                          Ir=Iakar + Ip (kdr L * N + ks ( R *V) )
                                                       k
                                                       k
                          l g= I ak ag + I p (k dg L * N + k s (R * V) )
                          Ib,= I ak ab + I p,( k dp L * N + k s (R * V) )
                                                         k
                          12.3   Interpolative Shading Methods

                          Interpolation is nothing but the identification of new  values that exist between known values
                          determined for the vertices of a polygon. Interpolative shading methods use interpolation at the vertices
                          of the faces of polygons.

                          Surface color can be calculated using an illumination model such as the usage of a formula at any point
                          of the surface. It can be more costly and it is even unnecessary when the image is used to preview the
                          scene. To avoid this problem, it is suggested to apply the formula at full scale only at selected surface
                          points. Then other surface points can be shaded with the help of any other techniques such as color
                          interpolation and surface normal interpolation.
                          In the following sub sections we will discuss about some interpolative shading methods that are used to
                          shade a polygon.
                          Constant Shading
                          Constant shading is the easiest shading model for a polygon.


                          Did you know?   Faceted shading or flat shading is the other name for constant shading.
                          Constant shading method applies an illumination model once to produce a single intensity value. The
                          single intensity value can be used to shade the polygon completely and to regenerate the polygon's
                          shade. This method is useful only when the following assumptions are true.
                          1.   The light source should be at infinite distance so that L * N becomes constant through out the
                              polygon face.
                          2.   The view point should be at infinite distance so that N * V becomes constant throughout the
                              polygon face.
                          3.   The polygon should signify the  actual surface being considered and it should not be an
                              approximation to a curved surface.






                          182                     LOVELY PROFESSIONAL UNIVERSITY
   184   185   186   187   188   189   190   191   192   193   194