@ignifx/core 0.14.0 → 0.16.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.
Files changed (58) hide show
  1. package/decoders/draco3dgltf.LICENSE.md +201 -0
  2. package/decoders/draco_decoder.js +116 -0
  3. package/decoders/draco_decoder_gltf.wasm +0 -0
  4. package/decoders/vendored.json +22 -0
  5. package/dist/agx-tone-mapping-Cgt844j6.js +53 -0
  6. package/dist/agx-tone-mapping-Cgt844j6.js.map +1 -0
  7. package/dist/auto-exposure-uzPn0beO.js +246 -0
  8. package/dist/auto-exposure-uzPn0beO.js.map +1 -0
  9. package/dist/bloom-hdr-CLtQj-oY.js +315 -0
  10. package/dist/bloom-hdr-CLtQj-oY.js.map +1 -0
  11. package/dist/contact-shadows-T523EXaP.js +84 -0
  12. package/dist/contact-shadows-T523EXaP.js.map +1 -0
  13. package/dist/{decoders-CHJ7vduE.js → decoders-BUQrlS8U.js} +3 -2
  14. package/dist/decoders-BUQrlS8U.js.map +1 -0
  15. package/dist/{environment-Cq2BmA96.js → environment-DPi0_0SP.js} +18 -4
  16. package/dist/environment-DPi0_0SP.js.map +1 -0
  17. package/dist/gtao-_nr0b6-E.js +630 -0
  18. package/dist/gtao-_nr0b6-E.js.map +1 -0
  19. package/dist/hdr-output-BrUvpAsE.js +525 -0
  20. package/dist/hdr-output-BrUvpAsE.js.map +1 -0
  21. package/dist/index.d.ts +509 -24
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/index.js +1522 -512
  24. package/dist/index.js.map +1 -1
  25. package/dist/{instanced-mesh-instance-DYwH0vLi.js → instanced-mesh-instance-NnODkvqK.js} +2 -2
  26. package/dist/{instanced-mesh-instance-DYwH0vLi.js.map → instanced-mesh-instance-NnODkvqK.js.map} +1 -1
  27. package/dist/mat4-D6exvAuO.js +949 -0
  28. package/dist/mat4-D6exvAuO.js.map +1 -0
  29. package/dist/{render-path-Dx0learj.js → render-path-Be7WgN7r.js} +35 -4
  30. package/dist/render-path-Be7WgN7r.js.map +1 -0
  31. package/dist/{render-texture-IuR0iFVa.js → render-texture-C_TnaSz2.js} +28 -2
  32. package/dist/render-texture-C_TnaSz2.js.map +1 -0
  33. package/dist/scene-color-passes-DlNr-qyZ.js +65 -0
  34. package/dist/scene-color-passes-DlNr-qyZ.js.map +1 -0
  35. package/dist/scene-inputs-BxGOsnIZ.js +318 -0
  36. package/dist/scene-inputs-BxGOsnIZ.js.map +1 -0
  37. package/dist/{shader-material-CDQ0Y5kN.js → shader-material-B6p66wB8.js} +17 -6
  38. package/dist/shader-material-B6p66wB8.js.map +1 -0
  39. package/dist/{shader-material-BPb_oEZQ.js → shader-material-C0TAUr4t.js} +102 -4
  40. package/dist/shader-material-C0TAUr4t.js.map +1 -0
  41. package/dist/ssgi-Dm-maZrc.js +113 -0
  42. package/dist/ssgi-Dm-maZrc.js.map +1 -0
  43. package/dist/{surface-shader-CwQ03yHG.js → surface-shader-BaK0kvBB.js} +2 -2
  44. package/dist/{surface-shader-CwQ03yHG.js.map → surface-shader-BaK0kvBB.js.map} +1 -1
  45. package/dist/taa-BwBZLy11.js +480 -0
  46. package/dist/taa-BwBZLy11.js.map +1 -0
  47. package/dist/{vec3-T2PasQZv.js → vec3-D-0Y2mzE.js} +4 -948
  48. package/dist/vec3-D-0Y2mzE.js.map +1 -0
  49. package/package.json +4 -2
  50. package/dist/decoders-CHJ7vduE.js.map +0 -1
  51. package/dist/environment-Cq2BmA96.js.map +0 -1
  52. package/dist/hdr-output-DDpIo4Q5.js +0 -300
  53. package/dist/hdr-output-DDpIo4Q5.js.map +0 -1
  54. package/dist/render-path-Dx0learj.js.map +0 -1
  55. package/dist/render-texture-IuR0iFVa.js.map +0 -1
  56. package/dist/shader-material-BPb_oEZQ.js.map +0 -1
  57. package/dist/shader-material-CDQ0Y5kN.js.map +0 -1
  58. package/dist/vec3-T2PasQZv.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mat4-D6exvAuO.js","names":[],"sources":["../src/math/mat4.ts"],"sourcesContent":["import { degToRad, EPSILON } from \"./math-utils.js\";\nimport type { Mat4Like, MutableQuat, MutableVec3, QuatLike, Vec3Like } from \"./types.js\";\n\n/**\n * The backing store of a {@link Mat4}: a `Float32Array` of exactly 16 elements, in column-major\n * order (`m[column * 4 + row]`). The `length: 16` refinement is what makes it a {@link Mat4Like},\n * and therefore what makes it accepted anywhere Babylon Lite wants a `Mat4`.\n *\n * @public\n */\nexport type Mat4Elements = Float32Array & { readonly length: 16 };\n\n/**\n * Allocates the 16-element column-major storage a matrix owns, pre-filled with zeroes.\n *\n * @returns Fresh, zeroed storage.\n */\nfunction allocateElements(): Mat4Elements {\n // The invariant is that this array is exactly 16\n // elements long, which `Float32Array`'s `length: number` cannot express. Babylon Lite brands its\n // own allocation the same way (`lib/math/_matrix-allocator.js`).\n // oxlint-disable-next-line typescript/no-unsafe-type-assertion\n return new Float32Array(16) as Mat4Elements;\n}\n\n/**\n * The determinant of the upper-left 3×3 basis. Its sign says whether the matrix mirrors, which is\n * how Babylon Lite decides the sign of the decomposed Y scale (`lib/math/mat4-decompose.js`).\n *\n * @param m - The matrix to measure.\n * @returns The 3×3 determinant.\n */\nfunction basisDeterminant(m: Mat4Like): number {\n const m0 = m[0] ?? 0;\n const m1 = m[1] ?? 0;\n const m2 = m[2] ?? 0;\n const m4 = m[4] ?? 0;\n const m5 = m[5] ?? 0;\n const m6 = m[6] ?? 0;\n const m8 = m[8] ?? 0;\n const m9 = m[9] ?? 0;\n const m10 = m[10] ?? 0;\n return m0 * (m5 * m10 - m6 * m9) + m1 * (m6 * m8 - m4 * m10) + m2 * (m4 * m9 - m5 * m8);\n}\n\n/**\n * Writes the unit quaternion of an orthonormal basis into `out`. Arguments are named row-major\n * (`b<row><column>`), matching Babylon Lite's `_quatFromRotationBasis`\n * (`lib/math/quat-from-rotation-matrix.js`), which this reproduces branch for branch.\n *\n * Shared with the quaternion module; not part of the public API.\n *\n * @param b00 - Row 0, column 0.\n * @param b01 - Row 0, column 1.\n * @param b02 - Row 0, column 2.\n * @param b10 - Row 1, column 0.\n * @param b11 - Row 1, column 1.\n * @param b12 - Row 1, column 2.\n * @param b20 - Row 2, column 0.\n * @param b21 - Row 2, column 1.\n * @param b22 - Row 2, column 2.\n * @param out - The quaternion to write.\n *\n * @internal\n */\nexport function basisToQuatToRef(\n b00: number,\n b01: number,\n b02: number,\n b10: number,\n b11: number,\n b12: number,\n b20: number,\n b21: number,\n b22: number,\n out: MutableQuat,\n): void {\n const trace = b00 + b11 + b22;\n if (trace > 0) {\n const s = 0.5 / Math.sqrt(trace + 1);\n out.set((b21 - b12) * s, (b02 - b20) * s, (b10 - b01) * s, 0.25 / s);\n return;\n }\n if (b00 > b11 && b00 > b22) {\n const s = 2 * Math.sqrt(1 + b00 - b11 - b22);\n out.set(0.25 * s, (b01 + b10) / s, (b02 + b20) / s, (b21 - b12) / s);\n return;\n }\n if (b11 > b22) {\n const s = 2 * Math.sqrt(1 + b11 - b00 - b22);\n out.set((b01 + b10) / s, 0.25 * s, (b12 + b21) / s, (b02 - b20) / s);\n return;\n }\n const s = 2 * Math.sqrt(1 + b22 - b00 - b11);\n out.set((b02 + b20) / s, (b12 + b21) / s, 0.25 * s, (b10 - b01) / s);\n}\n\n/**\n * A 4×4 transformation matrix stored column-major in a `Float32Array`, byte-compatible with WGSL's\n * `mat4x4<f32>` and with Babylon Lite's `Mat4` (translation in slots 12/13/14).\n *\n * ignifx is left-handed, Y up, +Z forward (ADR-0011), so the projection helpers are the `LH`\n * family and they use Lite's **reverse depth** convention: the near plane maps to 1 and the far\n * plane to 0.\n *\n * Instance methods mutate the matrix and return `this`; `ToRef` statics write into their `out`\n * matrix and allocate nothing, and are safe when `out` aliases an input. The remaining statics\n * allocate a fresh matrix and say so.\n *\n * @example\n * ```ts\n * const world = new Mat4();\n * Mat4.composeToRef(position, rotation, scale, world);\n *\n * const inverse = new Mat4();\n * if (Mat4.invertToRef(world, inverse)) {\n * Mat4.transformPointToRef(inverse, worldPoint, localPoint);\n * }\n * ```\n *\n * @public\n */\nexport class Mat4 {\n /**\n * The 16 elements, column-major (`elements[column * 4 + row]`). This is the object to hand to\n * anything that wants a {@link Mat4Like} — including Babylon Lite — and the buffer to upload to\n * the GPU. It is never reallocated, so a reference to it stays valid for the matrix's lifetime.\n */\n readonly elements: Mat4Elements;\n\n /**\n * Creates an identity matrix.\n */\n constructor() {\n const e = allocateElements();\n e[0] = 1;\n e[5] = 1;\n e[10] = 1;\n e[15] = 1;\n this.elements = e;\n }\n\n /**\n * Resets this matrix to the identity.\n *\n * @returns This matrix.\n */\n identity(): this {\n const e = this.elements;\n e[0] = 1;\n e[1] = 0;\n e[2] = 0;\n e[3] = 0;\n e[4] = 0;\n e[5] = 1;\n e[6] = 0;\n e[7] = 0;\n e[8] = 0;\n e[9] = 0;\n e[10] = 1;\n e[11] = 0;\n e[12] = 0;\n e[13] = 0;\n e[14] = 0;\n e[15] = 1;\n return this;\n }\n\n /**\n * Copies every element from another matrix.\n *\n * @param m - The matrix to read.\n * @returns This matrix.\n */\n copyFrom(m: Mat4Like): this {\n const e = this.elements;\n for (let i = 0; i < 16; i++) {\n e[i] = m[i] ?? 0;\n }\n return this;\n }\n\n /**\n * Copies this matrix into a new one.\n *\n * @returns A new matrix. **Allocates.**\n */\n clone(): Mat4 {\n return new Mat4().copyFrom(this.elements);\n }\n\n /**\n * Post-multiplies this matrix by another (`this = this * m`), so `m`'s transform is applied first\n * when the product acts on a column vector.\n *\n * @param m - The right-hand matrix.\n * @returns This matrix.\n */\n multiply(m: Mat4Like): this {\n Mat4.multiplyToRef(this.elements, m, this);\n return this;\n }\n\n /**\n * Inverts this matrix in place.\n *\n * @returns `true` on success. When the matrix is singular this returns `false` and leaves the\n * matrix untouched.\n */\n invert(): boolean {\n return Mat4.invertToRef(this.elements, this);\n }\n\n /**\n * Transposes this matrix in place, swapping rows and columns.\n *\n * @returns This matrix.\n */\n transpose(): this {\n Mat4.transposeToRef(this.elements, this);\n return this;\n }\n\n /**\n * The full 4×4 determinant of this matrix.\n *\n * @returns The determinant; zero means the matrix cannot be inverted.\n */\n determinant(): number {\n return Mat4.determinant(this.elements);\n }\n\n /**\n * Compares this matrix with another element by element, with a tolerance.\n *\n * @param m - The matrix to compare against.\n * @param epsilon - The largest per-element difference still considered equal.\n * @returns `true` when every element matches within `epsilon`.\n */\n equalsWithEpsilon(m: Mat4Like, epsilon: number = EPSILON): boolean {\n return Mat4.equalsWithEpsilon(this.elements, m, epsilon);\n }\n\n /**\n * Creates an identity matrix.\n *\n * @returns A new identity matrix. **Allocates.**\n */\n static identity(): Mat4 {\n return new Mat4();\n }\n\n /**\n * Creates a matrix holding a copy of another matrix's elements.\n *\n * @param m - The matrix to copy.\n * @returns A new matrix. **Allocates.**\n */\n static from(m: Mat4Like): Mat4 {\n return new Mat4().copyFrom(m);\n }\n\n /**\n * Builds a translation-rotation-scale matrix, the same composition order Babylon Lite's\n * `mat4Compose` uses (`translation * rotation * scale`).\n *\n * @param position - The translation, in metres.\n * @param rotation - The rotation; assumed to be a unit quaternion.\n * @param scale - The per-axis scale.\n * @returns A new matrix. **Allocates.**\n */\n static compose(position: Vec3Like, rotation: QuatLike, scale: Vec3Like): Mat4 {\n return Mat4.composeToRef(position, rotation, scale, new Mat4());\n }\n\n /**\n * Writes a translation-rotation-scale matrix into `out`.\n *\n * @param position - The translation, in metres.\n * @param rotation - The rotation; assumed to be a unit quaternion.\n * @param scale - The per-axis scale.\n * @param out - The matrix to write.\n * @returns `out`.\n *\n * @example\n * ```ts\n * Mat4.composeToRef(transform.localPosition, transform.localRotation, transform.localScale, local);\n * ```\n */\n static composeToRef(position: Vec3Like, rotation: QuatLike, scale: Vec3Like, out: Mat4): Mat4 {\n const qx = rotation.x;\n const qy = rotation.y;\n const qz = rotation.z;\n const qw = rotation.w;\n const sx = scale.x;\n const sy = scale.y;\n const sz = scale.z;\n const xx = qx * qx;\n const yy = qy * qy;\n const zz = qz * qz;\n const xy = qx * qy;\n const xz = qx * qz;\n const yz = qy * qz;\n const wx = qw * qx;\n const wy = qw * qy;\n const wz = qw * qz;\n const e = out.elements;\n e[0] = (1 - 2 * (yy + zz)) * sx;\n e[1] = 2 * (xy + wz) * sx;\n e[2] = 2 * (xz - wy) * sx;\n e[3] = 0;\n e[4] = 2 * (xy - wz) * sy;\n e[5] = (1 - 2 * (xx + zz)) * sy;\n e[6] = 2 * (yz + wx) * sy;\n e[7] = 0;\n e[8] = 2 * (xz + wy) * sz;\n e[9] = 2 * (yz - wx) * sz;\n e[10] = (1 - 2 * (xx + yy)) * sz;\n e[11] = 0;\n e[12] = position.x;\n e[13] = position.y;\n e[14] = position.z;\n e[15] = 1;\n return out;\n }\n\n /**\n * Splits an affine transformation-rotation-scale matrix back into its parts, using Babylon Lite's\n * convention (`lib/math/mat4-decompose.js`): scales are the lengths of the basis columns, and a\n * mirrored matrix (negative basis determinant) reports a **negative Y scale** rather than\n * silently dropping the reflection. Shear is not detected.\n *\n * @param m - The matrix to split.\n * @param outPosition - Receives the translation.\n * @param outRotation - Receives the rotation as a unit quaternion.\n * @param outScale - Receives the per-axis scale.\n * @returns `true` on success; `false` when a basis column has (near) zero length, in which case\n * the outputs are left untouched.\n *\n * @example\n * ```ts\n * Mat4.decomposeToRef(node.worldMatrix, position, rotation, scale);\n * ```\n */\n static decomposeToRef(\n m: Mat4Like,\n outPosition: MutableVec3,\n outRotation: MutableQuat,\n outScale: MutableVec3,\n ): boolean {\n const m0 = m[0] ?? 0;\n const m1 = m[1] ?? 0;\n const m2 = m[2] ?? 0;\n const m4 = m[4] ?? 0;\n const m5 = m[5] ?? 0;\n const m6 = m[6] ?? 0;\n const m8 = m[8] ?? 0;\n const m9 = m[9] ?? 0;\n const m10 = m[10] ?? 0;\n const sx = Math.hypot(m0, m1, m2);\n const syAbs = Math.hypot(m4, m5, m6);\n const sz = Math.hypot(m8, m9, m10);\n if (sx <= 1e-8 || syAbs <= 1e-8 || sz <= 1e-8) {\n return false;\n }\n const sy = basisDeterminant(m) < 0 ? -syAbs : syAbs;\n const invSx = 1 / sx;\n const invSy = 1 / sy;\n const invSz = 1 / sz;\n // Read the translation before writing anything, so `outPosition` may alias nothing dangerous.\n const tx = m[12] ?? 0;\n const ty = m[13] ?? 0;\n const tz = m[14] ?? 0;\n basisToQuatToRef(\n m0 * invSx,\n m4 * invSy,\n m8 * invSz,\n m1 * invSx,\n m5 * invSy,\n m9 * invSz,\n m2 * invSx,\n m6 * invSy,\n m10 * invSz,\n outRotation,\n );\n const qx = outRotation.x;\n const qy = outRotation.y;\n const qz = outRotation.z;\n const qw = outRotation.w;\n const invLength = 1 / Math.hypot(qx, qy, qz, qw);\n outRotation.set(qx * invLength, qy * invLength, qz * invLength, qw * invLength);\n outPosition.set(tx, ty, tz);\n outScale.set(sx, sy, sz);\n return true;\n }\n\n /**\n * Multiplies two matrices.\n *\n * @param a - The left-hand matrix.\n * @param b - The right-hand matrix.\n * @returns A new matrix holding `a * b`. **Allocates.**\n */\n static multiply(a: Mat4Like, b: Mat4Like): Mat4 {\n return Mat4.multiplyToRef(a, b, new Mat4());\n }\n\n /**\n * Writes `a * b` into `out`. Acting on a column vector, `b` is applied first.\n *\n * @param a - The left-hand matrix.\n * @param b - The right-hand matrix.\n * @param out - The matrix to write; may alias `a` or `b`.\n * @returns `out`.\n */\n static multiplyToRef(a: Mat4Like, b: Mat4Like, out: Mat4): Mat4 {\n const a0 = a[0] ?? 0;\n const a1 = a[1] ?? 0;\n const a2 = a[2] ?? 0;\n const a3 = a[3] ?? 0;\n const a4 = a[4] ?? 0;\n const a5 = a[5] ?? 0;\n const a6 = a[6] ?? 0;\n const a7 = a[7] ?? 0;\n const a8 = a[8] ?? 0;\n const a9 = a[9] ?? 0;\n const a10 = a[10] ?? 0;\n const a11 = a[11] ?? 0;\n const a12 = a[12] ?? 0;\n const a13 = a[13] ?? 0;\n const a14 = a[14] ?? 0;\n const a15 = a[15] ?? 0;\n const b0 = b[0] ?? 0;\n const b1 = b[1] ?? 0;\n const b2 = b[2] ?? 0;\n const b3 = b[3] ?? 0;\n const b4 = b[4] ?? 0;\n const b5 = b[5] ?? 0;\n const b6 = b[6] ?? 0;\n const b7 = b[7] ?? 0;\n const b8 = b[8] ?? 0;\n const b9 = b[9] ?? 0;\n const b10 = b[10] ?? 0;\n const b11 = b[11] ?? 0;\n const b12 = b[12] ?? 0;\n const b13 = b[13] ?? 0;\n const b14 = b[14] ?? 0;\n const b15 = b[15] ?? 0;\n const e = out.elements;\n e[0] = a0 * b0 + a4 * b1 + a8 * b2 + a12 * b3;\n e[1] = a1 * b0 + a5 * b1 + a9 * b2 + a13 * b3;\n e[2] = a2 * b0 + a6 * b1 + a10 * b2 + a14 * b3;\n e[3] = a3 * b0 + a7 * b1 + a11 * b2 + a15 * b3;\n e[4] = a0 * b4 + a4 * b5 + a8 * b6 + a12 * b7;\n e[5] = a1 * b4 + a5 * b5 + a9 * b6 + a13 * b7;\n e[6] = a2 * b4 + a6 * b5 + a10 * b6 + a14 * b7;\n e[7] = a3 * b4 + a7 * b5 + a11 * b6 + a15 * b7;\n e[8] = a0 * b8 + a4 * b9 + a8 * b10 + a12 * b11;\n e[9] = a1 * b8 + a5 * b9 + a9 * b10 + a13 * b11;\n e[10] = a2 * b8 + a6 * b9 + a10 * b10 + a14 * b11;\n e[11] = a3 * b8 + a7 * b9 + a11 * b10 + a15 * b11;\n e[12] = a0 * b12 + a4 * b13 + a8 * b14 + a12 * b15;\n e[13] = a1 * b12 + a5 * b13 + a9 * b14 + a13 * b15;\n e[14] = a2 * b12 + a6 * b13 + a10 * b14 + a14 * b15;\n e[15] = a3 * b12 + a7 * b13 + a11 * b14 + a15 * b15;\n return out;\n }\n\n /**\n * Writes the inverse of `m` into `out`.\n *\n * @param m - The matrix to invert.\n * @param out - The matrix to write; may alias `m`. Left untouched when the inverse does not exist.\n * @returns `true` on success, `false` when `m` is singular. Returning a status rather than `null`\n * keeps the call allocation-free (coding standards §7).\n *\n * @example\n * ```ts\n * if (!Mat4.invertToRef(world, worldToLocal)) {\n * // degenerate scale — skip this entity\n * }\n * ```\n */\n static invertToRef(m: Mat4Like, out: Mat4): boolean {\n const a00 = m[0] ?? 0;\n const a01 = m[1] ?? 0;\n const a02 = m[2] ?? 0;\n const a03 = m[3] ?? 0;\n const a10 = m[4] ?? 0;\n const a11 = m[5] ?? 0;\n const a12 = m[6] ?? 0;\n const a13 = m[7] ?? 0;\n const a20 = m[8] ?? 0;\n const a21 = m[9] ?? 0;\n const a22 = m[10] ?? 0;\n const a23 = m[11] ?? 0;\n const a30 = m[12] ?? 0;\n const a31 = m[13] ?? 0;\n const a32 = m[14] ?? 0;\n const a33 = m[15] ?? 0;\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n const determinant = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n // Lite rejects at the same threshold (`lib/math/mat4-invert.js`), so both agree on which\n // matrices are singular.\n if (Math.abs(determinant) < 1e-10) {\n return false;\n }\n const inv = 1 / determinant;\n const e = out.elements;\n e[0] = (a11 * b11 - a12 * b10 + a13 * b09) * inv;\n e[1] = (a02 * b10 - a01 * b11 - a03 * b09) * inv;\n e[2] = (a31 * b05 - a32 * b04 + a33 * b03) * inv;\n e[3] = (a22 * b04 - a21 * b05 - a23 * b03) * inv;\n e[4] = (a12 * b08 - a10 * b11 - a13 * b07) * inv;\n e[5] = (a00 * b11 - a02 * b08 + a03 * b07) * inv;\n e[6] = (a32 * b02 - a30 * b05 - a33 * b01) * inv;\n e[7] = (a20 * b05 - a22 * b02 + a23 * b01) * inv;\n e[8] = (a10 * b10 - a11 * b08 + a13 * b06) * inv;\n e[9] = (a01 * b08 - a00 * b10 - a03 * b06) * inv;\n e[10] = (a30 * b04 - a31 * b02 + a33 * b00) * inv;\n e[11] = (a21 * b02 - a20 * b04 - a23 * b00) * inv;\n e[12] = (a11 * b07 - a10 * b09 - a12 * b06) * inv;\n e[13] = (a00 * b09 - a01 * b07 + a02 * b06) * inv;\n e[14] = (a31 * b01 - a30 * b03 - a32 * b00) * inv;\n e[15] = (a20 * b03 - a21 * b01 + a22 * b00) * inv;\n return true;\n }\n\n /**\n * Writes the transpose of `m` into `out`.\n *\n * @param m - The matrix to transpose.\n * @param out - The matrix to write; may alias `m`.\n * @returns `out`.\n */\n static transposeToRef(m: Mat4Like, out: Mat4): Mat4 {\n const m0 = m[0] ?? 0;\n const m1 = m[1] ?? 0;\n const m2 = m[2] ?? 0;\n const m3 = m[3] ?? 0;\n const m4 = m[4] ?? 0;\n const m5 = m[5] ?? 0;\n const m6 = m[6] ?? 0;\n const m7 = m[7] ?? 0;\n const m8 = m[8] ?? 0;\n const m9 = m[9] ?? 0;\n const m10 = m[10] ?? 0;\n const m11 = m[11] ?? 0;\n const m12 = m[12] ?? 0;\n const m13 = m[13] ?? 0;\n const m14 = m[14] ?? 0;\n const m15 = m[15] ?? 0;\n const e = out.elements;\n e[0] = m0;\n e[1] = m4;\n e[2] = m8;\n e[3] = m12;\n e[4] = m1;\n e[5] = m5;\n e[6] = m9;\n e[7] = m13;\n e[8] = m2;\n e[9] = m6;\n e[10] = m10;\n e[11] = m14;\n e[12] = m3;\n e[13] = m7;\n e[14] = m11;\n e[15] = m15;\n return out;\n }\n\n /**\n * The full 4×4 determinant.\n *\n * @param m - The matrix to measure.\n * @returns The determinant; zero means the matrix cannot be inverted.\n */\n static determinant(m: Mat4Like): number {\n const a00 = m[0] ?? 0;\n const a01 = m[1] ?? 0;\n const a02 = m[2] ?? 0;\n const a03 = m[3] ?? 0;\n const a10 = m[4] ?? 0;\n const a11 = m[5] ?? 0;\n const a12 = m[6] ?? 0;\n const a13 = m[7] ?? 0;\n const a20 = m[8] ?? 0;\n const a21 = m[9] ?? 0;\n const a22 = m[10] ?? 0;\n const a23 = m[11] ?? 0;\n const a30 = m[12] ?? 0;\n const a31 = m[13] ?? 0;\n const a32 = m[14] ?? 0;\n const a33 = m[15] ?? 0;\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n }\n\n /**\n * Builds a pure translation matrix.\n *\n * @param x - Translation along X, in metres.\n * @param y - Translation along Y, in metres.\n * @param z - Translation along Z, in metres.\n * @returns A new matrix. **Allocates.**\n */\n static translation(x: number, y: number, z: number): Mat4 {\n return Mat4.translationToRef(x, y, z, new Mat4());\n }\n\n /**\n * Writes a pure translation matrix into `out`.\n *\n * @param x - Translation along X, in metres.\n * @param y - Translation along Y, in metres.\n * @param z - Translation along Z, in metres.\n * @param out - The matrix to write.\n * @returns `out`.\n */\n static translationToRef(x: number, y: number, z: number, out: Mat4): Mat4 {\n const e = out.identity().elements;\n e[12] = x;\n e[13] = y;\n e[14] = z;\n return out;\n }\n\n /**\n * Builds a pure scaling matrix.\n *\n * @param x - Scale along X.\n * @param y - Scale along Y.\n * @param z - Scale along Z.\n * @returns A new matrix. **Allocates.**\n */\n static scaling(x: number, y: number, z: number): Mat4 {\n return Mat4.scalingToRef(x, y, z, new Mat4());\n }\n\n /**\n * Writes a pure scaling matrix into `out`.\n *\n * @param x - Scale along X.\n * @param y - Scale along Y.\n * @param z - Scale along Z.\n * @param out - The matrix to write.\n * @returns `out`.\n */\n static scalingToRef(x: number, y: number, z: number, out: Mat4): Mat4 {\n const e = out.identity().elements;\n e[0] = x;\n e[5] = y;\n e[10] = z;\n return out;\n }\n\n /**\n * Builds a pure rotation matrix from a quaternion.\n *\n * @param q - The rotation; assumed to be a unit quaternion.\n * @returns A new matrix. **Allocates.**\n */\n static fromQuat(q: QuatLike): Mat4 {\n return Mat4.fromQuatToRef(q, new Mat4());\n }\n\n /**\n * Writes a pure rotation matrix into `out`.\n *\n * @param q - The rotation; assumed to be a unit quaternion.\n * @param out - The matrix to write.\n * @returns `out`.\n */\n static fromQuatToRef(q: QuatLike, out: Mat4): Mat4 {\n return Mat4.composeToRef(ZERO_TRANSLATION, q, UNIT_SCALE, out);\n }\n\n /**\n * Builds a left-handed view matrix that places the camera at `eye` looking at `target`.\n *\n * @param eye - The camera position, in metres.\n * @param target - The point to look at, in metres.\n * @param up - The camera's up direction.\n * @returns A new matrix. **Allocates.**\n */\n static lookAtLH(eye: Vec3Like, target: Vec3Like, up: Vec3Like): Mat4 {\n return Mat4.lookAtLHToRef(eye, target, up, new Mat4());\n }\n\n /**\n * Writes a left-handed view matrix into `out`. Reproduces Babylon Lite's `mat4LookAtLHToRef`,\n * including its degenerate-input behaviour: when `eye` and `target` coincide, or when `up` is\n * parallel to the view direction, `out` becomes the identity.\n *\n * @param eye - The camera position, in metres.\n * @param target - The point to look at, in metres.\n * @param up - The camera's up direction.\n * @param out - The matrix to write.\n * @returns `out`.\n */\n static lookAtLHToRef(eye: Vec3Like, target: Vec3Like, up: Vec3Like, out: Mat4): Mat4 {\n const ex = eye.x;\n const ey = eye.y;\n const ez = eye.z;\n let zx = target.x - ex;\n let zy = target.y - ey;\n let zz = target.z - ez;\n const zLength = Math.hypot(zx, zy, zz);\n if (zLength < 1e-10) {\n return out.identity();\n }\n const invZ = 1 / zLength;\n zx *= invZ;\n zy *= invZ;\n zz *= invZ;\n let xx = up.y * zz - up.z * zy;\n let xy = up.z * zx - up.x * zz;\n let xz = up.x * zy - up.y * zx;\n const xLength = Math.hypot(xx, xy, xz);\n if (xLength < 1e-10) {\n return out.identity();\n }\n const invX = 1 / xLength;\n xx *= invX;\n xy *= invX;\n xz *= invX;\n const yx = zy * xz - zz * xy;\n const yy = zz * xx - zx * xz;\n const yz = zx * xy - zy * xx;\n const e = out.elements;\n e[0] = xx;\n e[1] = yx;\n e[2] = zx;\n e[3] = 0;\n e[4] = xy;\n e[5] = yy;\n e[6] = zy;\n e[7] = 0;\n e[8] = xz;\n e[9] = yz;\n e[10] = zz;\n e[11] = 0;\n e[12] = -(xx * ex + xy * ey + xz * ez);\n e[13] = -(yx * ex + yy * ey + yz * ez);\n e[14] = -(zx * ex + zy * ey + zz * ez);\n e[15] = 1;\n return out;\n }\n\n /**\n * Builds a left-handed perspective projection.\n *\n * @param fovDegrees - The vertical field of view, in degrees.\n * @param aspect - The viewport's width divided by its height.\n * @param near - The near plane distance, in metres.\n * @param far - The far plane distance, in metres.\n * @returns A new matrix. **Allocates.**\n */\n static perspectiveLH(fovDegrees: number, aspect: number, near: number, far: number): Mat4 {\n return Mat4.perspectiveLHToRef(fovDegrees, aspect, near, far, new Mat4());\n }\n\n /**\n * Writes a left-handed perspective projection into `out`, matching Babylon Lite's\n * `mat4PerspectiveLHToRef` — which is a **reverse-depth** projection: the near plane maps to\n * clip-space depth 1 and the far plane to 0, the arrangement that keeps float depth precise.\n *\n * @param fovDegrees - The vertical field of view, in degrees.\n * @param aspect - The viewport's width divided by its height.\n * @param near - The near plane distance, in metres.\n * @param far - The far plane distance, in metres.\n * @param out - The matrix to write.\n * @returns `out`.\n */\n static perspectiveLHToRef(fovDegrees: number, aspect: number, near: number, far: number, out: Mat4): Mat4 {\n const cot = 1 / Math.tan(degToRad(fovDegrees) * 0.5);\n const range = far - near;\n const e = out.elements;\n e[0] = cot / aspect;\n e[1] = 0;\n e[2] = 0;\n e[3] = 0;\n e[4] = 0;\n e[5] = cot;\n e[6] = 0;\n e[7] = 0;\n e[8] = 0;\n e[9] = 0;\n e[10] = -near / range;\n e[11] = 1;\n e[12] = 0;\n e[13] = 0;\n e[14] = (far * near) / range;\n e[15] = 0;\n return out;\n }\n\n /**\n * Builds a centred left-handed orthographic projection.\n *\n * @param width - The view width, in metres.\n * @param height - The view height, in metres.\n * @param near - The near plane distance, in metres.\n * @param far - The far plane distance, in metres.\n * @returns A new matrix. **Allocates.**\n */\n static orthoLH(width: number, height: number, near: number, far: number): Mat4 {\n return Mat4.orthoLHToRef(width, height, near, far, new Mat4());\n }\n\n /**\n * Writes a centred left-handed orthographic projection into `out`, with the same reverse-depth\n * convention as {@link Mat4.perspectiveLHToRef}.\n *\n * @param width - The view width, in metres.\n * @param height - The view height, in metres.\n * @param near - The near plane distance, in metres.\n * @param far - The far plane distance, in metres.\n * @param out - The matrix to write.\n * @returns `out`.\n */\n static orthoLHToRef(width: number, height: number, near: number, far: number, out: Mat4): Mat4 {\n const halfWidth = width * 0.5;\n const halfHeight = height * 0.5;\n return Mat4.orthoOffCenterLHToRef(-halfWidth, halfWidth, -halfHeight, halfHeight, near, far, out);\n }\n\n /**\n * Writes an off-centre left-handed orthographic projection into `out`, reproducing Babylon Lite's\n * `mat4OrthoOffCenterLHToRef` (reverse depth).\n *\n * @param left - The left clip plane, in metres.\n * @param right - The right clip plane, in metres.\n * @param bottom - The bottom clip plane, in metres.\n * @param top - The top clip plane, in metres.\n * @param near - The near plane distance, in metres.\n * @param far - The far plane distance, in metres.\n * @param out - The matrix to write.\n * @returns `out`.\n */\n static orthoOffCenterLHToRef(\n left: number,\n right: number,\n bottom: number,\n top: number,\n near: number,\n far: number,\n out: Mat4,\n ): Mat4 {\n const range = far - near;\n const e = out.elements;\n e[0] = 2 / (right - left);\n e[1] = 0;\n e[2] = 0;\n e[3] = 0;\n e[4] = 0;\n e[5] = 2 / (top - bottom);\n e[6] = 0;\n e[7] = 0;\n e[8] = 0;\n e[9] = 0;\n e[10] = -1 / range;\n e[11] = 0;\n e[12] = (left + right) / (left - right);\n e[13] = (top + bottom) / (bottom - top);\n e[14] = far / range;\n e[15] = 1;\n return out;\n }\n\n /**\n * Reads a matrix's translation.\n *\n * @param m - The matrix to read.\n * @param out - The vector to write.\n * @returns `out`.\n */\n static getTranslationToRef<TOut extends MutableVec3>(m: Mat4Like, out: TOut): TOut {\n out.set(m[12] ?? 0, m[13] ?? 0, m[14] ?? 0);\n return out;\n }\n\n /**\n * Reads a matrix's per-axis scale as the lengths of its basis columns, negating Y for a mirrored\n * matrix exactly as {@link Mat4.decomposeToRef} does.\n *\n * @param m - The matrix to read.\n * @param out - The vector to write.\n * @returns `out`.\n */\n static getScaleToRef<TOut extends MutableVec3>(m: Mat4Like, out: TOut): TOut {\n const sx = Math.hypot(m[0] ?? 0, m[1] ?? 0, m[2] ?? 0);\n const syAbs = Math.hypot(m[4] ?? 0, m[5] ?? 0, m[6] ?? 0);\n const sz = Math.hypot(m[8] ?? 0, m[9] ?? 0, m[10] ?? 0);\n out.set(sx, basisDeterminant(m) < 0 ? -syAbs : syAbs, sz);\n return out;\n }\n\n /**\n * Reads a matrix's rotation, dividing the scale out of the basis first.\n *\n * @param m - The matrix to read.\n * @param out - The quaternion to write. Left untouched when a basis column has zero length.\n * @returns `out`.\n */\n static getRotationToRef<TOut extends MutableQuat>(m: Mat4Like, out: TOut): TOut {\n const m0 = m[0] ?? 0;\n const m1 = m[1] ?? 0;\n const m2 = m[2] ?? 0;\n const m4 = m[4] ?? 0;\n const m5 = m[5] ?? 0;\n const m6 = m[6] ?? 0;\n const m8 = m[8] ?? 0;\n const m9 = m[9] ?? 0;\n const m10 = m[10] ?? 0;\n const sx = Math.hypot(m0, m1, m2);\n const syAbs = Math.hypot(m4, m5, m6);\n const sz = Math.hypot(m8, m9, m10);\n if (sx <= 1e-8 || syAbs <= 1e-8 || sz <= 1e-8) {\n return out;\n }\n const invSx = 1 / sx;\n const invSy = 1 / (basisDeterminant(m) < 0 ? -syAbs : syAbs);\n const invSz = 1 / sz;\n basisToQuatToRef(\n m0 * invSx,\n m4 * invSy,\n m8 * invSz,\n m1 * invSx,\n m5 * invSy,\n m9 * invSz,\n m2 * invSx,\n m6 * invSy,\n m10 * invSz,\n out,\n );\n const invLength = 1 / Math.hypot(out.x, out.y, out.z, out.w);\n out.set(out.x * invLength, out.y * invLength, out.z * invLength, out.w * invLength);\n return out;\n }\n\n /**\n * Transforms a point by a matrix, applying translation and the perspective divide.\n *\n * @param m - The transformation.\n * @param point - The point to transform, in metres.\n * @param out - The vector to write; may alias `point`.\n * @returns `out`.\n */\n static transformPointToRef<TOut extends MutableVec3>(m: Mat4Like, point: Vec3Like, out: TOut): TOut {\n const x = point.x;\n const y = point.y;\n const z = point.z;\n const rx = x * (m[0] ?? 0) + y * (m[4] ?? 0) + z * (m[8] ?? 0) + (m[12] ?? 0);\n const ry = x * (m[1] ?? 0) + y * (m[5] ?? 0) + z * (m[9] ?? 0) + (m[13] ?? 0);\n const rz = x * (m[2] ?? 0) + y * (m[6] ?? 0) + z * (m[10] ?? 0) + (m[14] ?? 0);\n const invW = 1 / (x * (m[3] ?? 0) + y * (m[7] ?? 0) + z * (m[11] ?? 0) + (m[15] ?? 0));\n out.set(rx * invW, ry * invW, rz * invW);\n return out;\n }\n\n /**\n * Transforms a direction by a matrix, ignoring translation. Note that this is the plain basis\n * transform: a non-uniformly scaled matrix needs its inverse-transpose to keep normals correct.\n *\n * @param m - The transformation.\n * @param direction - The direction to transform.\n * @param out - The vector to write; may alias `direction`.\n * @returns `out`.\n */\n static transformDirectionToRef<TOut extends MutableVec3>(m: Mat4Like, direction: Vec3Like, out: TOut): TOut {\n const x = direction.x;\n const y = direction.y;\n const z = direction.z;\n out.set(\n x * (m[0] ?? 0) + y * (m[4] ?? 0) + z * (m[8] ?? 0),\n x * (m[1] ?? 0) + y * (m[5] ?? 0) + z * (m[9] ?? 0),\n x * (m[2] ?? 0) + y * (m[6] ?? 0) + z * (m[10] ?? 0),\n );\n return out;\n }\n\n /**\n * Compares two matrices element by element, with a tolerance.\n *\n * @param a - The first matrix.\n * @param b - The second matrix.\n * @param epsilon - The largest per-element difference still considered equal.\n * @returns `true` when every element matches within `epsilon`.\n */\n static equalsWithEpsilon(a: Mat4Like, b: Mat4Like, epsilon: number = EPSILON): boolean {\n for (let i = 0; i < 16; i++) {\n if (Math.abs((a[i] ?? 0) - (b[i] ?? 0)) > epsilon) {\n return false;\n }\n }\n return true;\n }\n}\n\n/**\n * The zero translation {@link Mat4.fromQuatToRef} composes with. Module-scope constant, frozen so it\n * can never be written through.\n */\nconst ZERO_TRANSLATION: Vec3Like = Object.freeze({ x: 0, y: 0, z: 0 });\n\n/**\n * The unit scale {@link Mat4.fromQuatToRef} composes with.\n */\nconst UNIT_SCALE: Vec3Like = Object.freeze({ x: 1, y: 1, z: 1 });\n\n/**\n * A frozen identity matrix, for the common case of \"no transform\". It is a plain {@link Mat4Like}\n * rather than a {@link Mat4} because a `Float32Array` cannot be frozen — pass it to anything that\n * reads a matrix, and use `new Mat4()` when you need one you can write to.\n *\n * @example\n * ```ts\n * Mat4.transformPointToRef(MAT4_IDENTITY, point, out); // copies the point\n * ```\n *\n * @public\n */\nexport const MAT4_IDENTITY: Mat4Like = Object.freeze({\n length: 16,\n 0: 1,\n 1: 0,\n 2: 0,\n 3: 0,\n 4: 0,\n 5: 1,\n 6: 0,\n 7: 0,\n 8: 0,\n 9: 0,\n 10: 1,\n 11: 0,\n 12: 0,\n 13: 0,\n 14: 0,\n 15: 1,\n} as const);\n"],"mappings":";;;;;;;AAiBA,SAAS,mBAAiC;CAKxC,uBAAO,IAAI,aAAa,EAAE;AAC5B;;;;;;;;AASA,SAAS,iBAAiB,GAAqB;CAC7C,MAAM,KAAK,EAAE,MAAM;CACnB,MAAM,KAAK,EAAE,MAAM;CACnB,MAAM,KAAK,EAAE,MAAM;CACnB,MAAM,KAAK,EAAE,MAAM;CACnB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6 +61,31 @@ import { addTask, createCopyToTextureTask, createRenderTarget, createRenderTask
