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

Support wireframes for 2D meshes #12135

Merged
merged 16 commits into from Mar 29, 2024
Merged

Conversation

msvbg
Copy link
Contributor

@msvbg msvbg commented Feb 26, 2024

Objective

Wireframes are currently supported for 3D meshes using the WireframePlugin in bevy_pbr. This PR adds the same functionality for 2D meshes.

Closes #5881.

Solution

Since there's no easy way to share material implementations between 2D, 3D, and UI, this is mostly a straight copy and rename from the original plugin into bevy_sprite.

image

Changelog

  • Added Wireframe2dPlugin and related types to support 2D wireframes.
  • Added an example to demonstrate how to use 2D wireframes

Copy link
Contributor

The generated examples/README.md is out of sync with the example metadata in Cargo.toml or the example readme template. Please run cargo run -p build-templated-pages -- update examples to update it, and commit the file change.

Copy link
Contributor

The generated examples/README.md is out of sync with the example metadata in Cargo.toml or the example readme template. Please run cargo run -p build-templated-pages -- update examples to update it, and commit the file change.

Copy link
Contributor

The generated examples/README.md is out of sync with the example metadata in Cargo.toml or the example readme template. Please run cargo run -p build-templated-pages -- update examples to update it, and commit the file change.

@IceSentry
Copy link
Contributor

The example looks very different for me. I'm only seeing lines around the shapes but no inside triangles are visible for me

@IceSentry
Copy link
Contributor

Also, can you rebase on main? I think the Color changes will break some stuff

Copy link
Contributor

The generated examples/README.md is out of sync with the example metadata in Cargo.toml or the example readme template. Please run cargo run -p build-templated-pages -- update examples to update it, and commit the file change.

@msvbg msvbg force-pushed the wireframe2d branch 3 times, most recently from c188f70 to b1f265e Compare February 26, 2024 21:39
@alice-i-cecile alice-i-cecile added C-Enhancement A new feature A-Gizmos Visual editor and debug gizmos labels Feb 26, 2024
@msvbg
Copy link
Contributor Author

msvbg commented Feb 26, 2024

Not entirely sure why the check-bans job is failing, perhaps because I modified Cargo.toml? It seems to be complaining about duplicate lock file entries.

@alice-i-cecile
Copy link
Member

Yep, the check-bans failure isn't your fault. It's a real-but-noisy failure that we're blocked on fixing due to version synchronization dances.

@msvbg
Copy link
Contributor Author

msvbg commented Feb 27, 2024

I see that @IceSentry approved already, but I felt that I should use the new color types now that #12137 was merged. I added 80aea41 and 2d177ff.

@IceSentry
Copy link
Contributor

I think adding it to bevy_internal should be done in a separate PR. I know it's tiny, but it makes it easier to keep track of history if it isn't mixed with unrelated things. I'm not entirely sure what the plan is for migration of bevy_color though.

@alice-i-cecile
Copy link
Member

alice-i-cecile commented Feb 27, 2024

I think adding it to bevy_internal should be done in a separate PR. I know it's tiny, but it makes it easier to keep track of history if it isn't mixed with unrelated things. I'm not entirely sure what the plan is for migration of bevy_color though.

Agreed. I'd like a small PR adding it to bevy_internal and exporting a prelude like the other crates. Feel free to open it @msvbg, otherwise I'll get to it in the next couple of days.

@alice-i-cecile
Copy link
Member

I've added the new color types to bevy_internal in #12158.

@msvbg
Copy link
Contributor Author

msvbg commented Feb 27, 2024

Rebased on top of #12158.

@alice-i-cecile alice-i-cecile added this to the 0.14 milestone Feb 27, 2024
@SludgePhD
Copy link
Contributor

This should fix #5881

@msvbg
Copy link
Contributor Author

msvbg commented Mar 27, 2024

Oh, didn't realize we had two of these PRs. My bad for not searching properly.

Copy link
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

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

Looks sensible, and an important feature.

@alice-i-cecile alice-i-cecile added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it C-Needs-Release-Note Work that should be called out in the blog due to impact labels Mar 28, 2024
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Mar 28, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 28, 2024
@alice-i-cecile
Copy link
Member

@msvbg looks like there's been breaking changes on main that need to be adapted to.

@msvbg
Copy link
Contributor Author

msvbg commented Mar 28, 2024

I'll get it fixed up.

@msvbg
Copy link
Contributor Author

msvbg commented Mar 29, 2024

@alice-i-cecile I resolved the problems in 7451663 and checked that the example still looks good :)

@alice-i-cecile alice-i-cecile added this pull request to the merge queue Mar 29, 2024
Merged via the queue into bevyengine:main with commit fee8244 Mar 29, 2024
31 checks passed
@msvbg msvbg deleted the wireframe2d branch March 29, 2024 18:55
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-Enhancement A new feature C-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.

Wireframe for 2D meshes
4 participants