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

feat: Support image filtering modes on ImageSource & Raster Graphics #2168

Merged
merged 7 commits into from
Dec 26, 2021

Conversation

eonarheim
Copy link
Member

@eonarheim eonarheim commented Dec 23, 2021

===:clipboard: PR Checklist :clipboard:===

  • 📌 issue exists in github for these changes
  • 🔬 existing tests still pass
  • 🙈 code conforms to the style guide
  • 📐 new tests written and passing / old tests updated with new scenario(s)
  • 📄 changelog entry added (or not needed)

==================

Related to the roadmap for v0.26.0 #1161, this PR exposes different webgl texture blending modes to the user. I've attempted to give them names that are indicative of their function.

  • ex.ImageFiltering.Blended - Blended is useful when you have high resolution artwork and would like it blended and smoothed
  • ex.ImageFiltering.Pixel - Pixel is useful when you do not want smoothing aka antialiasing applied to your graphics.

After the v0.25.0 and the switch to webgl, Excalibur really only catered to pixel art styles, now supports hi-res art styles as well!

Changes:

  • Excalibur will set a "default" blend mode based on the ex.EngineOption antialiasing property, but can be overridden per graphic
    • antialiasing: true, then the blend mode defaults to ex.ImageFiltering.Blended
    • antialiasing: false, then the blend mode defaults to ex.ImageFiltering.Pixel
  • ex.Text/ex.Font defaults to blended which improves the default look of text rendering dramatically!
  • ex.Circle and ex.Polygon also default to blended which improves the default look dramatically!
  • ex.ImageSource can now specify a blend mode before the Image is loaded, otherwise

@github-actions github-actions bot added the enhancement Label applied to enhancements or improvements to existing features label Dec 23, 2021
@eonarheim eonarheim merged commit 43eabe5 into main Dec 26, 2021
@eonarheim eonarheim deleted the feature/support-image-filtering-modes branch December 26, 2021 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Label applied to enhancements or improvements to existing features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant