-
Notifications
You must be signed in to change notification settings - Fork 18
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
Upgrade to 0.7 #6
Conversation
Thanks for working on this! I haven't look at the changes in bevy 0.6 yet... Concerning the borders, it's just 4 sprites with a system to correctly position them each time the camera is updated. Have the sprites or the cameras changed a lot in the new renderer? If not, the border system should not require many changes. |
SpriteBundles no longer use Meshes as of 0.6, so I'm not sure how you can replicate that effect now |
Yeah, there are some significant changes on how the renderer works. @awalker Seems to be the furthest along with https://github.com/awalker/bevy_pixel_camera which aims to use this PR as a base bevyengine/bevy#3463 . Is the custom mesh needed for only the outlines? or is it needed to ensure the correct alignment as well? It looked from the code errors I was seeing like it was the former, but I'm not sure how else you'd be doing the latter without the custom mesh. |
The custom mesh was needed for the correct alignment of all sprites; the default origin point of sprites in 0.5 was in the center, so sprites with odd dimensions would not be aligned on pixels. After a quick look at 0.6 docs, there doesn't seem to be an official way to set the origin point of sprites. The mesh is now hardcoded here and here. So I think the options are (ordered from ideal to hackish):
|
Oh, I hadn't seen the PR linked above by @chrisburnor, which correspond to solution 1... So it's probably best to just wait for that. |
I think now that Bevy supports Sprite Anchors, it should be possible to complete this PR and upgrade to bevy 0.7. |
Yes, sprite anchors should solve the problem. Does that mean you intend to finish the PR, or do you want me to do it? |
It would probably be much faster if you did it. I'm happy to continue to play around with it, but I likely wont' be able to make any serious progress for a few weeks until my calendar clears up. |
No problem! I should be able find some time in the coming days. And thank you for the heads-up about the sprite anchors implementation! |
I've got it working! Except there is a very strange bug: sprites are not displayed if the ClearColor is set to pure black... Any other color will work! I have no idea how this is even possible. The bug seems to happen with bevy's own OrthographicCameraBundle too, so it's either a bug on their side, or something has changed in the way to set background color that I'm not aware of. Other than that, the code is now much simpler, thank to the sprite anchors. |
The ClearColor bug happens on linux but not on windows, so it may not even be specific to bevy, but a bug in the intel GPU driver, or wayland... So I'm going to merge the PR. |
So far this just attacks the low hanging fruit for upgrading to 0.6.
Still To be Done: