View source on GitHub |
A framebuffer holding rasterized values required for deferred shading.
tfg.rendering.framebuffer.Framebuffer(
barycentrics: tfg.rendering.framebuffer.RasterizedAttribute
,
triangle_id: tf.Tensor,
vertex_ids: tf.Tensor,
foreground_mask: tf.Tensor,
attributes: Dict[str, tfg.rendering.framebuffer.RasterizedAttribute
] = dataclasses.field(default_factory=dict)
)
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.
Methods
layer
layer(
index
)
Slices at the given layer index, returning a single-layer Framebuffer.
__eq__
__eq__(
other
)