
206 III Image Space
if ( edge_x)
{
float k0 = dx1 - dx0; // Left slope
float k1 = dx3 - dx2; // Right slope
float m0=dx1+k0;// Left offset
float m1 = dx2 - k1; // Right offset
offset .x = ( m1 - m0) / (k0 - k1); // Intersection point
is_silhouette = (abs(offset .x) > 1.0f );
offset .x = ( abs( offset .x) < 0.5f)? offset .x : 0.5f;
}
Listing 3.2. Computing horizontal crease intersection point.
In Listing 3.2 we are computing the intersection point horizontally. The math
is relatively straightforward, and the resulting value is the coordinate relative to
the center sample location. If the intersection point lands somewhere within a
pixel in either direction, ...