Skip to content

GLTFLoader: Texture alpha should be ignored on opaque materials #15483

@0b5vr

Description

@0b5vr

In GLTFLoader we can load standard materials using StandardMaterial .
However, the alpha channel of its texture doesn't be handled properly, when renderer's alpha is activated.

In OPAQUE or MASK material, alpha channels of texture should be negated:
https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#alpha-coverage

Change the material's blend mode to ZERO-ONE (in GLTFLoader) might solve this problem?

This is how it should be (rendered in Unity):

image

Here's how it looks like in Three.js GLTFLoader:

default

This is the source code:
https://github.com/FMS-Cat/cube-gradient-alpha

Environment:

  • Three.js version: r99
  • Browser: Confirmed in Chrome, Firefox, Edge
  • OSes: Windows. Has not tested in other env
  • Hardware: Probably no requirements

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions