Previous Contents Next

Chapter 22   Coherence

The issue of coherence is often mentioned in relation to hidden surface removal, since many of these algorithms make use of it in some fashion. It does have widespread application to many areas of computer graphics.

Coherence denotes similarities between items or entities. It describes the extent to which these items or entities are locally constant. In many situations properties do not change drastically but rather in a smooth or continuous way. Coherence is based on the principle of locality, whereby "nearby" things do have the same or similar characteristics. In the field of computer science and computer graphics coherence properties have been exploited in a variety of different methods and techniques. With coherence processing of data can be accelerated considerably, e.g., hidden line/hidden surface removal.

Data can be stored more efficiently by eliminating redundancies due to coherence, e.g., run length encoding of raster images. Some approximate or incremental techniques are only useful in coherent situations, e.g., Newton iteration to determine the roots of a polynomial. In a coherent situation incremental methods can be designed that process an item by reusing the results obtained for a similar (coherent) item. Exploiting coherence leads to algorithms based on an incremental application of very simple operations, that in many cases can use "integer logic" to replace time-consuming floating-point arithmetic.

22.1   Types of coherence

In this section a survey of different types of coherence is given. Some of these types of coherence are not mutually exclusive and they are overlapping in the sense that in certain situations they can be used interchangeably.

22.1.1   Scan-line coherence

Scan-line algorithms for visible-surface determination have been one of the earliest examples in computer graphics that make use of coherence properties. With scan-line algorithms an image is generated sequentially, one scan line at a time. The fact that there are relatively few changes from one scan line to the next and almost the same objects (e.g., polygons) are visible on consecutive scan lines is called scan-line coherence. Therefore a scan line is processed by only updating the information of the previous scan line.

22.1.2   Span coherence

Coherence does not only exist between consecutive scan lines but is usually present within a single scan line too. Spans are portions of a scan line with some constant property, e.g., the same object is visible over a given span. All scan line based algorithms (e.g., hidden surface removal, polygon filling) do exploit span coherence, which is given between adjacent spans and within a single span as well.

22.1.3   Depth coherence

Depth coherence expresses the fact that the depth or distance to the viewer at some surface point changes gradually. Adjacent parts of a surface are usually close in depth. Therefore the depth at some surface point can be efficiently calculated by incrementally updating the depth information of an already processed nearby surface point. Furthermore the depth ordering of surfaces at one pixel is likely to be similar to the ordering at adjacent pixels.

An incremental update operation is again feasible.

22.1.4   Area coherence

Area coherence follows from image coherence and is given if adjacent pixels of a raster image do have the same or similar colour or intensity values. This situation arises if, for example, a group of pixels is covered by the same object or the same visible surface. In area coherent portions of an image the calculation of one pixel value allows for the calculation of values of nearby pixels with significantly less computation. Warnock's area subdivision algorithm for visible surface determination of a scene consisting of polygons is a prominent example of a method that makes use of area coherence.

22.1.5   Object coherence

Object coherence is based on some known relationships between objects or between parts of the same object. Objects may be disjoint, may be closely clustered or may consist of collections of low-level geometry, which usually are connected, smooth and bounded (e.g., polygons, surfaces). Local neighborhoods of space are likely to be occupied by the same objects. Depending on the given relations, manipulations like clipping, sorting, comparison, or intersection can first be performed at the object level to reduce the complexity and volume of calculations on low-level geometry.

22.1.6   Spatial coherence

Spatial coherence describes spatial homogeneities. These are a consequence of constant or slow varying relationships in the spatial arrangement of objects or data. Volume data like flow fields of a viscous fluid often exhibit a high degree of homogeneity. Considering the spatial arrangement of objects, spatial coherence is somewhat similar to object coherence.

22.1.7   Temporal coherence

Temporal coherence occurs whenever a dynamic environment changes smoothly over time, e.g., small viewpoint and/or object movement (object space temporal coherence). Discretization of a temporal coherent situation allows the calculation of the relevant information by using results obtained for previous time steps. Temporal coherence has been used in a variety of methods for accelerating the calculation of animation sequences. Often only restricted situations with high temporal coherence are handled by these techniques. Restrictions can be one of the following: fixed viewpoint or restricted camera movement, fixed light sources, restricted class of objects like planar or convex objects, etc.

22.1.8   Frame coherence

Frame coherence denotes the fact that successive frames of an animation sequence or video sequence are likely to be very similar if the difference in time is small, i.e., the projection of an environment tends to change continuously over time. Frame coherence is an immediate consequence of temporal coherence and object coherence and may be considered to be an image space temporal coherence. Frame coherence allows an efficient calculation and storage of video sequences.

22.1.9   Image coherence

Image coherence is the view-dependent analogue to object coherence. It results from the transfer of object coherence properties to the image plane by well-behaved projections, e.g., orthogonal or perspective projections. In the 2-D image plane there is at least the same degree of connectedness and smoothness as among the original 3-D objects. Local constancy of object space translates to local constancy in image space with only gradual changes. Some additional coherence is due to the projection technique itself. A given part of the image plane may be influenced by only a small subset of the items in object space.

22.1.10   Ray coherence

