A one-of-a-kind specialized rasterizer for rendering exceptionally realistic vector graphics with smooth color gradation.
D-Type Shading Rasterizer is a portable and special-purpose rasterizer designed for rendering highly realistic scalable vector art, such as VIVO scalable photos, or complex SVG and gradient meshes sometimes found in other vector formats. Unlike D-Type Direct Color Rasterizer, which processes only one color value per contour, D-Type Shading Rasterizer is designed to concurrently apply many RGBA color values to the same contour. More precisely, this rasterizer combines the energy of multiple spatially separated color sources to generate smooth color transitions, or color gradients, within each contour.
Typically one color source is located at each contour’s vertex, and a color interpolation algorithm is employed to compute the final pixel color values inside the contour. D-Type Shading Rasterizer currently supports six color interpolation algorithms:
The characteristics of these algorithms are illustrated further down. Despite their technical differences, they have one thing in common: all of them utilize multiple color sources to generate a smooth spectrum of colors or, alternatively, different shades of a single color, within the interior of individual contours. This smooth and gradual change of color — or color gradation — can be utilized to generate vector images that look highly realistic while remaining fully scalable and resolution-independent.
This is best illustrated by the following example:



Notice that in the images above, no contour is painted using a single (flat) color value. Instead, the contours are painted using many different color shades, resulting in a naturally textured appearance. Additionally, observe in the second magnified detail how the color outside the owl’s outer edge transitions gradually from white to light grey. Yet, the actual edge line is perfectly sharp and smooth.
The contours in a vector image can be triangles, polygons or other complex shapes consisting of straight and/or curved segments. D-Type Shading Rasterizer is not limited to rendering triangles only, unlike most GPUs. With D-Type Shading Rasterizer, end-user applications can create much richer vector-based geometries and take advantage of how different color interpolation algorithms interact with these geometries. Furthermore, D-Type Shading Rasterizer imposes no restrictions on the complexity of the underlying geometry. In other words, applications can supply to the rasterizer just a few contours or, in the case of highly realistic vector images, thousands of contours.
Much like D-Type Direct Color Rasterizer, D-Type Shading Rasterizer generates the entire vector image during the rasterization process, in a single pass. So it’s exceptionally fast. In fact, the rendering machinery behind D-Type’s VIVO Image Vectorizer relies on D-Type Shading Rasterizer to render extremely complex and detailed vector images designed to match or exceed the quality of high-resolution photographs.
Coordinates |
|
|---|---|
Color Shading Algorithms |
|
Advanced Features |
|
Dependencies |
None |
Availability |
Static or shared (dynamically linked) library for:
See Platforms and Portability for details. |
Each color shading algorithm exhibits different characteristics regarding how color changes within the contour and along its edges. The following chart demonstrates these characteristics. On the left side of each illustration, the top shape (triangle) has yellow, green and red color sources at its corners, while the bottom shape (quadrilateral) has green, blue, blue and red color sources. On the right side, the top shape (triangle) has blue, yellow and red color sources at its corners, while the bottom shape (triangle) has yellow, blue and red.
| Illustration of edge anti-aliasing and color shading algorithms | |
|---|---|
| Algorithm | Sample Output |
| Mean Value Coordinates | ![]() |
| Distance Field - Method A | ![]() |
| Distance Field - Method B | ![]() |
| Inverse Distance Weighting | ![]() |
| Gouraud Shading With Anti-Aliased Edges |
![]() |
| Gouraud Shading Without Anti-Aliased Edges |
![]() |
All of D-Type’s color interpolation algorithms distribute the energy of color sources from the vertices to the interior of the contour and along its edges.
The distribution of color energy is smooth and gradual both within the contour and along its edges.
Additionally, all algorithms, except for Gouraud Shading Without Anti-Aliased Edges, provide anti-aliasing at the edges of the contours.
This example closely resembles the first one, with the triangle and quadrilateral on the left now joined along their bottom and top edges, respectively. Similarly, the two triangles on the right have also joined. This setup illustrates the color transition between adjacent fill areas and the edge stitching behavior of each color interpolation algorithm.
| Illustration of edge stitching and color/shading transition between adjacent fill areas | |
|---|---|
| Algorithm | Sample Output |
| Mean Value Coordinates | ![]() |
| Distance Field - Method A | ![]() |
| Distance Field - Method B | ![]() |
| Inverse Distance Weighting | ![]() |
| Gouraud Shading With Anti-Aliased Edges |
![]() |
| Gouraud Shading Without Anti-Aliased Edges |
![]() |
All color interpolation algorithms demonstrate perfect stitching between adjacent contours. This holds true even for Gouraud Shading Without Anti-Aliased Edges which, as the name suggests, does not support anti-aliasing at the edges.
All color interpolation algorithms, except for Inverse Distance Weighting, feature a smooth color/shading transition between adjacent fill areas, provided that the same color sources are placed at the vertices of the joined edges. The Mean Value Coordinates algorithm is best in this regard, followed by the two Gouraud Shading algorithms, and finally the Distance Field algorithms.
The Inverse Distance Weighting algorithm is not designed for, and should not be used to create, smooth color and shading transitions outside of a single contour.
Ideally, contours that are part of the vector-based geometry (which D-Type Shading Rasterizer renders in a single rasterization pass) should not overlap. When overlaps do occur, end-user applications should be aware of the fact that different color interpolation algorithms yield different results in the overlapping regions. This is illustrated in the following example:


Different color interpolation algorithms yield varying results in overlapping regions. Only the Gouraud Shading Without Anti-Aliased Edges algorithm produces a result that is intuitively clear and useful. Therefore, it is advisable to avoid using overlapping shapes in general cases.
As mentioned earlier, D-Type Shading Rasterizer is not limited to rendering triangles. The contours in a vector image can be polygons or other complex shapes consisting of straight and/or curved segments. However, when rendering concave polygons and shapes, end-user applications should be aware of a limitation imposed by the Gouraud Shading algorithm, which is not present in any other color interpolation algorithm. Let’s examine the following example. Here, we have a sample concave shape with three color sources (red, yellow and blue) at its vertices:






As the images above demonstrate, all color interpolation algorithms, except for Gouraud Shading, feature a smooth and uniform color distribution across the entire interior of a concave shape.
The Gouraud Shading algorithms exhibit an abrupt color change in the regions inside the concave shape that are just below the local y-value minima ("valleys") and just above the local y-value maxima ("hills"). This behavior is a result of the Gouraud Shading algorithm’s design, which always interpolates colors between two endpoints in the horizontal direction. Therefore, the Gouraud Shading algorithms should not be used when the vector geometry consists of concave polygons. Instead, all concave polygons should be decomposed into two or more convex polygons before being processed with the Gouraud Shading interpolation algorithm. It is important to note that this extra step is not necessary for any other color interpolation algorithm supported by D-Type Shading Rasterizer.
If you have a question about D-Type technology that you can’t find the answer to, please use our Obtain Additional Information form. We will publish your question along with our response within a few days and notify you once the answer is available on our website.
Additionally, you may find it helpful to explore the history of D-Type releases and review the D-Type News page.
Available in binary, object, and/or source code format for any hardware or operating system environment, D-Type technology is an excellent choice for software developers seeking a rendering solution that is affordable, mature, reliable, secure, well-maintained, well-supported, super-fast and packed with features.