babylonjs-toolkit 9.12.101 → 9.12.1011

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/lib/index.d.ts CHANGED
@@ -7,7 +7,7 @@ declare namespace TOOLKIT {
7
7
  * @class SceneManager - All rights reserved (c) 2024 Mackey Kinard
8
8
  */
9
9
  class SceneManager {
10
- /** Gets the toolkit framework version string (9.12.101 - R1) */
10
+ /** Gets the toolkit framework version string (9.12.1011 - R1) */
11
11
  static get Version(): string;
12
12
  /** Gets the toolkit framework copyright notice */
13
13
  static get Copyright(): string;
@@ -1983,6 +1983,29 @@ declare namespace TOOLKIT {
1983
1983
  * (suppressed diffuse), preserving the previous Unity behavior.
1984
1984
  */
1985
1985
  static ApplyGlobalReflectionProbeDiffuse(texture: BABYLON.BaseTexture, scene: BABYLON.Scene, createPolynomialsFromFaces?: boolean): void;
1986
+ /** Tracks whether the global box-projection reflection shader fix has been installed (install-once). */
1987
+ private static _boxProjectionShaderPatched;
1988
+ /**
1989
+ * Installs a Unity-faithful per-pixel containment test into Babylon's shared `parallaxCorrectNormal`
1990
+ * box-projection helper (patches both the GLSL and WGSL copies of the `helperFunctions` shader include).
1991
+ *
1992
+ * Babylon applies box (local cubemap) projection to EVERY pixel of a material that has a reflection
1993
+ * bounding box, with no skybox fallback. Surfaces that sit OUTSIDE the probe box - e.g. a tall building
1994
+ * reflecting a ground-level racetrack probe - therefore hit the slab-intersection math in its invalid
1995
+ * regime (exit distance <= 0) and sample the dark box floor, turning glossy/metallic surfaces black.
1996
+ *
1997
+ * Unity instead evaluates probe contribution per-pixel: "When a pixel of an object is outside of any
1998
+ * reflection probe volume, Unity uses the skybox reflection." This injects exactly that rule - if the
1999
+ * shaded world position is outside the probe box on any axis, return the un-projected (infinite)
2000
+ * reflection vector so the pixel reflects the environment (the probe's sky hemisphere) instead of the
2001
+ * dark face. Pixels INSIDE the box are byte-for-byte unchanged, so ground reflections keep their
2002
+ * parallax correction.
2003
+ *
2004
+ * The patch is install-once, idempotent (sentinel guarded) and FAIL-SAFE: if a future Babylon release
2005
+ * renames or reformats the helper so the anchor is not found, it logs a warning and leaves the stock
2006
+ * shader untouched (reverting to Babylon's default behavior) rather than emitting a broken shader.
2007
+ * See README.md ("Box-Projected Reflection Shader Patch") for the full rationale.
2008
+ */
1986
2009
  /** Defines whether this extension is enabled. */
1987
2010
  enabled: boolean;
1988
2011
  private _webgpu;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "babylonjs-toolkit",
3
- "version": "9.12.101",
3
+ "version": "9.12.1011",
4
4
  "description": "Babylon Toolkit Runtime Library (UMD)",
5
5
  "author": "MackeyK24 <mackeyk24@gmail.com>",
6
6
  "main": "lib/babylon.toolkit.js",