-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
Allow changing the anisotropic filter level at run-time #4673
Comments
You should be able to update the default samplers in the same way that the custom samplers are updated. Then when Anisotropy is changed you just update both. |
By the way, I noticed mipmap LOD bias is not set on the default samplers, yet it still worked in godotengine/godot#61953 on StandardMaterial3Ds. |
I got here to check if something was done about the proposal but it seems to be staled. Basically, once you change ProjectSettings.set_setting(
"rendering/textures/default_filters/anisotropic_filtering_level",
16.0)
get_viewport().texture_mipmap_bias = 1.0 You can slide in the new anisotropy level to be added to all materials with the anisotropy flag set, so current engine code doesn't need to be changed, just need to add a new method to both |
@wagnerfs That's an interesting discovery – it should be relatively easy to add a method to set the anisotropic filtering level in this case. Perhaps it can even be made per-viewport like the texture mipmap bias (which is now correctly handled if it differs between multiple viewports in 4.3). PS: Remember to set ProjectSettings.set_setting(
"rendering/textures/default_filters/anisotropic_filtering_level",
16.0)
get_viewport().texture_mipmap_bias = 1.0
await get_tree().process_frame
get_viewport().texture_mipmap_bias = 0.0 |
@Calinou |
Feel free to open a pull request for this 🙂 Note that this should be exposed as a property if possible, like |
Related to #3134.
Describe the project you are working on
The Godot editor 🙂
Describe the problem or limitation you are having in your project
The anisotropic filter level used in material rendering cannot be changed while the project is running. This can be too limiting for graphics settings menus, which generally allow changing the anisotropic filtering level to improve performance on low-end GPUs (or improve quality on high-end GPUs with memory bandwidth to spare).
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Allow changing anisotropic filter level at run-time. This includes setting it at 1× to disable anisotropic filtering on all materials within the project, even if their sampling mode is set to anisotropic.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Similar to what godotengine/godot#51679 did with mipmap LOD bias, the max anisotropy should be separated from the sampler state creation process so it can be adjusted at run-time.
Max anisotropy is currently defined here: https://github.com/godotengine/godot/blob/68b86220c806fa02d0d2b21d6561e7ea871e840e/servers/rendering/renderer_rd/storage_rd/material_storage.cpp#L1338-L1388
If this enhancement will not be used often, can it be worked around with a few lines of script?
Anisotropic filtering can be disabled on a per-material basis (per-texture basis in
3.x
), but this requires a lot of code to consistently apply throughout an entire project at run-time. Also, this does not allow using a lower or higher level of anisotropic filtering than the default while leaving it enabled.Is there a reason why this should be core and not an add-on in the asset library?
Anisotropic filtering level can't be overridden by an add-on.
The text was updated successfully, but these errors were encountered: