feat: Support image filtering modes on ImageSource & Raster Graphics #2168
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
===:clipboard: PR Checklist :clipboard:===
==================
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 smoothedex.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:
ex.EngineOption
antialiasing property, but can be overridden per graphicantialiasing: true
, then the blend mode defaults toex.ImageFiltering.Blended
antialiasing: false
, then the blend mode defaults toex.ImageFiltering.Pixel
ex.Text/ex.Font
defaults to blended which improves the default look of text rendering dramatically!ex.Circle
andex.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