Immediate Mode Line/Gizmo Drawing#6529
Conversation
78beb71 to
ce474fd
Compare
james7132
left a comment
There was a problem hiding this comment.
Bikeshedding for a better long term name: bevy_gizmos? It'd fit better into the context of a user-facing editor.
|
Credit should be given to @lassade, @The5-1, and @Toqozz for their prior work in this space. Could you add Separately, @lassade's existing implementation for |
|
Oh I totally missed this here, good stuff 👌 Was still struggling to get my old attempt ported to 0.8 and then 0.9 hit ;p |
|
Note that I also heavily contributed to Toqozz/bevy_debug_lines. I did the port to the new renderer for 0.6, it was basically an entire rewrite. |
|
Once #5303 by @IceSentry is merged, should we reuse the wireframe material here? |
This PR needs colors to be per vertex with an option to disable depth testing + a 2d version, so that's not an option, and the |
63d13bb to
69c48e0
Compare
|
You added a new feature but didn't add a description for it. Please update the root Cargo.toml file. |
1 similar comment
|
You added a new feature but didn't add a description for it. Please update the root Cargo.toml file. |
8b21cb2 to
ab29eb7
Compare
ab29eb7 to
854ed62
Compare
There was a problem hiding this comment.
Fantastic work!
Ultimately I think we'll want to explore rendering using methods similar to Freya Holmers Shapes lib, as normal "mesh line drawing" has limitations when it comes to thickness, anti-aliasing + quality, etc. Definitely a "hard problem" though. I'm glad we started with the mesh-line approach so we can start building tools + visual debuggers now.
| ) -> Result<RenderPipelineDescriptor, SpecializedMeshPipelineError> { | ||
| let mut shader_defs = Vec::new(); | ||
| shader_defs.push("GIZMO_LINES_3D".into()); | ||
| shader_defs.push(ShaderDefVal::Int( |
There was a problem hiding this comment.
Not something to fix here, but the fact that we need to manually plug these values in, despite not using them in the shader, is unfortunate.
|
Turns out this was based on @Toqozz's @Toqozz: can you write "I agree to re-license the code from bevy_debug_lines used in this PR to the dual MIT/Apache-2.0 license Bevy uses" here if you agree to the re-license? No pressure btw. It is your code and you can do whatever you want with it. We will revert if we don't hear from you / if the answer is no. |
|
I agree to re-license the code from bevy_debug_lines used in this PR to the dual MIT/Apache-2.0 license Bevy uses. I didn't even realise that the license was limiting. |
|
Much appreciated! Thank you for building cool stuff! |
Objective
Add a convenient immediate mode drawing API for visual debugging.
Fixes #5619
Alternative to #1625
Partial alternative to #5734
Based off https://github.com/Toqozz/bevy_debug_lines with some changes:
Performance
Stress tested using Bevy's recommended optimization settings for the dev profile with the
following command.
cargo run --example many_debug_lines \ --config "profile.dev.package.\"*\".opt-level=3" \ --config "profile.dev.opt-level=1"I dipped to 65-70 FPS at 300,000 lines
CPU: 3700x
RAM Speed: 3200 Mhz
GPU: 2070 super - probably not very relevant, mostly cpu/memory bound
Fancy bloom screenshot
Changelog
GizmoPluginGizmossystem parameter for drawing lines and wireshapes.TODO
Future work
RenderLayersRenderLayersCo-Authored By: @lassade felipe.jorge.pereira@gmail.com
Co-Authored By: @The5-1 agaku@hotmail.de
Co-Authored By: @Toqozz toqoz@hotmail.com
Co-Authored By: @nicopap nico@nicopap.ch