@needle-tools/engine 4.7.0-next.8717e33 → 4.7.0-next.90c32d7

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.
Files changed (40) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/dist/{needle-engine.bundle-D7rb-MfE.js → needle-engine.bundle-BQj5ksLw.js} +17 -17
  3. package/dist/{needle-engine.bundle-y4TS-RJR.umd.cjs → needle-engine.bundle-BjYeQb1M.umd.cjs} +6 -6
  4. package/dist/{needle-engine.bundle-B-JkXLEd.min.js → needle-engine.bundle-U4x3bpq1.min.js} +6 -6
  5. package/dist/needle-engine.js +2 -2
  6. package/dist/needle-engine.min.js +1 -1
  7. package/dist/needle-engine.umd.cjs +1 -1
  8. package/lib/engine/engine_context.js +1 -1
  9. package/lib/engine/engine_context.js.map +1 -1
  10. package/lib/engine/engine_three_utils.js +4 -0
  11. package/lib/engine/engine_three_utils.js.map +1 -1
  12. package/lib/engine/webcomponents/needle-engine.attributes.d.ts +1 -1
  13. package/lib/engine-components/Camera.js +1 -1
  14. package/lib/engine-components/Camera.js.map +1 -1
  15. package/lib/engine-components/CameraUtils.js +5 -3
  16. package/lib/engine-components/CameraUtils.js.map +1 -1
  17. package/lib/engine-components/Skybox.js +4 -4
  18. package/lib/engine-components/Skybox.js.map +1 -1
  19. package/lib/engine-components/postprocessing/Effects/Antialiasing.js +1 -1
  20. package/lib/engine-components/postprocessing/Effects/Antialiasing.js.map +1 -1
  21. package/lib/engine-components/postprocessing/Effects/ScreenspaceAmbientOcclusionN8.js +1 -1
  22. package/lib/engine-components/postprocessing/PostProcessingHandler.js.map +1 -1
  23. package/package.json +1 -1
  24. package/plugins/common/logger.js +321 -0
  25. package/plugins/types/userconfig.d.ts +1 -1
  26. package/plugins/vite/alias.js +7 -2
  27. package/plugins/vite/imports-logger.js +1 -1
  28. package/plugins/vite/index.js +2 -0
  29. package/plugins/vite/logger.client.js +262 -0
  30. package/plugins/vite/logger.js +97 -0
  31. package/plugins/vite/materialx.js +6 -4
  32. package/src/engine/engine_context.ts +1 -1
  33. package/src/engine/engine_three_utils.ts +3 -0
  34. package/src/engine/webcomponents/needle-engine.attributes.ts +1 -1
  35. package/src/engine-components/Camera.ts +1 -1
  36. package/src/engine-components/CameraUtils.ts +5 -3
  37. package/src/engine-components/Skybox.ts +5 -5
  38. package/src/engine-components/postprocessing/Effects/Antialiasing.ts +1 -1
  39. package/src/engine-components/postprocessing/Effects/ScreenspaceAmbientOcclusionN8.ts +1 -1
  40. package/src/engine-components/postprocessing/PostProcessingHandler.ts +1 -2
package/CHANGELOG.md CHANGED
@@ -4,6 +4,11 @@ All notable changes to this package will be documented in this file.
4
4
  The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5
5
  and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [4.6.3] - 2025-07-25
8
+ - Update Vite alias plugin to make sure the same postprocessing module is used
9
+ - Improve postprocessing stability
10
+ - Fix: Postprocessing with transparent background
11
+
7
12
  ## [4.6.2] - 2025-07-23
8
13
  - Postprocessing performance and stability improvements
9
14
  - Add: Custom postprocessing effects can now use `PostProcessingEffectPriority` to ensure effects are correctly sorted (e.g. before DepthOfField)
@@ -1279,7 +1279,7 @@ function Fi(o, t = void 0, e = void 0, i = void 0) {
1279
1279
  console.warn(`Object "${c.name}" has NaN values in position or scale.... will ignore it`, u, f);
1280
1280
  return;
1281
1281
  }
1282
- n.expandByObject(c, !0), c.children = d;
1282
+ c.geometry === null && (c.geometry = void 0), n.expandByObject(c, !0), c.children = d;
1283
1283
  }
1284
1284
  for (const d of c.children)
1285
1285
  a(d);
@@ -1806,9 +1806,9 @@ qo('if(!globalThis["NEEDLE_PROJECT_BUILD_TIME"]) globalThis["NEEDLE_PROJECT_BUIL
1806
1806
  qo('if(!globalThis["NEEDLE_PUBLIC_KEY"]) globalThis["NEEDLE_PUBLIC_KEY"] = "unknown";');
1807
1807
  qo('globalThis["__NEEDLE_ENGINE_VERSION__"] = "4.7.0-alpha";');
1808
1808
  qo('globalThis["__NEEDLE_ENGINE_GENERATOR__"] = "undefined";');
1809
- qo('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Thu Jul 24 2025 15:34:20 GMT+0000 (Coordinated Universal Time)";');
1809
+ qo('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Sat Jul 26 2025 14:12:06 GMT+0000 (Coordinated Universal Time)";');
1810
1810
  qo('globalThis["__NEEDLE_PUBLIC_KEY__"] = "' + NEEDLE_PUBLIC_KEY + '";');
1811
- const es = "4.7.0-alpha", Tg = "undefined", av = "Thu Jul 24 2025 15:34:20 GMT+0000 (Coordinated Universal Time)";
1811
+ const es = "4.7.0-alpha", Tg = "undefined", av = "Sat Jul 26 2025 14:12:06 GMT+0000 (Coordinated Universal Time)";
1812
1812
  rv && console.log(`Engine version: ${es} (generator: ${Tg})
1813
1813
  Project built at ${av}`);
1814
1814
  const cc = NEEDLE_PUBLIC_KEY, zo = "needle_isActiveInHierarchy", Sa = "builtin_components", bd = "needle_editor_guid";
@@ -16943,7 +16943,7 @@ const Vt = (Sn = class extends j {
16943
16943
  const s = `[Camera] Apply ClearFlags: ${$r[this._clearFlags]} - "${this.name}"`;
16944
16944
  console.debug(s);
16945
16945
  }
16946
- const i = this.context.domElement.getAttribute("background-image") || this.context.domElement.getAttribute("background-color") || this.context.domElement.getAttribute("skybox-image");
16946
+ const i = this.context.domElement.getAttribute("background-image") || this.context.domElement.getAttribute("background-color");
16947
16947
  switch (this._clearFlags) {
16948
16948
  case 0:
16949
16949
  return;
@@ -33418,7 +33418,7 @@ class Mf extends ft {
33418
33418
  // predicationMode: MODULES.POSTPROCESSING.MODULE.PredicationMode.DEPTH,
33419
33419
  });
33420
33420
  return this.preset.onValueChanged = (n) => {
33421
- QE && console.log("Antialiasing preset changed to", n, e), e.applyPreset(n);
33421
+ QE && console.log("Antialiasing preset changed to", n), e.applyPreset(n);
33422
33422
  }, e;
33423
33423
  }
33424
33424
  }
@@ -33897,7 +33897,7 @@ class ms extends ft {
33897
33897
  i,
33898
33898
  n
33899
33899
  );
33900
- s.name = "SSAO N8";
33900
+ s.name = "SSAO_N8";
33901
33901
  const a = lg[this.quality];
33902
33902
  s.setQualityMode(a), s.configuration.transparencyAware = !1;
33903
33903
  const l = new ns(i, n);
@@ -36177,7 +36177,7 @@ var RA = Object.defineProperty, Ah = (o, t, e, i) => {
36177
36177
  return n && RA(t, e, n), n;
36178
36178
  };
36179
36179
  const Lt = S("debugskybox");
36180
- By("skybox-image");
36180
+ By("background-image");
36181
36181
  By("environment-image");
36182
36182
  function n0(o, t, e, i, n) {
36183
36183
  const s = new Fy();
@@ -36192,10 +36192,10 @@ function n0(o, t, e, i, n) {
36192
36192
  const _u = new Array();
36193
36193
  fe.registerCallback(me.ContextCreationStart, (o) => {
36194
36194
  var n;
36195
- const t = o.context, e = t.domElement.getAttribute("skybox-image") || t.domElement.getAttribute("background-image"), i = t.domElement.getAttribute("environment-image");
36195
+ const t = o.context, e = t.domElement.getAttribute("background-image"), i = t.domElement.getAttribute("environment-image");
36196
36196
  if (e) {
36197
- Lt && console.log("Creating remote skybox to load " + e), ((n = t.mainCameraComponent) == null ? void 0 : n.clearFlags) !== $r.Skybox && console.warn('"skybox-image"/"background-image" attribute has no effect: camera clearflags are not set to "Skybox"');
36198
- const s = n0(t, e, !0, !1, "skybox-image");
36197
+ Lt && console.log("Creating remote skybox to load " + e), ((n = t.mainCameraComponent) == null ? void 0 : n.clearFlags) !== $r.Skybox && console.warn('"background-image" attribute has no effect: camera clear flags are not set to "Skybox"');
36198
+ const s = n0(t, e, !0, !1, "background-image");
36199
36199
  _u.push(s);
36200
36200
  }
36201
36201
  if (i) {
@@ -43009,23 +43009,23 @@ const O2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
43009
43009
  __Ignore: KI
43010
43010
  }, Symbol.toStringTag, { value: "Module" })), Cu = S("debugmissingcamera");
43011
43011
  fe.registerCallback(me.MissingCamera, (o) => {
43012
- var l, c, h, d;
43012
+ var l, c, h;
43013
43013
  Cu && console.warn("Creating missing camera");
43014
43014
  const t = o.context.scene, e = new ve();
43015
43015
  e.name = "Default Fallback Camera", t.add(e);
43016
43016
  const i = new Ai();
43017
43017
  if (i.sourceId = ((c = (l = o.files) == null ? void 0 : l[0]) == null ? void 0 : c.src) ?? "unknown", i.fieldOfView = 35, o.context.domElement.getAttribute("transparent") != null)
43018
43018
  i.clearFlags = $r.Uninitialized;
43019
- else if ((h = o.context.domElement.getAttribute("skybox-image")) != null && h.length || (d = o.context.domElement.getAttribute("background-image")) != null && d.length || o.context.lightmaps.tryGetSkybox(i.sourceId))
43020
- i.clearFlags = $r.Skybox, i.backgroundBlurriness = 0.2;
43019
+ else if ((h = o.context.domElement.getAttribute("background-image")) != null && h.length || o.context.lightmaps.tryGetSkybox(i.sourceId))
43020
+ i.clearFlags = $r.Skybox, o.context.domElement.getAttribute("background-blurriness") === null && (o.context.scene.backgroundBlurriness = 0.2);
43021
43021
  else {
43022
43022
  if (i.clearFlags = $r.SolidColor, !o.context.domElement.getAttribute("background-color")) {
43023
- let u = "#efefef";
43024
- typeof window !== void 0 && window.matchMedia("(prefers-color-scheme: dark)").matches && (u = "#1f1f1f"), t.background = new re(u);
43023
+ let d = "#efefef";
43024
+ typeof window !== void 0 && window.matchMedia("(prefers-color-scheme: dark)").matches && (d = "#1f1f1f"), t.background = new re(d);
43025
43025
  }
43026
43026
  if (!t.environment) {
43027
- const u = new wC(o.context.renderer), f = new Xy("neutral");
43028
- t.environment = u.fromScene(f, 0.025).texture;
43027
+ const d = new wC(o.context.renderer), u = new Xy("neutral");
43028
+ t.environment = d.fromScene(u, 0.025).texture;
43029
43029
  }
43030
43030
  }
43031
43031
  const s = qa(e, i, !0);