KhronosGroup / KhronosGroup/WebGL
Test int/uint textures with alpha channels
- Dominant language
- HTML
- Stars
- 2.9k
- Forks
- 703
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 4
Description
TexImageUtils' simpleUintTextureFragmentShaderES3 and simpleIntTextureFragmentShaderES3 explicitly output an opaque alpha (1.0, which translates to the maximum unsigned/signed int value for the texture type) because they try to smooth over differences between sampling a texture with no alpha channel, and a texture with an alpha channel.
This issue came up in #2451 when adding semi-transparent test cases to the canvas-to-texture tests.
These shaders should be changed to support returning the alpha channel from the target texture. The main entry points for this helper class already receive the internalformat they're intended to work with, so it should be straightforward to have two versions of the shaders, one for use with textures that have an alpha channel, and one for those without.
This change is likely to have wide-ranging effects on the conformance suite and will need to be tested carefully. Certainly the new canvas tests in #2451 will need to be updated, and likely others.
Contributor guide
Research direction
Start with TexImageUtils and its simpleUintTextureFragmentShaderES3 and simpleIntTextureFragmentShaderES3 entry points, checking how internalformat is passed. Review the canvas-to-texture tests from #2451 and the broader conformance tests that use these helpers. Done means alpha-channel textures return their sampled alpha while textures without alpha retain compatible behavior, with affected tests updated and passing.
Written by the indexing model from the issue text.
Assessment
- Domain
- computer-graphics, testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100