Skip to content

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

Closed
@scurest

Description

@scurest

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions