Graphics Reference
In-Depth Information
all materials use a Blinn-Phong BRDF ( Zink , Hoxley, Engel, Kornmann, & Suni). We will
also omit any performance optimizations for now, as these will be covered in the following
section.
11.2.1 G-Buffer Layout
To start off, we must first design the layout and format of the g-buffer. As mentioned in
the previous section, the g-buffer contains the scene geometry's surface properties that
are needed to evaluate the BRDF. This means that we must examine the equations for our
BRDF to determine which properties will be needed. For reference, the equations for the
variant of Blinn-Phong that we will use are listed in Equation (11.1):
(11.1)
In the above equations N is the surface normal direction vector, L is the direction
vector from the surface to the light source, V is the direction vector from the surface to the
camera, and P is the specular power (which is a measure of shininess/roughness in this
lighting model). The Albedo terms refer to the reflectiveness of the material being shaded,
and the specular and diffuse albedos are modulated with the specular and diffuse light-
ing contributions, respectively. To provide all of the parameters needed to complete the
above equations, we will need to store diffuse albedo, specular albedo, the specular power,
the surface normal vector, and the surface position vector in our g-buffer. To have our
g-buffer contain all of the values required to evaluate the above equations, we will need to
store 13 distinct floating-point values in our g-buffer render targets. Since we can store at
most 4 values per texel in a texture, 3 we will need to use 4 render targets in our g-buffer.
Figure 11.3 shows the formats of the render targets that we will use, along with the layout
of the data within those render targets.
With these render target formats, the resulting footprint for each pixel is 64 bytes.
This means that at 1280x720 resolution, the total size of the g-buffer is 56.25 megabytes,
or 126.56 megabytes for 1920×1080. Keep in mind that this is in addition to the memory
footprint of the back buffer and depth-stencil buffer, which is the minimum number of
3 This is because the available texture element formats supply at most four components.
Search WWH ::




Custom Search