KhronosGroup / KhronosGroup/glTF-Sample-Assets
Texture wrap bug in TextureLinearInterpolationTest
- Dominant language
- TypeScript
- Stars
- 1.1k
- Forks
- 107
- Avg merge
- 9h 39m
- Merged PRs (30d)
- 4
Description
When using multisampled rendering on TextureLinearInterpolationTest model, TestLabels.png semi-transparent texture shows dots at the bottom of the rendered rectangular geometry when viewed from the high angles. See the screenshot:
The bug was traced down to the wrong texture wrapping mode. The texture uses default sampler, so the default REPEAT mode is used for wrapS and wrapT, resulting in artefacts when viewed from high angles while multisampling. The fix is to use sampler with CLAMP_TO_EDGE wrapS and wrapT modes. The diff for the fix in Models/TextureLinearInterpolationTest/glTF/TextureLinearInterpolationTest.gltf is as follows:
[fix.diff.txt](https://github.com/user-attachments/files/30342692/fix.diff.txt)
After applying the fix, multisampling correctly samples texture at the edge, not mistakenly taking some samples from the opposite side of the texture.
Contributor guide
Research direction
Open Models/TextureLinearInterpolationTest/glTF/TextureLinearInterpolationTest.gltf and inspect its texture and sampler definitions. Compare the linked fix.diff.txt, apply the wrapping-mode correction, and verify that multisampled rendering no longer shows edge dots when viewed from high angles.
Written by the indexing model from the issue text.
Assessment
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 88/100