The present invention relates generally to computer graphics systems that blend color values and, more particularly, to a hardware rendering pipeline that determines opacity values.
In rendering systems, blending, or compositing as it is sometimes known, is a process that combines RGB color values of source samples with RGB color values of corresponding destination samples. The combined RGB values are typically stored in an image buffer. In volume rendering systems, the RGB color values of the samples are interpolated from voxel values.
An opacity (xcex1) value associated with the RGB values controls how much of the color values of the destination samples should be combined with those of the source samples. Without blending, the color values of the source samples overwrite the values of the destination samples, as though the source samples are opaque. With blending, it is possible to control how much of the existing destination color values should be combined with those of the source samples. Blending enables effects such as translucent images. Color blending lies at the heart of techniques such as transparency and digital compositing.
One way to understand blending operations is to consider the RGB values of the samples as representing their color, and the xcex1 values as representing their transparency or opacity. Levels of transparency range from completely transparent to somewhat transparent (translucent) to opaque. In standard computer graphics systems that employ blending, xcex1 has a value between 0 and 1. If xcex1=0, the sample is transparent, and if xcex1=1, the sample is opaque. If xcex1 has some value between 0 and 1, the sample is translucent.
If the rendering system uses ray casting, the number of samples that are generated along a ray can vary depending on viewing angle, for example, non-orthogonal projections may have a different number of samples than orthogonal projections. Also, the volume samples may be non-uniformly spaced because samples along the x, y, and z axes were acquired at different rates, as in anisotropic volumes.
Using the wrong number of samples can be a problem. If the number of samples is greater than it should be, the resulting image can be too opaque. If the number of samples is less than it should be, the resulting image can be too translucent. In other words, the translucency of the final image varies with the number of samples.
Often the number of samples cannot be controlled, so accurate rendering requires correcting the opacity at samples to account for the sample spacing. Therefore, there is a need to perform opacity correction, and more particularly, to perform opacity correction in a hardware rendering pipeline.
A method corrects opacity values of samples in a rendering pipeline. The method partitions a range of uncorrected alpha values into a plurality of segments in a low to high order. Corrected alpha values for uncorrected alpha values in the highest segment are determined by direct table look-up. Corrected alpha values for uncorrected alpha values in all but the highest segment are determined by linear interpolation.