Tracing rays through an object environment has been used extensively in computer graphics for image rendering purposes. The classical ray-tracing approach has been as follows: for each pixel of an image a ray is cast from the eye point into object space to determine the intersection point of the first visible object. To account for global illumination effects an approximation to the light distribution in the object scene is done by recursively casting further rays from this point of intersection. Depending on the surface properties of the intersected object, rays are cast in the direction of reflection and refraction.

Shadow calculation is done by tracing rays from the point of intersection to the various light sources. Therefore, a ray tree is constructed to calculate the colour information for each pixel. Due to the spatial coherence and object coherence of the scene, similar rays, i.e., rays with similar origin and direction, often have almost the same behavior. Similar rays often intersect the same object, the points of intersection are close together and so on. This property is called ray coherence. The similarity between ray trees is analogously called ray tree coherence. One of the major drawbacks of ray tracing has been its excessive computational cost. An extensive amount of research has been done to accelerate ray tracing by taking advantage of the various types of coherence that are inherent in the raytracing technique.

22.1.11   Other types of coherence

The following less frequently used types of coherence are listed only for reasons of completeness: cell coherence, cluster coherence, cube coherence, data coherence, edge coherence, external coherence, face coherence, frustum coherence, geometric coherence, hierarchical coherence, implied edge coherence, intervisibility coherence, invisibility coherence, objective coherence, patch-to-patch coherence, path coherence, predictive coherence, screen-area coherence, shadow coherence, space coherence, surface coherence and volume coherence.

22.2   Exploiting Coherence

22.2.1   Incremental techniques

Incremental techniques are well suited to exploit coherence properties. Results from a previous, similar and therefore coherent situation are reused or modified to efficiently process the current situation. The Newton method for the incremental determination of the roots f(x)=0 of a continuous function is a typical example. Thereby the iteration formula xi+1 = x i - f(x i)/f'(xi) is used. Starting out from an approximation x i to a root of f(x) a better approximation xi+1 is determined. In certain situations there exist only incremental calculations to derive the desired result. In coherent situations incremental calculations are usually much faster than algorithms that do not reuse previous results. Incremental methods try to minimize costly operations during an iteration or replace them by easier operations, e.g., integer rather than floating point arithmetic. Interpolation formulas that typically make sense only in coherent situations can be handled efficiently with incremental calculations.

Some examples in computer graphics where incremental computations are used with great advantage are: raster conversion of lines, circle, ellipses, shading of polygons (Gouraud, Phong), intersection calculations (edge - scan line, ray - parametrically defined surface patches). One problem with incremental calculations is numerical stability. Care has to be taken that error propagation is kept under control. There are systems, namely chaotic deterministic dynamic systems, that are highly sensitive to calculation errors. In such cases incremental processing is not applicable.

Data compression through incremental storage, i.e., storing only the hopefully small differences to previous data sets, is another example of coherence exploitation.

Incremental techniques typically constitute a trade-off between computation cost and storage cost. Instead of doing a costly calculation of a result from scratch the previous result is stored and, usually, has to be modified only slightly. Incremental techniques introduce a sequential ordering into the processing which might interfere with parallelization efforts.

22.2.2   Bounding volumes

The central idea of bounding volumes is the assumption that it is cheaper to process several simple objects (bounds) instead of a complex object. A complex (geometric) object is approximated by a simple bounding volume. This strategy pays off if most of the calculations can be done with the simple approximating bounding volume and only few calculations must be done with the complex object itself. A typical example is the ray-object intersection test of ray tracing: A ray is first tested against the simple bounding volume. Only if a ray pierces the bounding volume a more complicated ray-object intersection test is done. The additional overhead for those rays that intersect the bounding volume and hence have to be tested against the complex geometric object anyway is easily compensated by the fact that most rays are far away from the object.

Computation expense may be reduced by a constant factor but no improvement on the linear time complexity (in the number of objects) is achieved. Bounding volume hierarchies have been developed to attain a logarithmic time behavior in the number of objects. Bounding volumes are grouped together and are enclosed within larger bounding volumes recursively so that a hierarchy (tree) of bounding volumes is generated. Processing a parent volume may make it superfluous to consider bounding volumes and objects contained within. For example, if a ray does not intersect a parent volume there is no need to check for an intersection with all the corresponding child volumes. With one intersection test it is possible to eliminate many objects from further consideration.

22.2.3   Subdivision techniques

Subdivision strategies are rather common in computer science. The divide-and-conquer approach is often used to subdivide a problem into subproblems that are easier to process. The solution of the problem is then generated from the solutions to the subproblems. In many situations subdivision increases coherence properties in the subproblems by, e.g., reducing the complexity or dimensionality of the original problem. The scan-line algorithm for visible surface determination is a typical example: A 2D image is subdivided into 1D scan lines, the 3D object scene is intersected with 2D scan planes and visibility is finally determined for 1D spans at 0D span boundaries.

In computer graphics subdivision is done to make use of the principle of locality that exists in coherent situations. Thereby subdivision tries to obtain coherent homogeneous regions that can be manipulated efficiently. Subdivision is applied to a variety of different spaces, e.g., image space, object space, ray space, time space. With subdivision faster calculation, parallel processing and reduction in storage requirements are achievable.

22.3   Data structures for coherence

Some specific data structures have been developed that are well suited to exploit coherence properties. Only few examples are shortly mentioned here.


Previous Contents Next