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

Add a depth_bias to Material2d #10683

Merged
merged 1 commit into from
Nov 25, 2023
Merged

Conversation

SludgePhD
Copy link
Contributor

@SludgePhD SludgePhD commented Nov 21, 2023

Objective

It is currently impossible to control the relative ordering of two 2D materials at the same depth. This is required to implement wireframes for 2D meshes correctly (#5881).

Solution

Add a Material2d::depth_bias function that mirrors the existing 3D Material::depth_bias function.

(this is pulled out of #10489)


Changelog

Added

  • Added Material2d::depth_bias

Migration Guide

PreparedMaterial2d has a new depth_bias field. A value of 0.0 can be used to get the previous behavior.

@alice-i-cecile alice-i-cecile added A-Rendering Drawing game state to the screen C-Usability A targeted quality-of-life change that makes Bevy easier to use labels Nov 21, 2023
@james7132 james7132 requested a review from superdump November 25, 2023 20:17
@james7132 james7132 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-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide labels Nov 25, 2023
Copy link
Contributor

It looks like your PR is a breaking change, but you didn't provide a migration guide.

Could you add some context on what users should update when this change get released in a new version of Bevy?
It will be used to help writing the migration guide for the version. Putting it after a ## Migration Guide will help it get automatically picked up by our tooling.

@james7132
Copy link
Member

Note: the addition of a depth_bias public field to PreparedMaterial is a breaking change. Can you please add this as a part of this PR's migration guide?

@SludgePhD
Copy link
Contributor Author

@james7132 right, done!

@alice-i-cecile alice-i-cecile added this pull request to the merge queue Nov 25, 2023
Merged via the queue into bevyengine:main with commit 3c8c257 Nov 25, 2023
27 checks passed
@SludgePhD SludgePhD deleted the 2d-depth-bias branch November 25, 2023 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Usability A targeted quality-of-life change that makes Bevy easier to use M-Needs-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide 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.

3 participants