-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
use anisotropic filtering for raster tiles #1064 #4443
use anisotropic filtering for raster tiles #1064 #4443
Conversation
src/source/raster_tile_source.js
Outdated
const max = gl.getParameter(ext.MAX_TEXTURE_MAX_ANISOTROPY_EXT); | ||
gl.texParameterf(gl.TEXTURE_2D, ext.TEXTURE_MAX_ANISOTROPY_EXT, max); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are any of these values cachable for the lifetime of the page? Reducing the # of per-frame calls to WebGL APIs is important for performance. You may want to wrap that caching behaviour in the painter
module.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, good point!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👌
eb119a0
to
8f139a8
Compare
Awesome! Do you know if it has a noticeable impact on performance? E.g. should we just have it enabled all the time, or add an option to turn it off? |
I ran a modified fps benchmark with satellite-streets at pitch 60 and bearing 45. Got around the same 60FPS on both. I also did manual testing, rotating and pitching the map with the mouse and couldn't notice any performance degradation. So I think it's simpler to leave it on. |
@andrewharvey fps benchmark is not very useful once it reaches 60fps — I think we should remove it. You might get more out of the |
|
Huh, so it's actually faster with anisotropic filtering most of the time? 🎉 |
Yeah, unless there is an issue with the benchmark. I ran a second time to be sure and results were the same. |
Launch Checklist
briefly describe the changes in this PR
Implements anisotropic filtering for raster tiles Use anisotropic filtering for raster tiles in perspective view #1064
write tests for all new functionality
Rendering test fixtures may need to be updated, apart from that I don't think it's something that we can/need unit tests for.
document any changes to public APIs
N/A
post benchmark scores
I ran a modified fps benchmark with satellite-streets at pitch 60 and bearing 45. Got around the same 60FPS on both.
manually test the debug page
Before/After
test it falls back on unsupported devices
Not sure how to do this.
investigate if it makes any difference that this is enabled even when the map isn't pitched
My fps benchmark didn't seem to indicate any performance issues, so I think it's fine as is.
"The filtering level used should depend on the current pitch."
Do we need to do this, or can we just use the max level?