Deconflate transparent and doubleSideMaterial

This commit is contained in:
Sean Lilley 2023-10-03 09:27:12 -04:00
parent fba3cdf4e9
commit 44e76de7be

View File

@ -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 {