-
-
Notifications
You must be signed in to change notification settings - Fork 35.6k
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
GLTFLoader: Texture alpha should be ignored on opaque materials #15483
Comments
Have you checked that modifying the material's blend mode fixes the problem? You can do that after the model is returned from the loader: gltf.scene.traverse((o) => {
if (o.isMesh) {
o.material.blending = THREE.CustomBlending;
// ...
}
}); If this is a setting that GLTFLoader should be applying only when the renderer's alpha property is enabled, a loader can't really know when to do that. :/ |
Wait uh I thought alpha is going to always be 1 regardless of map's alpha value under the ZERO-ONE blending settings... ._. |
I'm afraid I don't understand the issue — why do the texture's alpha values need to be negated? The link you gave to the Alpha Coverage section of the spec doesn't mention this. In your sample source repository, which of the two models are you talking about? |
Bleh I might have picked wrong words, negated -> ignored (I have a disability to my English) |
You mean, we should treat the alpha as a "fourth component of the output" even if it's fully "
|
Better late than never™ #22424 |
In
GLTFLoader
we can load standard materials usingStandardMaterial
.However, the alpha channel of its texture doesn't be handled properly, when renderer's alpha is activated.
In
OPAQUE
orMASK
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):
Here's how it looks like in Three.js GLTFLoader:
This is the source code:
https://github.com/FMS-Cat/cube-gradient-alpha
Environment:
The text was updated successfully, but these errors were encountered: