2.26
Stippling

- 2.26.1. Overview
- 2.26.2. Algorithm
- 2.26.3. Types

2.26.1
Overview
1
One major issue with deferred rendering is that it does not allow for translucency; the scene is placed into a single flat image and there is no way to express the fact that an object is to be overlaid on top of another object. This can be a problem when implementing systems such as level-of-detail (or LOD) switching. A basic requirement for an LOD system is that when the viewer moves a certain distance away from an object, that object should be replaced with a lower-polygon version in order to reduce rendering costs. Switching from a high polygon version to a low polygon version in one frame can be visually jarring, however, so it is usually desirable to fade out one version of the object whilst fading in another version over the course of a few frames. This presents an immediate problem: It is not possible to implement traditional alpha translucency fading in a deferred rendering system, as described above.
2
The stippling technique attempts to provide an alternative to alpha translucency. The technique is simple: Simply discard some pixels of an object when the object is rendered into the geometry buffer. By progressively discarding more pixels over the course of a few frames, the object can be made to fade . If the pattern of discarded pixels is randomized and the fading time is short, the result is visually acceptable for implementing LOD systems.
2.26.1.3 Stippling
2.26.2
Algorithm
1
The stippling algorithm is very simple:
2.26.2.2 Algorithm

1. Tile a pattern texture t over the entire screen.
2. For each pixel with screen coordinates p in the object currently being rendered, sample a value x from t at p.
3. If x is less than the defined stippling threshold s, discard the pixel.

3
In practice, for good visual results when fading between two objects, the programmer should use two complementary stippling patterns for the objects. For example, using a checkerboard stippling pattern for the first object and an inverted copy of the pattern for the other. This guarantees that at no point are the same pixels from both objects discarded.
2.26.3
Types
1
In the r2 package, the stippling effect is provided by shaders such as R2SurfaceShaderBasicStippledSingle.