Add test for GltfLoaderSettings::override_sampler
and mipmap rendering
#19095
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.
Objective
Add a test for
GltfLoaderSettings::override_sampler
. This also serves as a test of the renderer and mipmap filtering options.gltf_override_sampler.mp4
Solution
#17875 recently added support for overriding texture samplers during glTF loading. This PR adds an example-based test for that feature - it loads a simple checkerboard model with various sampler settings and lets the user switch between them.
As a bonus, this also tests the rendering side of mipmap filtering. Currently there are no other tests or examples that do this.
But there's a catch! The test works by loading the same glTF multiple times, each time changing
GltfLoaderSettings::override_sampler
. That falls afoul of #18267 - subsequent loads of the same asset return the first loaded version, effectively ignoring the different settings of later loads.I've confirmed that the test does work if the assets are duplicated. This can be reproduced in the PR branch by syncing to
faefb8dda88ed97c9e127e5948c700c8a6275e0c
.Concerns
3d/test_mipmap_filtering
or something.Testing
Tested on Win10/Nvidia, across Desktop/Vulkan, Chrome/WebGL, Chrome/WebGPU.