Skip to content
larspensjo edited this page Oct 28, 2012 · 3 revisions

A G-buffer (geometry buffer) is used for deferred shading. For a more detailed explanation, see blog entry Deferred shading, part 2 It consists of information as shown below. It is important to not use more data for the G buffer than what is necessary. One reason is that it will consume RAM from the graphics card, but a more important reason is that it will require a high volume of data being transferred for every pixel. All buffers used for for the deferred shading are allocated by the RenderControl class.

Depth buffer

Just a standard 24-bit depth buffer with stencil bits.

Diffuse texture

RGB buffer (no alpha). It is the color output of the first rendering phase.

Position

A 32 bit RGBA float used to store the world position of the pixel. The alpha channel is used for sun light information before any effects of dynamic shadows. When precomputed shadows are used, the alpha channel will be used as the actual sun intensity. If static or dynamic shadows are used (based on shadow maps), it is only used as a flag whether it is reached by the sun.

Normals

A 16-bit RGBA float. The RGB channel is used for the normal of the pixel, and the alpha channel is used for information about the precomputed ambient light.

Blending data

An 8-bit RGBA color information, with precomputed alpha. All blending is thus rendered separately, and eventuaolly applied by the deferred shader.

Lights

A 16-bit float buffer. There is no separate color information for lighting, only luminance information.

Clone this wiki locally