196 II Rendering Techniques
Any combination of these parameters may be requested by an artist, hence the
= 1296 variations already shown in this limited example. Unlike ﬁltering and
wrapping modes, these parameters are not encapsulated in the OpenGL texture sam-
pling state. Supporting these parameters in the real-time pipeline requires different
execution paths on both the CPU and the GPU.
Some 3D engines have a limited number of material proﬁles like Diffuse only,
Diffuse + Normal, Diffuse + Environment. Source engine [Valve 11] gives an ex-
ample: “The Phong mask is a greyscale image stored in the alpha channel of the
model’s normal map.” There is always a workaround to write our own shader that
implements any combination of the parameters in our table. However, an artist is
not going to do it, and it is too time consuming to be used in the prototyping stage.
These limitations basically leave no way for an artist to experiment with texturing
pipeline in a full degree of freedom in real time.
This article presents an original rendering pipeline designed to support a ﬂexible
texture pipeline, allowing any combination of texture and blending options. It was
inspired by the Blender texturing pipeline [KatsBits 00] and designed for it. Our
pipeline allows artists to use Blender’s texturing expressiveness during the early de-
velopment stage, while retaining the advantage of 3D engines ’ real-time performance
when visualizing the results of texturing experiments.
Let’s start by clearing up some terminology:
• Phong lighting. A commonly used lighting model with the following pa-
rameters: diffuse and specular colors, shininess, surface normal, camera, and
• G-buffer. A storage of material properties baked in screen space. Can b e rep-
resented by a number of textures or a single layered texture. The information
is extracted from the G-buffer when the light contribution to the fragment is
• Deferred rendering. A family of rendering pipelines that split material
properties and lighting evaluation. Generally, it is implemented in two steps:
G-buffer creation and light resolution.
14.1.2 Textures in Blender
A Blender material contains a list of textures. Material properties correspond to the
uniform properties of a geometric primitive and deﬁne the initial parameter val-
ues. Textures are applied in a sequence, modifying some of these values in a high-
frequency manner. Table 14.1 is constructed from a core set, but not all of the
Blender texture parameters. After the primitive parameters are set by the material