-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
[Merged by Bors] - add a 3d lines example #5319
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
Conversation
I really like this as a learning example! I still think we should consider shipping a first class tool for this, but we can cross that bridge when we get there 😄 |
Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
Yeah, I agree we should have an api for that at some point, but this uses a different Material it can't just use the normal primitive shape. Or it could, but it would require some warning to only use it with a Material made to draw lines. |
I agree that these lines can't be shapes. |
I think I'd prefer creating a module I guess I should write a line drawing RFC 👀 |
Regarding the API for a debug lines module, I'd be more than happy to provide input. I've a vision™, to say the least. Based on this code, I'd use a mix of my To create something very ergonomic, accepting lines, line strips, shapes and does not require modifying any system param to draw (only local changes) that is easy to disable with a cargo flag. |
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.
LGTM. I remember migrating bevy_debug_lines to 0.6 and adding about 300 lines of code. This is so much better.
This is also a pretty decent introduction to the AsBindGroup
derive macro. We definitively need this.
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.
Very nice. Should be useful both as learning material and as a snippet to steal! No complaints about the example; you know how this works.
bors r+ |
# Objective - Showcase how to use a `Material` and `Mesh` to spawn 3d lines  ## Solution - Add an example using a simple `Material` and `Mesh` definition to draw a 3d line - Shows how to use `LineList` and `LineStrip` in combination with a specialized `Material` ## Notes This isn't just a primitive shape because it needs a special Material, but I think it's a good showcase of the power of the `Material` and `AsBindGroup` abstractions. All of this is easy to figure out when you know these options are a thing, but I think they are hard to discover which is why I think this should be an example and not shipped with bevy. Co-authored-by: Charles <IceSentry@users.noreply.github.com>
# Objective - Showcase how to use a `Material` and `Mesh` to spawn 3d lines  ## Solution - Add an example using a simple `Material` and `Mesh` definition to draw a 3d line - Shows how to use `LineList` and `LineStrip` in combination with a specialized `Material` ## Notes This isn't just a primitive shape because it needs a special Material, but I think it's a good showcase of the power of the `Material` and `AsBindGroup` abstractions. All of this is easy to figure out when you know these options are a thing, but I think they are hard to discover which is why I think this should be an example and not shipped with bevy. Co-authored-by: Charles <IceSentry@users.noreply.github.com>
# Objective - Showcase how to use a `Material` and `Mesh` to spawn 3d lines  ## Solution - Add an example using a simple `Material` and `Mesh` definition to draw a 3d line - Shows how to use `LineList` and `LineStrip` in combination with a specialized `Material` ## Notes This isn't just a primitive shape because it needs a special Material, but I think it's a good showcase of the power of the `Material` and `AsBindGroup` abstractions. All of this is easy to figure out when you know these options are a thing, but I think they are hard to discover which is why I think this should be an example and not shipped with bevy. Co-authored-by: Charles <IceSentry@users.noreply.github.com>
# Objective - Showcase how to use a `Material` and `Mesh` to spawn 3d lines  ## Solution - Add an example using a simple `Material` and `Mesh` definition to draw a 3d line - Shows how to use `LineList` and `LineStrip` in combination with a specialized `Material` ## Notes This isn't just a primitive shape because it needs a special Material, but I think it's a good showcase of the power of the `Material` and `AsBindGroup` abstractions. All of this is easy to figure out when you know these options are a thing, but I think they are hard to discover which is why I think this should be an example and not shipped with bevy. Co-authored-by: Charles <IceSentry@users.noreply.github.com>
Objective
Material
andMesh
to spawn 3d linesSolution
Material
andMesh
definition to draw a 3d lineLineList
andLineStrip
in combination with a specializedMaterial
Notes
This isn't just a primitive shape because it needs a special Material, but I think it's a good showcase of the power of the
Material
andAsBindGroup
abstractions. All of this is easy to figure out when you know these options are a thing, but I think they are hard to discover which is why I think this should be an example and not shipped with bevy.