@archvisioninc/canvas 2.3.9 → 2.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -249,17 +249,15 @@ export const updateMaterial = inboundData => {
|
|
|
249
249
|
|
|
250
250
|
// Transparency
|
|
251
251
|
if (!_.isEmpty(id) && material && transparencyEnabled !== undefined) {
|
|
252
|
-
if (!
|
|
253
|
-
material.
|
|
254
|
-
material.albedoTexture.useAlphaFromAlbedoTexture = false;
|
|
252
|
+
if (!albedoHasAlpha) {
|
|
253
|
+
material.transparencyMode = BABYLON.PBRMaterial.PBRMATERIAL_ALPHABLEND;
|
|
255
254
|
}
|
|
256
|
-
material.transparencyMode = BABYLON.PBRMaterial.PBRMATERIAL_ALPHABLEND;
|
|
257
255
|
material.transparencyEnabled = transparencyEnabled;
|
|
258
256
|
}
|
|
259
257
|
|
|
260
258
|
// Albedo alpha
|
|
261
|
-
if (!_.isEmpty(id) && material
|
|
262
|
-
const hasAlbedoTexture = material
|
|
259
|
+
if (!_.isEmpty(id) && material && albedoHasAlpha !== undefined) {
|
|
260
|
+
const hasAlbedoTexture = material?.albedoTexture;
|
|
263
261
|
const alphaMode = albedoHasAlpha ? 'PBRMATERIAL_ALPHATEST' : 'PBRMATERIAL_ALPHABLEND';
|
|
264
262
|
if (hasAlbedoTexture) {
|
|
265
263
|
material.albedoTexture.hasAlpha = albedoHasAlpha;
|
package/package.json
CHANGED
|
@@ -283,18 +283,16 @@ export const updateMaterial = inboundData => {
|
|
|
283
283
|
|
|
284
284
|
// Transparency
|
|
285
285
|
if (!_.isEmpty(id) && material && transparencyEnabled !== undefined) {
|
|
286
|
-
if (!
|
|
287
|
-
material.
|
|
288
|
-
material.albedoTexture.useAlphaFromAlbedoTexture = false;
|
|
286
|
+
if (!albedoHasAlpha) {
|
|
287
|
+
material.transparencyMode = BABYLON.PBRMaterial.PBRMATERIAL_ALPHABLEND;
|
|
289
288
|
}
|
|
290
289
|
|
|
291
|
-
material.transparencyMode = BABYLON.PBRMaterial.PBRMATERIAL_ALPHABLEND;
|
|
292
290
|
material.transparencyEnabled = transparencyEnabled;
|
|
293
291
|
}
|
|
294
292
|
|
|
295
293
|
// Albedo alpha
|
|
296
|
-
if (!_.isEmpty(id) && material
|
|
297
|
-
const hasAlbedoTexture = material
|
|
294
|
+
if (!_.isEmpty(id) && material && albedoHasAlpha !== undefined) {
|
|
295
|
+
const hasAlbedoTexture = material?.albedoTexture;
|
|
298
296
|
const alphaMode = albedoHasAlpha ? 'PBRMATERIAL_ALPHATEST' : 'PBRMATERIAL_ALPHABLEND';
|
|
299
297
|
|
|
300
298
|
if (hasAlbedoTexture) {
|
|
@@ -314,6 +312,7 @@ export const updateMaterial = inboundData => {
|
|
|
314
312
|
if (transparencyType) {
|
|
315
313
|
material.transparencyType = _.toLower(transparencyType);
|
|
316
314
|
}
|
|
315
|
+
|
|
317
316
|
const isComplex = _.toLower(material.transparencyType) === TRANSPARENCY_MODES.complex;
|
|
318
317
|
material.subSurface.isRefractionEnabled = isComplex;
|
|
319
318
|
|