tfg.rendering.framebuffer.Framebuffer

A framebuffer holding rasterized values required for deferred shading.

Tensors are expected to have shape [batch, height, width, channels].

For now, the fields are specialized for triangle rendering. Other primitives may be supported in the future.

Immutable once created. Uses cached_property to avoid creating redundant tf ops when properties are accessed multiple times.

background_mask

batch_size

height

is_multi_layer

num_layers

pixel_count

width

barycentrics Dataclass field
triangle_id Dataclass field
vertex_ids Dataclass field
foreground_mask Dataclass field
attributes Dataclass field

Methods

layer

View source

Slices at the given layer index, returning a single-layer Framebuffer.

__eq__