Skip to main content

Module gbuffer

Module gbuffer 

Source
Expand description

G-Buffer management for deferred rendering.

The G-Buffer stores per-pixel geometric and material data that the lighting pass reads to compute final shading. This module provides configurable attachment layouts, bind/unbind semantics, debug visualization, MRT (Multiple Render Target) configuration, and memory usage statistics.

Structs§

GBuffer
The main G-Buffer object that manages all attachment textures and the framebuffer. This struct owns the GPU resource handles (as opaque u64 IDs) and provides bind/unbind/resize/clear operations.
GBufferAttachment
Describes a single attachment in the G-Buffer.
GBufferBuilder
Fluent builder for constructing a G-Buffer with a custom layout.
GBufferDebugView
Debug view configuration and state for visualizing G-Buffer contents.
GBufferLayout
Describes the full set of attachments in a G-Buffer.
GBufferStats
Statistics about G-Buffer memory usage and performance.
MrtConfig
Configuration for Multiple Render Targets output from the geometry pass.
TextureState
Represents the runtime state of an individual texture in the G-Buffer.

Enums§

ClearValue
Clear value for a G-Buffer attachment.
GBufferAttachmentFormat
Pixel format for a single G-Buffer attachment.
GBufferDebugChannel
Which channel of the G-Buffer to visualize.
GBufferError
Errors that can occur during G-Buffer operations.
GBufferSemantic
Named semantic for a G-Buffer attachment.

Functions§

octahedral_decode
Decode an octahedral-encoded normal back to a unit vector.
octahedral_encode
Octahedral normal encoding: packs a unit normal into 2 floats in [-1, 1]. This is more bandwidth-efficient than storing XYZ in RGBA16F.
pack_normal_snorm16
Pack a normal into a u32 using 16-bit snorm for each component.
unpack_normal_snorm16
Unpack a u32 snorm16 packed normal.