"Reducing Rasterization Bandwidth"

Reducing Rasterization Bandwidth

For deferred rendering, the triangle rasterizer needs to read material data
from an atlas, implemented as an array texture. It appears to do the whole
kaboom, three texture reads are needed at minimum in order to populate the
G-Buffer:

Texture 1: R: Albedo R | G: Albedo G | B: Albedo B | A: (Alpha) 
Texture 2: R: Roughness| G: Metallic | B: Emissive | A: Quilt F
Texture 3: R: Normal X | G: Normal Y | B: Normal Z | A: Height

As we're making use of quilting, each fragment needs the input of all three
corner vertices, so we're doing 3x3 = 9 reads per fragment. That is a tad
much. Intel cards like the HD 4000 in particular are happy to do a few more
calculations if only the shader eases down on bandwidth usage.

So let's see how we could reduce the number of required channels from 12 to
8 or lower.

http://oliverm-h.blogspot.de/2013/05/normal-maps-replacing-blue-channel.html
suggests that the blue channel from the normal map can be removed, as the
normal maps Z value can be reconstructed from its X/Y channels using
z = sqrt(1-x*x-y*y).

Texture 1: R: Albedo R | G: Albedo G | B: Albedo B | A: (Alpha) 
Texture 2: R: Roughness| G: Metallic | B: Emissive | A: Quilt F
Texture 3: R: Normal X | G: Normal Y | B: Height   | A: ?

http://artisaverb.info/DitchingDiffuse.html suggests that the diffuse channel
may not be that important to build a material; Particularly for our art style,
we may do just fine using vertex colors + Quilt factor for turbulence, and
a single B/W luma channel for shapes, patterns and details. 

Texture 1: R: Luma     | G: Emissive | B: Quilt F  | A: (Alpha) 
Texture 2: R: Roughness| G: Metallic | B: ?        | A: ?
Texture 3: R: Normal X | G: Normal Y | B: Height   | A: ?

Now, I mostly kept the height field info here to make use of "Bump Mapping 
Unparametrized Surfaces on the GPU" by Morten S. Mikkelsen, and replace
normal mapping completely here with just the height map; Unfortunately this
introduces blocky artifacts; The alternative is to work with a 2-channel
derivative height map; Now, the main reason for Mikkelsen's approach is to
do normal pertubation without tangents; But as we do have calculated tangents
from the quilting, we can actually do just fine with normals. So let's forget
about the height map.

Texture 1: R: Luma     | G: Roughness| B: Metallic | A: (Alpha) 
Texture 2: R: Normal X | G: Normal Y | B: Emissive | A: Quilt F 

Which brings us down to 8. It's a bit awkward to merge the channels this way,
but as nearly all of the texture work is procedurally generated, that's not
much of a problem.