mirror of
https://github.com/CesiumGS/obj2gltf.git
synced 2024-11-23 08:34:14 -05:00
Deconflate transparent and doubleSideMaterial
This commit is contained in:
parent
fba3cdf4e9
commit
44e76de7be
@ -846,19 +846,14 @@ function createSpecularGlossinessMaterial(material, options) {
|
|||||||
} else {
|
} else {
|
||||||
const alpha = material.alpha;
|
const alpha = material.alpha;
|
||||||
diffuseFactor[3] = alpha;
|
diffuseFactor[3] = alpha;
|
||||||
|
transparent = alpha < 1.0;
|
||||||
if (options.doubleSidedMaterial) {
|
|
||||||
transparent = true;
|
|
||||||
} else {
|
|
||||||
transparent = alpha < 1.0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (defined(diffuseTexture)) {
|
if (defined(diffuseTexture)) {
|
||||||
transparent = transparent || diffuseTexture.transparent;
|
transparent = transparent || diffuseTexture.transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
const doubleSided = transparent;
|
const doubleSided = transparent || options.doubleSidedMaterial;
|
||||||
const alphaMode = transparent ? "BLEND" : "OPAQUE";
|
const alphaMode = transparent ? "BLEND" : "OPAQUE";
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@ -932,19 +927,14 @@ function createMetallicRoughnessMaterial(material, options) {
|
|||||||
} else {
|
} else {
|
||||||
const alpha = material.alpha;
|
const alpha = material.alpha;
|
||||||
baseColorFactor[3] = alpha;
|
baseColorFactor[3] = alpha;
|
||||||
|
transparent = alpha < 1.0;
|
||||||
if (options.doubleSidedMaterial) {
|
|
||||||
transparent = true;
|
|
||||||
} else {
|
|
||||||
transparent = alpha < 1.0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (defined(baseColorTexture)) {
|
if (defined(baseColorTexture)) {
|
||||||
transparent = transparent || baseColorTexture.transparent;
|
transparent = transparent || baseColorTexture.transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
const doubleSided = transparent;
|
const doubleSided = transparent || options.doubleSidedMaterial;
|
||||||
const alphaMode = transparent ? "BLEND" : "OPAQUE";
|
const alphaMode = transparent ? "BLEND" : "OPAQUE";
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
Loading…
Reference in New Issue
Block a user