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

Update texture_atlas example with different padding and sampling #10073

Merged
merged 6 commits into from Dec 14, 2023

Conversation

antoniacobaeus
Copy link
Contributor

@antoniacobaeus antoniacobaeus commented Oct 10, 2023

Objective

Solution

Updated the texture_atlas example by adding 4 different texture atlases:

  1. linear, no padding
  2. linear, padding
  3. nearest neighbor, no padding
  4. nearest neighbor, padding

Now renders one padded and one unpadded texture atlas, and the same upscaled sprite from each of the new texture atlases. See the screenshot below (taken on 1080p monitor).

Screenshot from 2023-10-10 08-37-43

From left->right: linear no padding, nearest no padding, linear padding, nearest padding.


@github-actions
Copy link
Contributor

Welcome, new contributor!

Please make sure you've read our contributing guide and we look forward to reviewing your pull request shortly ✨

@alice-i-cecile alice-i-cecile added A-Rendering Drawing game state to the screen C-Examples An addition or correction to our examples labels Oct 10, 2023
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.

Nice stuff! Good docs, simple and clean code.

Copy link
Contributor

@ickshonpe ickshonpe left a comment

Choose a reason for hiding this comment

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

Two requests:

  • I have to resize the window to view all of the images. Everything should fit into the default window size.
  • It would be good to have a label for each of the piggy shopkeepers detailing the filtering and padding that has been applied to their sprite.

Otherwise an excellent first contribution, does exactly what we wanted.

examples/2d/texture_atlas.rs Outdated Show resolved Hide resolved
examples/2d/texture_atlas.rs Outdated Show resolved Hide resolved
antoniacobaeus and others added 2 commits October 11, 2023 21:19
Add labels to indicate the different settings

Co-authored-by: davidasberg <david.aasberg@gmail.com>
@antoniacobaeus
Copy link
Contributor Author

Added the requests mentioned above. The example should now fit in the default window size, and labels are added to display the different settings, see image below.

Screenshot from 2023-10-13 17-29-0525

Since it seems like text2d is broken on main I had to merge with #9708 to test the labels. I manage to get the text to show, but got some artifacts which shouldn't be present when text2d works properly.

Copy link
Contributor

@ickshonpe ickshonpe left a comment

Choose a reason for hiding this comment

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

Sorry for not rereviewing earlier, the changes are exactly what I asked for. Looks great now.
Text2d works again I think, so once you've merged with main this is ready to go.

Ignore my remaining comments if you like, they are only stylistic and not blocking at all.

examples/2d/texture_atlas.rs Outdated Show resolved Hide resolved
examples/2d/texture_atlas.rs Outdated Show resolved Hide resolved
examples/2d/texture_atlas.rs Outdated Show resolved Hide resolved
examples/2d/texture_atlas.rs Outdated Show resolved Hide resolved
@alice-i-cecile alice-i-cecile added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Dec 14, 2023
@alice-i-cecile
Copy link
Member

CI is failing: fix that up and I'll merge this in for you <3

@alice-i-cecile alice-i-cecile added this pull request to the merge queue Dec 14, 2023
Merged via the queue into bevyengine:main with commit ca1874e Dec 14, 2023
22 checks passed
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-Examples An addition or correction to our examples 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.

Expand the texture atlas builder example to demonstrate more features
3 participants