redhotmagma-visualization 1.44.2 → 1.44.4

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.
@@ -290,6 +290,7 @@ var Three3DScene = exports.Three3DScene = /*#__PURE__*/function (_Three3D) {
290
290
  useShadowGround: true,
291
291
  removeGroundForScreenshot: true,
292
292
  useEnvironmentMap: true,
293
+ useDirectionalLight: false,
293
294
  useBakedShadows: false,
294
295
  bakedShadow: {
295
296
  lightPositionOffset: {
@@ -400,6 +401,8 @@ var Three3DScene = exports.Three3DScene = /*#__PURE__*/function (_Three3D) {
400
401
  renderer.outputEncoding = _three.sRGBEncoding;
401
402
  renderer.shadowMap.enabled = true;
402
403
  renderer.shadowMap.type = _three.PCFSoftShadowMap;
404
+ renderer.toneMapping = _three.ACESFilmicToneMapping;
405
+ renderer.toneMappingExposure = 1;
403
406
  var realWidth = window.innerWidth * window.devicePixelRatio;
404
407
  if ((0, _isMobileDevice.isMobileDevice)() && realWidth >= 1024) {
405
408
  renderer.setPixelRatio(1);
@@ -450,11 +453,13 @@ var Three3DScene = exports.Three3DScene = /*#__PURE__*/function (_Three3D) {
450
453
  key: "createScene",
451
454
  value: function createScene() {
452
455
  var scene = new _three.Scene();
453
- scene.add(this.createDirLight());
454
456
  scene.add(this.sceneContainer);
455
457
  if (this.config.useEnvironmentMap && this.envMap) {
456
458
  scene.environment = this.envMap;
457
459
  }
460
+ if (this.config.useDirectionalLight) {
461
+ scene.add(this.createDirLight());
462
+ }
458
463
  return scene;
459
464
  }
460
465
  }, {
@@ -505,7 +510,7 @@ var Three3DScene = exports.Three3DScene = /*#__PURE__*/function (_Three3D) {
505
510
  key: "addLightsIfNeeded",
506
511
  value: function addLightsIfNeeded(scene) {
507
512
  var sceneHasLight = scene.getObjectByProperty("isLight", true);
508
- if (!sceneHasLight && !this.dirLight) {
513
+ if (!sceneHasLight && !this.dirLight && (this.config.useDirectionalLight || !this.config.useEnvironmentMap)) {
509
514
  this.scene.add(this.createDirLight());
510
515
  } else if (sceneHasLight) {
511
516
  // remove if the scene shipped its own light
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "redhotmagma-visualization",
3
- "version": "1.44.2",
3
+ "version": "1.44.4",
4
4
  "license": "UNLICENSED",
5
5
  "private": false,
6
6
  "main": "./index.js",
7
7
  "dependencies": {
8
8
  "@babel/polyfill": "^7.12.1",
9
- "@configuratorware/scripts": "1.44.2",
9
+ "@configuratorware/scripts": "1.44.4",
10
10
  "@tweenjs/tween.js": "^17.6.0",
11
11
  "console-polyfill": "^0.3.0",
12
12
  "css-element-queries": "^1.2.3",
@@ -1,4 +1,5 @@
1
1
  import {
2
+ ACESFilmicToneMapping,
2
3
  AnimationMixer,
3
4
  Box3,
4
5
  CameraHelper,
@@ -273,6 +274,7 @@ export class Three3DScene extends Three3D {
273
274
  useShadowGround: true,
274
275
  removeGroundForScreenshot: true,
275
276
  useEnvironmentMap: true,
277
+ useDirectionalLight: false,
276
278
  useBakedShadows: false,
277
279
  bakedShadow: {
278
280
  lightPositionOffset: { x: 0, y: 0, z: 0 },
@@ -335,6 +337,8 @@ export class Three3DScene extends Three3D {
335
337
  renderer.outputEncoding = sRGBEncoding;
336
338
  renderer.shadowMap.enabled = true;
337
339
  renderer.shadowMap.type = PCFSoftShadowMap;
340
+ renderer.toneMapping = ACESFilmicToneMapping;
341
+ renderer.toneMappingExposure = 1;
338
342
 
339
343
  const realWidth = window.innerWidth * window.devicePixelRatio;
340
344
  if (isMobileDevice() && realWidth >= 1024) {
@@ -386,12 +390,14 @@ export class Three3DScene extends Three3D {
386
390
 
387
391
  createScene() {
388
392
  const scene = new Scene();
389
- scene.add(this.createDirLight());
390
393
  scene.add(this.sceneContainer);
391
394
 
392
395
  if (this.config.useEnvironmentMap && this.envMap) {
393
396
  scene.environment = this.envMap;
394
397
  }
398
+ if (this.config.useDirectionalLight) {
399
+ scene.add(this.createDirLight());
400
+ }
395
401
 
396
402
  return scene;
397
403
  }
@@ -445,7 +451,11 @@ export class Three3DScene extends Three3D {
445
451
 
446
452
  addLightsIfNeeded(scene) {
447
453
  const sceneHasLight = scene.getObjectByProperty("isLight", true);
448
- if (!sceneHasLight && !this.dirLight) {
454
+ if (
455
+ !sceneHasLight &&
456
+ !this.dirLight &&
457
+ (this.config.useDirectionalLight || !this.config.useEnvironmentMap)
458
+ ) {
449
459
  this.scene.add(this.createDirLight());
450
460
  } else if (sceneHasLight) {
451
461
  // remove if the scene shipped its own light