Graphics Programs Reference
In-Depth Information
Figure 5-8 . Diffuse reflection: the circle represents the point light source
Note Although we are talking about a surface, in the context of an
ES 2.0 application, this surface is a triangle primitive represented as
a set of vertices. So, in this context, the surface does not explicitly
interact with the incoming light; however, the vertices do.
If θ is the angle between N and S , then, apart from the two cases mentioned, for
all other cases the illumination will be proportional to cos( θ ). Therefore, the amount
of radiation striking the surface is Iin( N . S ) , where Iin is the intensity of the light
source and ( N . S ) is the dot product of vectors N and S . Because only a fraction of
the incoming light is actually scattered, you need to introduce a coefficient into this
equation, so that you can determine the intensity of the outgoing light:
Iout = K(Iin( N . S ))
Here, K is the reflection coefficient, which represents the fraction of the incoming
light that is scattered. Iout is the intensity of the outgoing light. Now, we describe
the shading technique in which, using this lighting equation, we evaluate Iout at each
vertex of an object (specifically, the primitives constituting this object).
 
Search WWH ::




Custom Search