Class RenderAggregator

java.lang.Object
eu.svjatoslav.sixth.e3d.renderer.raster.RenderAggregator

public class RenderAggregator extends Object
Collects transformed shapes during a render frame and paints them in depth-sorted order.

The RenderAggregator implements the painter's algorithm: shapes are sorted from back to front (highest Z-depth first) and then painted sequentially. This ensures that closer shapes correctly occlude those behind them.

When two shapes have the same Z-depth, their unique AbstractCoordinateShape.shapeId is used as a tiebreaker to guarantee deterministic rendering order.

This class is used internally by ShapeCollection during the render pipeline. You typically do not need to interact with it directly.

See Also:
  • Constructor Details

    • RenderAggregator

      public RenderAggregator()
  • Method Details

    • paint

      public void paint(RenderingContext renderBuffer)
      Sorts all queued shapes by Z-depth (back to front) and paints them.
      Parameters:
      renderBuffer - the rendering context to paint shapes into
    • queueShapeForRendering

      public void queueShapeForRendering(AbstractCoordinateShape shape)
      Adds a transformed shape to the queue for rendering in this frame.
      Parameters:
      shape - the shape to render, with its screen-space coordinates already computed
    • reset

      public void reset()
      Clears all queued shapes, preparing for a new render frame.