Skip to content
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

Gizmo line styles #12394

Merged
merged 18 commits into from
Mar 25, 2024
Merged

Gizmo line styles #12394

merged 18 commits into from
Mar 25, 2024

Conversation

lynn-lumen
Copy link
Contributor

Objective

  • Adds line styles to bevy gizmos, suggestion of Tracking issue: Amazing Gizmos #9400
  • Currently solid and dotted lines are implemented but this can easily be extended to support dashed lines as well if that is wanted.

Solution

  • Adds the enum GizmoLineStyle and uses it in each GizmoConfig to configure the style of the line.
  • Each "dot" in a dotted line has the same width and height as the line_width of the corresponding line.

Changelog

  • Added GizmoLineStyle to bevy_gizmos
  • Added a line_style: GizmoLineStyle attribute to GizmoConfig
  • Updated the lines.wgsl shader and the pipelines accordingly.

Migration Guide

  • Any manually created GizmoConfig must now include the line_style attribute

Additional information

Some pretty pictures :)

This is the 3d_gizmos example with/without line_perspective:
Screenshot 2024-03-09 at 23 25 53
Screenshot 2024-03-09 at 23 25 39

And the 2d example:
Screenshot 2024-03-09 at 23 25 06

@pablo-lua
Copy link
Contributor

At this point I think we should break gizmos 2d_example and 3d_example in a few parts, the examples are getting pretty cramped

@lynn-lumen
Copy link
Contributor Author

At this point I think we should break gizmos 2d_example and 3d_example in a few parts, the examples are getting pretty cramped

I agree but I think this should wait until both #12252 and this are merged so we can have one "fancy_gizmos" example.

@james7132 james7132 added C-Usability A targeted quality-of-life change that makes Bevy easier to use A-Gizmos Visual editor and debug gizmos labels Mar 10, 2024
@lynn-lumen lynn-lumen changed the title Adds Gizmo line styles Gizmo line styles Mar 11, 2024
Copy link
Contributor

@pablo-lua pablo-lua left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good. The problem with examples being too big can be in another PR.

@lynn-lumen lynn-lumen requested a review from BD103 March 22, 2024 00:46
Copy link
Member

@BD103 BD103 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good and tested, though take my review with a grain of salt. I have little experience with gizmos or shaders. 😅

crates/bevy_gizmos/src/lines.wgsl Outdated Show resolved Hide resolved
crates/bevy_gizmos/src/lines.wgsl Outdated Show resolved Hide resolved
@pablo-lua pablo-lua added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it M-Needs-Release-Note Work that should be called out in the blog due to impact labels Mar 22, 2024
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Mar 25, 2024
Merged via the queue into bevyengine:main with commit 97a5059 Mar 25, 2024
28 checks passed
@lynn-lumen lynn-lumen mentioned this pull request Apr 12, 2024
57 tasks
@alice-i-cecile
Copy link
Member

Thank you to everyone involved with the authoring or reviewing of this PR! This work is relatively important and needs release notes! Head over to bevyengine/bevy-website#1290 if you'd like to help out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Gizmos Visual editor and debug gizmos C-Usability A targeted quality-of-life change that makes Bevy easier to use M-Needs-Release-Note Work that should be called out in the blog due to impact S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants