bevy_debug_lines
A prototype plugin providing a simple line drawing api for bevy.
About
This plugin uses a shader and sends individual points to the GPU, which then moves geometry to make a line. This is quite fast with a significant number of lines, and there is no added cost to moving lines around.
Usage
Add the plugin in your App::build() phase:
use *;
use *;
Draw a line in whatever system you have using the DebugLines resource:
See the examples for a more complete usage example.
Notes and Missing Stuff
This plugin is in alpha, so there are things missing and general annoyances:
- Each separate line needs a separate ID... to separate it from the others. This can probably be handled automatically instead.
- There is a defined maximum number of lines that is kinda low (
MAX_LINES = 128). I have some ideas to resolve this. - Thickness is hardcoded (see
line.vert), this is also easy to resolve. - Color is hardcoded (see
line.frag). - Missing documentation, but there's only really one function you should use;
add_or_update_line(id, start, end).