61
61
  * @internal
62
62
  */
63
63
  const DEPTH_STENCIL_FORMAT = "depth24plus-stencil8";
64
+ /** The scenes `rendering.hdr` built, created on first use so the module has no import-time work. */
65
+ let hdrScenes = null;
66
+ /**
67
+ * Records that a scene renders through the HDR path, so code outside the HDR chunk (a custom
68
+ * shader's build) can ask without importing it.
69
+ *
70
+ * @param scene - The scene `./hdr-output.ts` built a render path for.
71
+ *
72
+ * @internal
73
+ */
74
+ function markHdrScene(scene) {
75
+ hdrScenes ??= /* @__PURE__ */ new WeakSet();
76
+ hdrScenes.add(scene);
77
+ }
78
+ /**
79
+ * Whether a scene renders through the HDR path, where every colour writer must write linear colour.
80
+ *
81
+ * @param scene - The scene.
82
+ * @returns `true` once `./hdr-output.ts` has built the scene's render path.
83
+ *
84
+ * @internal
85
+ */
86
+ function isHdrScene(scene) {
87
+ return hdrScenes?.has(scene) === true;
88
+ }
64
89
  /**
65
90
  * Builds the scene's render task into an offscreen target and the blit that composites it, and
66
91
  * appends both to the scene's frame graph.
@@ -108,7 +133,8 @@ function installOffscreenRenderPath(engine, scene) {
108
133
  samples: 1,
109
134
  size: engine
110
135
  });
111
- addTask(scene, createRenderTask(config, engine, scene));
136
+ const sceneTask = createRenderTask(config, engine, scene);
137
+ addTask(scene, sceneTask);
112
138
  const present = createCopyToTextureTask({
113
139
  name: "ignifx:present",
114
140
  sourceTexture: sceneColor,
@@ -126,10 +152,15 @@ function installOffscreenRenderPath(engine, scene) {
126
152
  get isPresentEnabled() {
127
153
  return isPresentEnabled;
128
154
  },
129
- hdr: null
155
+ hdr: null,
156
+ scenePass: {
157
+ task: sceneTask,
158
+ target: sceneColor,
159
+ format: engine.format
160
+ }
130
161
  };
131
162
  }
132
163
  //#endregion
133
- export { installOffscreenRenderPath as n, DEPTH_STENCIL_FORMAT as t };
164
+ export { markHdrScene as i, installOffscreenRenderPath as n, isHdrScene as r, DEPTH_STENCIL_FORMAT as t };
134
165
 
135
- //# sourceMappingURL=render-path-Dx0learj.js.map
166
+ //# sourceMappingURL=render-path-Be7WgN7r.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render-path-Be7WgN7r.js","names":[],"sources":["../src/lite/gpu/render-path.ts"],"sourcesContent":["import { addTask, createCopyToTextureTask, createRenderTarget, createRenderTask } from \"@babylonjs/lite\";\nimport type {\n EngineContext,\n RenderTarget,\n RenderTargetTextureResult,\n SceneContext,\n Task,\n Texture2D,\n} from \"@babylonjs/lite\";\n\n/**\n * The offscreen render path (`docs/architecture/07-rendering.md` §2.7): the frame graph a scene gets\n * when the project declares `rendering.features.postProcessing`.\n *\n * Everything here needs a device.\n *\n * ## Why the default render task is not good enough\n *\n * `createSceneContext` appends a task named `\"scene\"` that draws straight into the surface's\n * swapchain target — `surface.scRT` for a single-sample surface, or an MSAA colour target that\n * resolves into `scRT` (`lib/scene/scene-core.js` 74-79). Either way the scene's colour ends up in\n * the swapchain texture, and a post-process pass cannot read it: `createSurface` configures the\n * canvas context with no `usage` (`lib/engine/surface.js` 30), so the swapchain texture is\n * `RENDER_ATTACHMENT` only. Binding it as a sampled texture fails WebGPU validation, the whole\n * frame's command buffer is rejected, and the page presents black. That is exactly what the Phase 2\n * visual suite measured, and it is why this module exists.\n *\n * Lite offers no way to retarget the default task after the fact — `RenderTaskConfig.rt` is read\n * when the task is created, and `FrameGraph`'s public surface is only `build`/`execute`/`dispose`\n * (`index.d.ts` 5367). So the scene is created with `defaultRenderTask: false` and this module\n * builds the replacement.\n *\n * ## The graph it builds\n *\n * ```text\n * [shadow] → scene ──→ sceneColor ──→ present ──→ swapchain\n * └─ (a PostProcessStack appends its effects here, and disables present)\n * ```\n *\n * - `scene` is a normal `createRenderTask`. With MSAA it draws into a multisampled colour target\n * that owns its depth and resolves into `sceneColor` through `rst`; without MSAA it draws into\n * `sceneColor` directly with a separate depth target, which is the same split Lite's own default\n * uses (`RenderTaskConfig.depth`, `index.d.ts` 9782).\n * - `sceneColor` is an ordinary `createRenderTarget`, so `buildRenderTarget` allocates it with\n * `RENDER_ATTACHMENT | TEXTURE_BINDING | COPY_SRC | COPY_DST` (`lib/engine/render-target.js`) —\n * the `TEXTURE_BINDING` the swapchain lacks.\n * - `present` is a `createCopyToTextureTask` from `sceneColor` to the swapchain. Copying *into* the\n * swapchain is supported and takes the blit path (`lib/frame-graph/copy-to-texture-task.js`,\n * `swapAsView`); copying *out of* it is refused (Lite error 80), which is the same limit stated\n * from the other side.\n * - The swapchain is written every frame whatever else happens: with no chain, `present` does it;\n * with a chain, the chain's last effect does it and `present` is switched off\n * ({@link ScenePresenter.setPresentEnabled}).\n *\n * ## Resize\n *\n * Every target here is sized by passing the **surface** as `RenderTargetDescriptor.size`, which\n * `resolveSize` re-reads from `canvas.width`/`canvas.height` on every `buildRenderTarget`\n * (`lib/engine/render-target.js`). A surface resize calls the scene's `_resize`, which is\n * `frameGraph.build()` (`lib/scene/scene-core.js` 67-68): every target is reallocated at the new\n * size and every task re-records, which is also what refreshes the bind groups that captured the old\n * texture views. Nothing here has to observe the canvas itself, and nothing is eagerly allocated —\n * `createRenderTargetTexture` would be, and Lite rejects a surface as its size for exactly that\n * reason.\n */\n\n/**\n * The depth/stencil format Lite's own default render task uses (`lib/scene/scene-core.js` 76-77).\n *\n * @internal\n */\nexport const DEPTH_STENCIL_FORMAT: GPUTextureFormat = \"depth24plus-stencil8\";\n\n/**\n * The HDR half of a presenter, when `rendering.hdr` built one (`./hdr-output.ts`).\n *\n * @internal\n */\nexport interface HdrOutputHandle {\n /** The scene's linear `rgba16float` colour, as a sampled texture. Values may exceed 1. */\n readonly sceneTexture: Texture2D;\n /** The render target behind {@link HdrOutputHandle.sceneTexture}, for a pass that writes it back (TAA). */\n readonly sceneTarget: RenderTarget;\n /** The `\"scene\"` render task, whose scene uniforms the TAA jitter offsets. */\n readonly sceneTask: Task;\n /**\n * The auto exposure result, a 1×1 `r32float` texture holding `log2` of the multiplier the output\n * pass applies (`./auto-exposure.ts`); `null` when `rendering.autoExposure` is off.\n */\n readonly exposureTexture: Texture2D | null;\n /**\n * The same target with its sampled facade and resize hook: what HDR bloom (step G12) samples,\n * writes back into, and rebinds on resize.\n */\n readonly sceneTargetTexture: RenderTargetTextureResult;\n /**\n * The per-frame work: uploads the scene's exposure, contrast and curve when they changed, and\n * gives every new PBR material the linear-output plugin.\n *\n * @param isSceneRegistered - Whether Lite has built the scene, so a patched material needs a\n * rebuild.\n */\n update(isSceneRegistered: boolean): void;\n /**\n * Puts a task between the scene pass and the output pass, where it reads and writes linear\n * colour: a `PostProcessStack`'s custom effects ordered before any built-in one (GI plan G3).\n *\n * @param task - The task; it must write an `rgba16float` target.\n * @param isFrameGraphBuilt - Whether the scene is registered, so the task has to be recorded now.\n */\n insertLinearTask(task: Task, isFrameGraphBuilt: boolean): void;\n /**\n * Points the output pass at another linear texture, or back at the scene's.\n *\n * @param texture - The last linear effect's output, or `null` for {@link HdrOutputHandle.sceneTexture}.\n */\n setOutputSource(texture: Texture2D | null): void;\n}\n\n/** The scenes `rendering.hdr` built, created on first use so the module has no import-time work. */\nlet hdrScenes: WeakSet<SceneContext> | null = null;\n\n/**\n * Records that a scene renders through the HDR path, so code outside the HDR chunk (a custom\n * shader's build) can ask without importing it.\n *\n * @param scene - The scene `./hdr-output.ts` built a render path for.\n *\n * @internal\n */\nexport function markHdrScene(scene: SceneContext): void {\n hdrScenes ??= new WeakSet();\n hdrScenes.add(scene);\n}\n\n/**\n * Whether a scene renders through the HDR path, where every colour writer must write linear colour.\n *\n * @param scene - The scene.\n * @returns `true` once `./hdr-output.ts` has built the scene's render path.\n *\n * @internal\n */\nexport function isHdrScene(scene: SceneContext): boolean {\n return hdrScenes?.has(scene) === true;\n}\n\n/**\n * A scene's offscreen render path: the colour a `PostProcessStack` reads, and the compositing blit\n * it takes over from.\n *\n * @internal\n */\nexport interface ScenePresenter {\n /**\n * The single-sample colour target the scene ends up in — resolved when MSAA is on. It carries\n * `TEXTURE_BINDING`, so it is a legal `sourceTexture` for a post-process task.\n */\n readonly sceneColor: RenderTarget;\n /** The surface's swapchain target, where the last pass of the frame has to land. */\n readonly swapchain: RenderTarget;\n /**\n * Switches the compositing blit on or off.\n *\n * @param enabled - `false` while an effect chain writes the swapchain itself.\n */\n setPresentEnabled(enabled: boolean): void;\n /** Whether the compositing blit currently runs. */\n readonly isPresentEnabled: boolean;\n /** The HDR output pass, when `rendering.hdr` is on; `null` for the plain offscreen path. */\n readonly hdr: HdrOutputHandle | null;\n /**\n * The scene's render task and the single-sample colour target it ends in: {@link\n * ScenePresenter.sceneColor} on the plain path, the `rgba16float` target under `rendering.hdr`.\n * Scene-colour effects (contact shadows, SSGI) insert their tasks right after `task` and write their\n * result back into `target`, so everything downstream reads it.\n */\n readonly scenePass: ScenePass;\n}\n\n/**\n * The scene's render task and its resolved colour target.\n *\n * @internal\n */\nexport interface ScenePass {\n /** The task named `\"scene\"`. */\n readonly task: Task;\n /** The single-sample colour target the scene ends in; it carries `TEXTURE_BINDING` and `COPY_DST`. */\n readonly target: RenderTarget;\n /** That target's colour format. */\n readonly format: GPUTextureFormat;\n}\n\n/**\n * Builds the scene's render task into an offscreen target and the blit that composites it, and\n * appends both to the scene's frame graph.\n *\n * @remarks\n * Call it immediately after `createSceneContext(engine, { defaultRenderTask: false })` and before\n * `registerScene`: `addTask` appends, so calling it first is what puts `\"scene\"` ahead of everything\n * a feature adds later, and `registerSceneWithShadowSupport` still unshifts its own `\"shadow\"` task\n * in front of both.\n *\n * @param engine - The engine, which is also the primary surface.\n * @param scene - The scene created with no default render task.\n * @returns The presenter a `PostProcessStack` builds its chain against.\n *\n * @example\n * ```ts\n * const scene = createSceneContext(engine, { defaultRenderTask: false });\n * const presenter = installOffscreenRenderPath(engine, scene);\n * ```\n *\n * @internal\n */\nexport function installOffscreenRenderPath(engine: EngineContext, scene: SceneContext): ScenePresenter {\n const isMultisampled = engine.msaaSamples > 1;\n const sceneColor = createRenderTarget({\n lbl: \"ignifx:scene-color\",\n format: engine.format,\n samples: 1,\n size: engine,\n });\n const colorTarget = isMultisampled\n ? createRenderTarget({\n lbl: \"ignifx:scene-color-msaa\",\n format: engine.format,\n dFormat: DEPTH_STENCIL_FORMAT,\n samples: engine.msaaSamples,\n size: engine,\n })\n : sceneColor;\n const config: {\n name: string;\n rt: RenderTarget;\n rst?: RenderTarget;\n depth?: RenderTarget;\n } = { name: \"scene\", rt: colorTarget };\n if (isMultisampled) {\n config.rst = sceneColor;\n } else {\n // A colour target that carries no `dFormat` allocates no depth of its own, so the pass needs a\n // separate one — the arrangement Lite's own single-sample default task uses.\n config.depth = createRenderTarget({\n lbl: \"ignifx:scene-depth\",\n dFormat: DEPTH_STENCIL_FORMAT,\n samples: 1,\n size: engine,\n });\n }\n const sceneTask: Task = createRenderTask(config, engine, scene);\n addTask(scene, sceneTask);\n\n const present: Task = createCopyToTextureTask(\n { name: \"ignifx:present\", sourceTexture: sceneColor, targetTexture: engine.scRT },\n engine,\n scene,\n );\n addTask(scene, present);\n\n let isPresentEnabled = true;\n return {\n sceneColor,\n swapchain: engine.scRT,\n setPresentEnabled(enabled: boolean): void {\n isPresentEnabled = enabled;\n present.executionEnabled = enabled;\n },\n get isPresentEnabled(): boolean {\n return isPresentEnabled;\n },\n hdr: null,\n scenePass: { task: sceneTask, target: sceneColor, format: engine.format },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuEA,MAAa,uBAAyC;;AAiDtD,IAAI,YAA0C;;;;;;;;;AAU9C,SAAgB,aAAa,OAA2B;CACtD,8BAAc,IAAI,QAAQ;CAC1B,UAAU,IAAI,KAAK;AACrB;;;;;;;;;AAUA,SAAgB,WAAW,OAA8B;CACvD,OAAO,WAAW,IAAI,KAAK,MAAM;AACnC;;;;;;;;;;;;;;;;;;;;;;;AAuEA,SAAgB,2BAA2B,QAAuB,OAAqC;CACrG,MAAM,iBAAiB,OAAO,cAAc;CAC5C,MAAM,aAAa,mBAAmB;EACpC,KAAK;EACL,QAAQ,OAAO;EACf,SAAS;EACT,MAAM;CACR,CAAC;CAUD,MAAM,SAKF;EAAE,MAAM;EAAS,IAdD,iBAChB,mBAAmB;GACjB,KAAK;GACL,QAAQ,OAAO;GACf,SAAS;GACT,SAAS,OAAO;GAChB,MAAM;EACR,CAAC,IACD;CAMiC;CACrC,IAAI,gBACF,OAAO,MAAM;MAIb,OAAO,QAAQ,mBAAmB;EAChC,KAAK;EACL,SAAS;EACT,SAAS;EACT,MAAM;CACR,CAAC;CAEH,MAAM,YAAkB,iBAAiB,QAAQ,QAAQ,KAAK;CAC9D,QAAQ,OAAO,SAAS;CAExB,MAAM,UAAgB,wBACpB;EAAE,MAAM;EAAkB,eAAe;EAAY,eAAe,OAAO;CAAK,GAChF,QACA,KACF;CACA,QAAQ,OAAO,OAAO;CAEtB,IAAI,mBAAmB;CACvB,OAAO;EACL;EACA,WAAW,OAAO;EAClB,kBAAkB,SAAwB;GACxC,mBAAmB;GACnB,QAAQ,mBAAmB;EAC7B;EACA,IAAI,mBAA4B;GAC9B,OAAO;EACT;EACA,KAAK;EACL,WAAW;GAAE,MAAM;GAAW,QAAQ;GAAY,QAAQ,OAAO;EAAO;CAC1E;AACF"}
@@ -24,6 +24,16 @@ import { addTask, buildFrameGraphTask, createRenderTarget, createRenderTask, get
24
24
  * re-pointing the pass is one assignment. A `null` camera would fall back to the scene's main
25
25
  * camera, so the pass is switched off with `Task.executionEnabled` instead.
26
26
  *
27
+ * ## Editor-only meshes
28
+ *
29
+ * A render task draws every visible mesh of its scene; `RenderTaskConfig` has no mesh filter. So
30
+ * the task's `execute` (the frame graph calls it, `lib/frame-graph/frame-graph.js` 16) is wrapped:
31
+ * it hides each visible mesh whose `metadata[excludeKey]` is `true`, runs, and shows them again.
32
+ * The main pass has already drawn the frame by then (the task is appended after it), so the main
33
+ * view never sees them hidden and does not flicker. `drawList` reads `visible` as it encodes
34
+ * (`render-task-base.js` 354), and this task's opaque bundle is only ever encoded inside the
35
+ * wrapper, so it never holds them either.
36
+ *
27
37
  * ## Gaps in Lite's public surface
28
38
  *
29
39
  * - **No task removal.** `FrameGraph` exposes only `build`/`execute`/`dispose`, and a disposed
@@ -51,11 +61,12 @@ const BYTES_PER_PIXEL = 4;
51
61
  * @param scene - The registered render scene.
52
62
  * @param width - The width in pixels.
53
63
  * @param height - The height in pixels.
64
+ * @param excludeKey - The `metadata` key that, set to `true` on a mesh, keeps it out of the pass.
54
65
  * @returns The pass.
55
66
  *
56
67
  * @internal
57
68
  */
58
- function createLiteRenderTexture(engine, scene, width, height) {
69
+ function createLiteRenderTexture(engine, scene, width, height, excludeKey) {
59
70
  const target = createRenderTarget({
60
71
  lbl: "ignifx:render-texture",
61
72
  format: engine.format,
@@ -73,6 +84,21 @@ function createLiteRenderTexture(engine, scene, width, height) {
73
84
  };
74
85
  const task = createRenderTask(config, engine, scene);
75
86
  task.executionEnabled = false;
87
+ const execute = task.execute?.bind(task);
88
+ if (execute === void 0) throw new TypeError("Lite's render task has no execute(); render-texture.ts needs updating for this Lite.");
89
+ const hidden = [];
90
+ task.execute = () => {
91
+ for (const mesh of scene.meshes) if (mesh.visible !== false && mesh.metadata?.[excludeKey] === true) {
92
+ mesh.visible = false;
93
+ hidden.push(mesh);
94
+ }
95
+ try {
96
+ return execute();
97
+ } finally {
98
+ for (const mesh of hidden) mesh.visible = true;
99
+ hidden.length = 0;
100
+ }
101
+ };
76
102
  addTask(scene, task);
77
103
  buildFrameGraphTask(getFrameGraph(scene), task);
78
104
  let isDisposed = false;
@@ -171,4 +197,4 @@ async function readTexture(device, texture, width, height) {
171
197
  //#endregion
172
198
  export { createLiteRenderTexture };
173
199
 
174
- //# sourceMappingURL=render-texture-IuR0iFVa.js.map
200
+ //# sourceMappingURL=render-texture-C_TnaSz2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render-texture-C_TnaSz2.js","names":["internals"],"sources":["../src/lite/gpu/render-texture.ts"],"sourcesContent":["import { addTask, buildFrameGraphTask, createRenderTarget, createRenderTask, getFrameGraph } from \"@babylonjs/lite\";\nimport type { Camera, EngineContext, Mesh, RenderTarget, RenderTaskConfig, SceneContext, Task } from \"@babylonjs/lite\";\n\n/**\n * Render-to-texture (`docs/architecture/07-rendering.md` §2.11): a second pass of the render scene,\n * through another camera, into an offscreen colour target that can be read back.\n *\n * Everything here needs a device, and every Lite claim was read from `@babylonjs/lite@1.34.0`.\n *\n * ## The pass\n *\n * One `createRenderTask` per texture, appended to the render scene's frame graph. Its target is an\n * ordinary `createRenderTarget` of a fixed `{ width, height }`, in the surface's colour format with\n * a depth/stencil attachment of its own, single-sample. The task owns it: `record()` allocates it\n * (`buildRenderTarget`, `RENDER_ATTACHMENT | TEXTURE_BINDING | COPY_SRC | COPY_DST`,\n * `lib/engine/render-target.js` 59) and `dispose()` frees it. The task auto-mirrors the scene's\n * renderables, builds its own pipelines for its target signature, and writes a scene UBO of its own\n * (`_sceneUBO`, `lib/frame-graph/render-task-base.js` 85), so its camera never disturbs the main\n * pass.\n *\n * ## The camera\n *\n * `RenderTaskConfig.cam` is read on every execute (`task._config.cam ?? scene.camera`,\n * `render-task-base.js` 236, 279) from the config object the task keeps by reference (line 77), so\n * re-pointing the pass is one assignment. A `null` camera would fall back to the scene's main\n * camera, so the pass is switched off with `Task.executionEnabled` instead.\n *\n * ## Editor-only meshes\n *\n * A render task draws every visible mesh of its scene; `RenderTaskConfig` has no mesh filter. So\n * the task's `execute` (the frame graph calls it, `lib/frame-graph/frame-graph.js` 16) is wrapped:\n * it hides each visible mesh whose `metadata[excludeKey]` is `true`, runs, and shows them again.\n * The main pass has already drawn the frame by then (the task is appended after it), so the main\n * view never sees them hidden and does not flicker. `drawList` reads `visible` as it encodes\n * (`render-task-base.js` 354), and this task's opaque bundle is only ever encoded inside the\n * wrapper, so it never holds them either.\n *\n * ## Gaps in Lite's public surface\n *\n * - **No task removal.** `FrameGraph` exposes only `build`/`execute`/`dispose`, and a disposed\n * render task throws from `record()` on the next `frameGraph.build()` (a canvas resize). So the\n * task is spliced out of `_tasks`, the array `addTask` appends to (`lib/frame-graph/frame-graph.js`),\n * before it is disposed.\n * - **No texture readback.** Lite reads back only the swapchain (`captureScreenshot`). The read here\n * copies the target's `_colorTexture` into a mapped buffer through `engine._device`. Queue order\n * makes it read the last frame submitted before the call.\n */\n\n/** The depth/stencil format Lite's own render tasks use. */\nconst DEPTH_STENCIL_FORMAT: GPUTextureFormat = \"depth24plus-stencil8\";\n\n/** WebGPU's `bytesPerRow` alignment for a texture-to-buffer copy. */\nconst ROW_ALIGNMENT = 256;\n\n/** RGBA8 bytes per pixel. */\nconst BYTES_PER_PIXEL = 4;\n\n/** The fields of a Lite 1.34 render target that hold its live GPU texture. */\ninterface TargetInternals {\n /** The colour texture, `null` until the owning task has recorded. */\n _colorTexture?: GPUTexture | null;\n}\n\n/** The field of a Lite 1.34 engine that holds its device. */\ninterface EngineInternals {\n /** The device; replaced after a device-loss recovery, so read on every use. */\n _device?: GPUDevice;\n}\n\n/** The field of a Lite 1.34 frame graph that holds its tasks. */\ninterface FrameGraphInternals {\n /** The tasks, in execute order. */\n _tasks?: Task[];\n}\n\n/**\n * One texture's render pass.\n *\n * @internal\n */\nexport interface LiteRenderTexture {\n /**\n * Points the pass at a camera, or switches it off.\n *\n * @param camera - The camera to render through from the next frame, or `null` to stop.\n */\n setCamera(camera: Camera | null): void;\n /**\n * Reads the texture as it is after the last submitted frame.\n *\n * @returns `width * height * 4` bytes of RGBA8, top row first.\n * @throws Error when the pass has not recorded yet or the engine has no device.\n */\n read(): Promise<Uint8ClampedArray>;\n /** Removes the pass from the frame graph and frees its target. Idempotent. */\n dispose(): void;\n}\n\n/**\n * Creates a texture's render pass, switched off, at the end of the render scene's frame graph.\n *\n * @remarks\n * Call it only once the scene is registered: the task is recorded at once, which allocates its\n * target.\n *\n * @param engine - The WebGPU engine.\n * @param scene - The registered render scene.\n * @param width - The width in pixels.\n * @param height - The height in pixels.\n * @param excludeKey - The `metadata` key that, set to `true` on a mesh, keeps it out of the pass.\n * @returns The pass.\n *\n * @internal\n */\nexport function createLiteRenderTexture(\n engine: EngineContext,\n scene: SceneContext,\n width: number,\n height: number,\n excludeKey: string,\n): LiteRenderTexture {\n const target: RenderTarget = createRenderTarget({\n lbl: \"ignifx:render-texture\",\n format: engine.format,\n dFormat: DEPTH_STENCIL_FORMAT,\n samples: 1,\n size: { width, height },\n });\n const config: RenderTaskConfig = { name: \"ignifx:render-texture\", rt: target, cam: null };\n const task = createRenderTask(config, engine, scene);\n task.executionEnabled = false;\n const execute = task.execute?.bind(task);\n if (execute === undefined) {\n throw new TypeError(\"Lite's render task has no execute(); render-texture.ts needs updating for this Lite.\");\n }\n const hidden: Mesh[] = [];\n task.execute = (): number => {\n for (const mesh of scene.meshes) {\n if (mesh.visible !== false && mesh.metadata?.[excludeKey] === true) {\n mesh.visible = false;\n hidden.push(mesh);\n }\n }\n try {\n return execute();\n } finally {\n for (const mesh of hidden) {\n mesh.visible = true;\n }\n hidden.length = 0;\n }\n };\n addTask(scene, task);\n buildFrameGraphTask(getFrameGraph(scene), task);\n let isDisposed = false;\n return {\n setCamera(camera: Camera | null): void {\n if (isDisposed) {\n return;\n }\n config.cam = camera;\n task.executionEnabled = camera !== null;\n },\n async read(): Promise<Uint8ClampedArray> {\n const texture = isDisposed ? null : colorTextureOf(target);\n const device = deviceOf(engine);\n if (texture === null || device === null) {\n throw new Error(\"The render texture has no GPU texture to read.\");\n }\n return readTexture(device, texture, width, height);\n },\n dispose(): void {\n if (isDisposed) {\n return;\n }\n isDisposed = true;\n task.executionEnabled = false;\n removeTask(scene, task);\n task.dispose();\n },\n };\n}\n\n/**\n * A render target's live colour texture.\n *\n * @param target - The target.\n * @returns The texture, or `null` before the owning task has recorded.\n */\nfunction colorTextureOf(target: RenderTarget): GPUTexture | null {\n // Boundary assertion (coding standards §5.2): the field Lite 1.34 keeps, documented above.\n // oxlint-disable-next-line typescript/no-unsafe-type-assertion\n const internals = target as RenderTarget & TargetInternals;\n // oxlint-disable-next-line no-underscore-dangle\n return internals._colorTexture ?? null;\n}\n\n/**\n * An engine's current device.\n *\n * @param engine - The engine.\n * @returns The device, or `null` for an engine without one.\n */\nfunction deviceOf(engine: EngineContext): GPUDevice | null {\n // oxlint-disable-next-line typescript/no-unsafe-type-assertion\n const internals = engine as EngineContext & EngineInternals;\n // oxlint-disable-next-line no-underscore-dangle\n return internals._device ?? null;\n}\n\n/**\n * Takes a task out of a scene's frame graph, so the next rebuild does not record it.\n *\n * @param scene - The scene.\n * @param task - The task.\n */\nfunction removeTask(scene: SceneContext, task: Task): void {\n // oxlint-disable-next-line typescript/no-unsafe-type-assertion\n const graph = getFrameGraph(scene) as ReturnType<typeof getFrameGraph> & FrameGraphInternals;\n // oxlint-disable-next-line no-underscore-dangle\n const tasks = graph._tasks;\n if (!Array.isArray(tasks)) {\n // A Lite upgrade renamed the field: fail here, not on the next rebuild (07-rendering §2.11).\n throw new TypeError(\"Lite's FrameGraph has no _tasks array; render-texture.ts needs updating for this Lite.\");\n }\n const index = tasks.indexOf(task);\n if (index >= 0) {\n tasks.splice(index, 1);\n }\n}\n\n/**\n * Copies a colour texture into tightly packed RGBA8.\n *\n * @param device - The device that owns the texture.\n * @param texture - An 8-bit RGBA or BGRA texture with `COPY_SRC`.\n * @param width - The width to read.\n * @param height - The height to read.\n * @returns The pixels, top row first, red first.\n */\nasync function readTexture(\n device: GPUDevice,\n texture: GPUTexture,\n width: number,\n height: number,\n): Promise<Uint8ClampedArray> {\n const rowBytes = width * BYTES_PER_PIXEL;\n const bytesPerRow = Math.ceil(rowBytes / ROW_ALIGNMENT) * ROW_ALIGNMENT;\n const buffer = device.createBuffer({\n label: \"ignifx:render-texture-read\",\n size: bytesPerRow * height,\n usage: GPUBufferUsage.COPY_DST | GPUBufferUsage.MAP_READ,\n });\n try {\n const encoder = device.createCommandEncoder({ label: \"ignifx:render-texture-read\" });\n encoder.copyTextureToBuffer({ texture }, { buffer, bytesPerRow }, { width, height });\n device.queue.submit([encoder.finish()]);\n await buffer.mapAsync(GPUMapMode.READ);\n const mapped = new Uint8Array(buffer.getMappedRange());\n const out = new Uint8ClampedArray(rowBytes * height);\n for (let row = 0; row < height; row += 1) {\n out.set(mapped.subarray(row * bytesPerRow, row * bytesPerRow + rowBytes), row * rowBytes);\n }\n if (texture.format.startsWith(\"bgra\")) {\n for (let index = 0; index < out.length; index += BYTES_PER_PIXEL) {\n const blue = out[index] ?? 0;\n out[index] = out[index + 2] ?? 0;\n out[index + 2] = blue;\n }\n }\n return out;\n } finally {\n buffer.destroy();\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiDA,MAAM,uBAAyC;;AAG/C,MAAM,gBAAgB;;AAGtB,MAAM,kBAAkB;;;;;;;;;;;;;;;;;AA2DxB,SAAgB,wBACd,QACA,OACA,OACA,QACA,YACmB;CACnB,MAAM,SAAuB,mBAAmB;EAC9C,KAAK;EACL,QAAQ,OAAO;EACf,SAAS;EACT,SAAS;EACT,MAAM;GAAE;GAAO;EAAO;CACxB,CAAC;CACD,MAAM,SAA2B;EAAE,MAAM;EAAyB,IAAI;EAAQ,KAAK;CAAK;CACxF,MAAM,OAAO,iBAAiB,QAAQ,QAAQ,KAAK;CACnD,KAAK,mBAAmB;CACxB,MAAM,UAAU,KAAK,SAAS,KAAK,IAAI;CACvC,IAAI,YAAY,KAAA,GACd,MAAM,IAAI,UAAU,sFAAsF;CAE5G,MAAM,SAAiB,CAAC;CACxB,KAAK,gBAAwB;EAC3B,KAAK,MAAM,QAAQ,MAAM,QACvB,IAAI,KAAK,YAAY,SAAS,KAAK,WAAW,gBAAgB,MAAM;GAClE,KAAK,UAAU;GACf,OAAO,KAAK,IAAI;EAClB;EAEF,IAAI;GACF,OAAO,QAAQ;EACjB,UAAU;GACR,KAAK,MAAM,QAAQ,QACjB,KAAK,UAAU;GAEjB,OAAO,SAAS;EAClB;CACF;CACA,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GAAG;GAAE;GAAO;EAAO,CAAC;EACnF,OAAO,MAAM,OAAO,CAAC,QAAQ,OAAO,CAAC,CAAC;EACtC,MAAM,OAAO,SAAS,WAAW,IAAI;EACrC,MAAM,SAAS,IAAI,WAAW,OAAO,eAAe,CAAC;EACrD,MAAM,MAAM,IAAI,kBAAkB,WAAW,MAAM;EACnD,KAAK,IAAI,MAAM,GAAG,MAAM,QAAQ,OAAO,GACrC,IAAI,IAAI,OAAO,SAAS,MAAM,aAAa,MAAM,cAAc,QAAQ,GAAG,MAAM,QAAQ;EAE1F,IAAI,QAAQ,OAAO,WAAW,MAAM,GAClC,KAAK,IAAI,QAAQ,GAAG,QAAQ,IAAI,QAAQ,SAAS,iBAAiB;GAChE,MAAM,OAAO,IAAI,UAAU;GAC3B,IAAI,SAAS,IAAI,QAAQ,MAAM;GAC/B,IAAI,QAAQ,KAAK;EACnB;EAEF,OAAO;CACT,UAAU;EACR,OAAO,QAAQ;CACjB;AACF"}
@@ -0,0 +1,65 @@
1
+ import { frameGraphTasks } from "./scene-inputs-BxGOsnIZ.js";
2
+ import { addTaskAfter, buildFrameGraphTask, createCopyToTextureTask, createRenderTarget, disposeRenderTarget, getFrameGraph } from "@babylonjs/lite";
3
+ //#region src/lite/gpu/scene-color-passes.ts
4
+ /**
5
+ * Inserts the passes after the scene task, in order.
6
+ *
7
+ * @param engine - The engine; also the surface the scratch target is sized by.
8
+ * @param scene - The scene.
9
+ * @param presenter - The offscreen render path.
10
+ * @param passes - The effects, first to last.
11
+ * @param isFrameGraphBuilt - Whether the scene is registered, so each task is recorded now.
12
+ * @returns The handle that takes them out again.
13
+ *
14
+ * @internal
15
+ */
16
+ function installSceneColorPasses(engine, scene, presenter, passes, isFrameGraphBuilt) {
17
+ const { task: sceneTask, target: sceneTarget, format } = presenter.scenePass;
18
+ const scratch = createRenderTarget({
19
+ lbl: "ignifx:scene-color-scratch",
20
+ format,
21
+ samples: 1,
22
+ size: engine
23
+ });
24
+ const tasks = [];
25
+ let source = sceneTarget;
26
+ for (const pass of passes) {
27
+ const target = source === sceneTarget ? scratch : sceneTarget;
28
+ tasks.push(pass.create(source, target));
29
+ source = target;
30
+ }
31
+ if (source !== sceneTarget) tasks.push(createCopyToTextureTask({
32
+ name: "ignifx:scene-color-copy",
33
+ sourceTexture: scratch,
34
+ targetTexture: sceneTarget
35
+ }, engine, scene));
36
+ let after = sceneTask;
37
+ for (const task of tasks) {
38
+ addTaskAfter(scene, task, after);
39
+ after = task;
40
+ }
41
+ if (isFrameGraphBuilt) {
42
+ const graph = getFrameGraph(scene);
43
+ for (const task of tasks) buildFrameGraphTask(graph, task);
44
+ }
45
+ let isDisposed = false;
46
+ return {
47
+ taskCount: tasks.length,
48
+ dispose() {
49
+ if (isDisposed) return;
50
+ isDisposed = true;
51
+ const list = frameGraphTasks(scene);
52
+ for (const task of tasks) {
53
+ task.executionEnabled = false;
54
+ const index = list?.indexOf(task) ?? -1;
55
+ if (list !== null && index >= 0) list.splice(index, 1);
56
+ task.dispose();
57
+ }
58
+ disposeRenderTarget(scratch);
59
+ }
60
+ };
61
+ }
62
+ //#endregion
63
+ export { installSceneColorPasses };
64
+
65
+ //# sourceMappingURL=scene-color-passes-DlNr-qyZ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scene-color-passes-DlNr-qyZ.js","names":[],"sources":["../src/lite/gpu/scene-color-passes.ts"],"sourcesContent":["import {\n addTaskAfter,\n buildFrameGraphTask,\n createCopyToTextureTask,\n createRenderTarget,\n disposeRenderTarget,\n getFrameGraph,\n} from \"@babylonjs/lite\";\nimport { frameGraphTasks } from \"./scene-inputs.js\";\nimport type { ScenePresenter } from \"./render-path.js\";\nimport type { EngineContext, RenderTarget, SceneContext, Task } from \"@babylonjs/lite\";\n\n/**\n * Scene-colour passes (`docs/architecture/07-rendering.md` §2.7, GI plan steps G10 and G11): Lite\n * screen-space effects that read the lit scene colour and the shared scene-input depth, and whose\n * result replaces the scene colour before anything else reads it. Its own chunk, loaded with the\n * first such effect (`CONSTITUTION.md` §2.5).\n *\n * ```text\n * scene ─→ S ─ pass 1 ─→ scratch ─ pass 2 ─→ S ─ … [─ copy ─→ S] ─→ present / output pass / chain\n * ```\n *\n * `S` is the presenter's {@link ScenePresenter.scenePass} target: `sceneColor` on the plain path,\n * the linear `rgba16float` target under `rendering.hdr`, so the passes see linear colour ahead of\n * the output pass there. Lite's composite cannot write its own source, so the passes ping-pong\n * between `S` and one scratch target of the same format, and a copy brings an odd count back into\n * `S`. Every task sits right after the scene task, ahead of the present blit, the HDR output pass\n * and a `PostProcessStack` chain alike, which therefore need no change.\n */\n\n/**\n * One scene-colour effect, as the installer sees it.\n *\n * @internal\n */\nexport interface SceneColorPass {\n /**\n * Creates the effect's task.\n *\n * @param source - The colour it reads.\n * @param target - The colour it writes; never `source`.\n * @returns The task.\n */\n create(source: RenderTarget, target: RenderTarget): Task;\n}\n\n/**\n * The installed passes.\n *\n * @internal\n */\nexport interface InstalledSceneColorPasses {\n /** How many tasks were added, copy included. */\n readonly taskCount: number;\n /** Removes and disposes every task and the scratch target. Idempotent. */\n dispose(): void;\n}\n\n/**\n * Inserts the passes after the scene task, in order.\n *\n * @param engine - The engine; also the surface the scratch target is sized by.\n * @param scene - The scene.\n * @param presenter - The offscreen render path.\n * @param passes - The effects, first to last.\n * @param isFrameGraphBuilt - Whether the scene is registered, so each task is recorded now.\n * @returns The handle that takes them out again.\n *\n * @internal\n */\nexport function installSceneColorPasses(\n engine: EngineContext,\n scene: SceneContext,\n presenter: ScenePresenter,\n passes: readonly SceneColorPass[],\n isFrameGraphBuilt: boolean,\n): InstalledSceneColorPasses {\n const { task: sceneTask, target: sceneTarget, format } = presenter.scenePass;\n const scratch = createRenderTarget({ lbl: \"ignifx:scene-color-scratch\", format, samples: 1, size: engine });\n const tasks: Task[] = [];\n let source = sceneTarget;\n for (const pass of passes) {\n const target = source === sceneTarget ? scratch : sceneTarget;\n tasks.push(pass.create(source, target));\n source = target;\n }\n if (source !== sceneTarget) {\n tasks.push(\n createCopyToTextureTask(\n { name: \"ignifx:scene-color-copy\", sourceTexture: scratch, targetTexture: sceneTarget },\n engine,\n scene,\n ),\n );\n }\n let after = sceneTask;\n for (const task of tasks) {\n addTaskAfter(scene, task, after);\n after = task;\n }\n if (isFrameGraphBuilt) {\n const graph = getFrameGraph(scene);\n for (const task of tasks) {\n buildFrameGraphTask(graph, task);\n }\n }\n let isDisposed = false;\n return {\n taskCount: tasks.length,\n dispose(): void {\n if (isDisposed) {\n return;\n }\n isDisposed = true;\n const list = frameGraphTasks(scene);\n for (const task of tasks) {\n // Disable first: a disposed task that still executes is a use-after-free.\n task.executionEnabled = false;\n const index = list?.indexOf(task) ?? -1;\n if (list !== null && index >= 0) {\n list.splice(index, 1);\n }\n task.dispose();\n }\n disposeRenderTarget(scratch);\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;AAsEA,SAAgB,wBACd,QACA,OACA,WACA,QACA,mBAC2B;CAC3B,MAAM,EAAE,MAAM,WAAW,QAAQ,aAAa,WAAW,UAAU;CACnE,MAAM,UAAU,mBAAmB;EAAE,KAAK;EAA8B;EAAQ,SAAS;EAAG,MAAM;CAAO,CAAC;CAC1G,MAAM,QAAgB,CAAC;CACvB,IAAI,SAAS;CACb,KAAK,MAAM,QAAQ,QAAQ;EACzB,MAAM,SAAS,WAAW,cAAc,UAAU;EAClD,MAAM,KAAK,KAAK,OAAO,QAAQ,MAAM,CAAC;EACtC,SAAS;CACX;CACA,IAAI,WAAW,aACb,MAAM,KACJ,wBACE;EAAE,MAAM;EAA2B,eAAe;EAAS,eAAe;CAAY,GACtF,QACA,KACF,CACF;CAEF,IAAI,QAAQ;CACZ,KAAK,MAAM,QAAQ,OAAO;EACxB,aAAa,OAAO,MAAM,KAAK;EAC/B,QAAQ;CACV;CACA,IAAI,mBAAmB;EACrB,MAAM,QAAQ,cAAc,KAAK;EACjC,KAAK,MAAM,QAAQ,OACjB,oBAAoB,OAAO,IAAI;CAEnC;CACA,IAAI,aAAa;CACjB,OAAO;EACL,WAAW,MAAM;EACjB,UAAgB;GACd,IAAI,YACF;GAEF,aAAa;GACb,MAAM,OAAO,gBAAgB,KAAK;GAClC,KAAK,MAAM,QAAQ,OAAO;IAExB,KAAK,mBAAmB;IACxB,MAAM,QAAQ,MAAM,QAAQ,IAAI,KAAK;IACrC,IAAI,SAAS,QAAQ,SAAS,GAC5B,KAAK,OAAO,OAAO,CAAC;IAEtB,KAAK,QAAQ;GACf;GACA,oBAAoB,OAAO;EAC7B;CACF;AACF"}