-
-
Notifications
You must be signed in to change notification settings - Fork 261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Debug Renderer Improvements #106
Conversation
Hey @sebcrozet, This just needs one more thing, as a library i used a cargo feature to swap whether the Debug Components were put on their own render pass or on the main pass by default. i just used 'default_main_pass' as it made sense in the library context, but in rapier i think changing the name of the feature to 'debug_renderer_default_main_pass' is the clearest and most descriptive. It's to long i think but i haven't thought of any better alternatives, does that feature name work for you? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have no idea how much I appreciate your work on this! I was using this for a bit and figured out the trimesh stuff I think. I also added rendering for convex meshes and compound meshes in my branch, will try and see if I can push it to this PR later.
src/render/mesh/trimesh.rs
Outdated
|
||
#[cfg(feature = "dim3")] | ||
pub fn wire_trimesh(trimesh: &TriMesh) -> Mesh { | ||
let mut mesh = Mesh::new(PrimitiveTopology::LineList); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might actually be adding too many lines?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's been a while since i've looked at this but, if i remember correctly the code to generate the timesh mesh was basically just taken from the current debug renderer.
@ByteBuddha The feature name |
It should't be too difficult, Creating the Custom material is easy enough, i just need to figure out how to actually create a custom render pass in the new renderer. Unfortunately I'm having issues getting bevy 0.6 to work on my laptop, I didnt have any trouble using main a week or 2 ago, but for some reason it's unable to find my GPU, going to spend the day installing arch linux cause i think that might fix it. I know @Aceeri has some code i read he was planning to push we might also want to wait for that. I'll pick this back up as soon as i can get a working bevy 0.6 install 😢 If anyone else gets to it before me be my guest to push a PR |
I can definitely work a bit on this, might not have a whole lot of time today specifically but I do have some additions for some more rendering stuff too. |
I briefly looked into this today. There seems like there are going to be a couple of issue's updating this to bevy 0.6.0. With so much changed it might even be worth just a total rewrite. The two most difficult to deal with as i see them are
I don't think these would be too hard to figure out, but i won't have the time to devote to this for probably the next several months maybe even upwards of a year, I'm having some issues with my wife so I'm effectively yeeting all of my more time intensive personal projects out the window to focus on my personal life. I would really love it if someone wanted to pick up the torch on this one, I really feel the need for a better debug renderer for rapier and i like the approach used here, I just don't have the time to look into all the new changes for the brand new renderer. otherwise this PR will probably end up stale and unusable by the time i can come back. I'd love to help anyone willing to put in the work for this, I can be reached here on github or under the username perjoratic on the bevy/rapier discord servers. |
I'll try and take the reins of it as I definitely agree this is very useful. I did a bit of research around to see what other crates seem to be using and it seems like I'll try and make something based off of an updated version of https://github.com/ForesightMiningSoftwareCorporation/bevy_polyline, specifically aevyrie's fork here: https://github.com/aevyrie/bevy_poly_line |
Made some progress on this, I implemented a wireframe renderer here: https://github.com/Aceeri/bevy_stylized_wireframe Still planning on updating it a bit to add some more options for color/dashed/etc. But is pretty solid so far, will try and put in a PR in the next couple days. |
@Aceeri How are things going? Any progress? |
@CleanCut I have some stuff working here if you wanted to take a look: https://github.com/aceeri/bevy_rapier/tree/convex-compound I need to add some amount of customizability to wireframes colors and stuff is the main thing I need to do I think. |
Alright, sorry about that, I had some rust stuff to do at work which ended up taking up most of my time/mental energy, going to focus on getting this out the door as a PR this weekend. |
I do have my attention divided between making some steam audio support for rust though, heron does seem to have its own debug renderer stuff going pretty well. Might be worth taking a look at their stuff. |
No need to apologize! You contribute on your own timeframe. |
Thank you for your work on this @ByteBuddha! Rapier has now its official line-based debug-renderer that |
This is still a work in progress, but it's ready for initial review.
RapierDebugPlugin adds a custom render pass named
RapierDebugPass
that will be rendered after the main_pass. The debug components can be viewed on this pass or the defaultMainPass
. To change the default behavior currently the 'default_main_pass' feature can be set.Components
RapierDebugCollider
Displays the colliderRapierDebugPosition
Displays a 'x' on position of a collider or a rigidbody.RapierDebugPath
Tracks the path of motion of a collider and displays a line created from the past 1000 positionsEvents
RapierDebugToggleVisibilty
Toggles the visibilty of a debug component using the bevyVisible
struct.RapierDebugToggleRenderPass
Toggles the render pass used to display the components between main pass & rapier debug pass.List of things left to do: