x3d-image 2.1.10 → 2.2.0

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "x3d-image",
3
- "version": "2.1.10",
3
+ "version": "2.2.0",
4
4
  "description": "Render image files from X3D",
5
5
  "main": "src/main.js",
6
6
  "bin": {
@@ -53,7 +53,7 @@
53
53
  "dependencies": {
54
54
  "colors": "^1.4.0",
55
55
  "electron": "^37.2.0",
56
- "x_ite": "^11.6.0",
56
+ "x_ite": "^11.6.2",
57
57
  "yargs": "^18.0.0"
58
58
  },
59
59
  "devDependencies": {
package/src/image.js CHANGED
@@ -359,7 +359,6 @@ async function addEnvironmentLight (browser, scene, name)
359
359
  environmentLight = scene .createNode ("EnvironmentLight");
360
360
 
361
361
  const
362
- diffuseTexture = scene .createNode ("ImageCubeMapTexture"),
363
362
  specularTexture = scene .createNode ("ImageCubeMapTexture"),
364
363
  textureProperties = scene .createNode ("TextureProperties");
365
364
 
@@ -367,12 +366,10 @@ async function addEnvironmentLight (browser, scene, name)
367
366
  textureProperties .minificationFilter = "NICEST";
368
367
  textureProperties .magnificationFilter = "NICEST";
369
368
 
370
- diffuseTexture .textureProperties = textureProperties;
371
369
  specularTexture .textureProperties = textureProperties;
372
370
 
373
371
  environmentLight .intensity = 1;
374
372
  environmentLight .color = new X3D .SFColor (1, 1, 1);
375
- environmentLight .diffuseTexture = diffuseTexture;
376
373
  environmentLight .specularTexture = specularTexture;
377
374
  }
378
375
 
@@ -383,19 +380,12 @@ async function addEnvironmentLight (browser, scene, name)
383
380
 
384
381
  const
385
382
  fileURL = new URL (`images/${image}`, url .pathToFileURL (path .join (__dirname, "/"))),
386
- diffuseURL = new X3D .MFString (`${fileURL}-diffuse.avif`, `${fileURL}-diffuse.jpg`),
387
- specularURL = new X3D .MFString (`${fileURL}-specular.avif`, `${fileURL}-specular.jpg`);
388
-
389
- if (!environmentLight .diffuseTexture .url .equals (diffuseURL))
390
- environmentLight .diffuseTexture .url = diffuseURL;
383
+ specularURL = new X3D .MFString (`${fileURL}.avif`, `${fileURL}.jpg`);
391
384
 
392
385
  if (!environmentLight .specularTexture .url .equals (specularURL))
393
386
  environmentLight .specularTexture .url = specularURL;
394
387
 
395
388
  scene .addRootNode (environmentLight);
396
389
 
397
- await Promise .all ([
398
- environmentLight .diffuseTexture .getValue () .requestImmediateLoad (),
399
- environmentLight .specularTexture .getValue () .requestImmediateLoad (),
400
- ]);
390
+ await environmentLight .specularTexture .getValue () .requestImmediateLoad ();
401
391
  }
Binary file
Binary file