Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

glTF sandbox: alpha=0 with MASK mode not transparent #15557

Open
scurest opened this issue Sep 12, 2024 · 4 comments
Open

glTF sandbox: alpha=0 with MASK mode not transparent #15557

scurest opened this issue Sep 12, 2024 · 4 comments
Assignees
Milestone

Comments

@scurest
Copy link

scurest commented Sep 12, 2024

Repro
In https://sandbox.babylonjs.com/, the following glTF material is opaque

Cube-Alpha0.zip

    {
      "alphaMode": "MASK",
      "doubleSided": true,
      "name": "Material.001",
      "pbrMetallicRoughness": {
        "baseColorFactor": [
          0.800000011920929,
          0.800000011920929,
          0.800000011920929,
          0
        ],
        "metallicFactor": 0,
        "roughnessFactor": 0.5
      }
    }

Because this uses MASK mode and the alpha value (0) is less than the alphaCutoff (default of 0.5), this should be fully transparent.

If alpha=0 is achieved with a fully transparent texture instead

Cube-TextureAlpha0.zip

    {
      "alphaMode": "MASK",
      "doubleSided": true,
      "name": "Material.001",
      "pbrMetallicRoughness": {
        "baseColorTexture": {
          "index": 0  // <- this has alpha=0 everywhere
        },
        "metallicFactor": 0,
        "roughnessFactor": 0.5
      }
    }

then it renders transparent as expected.

Screenshots
compare

Desktop (please complete the following information):

  • OS: Arch Linux
  • Browser: Firefox
  • Version: 128

Additional context
KhronosGroup/glTF-Blender-IO#2328

@Popov72
Copy link
Contributor

Popov72 commented Sep 12, 2024

cc @bghgary

@bghgary
Copy link
Contributor

bghgary commented Sep 12, 2024

We seem to be ending up in alpha blend mode for this case. I will investigate, but we probably need to overhaul how we detect alpha a bit.

@bghgary
Copy link
Contributor

bghgary commented Sep 13, 2024

I'm going to try to fix this along with #15504 since it's somewhat related, but this may take a while to confirm everything is working.

@thomlucc thomlucc added this to the 8.0 milestone Sep 23, 2024
Copy link

This issue has been automatically staled because it has been inactive for more than 14 days. Please update to "unstale".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants