question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

GLTFLoader: Alpha mode should default to Blend when material color has transparency

See original GitHub issue
Description of the problem

Some software exports GLTFs without setting alpha mode, even in materials with transparency. Blender correctly renders these materials as transparent, but the GLTFLoader defaults to opaque even when an alpha < 1.0 is specified in the material.

Suggested solution

When alpha < 1.0, if no alphaMode is specified, default to BLEND rather than OPAQUE.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6

github_iconTop GitHub Comments

2reactions
WestLangleycommented, Aug 12, 2020

I fail to see the logic behind defaulting to opaque when a material is clearly transparent

It is not always so clear. Transparency can be set in the alpha channel of the texture. The loader is not expected to discern that.

0reactions
diegoescalacommented, Aug 12, 2020

Yes, good point.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using threeGLTFLoader load gltf get transparency problem
I think your glTF model probably has materials that are marked "alphaMode": "BLEND" . In most realtime 3D rendering systems, including ThreeJS, ...
Read more >
GLTF Parser Hooks - Questions - Babylon.js Forum
OPAQUE; } } else { // Default: Base Color Alpha Blending material.AlphaMode = AlphaMode.BLEND; } }. That setup up alpha mode for the...
Read more >
Material#blending – three.js docs
Sets the alpha value to be used when running an alpha test. The material will not be rendered if the opacity is lower...
Read more >
Blending - LearnOpenGL
The amount of transparency of an object is defined by its color's alpha value. ... Now that we've enabled blending we need to...
Read more >
Journey of Learning Three.js (Day 4) | by James Min | Medium
Then I change the blend mode in Setting from Opaque to Alpha Hashed which makes my globe transparent: All I need to do...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found