t
The filtered transparency model stipulates the final color as:
IA + ktOtIB,
where Ot is the transparency or filter color of A.
In order to correctly compute the final color at each pixel, we must rasterize
polygons in the back to front order. This in general is quite expensive. A
multi-pass algorithm by Mammen renders all transparent objects in a special
buffer and all opaque objects using the regular Z-buffer.
The special transparency-buffers store an activity flag for each pixel, which
is initialized to 0. The Z-values in the transparency Z-buffer are initialized to
the closest possible Z value.
All the opaque objects are rendered first using the standard technique.
Next, multiple passes processing the transparent polygons
in the back to front order is done as follows:
-
If a transparent polygons Z value is closer than that in the main Z-buffer
and farther than that in the transparency Z-buffer, it is saved in the
transparency buffer and the corresponding flag is set.
-
Once all polygons are processed, we have the farthest transparent polygons in the
transparency that are closer than the closest Z value in the main Z-buffer. The
pixels with their flags set are blended with the corresponding pixels in the
main buffer and the Z value copied from the transparency Z-buffer to the main
Z-buffer.
-
Transparency flags and Z-values are reset and next pass is performed. The process
is complete once all polygons are processed, i.e. no flag bit is set.
Screen-door transparency algorithm is a less expensive technique. This techniques
represents each polygon as a fine mesh of wires. Higher the intended opacity,
denser the mesh. The results of this algorithms are not as impressive, as this
technique compromises resolution. In addition, interaction between two overlapping
meshes can generate aliasing artifacts and there is no direct control over how
much of a mesh behind another mesh of equal transparency shows through -- the mesh
in the back can be completely hidden.