PerformanceLineDrawer
A utility class for efficient drawing of lines and line loops in 2D and 3D spaces.
This class leverages optimized vertex buffers and custom shaders to render a set of line segments or closed loops with high performance. It manages vertex buffers dynamically based on the size of the data being rendered, reusing small buffers for less complex drawings and larger buffers for more complex ones.
The PerformanceLineDrawer
provides methods to draw:
Line segments in 2D and 3D spaces.
Closed line loops in 2D and 3D spaces.
The underlying rendering system uses a shade style manager to configure vertex and fragment shader behavior, accommodating customization via provided shade styles.
Functions:
drawLineSegments
: Draws a series of line segments, supporting both 2D and 3D points.drawLineLoops
: Draws a series of closed line loops, supporting both 2D and 3D points.
Dynamic vertex buffer selection ensures adaptability and performance. Small buffers are recycled efficiently, while a larger buffer is used for heavy workloads. This enables controlled memory use and optimal rendering speed.
Functions
Draws a series of connected line loops using the specified drawing context and style.
Draws a series of connected line loops in 3D space using the specified drawing context and style.
Draws a series of line segments using the given drawing context and style.
Draws a series of line segments in 3D space using the specified drawing context and style.