@crystaldesign/real-time-viewer 26.14.0-beta.4 → 26.14.0-beta.40

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.
@@ -50,6 +50,7 @@ import { EngineFactory } from '@babylonjs/core/Engines/engineFactory';
50
50
  import { Scene } from '@babylonjs/core/scene';
51
51
  import { DracoCompression } from '@babylonjs/core/Meshes/Compression/dracoCompression';
52
52
  import { LoadAssetContainerAsync } from '@babylonjs/core/Loading/index';
53
+ import { PBRBaseMaterial } from '@babylonjs/core/Materials/PBR/pbrBaseMaterial';
53
54
  import { VertexBuffer } from '@babylonjs/core/Buffers/buffer';
54
55
  import '@babylonjs/loaders/glTF/2.0/';
55
56
  import { UniversalCamera } from '@babylonjs/core/Cameras/universalCamera';
@@ -3198,6 +3199,7 @@ var customMat = /*#__PURE__*/function () {
3198
3199
  _mat,
3199
3200
  res,
3200
3201
  parsedMat,
3202
+ opacityTexture,
3201
3203
  found,
3202
3204
  mat,
3203
3205
  _args = arguments;
@@ -3249,6 +3251,14 @@ var customMat = /*#__PURE__*/function () {
3249
3251
  parsedMat.baseTexture = doReCtrTex(parsedMat.baseTexture);
3250
3252
  parsedMat.metallicRoughnessTexture = doReCtrTex(parsedMat.metallicRoughnessTexture);
3251
3253
  parsedMat.normalTexture = doReCtrTex(parsedMat.normalTexture);
3254
+
3255
+ // Parse drops the opacity texture (PBRMetallicRoughnessMaterial has no serialized slot for it), so it is applied by hand
3256
+ if (res.opacityTexture) {
3257
+ opacityTexture = doReCtrTex(res.opacityTexture); // IDM3D alpha masks are grayscale images without an alpha channel
3258
+ opacityTexture.getAlphaFromRGB = true;
3259
+ parsedMat._opacityTexture = opacityTexture;
3260
+ parsedMat.transparencyMode = PBRBaseMaterial.PBRMATERIAL_ALPHATEST;
3261
+ }
3252
3262
  found = !!parsedMat.baseTexture;
3253
3263
  if (!found) LOG$2.warn('MISSING_MATERIAL: could not get material ' + _customMat.name + ' for iln ' + _customMat.blob);
3254
3264
  if (setDataRow) useUtilStoreContext().setAnalyzeDataRow({
@@ -3263,8 +3273,8 @@ var customMat = /*#__PURE__*/function () {
3263
3273
  mat: parsedMat,
3264
3274
  found: true
3265
3275
  });
3266
- case 28:
3267
- _context.prev = 28;
3276
+ case 29:
3277
+ _context.prev = 29;
3268
3278
  _context.t0 = _context["catch"](10);
3269
3279
  if (setDataRow) useUtilStoreContext().setAnalyzeDataRow({
3270
3280
  type: 'MAT',
@@ -3274,17 +3284,17 @@ var customMat = /*#__PURE__*/function () {
3274
3284
  path: _customMat.blob,
3275
3285
  sizeMb: 0
3276
3286
  });
3277
- case 31:
3287
+ case 32:
3278
3288
  mat = new PBRMetallicRoughnessMaterial(_customMat.name, sceneStore.scene);
3279
3289
  return _context.abrupt("return", {
3280
3290
  mat: mat,
3281
3291
  found: true
3282
3292
  });
3283
- case 33:
3293
+ case 34:
3284
3294
  case "end":
3285
3295
  return _context.stop();
3286
3296
  }
3287
- }, _callee, null, [[10, 28]]);
3297
+ }, _callee, null, [[10, 29]]);
3288
3298
  }));
3289
3299
  return function customMat(_x) {
3290
3300
  return _ref.apply(this, arguments);
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/CustomMaterial/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,4BAA4B,EAAE,MAAM,4DAA4D,CAAC;AAK1G,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,KAAK,EAAE,KAAK,CAAC;IACb,MAAM,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,C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