glTF 2.0 'OPAQUE' mode broken
See original GitHub issueWhen alphaBlend
mode is set to OPAQUE
, glTF 2.0 specifies that source alpha values will be ignored, not pre-multiplied. There is a test model to check this: AlphaBlendModeTest.
This was broken recently. I ran git bisect
on this, and I’m sorry @OmarShehata, it narrowed this down to one of your image handling commits here: b772d527599c78796 (part of #7579).
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
A-Frame gltf 2.0 can't set opacity - Stack Overflow
I import a animated gltf 2.0 model in a A-Frame scene. I want to set its opacity to 0.5. But it doen't work,...
Read more >Transparent PNG image in GLTF appears black?
The transparent part of the PNG image, however, becomes black and I don't know why ... It might be a glTF 2.0 model...
Read more >glTF 2.0 — Blender Manual
Three settings are supported by glTF: Opaque. Alpha values are ignored (the default). Alpha Blend.
Read more >glTF™ 2.0 Specification - Khronos Registry
glb extension and model/gltf-binary Media Type. Files representing binary buffers SHOULD use either: .bin file extension with application/octet- ...
Read more >Writing volumetric refraction in glTF 2.0 - Don McCurdy
This may change as renderers improve over time, but for now it's important to keep it in mind and ensure that transmissive objects...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think “always false” might be correct for glTF 2.0, particularly if the BLEND side of the test model continues to work.
Thanks for tracking this down @emackey ! Looks like this is indeed an ImageBitmap issue. One of the major issues with implementing it was that an ImageBitmap cannot be flipped during texture upload. It looks like premultiplied alpha is another setting that would need to be done passed on image decode to get ImageBitmap to work correctly.
Here’s my local Sandcastle. This expects the
AlphaBlendModeTest
folder from the glTF sample models repo to be copied toApps/SampleData/models/
.Changing Resource.js:1894 to:
Fixes the issue. This potentially impacts imagery as well.