[][src]Module luminance::framebuffer

Framebuffers and utility types and functions.

Framebuffers are at the core of rendering. They’re the support of rendering operations and can be used to highly enhance the visual aspect of a render. You’re always provided with at least one framebuffer, Framebuffer::back_buffer. That function returns a framebuffer that represents – for short – the current back framebuffer. You can render to that framebuffer and when you swap the buffers, your render appears in the front framebuffer (likely your screen).

Framebuffers

A framebuffer is an object maintaining the required GPU state to hold images you render to. It gathers two important concepts:

  • Color buffers.
  • Depth buffers.

The color buffers hold the color images you render to. A framebuffer can hold several of them with different color formats. The depth buffers hold the depth images you render to. Framebuffers can hold only one depth buffer.

Framebuffer slots

A framebuffer slot contains either its color buffers or its depth buffer. Sometimes, you might find it handy to have no slot at all for a given type of buffer. In that case, we use ().

The slots are a way to convert the different formats you use for your framebuffers’ buffers into their respective texture representation so that you can handle the corresponding texels.

Color buffers are abstracted by ColorSlot and the depth buffer by DepthSlot.

Structs

Framebuffer

Framebuffer with static layering, dimension, access and slots formats.

Enums

FramebufferError

Framebuffer error.

IncompleteReason

Reason a framebuffer is incomplete.

Traits

ColorSlot

A framebuffer has a color slot. A color slot can either be empty (the unit type is used,()) or several color formats.

DepthSlot

A framebuffer has a depth slot. A depth slot can either be empty (the unit type is used, ()) or a single depth format.