@onerjs/core 8.56.1 → 8.56.2

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 (88) hide show
  1. package/Cameras/arcRotateCamera.pure.js +24 -0
  2. package/Cameras/arcRotateCamera.pure.js.map +1 -1
  3. package/Engines/abstractEngine.pure.js +2 -2
  4. package/Engines/abstractEngine.pure.js.map +1 -1
  5. package/Engines/constants.d.ts +5 -0
  6. package/Engines/constants.js +5 -0
  7. package/Engines/constants.js.map +1 -1
  8. package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.pure.d.ts +4 -0
  9. package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.pure.js +12 -0
  10. package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.pure.js.map +1 -1
  11. package/FrameGraph/Node/Blocks/inputBlock.pure.js +2 -1
  12. package/FrameGraph/Node/Blocks/inputBlock.pure.js.map +1 -1
  13. package/FrameGraph/Node/Types/nodeRenderGraphTypes.d.ts +2 -0
  14. package/FrameGraph/Node/Types/nodeRenderGraphTypes.js +2 -0
  15. package/FrameGraph/Node/Types/nodeRenderGraphTypes.js.map +1 -1
  16. package/FrameGraph/Tasks/Rendering/geometryRendererTask.d.ts +21 -0
  17. package/FrameGraph/Tasks/Rendering/geometryRendererTask.js +45 -0
  18. package/FrameGraph/Tasks/Rendering/geometryRendererTask.js.map +1 -1
  19. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.pure.d.ts +1 -0
  20. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.pure.js +18 -3
  21. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.pure.js.map +1 -1
  22. package/Materials/Node/Blocks/Fragment/prePassOutputBlock.pure.js +5 -21
  23. package/Materials/Node/Blocks/Fragment/prePassOutputBlock.pure.js.map +1 -1
  24. package/Materials/Node/nodeMaterial.pure.d.ts +10 -0
  25. package/Materials/Node/nodeMaterial.pure.js +11 -0
  26. package/Materials/Node/nodeMaterial.pure.js.map +1 -1
  27. package/Materials/Node/nodeMaterialBuildState.d.ts +1 -0
  28. package/Materials/Node/nodeMaterialBuildState.js +7 -1
  29. package/Materials/Node/nodeMaterialBuildState.js.map +1 -1
  30. package/Materials/PBR/openpbrMaterial.pure.d.ts +3 -0
  31. package/Materials/PBR/pbrBaseMaterial.pure.d.ts +3 -0
  32. package/Materials/Textures/textureProcessor.d.ts +29 -6
  33. package/Materials/Textures/textureProcessor.js +22 -16
  34. package/Materials/Textures/textureProcessor.js.map +1 -1
  35. package/Materials/materialHelper.geometryrendering.d.ts +19 -0
  36. package/Materials/materialHelper.geometryrendering.js +29 -1
  37. package/Materials/materialHelper.geometryrendering.js.map +1 -1
  38. package/Materials/prepass.defines.d.ts +3 -0
  39. package/Materials/prepass.defines.js +3 -0
  40. package/Materials/prepass.defines.js.map +1 -1
  41. package/Materials/standardMaterial.pure.d.ts +3 -0
  42. package/Maths/math.vector.pure.d.ts +1 -5
  43. package/Maths/math.vector.pure.js.map +1 -1
  44. package/Misc/filesInput.d.ts +15 -0
  45. package/Misc/filesInput.js +156 -74
  46. package/Misc/filesInput.js.map +1 -1
  47. package/Misc/tools.pure.js +1 -1
  48. package/Misc/tools.pure.js.map +1 -1
  49. package/Rendering/geometryBufferRenderer.pure.d.ts +30 -0
  50. package/Rendering/geometryBufferRenderer.pure.js +84 -0
  51. package/Rendering/geometryBufferRenderer.pure.js.map +1 -1
  52. package/Shaders/ShadersInclude/objectIdFunctions.d.ts +5 -0
  53. package/Shaders/ShadersInclude/objectIdFunctions.js +22 -0
  54. package/Shaders/ShadersInclude/objectIdFunctions.js.map +1 -0
  55. package/Shaders/ShadersInclude/openpbrBlockPrePass.js +3 -0
  56. package/Shaders/ShadersInclude/openpbrBlockPrePass.js.map +1 -1
  57. package/Shaders/ShadersInclude/pbrBlockPrePass.js +3 -0
  58. package/Shaders/ShadersInclude/pbrBlockPrePass.js.map +1 -1
  59. package/Shaders/ShadersInclude/prePassDeclaration.d.ts +1 -0
  60. package/Shaders/ShadersInclude/prePassDeclaration.js +5 -0
  61. package/Shaders/ShadersInclude/prePassDeclaration.js.map +1 -1
  62. package/Shaders/default.fragment.js +5 -1
  63. package/Shaders/default.fragment.js.map +1 -1
  64. package/Shaders/geometry.fragment.js +9 -1
  65. package/Shaders/geometry.fragment.js.map +1 -1
  66. package/Shaders/openpbr.fragment.js +2 -1
  67. package/Shaders/openpbr.fragment.js.map +1 -1
  68. package/Shaders/pbr.fragment.js +2 -1
  69. package/Shaders/pbr.fragment.js.map +1 -1
  70. package/ShadersWGSL/ShadersInclude/objectIdFunctions.d.ts +5 -0
  71. package/ShadersWGSL/ShadersInclude/objectIdFunctions.js +22 -0
  72. package/ShadersWGSL/ShadersInclude/objectIdFunctions.js.map +1 -0
  73. package/ShadersWGSL/ShadersInclude/openpbrBlockPrePass.js +3 -0
  74. package/ShadersWGSL/ShadersInclude/openpbrBlockPrePass.js.map +1 -1
  75. package/ShadersWGSL/ShadersInclude/pbrBlockPrePass.js +3 -0
  76. package/ShadersWGSL/ShadersInclude/pbrBlockPrePass.js.map +1 -1
  77. package/ShadersWGSL/ShadersInclude/prePassDeclaration.d.ts +1 -0
  78. package/ShadersWGSL/ShadersInclude/prePassDeclaration.js +5 -0
  79. package/ShadersWGSL/ShadersInclude/prePassDeclaration.js.map +1 -1
  80. package/ShadersWGSL/default.fragment.js +5 -1
  81. package/ShadersWGSL/default.fragment.js.map +1 -1
  82. package/ShadersWGSL/geometry.fragment.js +9 -1
  83. package/ShadersWGSL/geometry.fragment.js.map +1 -1
  84. package/ShadersWGSL/openpbr.fragment.js +2 -1
  85. package/ShadersWGSL/openpbr.fragment.js.map +1 -1
  86. package/ShadersWGSL/pbr.fragment.js +2 -1
  87. package/ShadersWGSL/pbr.fragment.js.map +1 -1
  88. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"textureProcessor.js","sourceRoot":"","sources":["../../../../../dev/core/src/Materials/Textures/textureProcessor.ts"],"names":[],"m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C;QAClB,MAAM,KAAK,CAAC;IAChB,CAAC;IAED,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC;IAElB,oBAAoB,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;IAC9C,MAAM,MAAM,GAA2B,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC;IACpF,IAAI,gBAAgB,EAAE,CAAC;QACnB,MAAM,CAAC,UAAU,GAAG,gBAAgB,CAAC;IACzC,CAAC;IACD,OAAO,MAAM,CAAC;AAClB,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACrC,IAAY,EACZ,KAA6B,EAC7B,OAAuB,EACvB,KAAY,EACZ,gBAAoC,EACpC,iBAA+B;IAE/B,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;QACjB,MAAM,QAAQ,GAAG,oBAAoB,CAAC,aAAa,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,CAAC;QACrE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,iBAAiB,CAAC,CAAC,CAAC,uBAAuB,CAAC,QAAQ,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;IAC1H,CAAC;IACD,OAAO,MAAM,qBAAqB,CAAC,IAAI,EAAE,EAAE,GAAG,KAAK,EAAE,OAAO,EAAE,EAAE,mBAAmB,CAAC,IAAI,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,CAAC,CAAC;AAC7J,CAAC","sourcesContent":["import { type Scene } from \"../../scene\";\nimport { type IProceduralTextureCreationOptions } from \"core/Materials/Textures/Procedurals/proceduralTexture\";\nimport { ProceduralTexture } from \"./Procedurals/proceduralTexture.pure\";\nimport { type BaseTexture } from \"./baseTexture\";\nimport { type Nullable } from \"../../types\";\nimport { type Texture } from \"./texture\";\nimport { type TextureSize } from \"./textureCreationOptions\";\nimport { ShaderLanguage } from \"core/Materials/shaderLanguage\";\nimport { Constants } from \"../../Engines/constants\";\nimport { Color4 } from \"core/Maths/math.color.pure\";\n\nconst _ShaderName = \"textureProcessor\";\n\n/**\n * Specifies the color space of a texture operand.\n * When `sRGB` is set the sampled RGB values are converted to linear space before any channel\n * swizzle, factor multiplication, or arithmetic operation. Alpha is always treated as linear.\n */\nexport enum TextureColorSpace {\n /** Texture data is already in linear space (default). No conversion applied. */\n Linear = 0,\n /** Texture data is in sRGB (gamma) space. RGB channels are linearized (IEC 61966-2-1) before use. */\n SRGB = 1,\n}\n\n/**\n * Bitmask controlling which channels are written to the output texture by a processing operation.\n * Channels excluded from the mask receive a sensible default: `0.0` for RGB channels, `1.0` for alpha.\n * Use `ChannelMask.RGBA` (or omit the parameter) to pass all channels through unchanged.\n *\n * | Flag | Channels written | Excluded channels |\n * |------|-----------------|-------------------|\n * | R | red | G=0, B=0, A=1 |\n * | G | green | R=0, B=0, A=1 |\n * | B | blue | R=0, G=0, A=1 |\n * | A | alpha | R=0, G=0, B=0 |\n * | RGB | red, green, blue | A=1 |\n * | RGBA | all four | (none) |\n */\nexport enum ChannelMask {\n /** Pass only the red channel; G=0, B=0, A=1. */\n R = 0x1,\n /** Pass only the green channel; R=0, B=0, A=1. */\n G = 0x2,\n /** Pass only the blue channel; R=0, G=0, A=1. */\n B = 0x4,\n /** Pass only the alpha channel; R=0, G=0, B=0. */\n A = 0x8,\n /** Pass red, green, and blue; alpha is forced to 1.0. */\n RGB = 0x7,\n /** Pass all four channels unchanged (default — no masking). */\n RGBA = 0xf,\n}\n\n/**\n * Specifies which channel of a texture to read for an operation.\n * When a single channel is selected its scalar value is broadcast to RGB; alpha\n * is either preserved from the original sample or replicated when `A` is chosen.\n *\n * | Value | Swizzle |\n * |-------|---------|\n * | RGBA | (r, g, b, a) — no swizzle (default) |\n * | R | (r, r, r, a) |\n * | G | (g, g, g, a) |\n * | B | (b, b, b, a) |\n * | A | (a, a, a, a) |\n */\nexport enum TextureChannel {\n /** Use all four channels as sampled (default). */\n RGBA = 0,\n /** Broadcast the red channel to RGB; preserve alpha: RRRA. */\n R = 1,\n /** Broadcast the green channel to RGB; preserve alpha: GGGA. */\n G = 2,\n /** Broadcast the blue channel to RGB; preserve alpha: BBBA. */\n B = 3,\n /** Broadcast the alpha channel to all four components: AAAA. */\n A = 4,\n}\n\n/**\n * Represents an operand for a texture processing operation, or the result of one.\n *\n * As an operand, the value evaluates to a vec4 per texel:\n * - `texture` only → `sample(texture)`\n * - `factor` only → `factor` (constant)\n * - both → `sample(texture) * factor`\n *\n * As a result returned by a processing function:\n * - `texture` holds the GPU-processed output; `dispose()` releases it when no longer needed.\n * - `factor` holds a CPU-folded constant when all inputs were texture-free; no `dispose` is set.\n *\n * Results are directly usable as operands to subsequent operations. When a result with a\n * `dispose` function is passed as an operand, the next operation automatically calls `dispose`\n * after consuming it, so intermediate textures are cleaned up without manual tracking.\n *\n * At least one of `texture` or `factor` must be provided when used as an operand.\n */\nexport interface ITextureProcessOperand {\n /**\n * Texture to sample. When combined with `factor`, the sampled value is multiplied\n * component-wise by the factor. Null when the operand or result is a constant.\n */\n texture: Nullable<BaseTexture>;\n /**\n * Optional constant RGBA factor. If `texture` is also set, the sampled value is\n * multiplied by this factor. If `texture` is not set, this becomes the constant output.\n * When omitted and `texture` is set, defaults to (1, 1, 1, 1) — no scaling.\n */\n factor?: Color4;\n /**\n * Optional channel selection applied to the sampled texture value before any factor\n * multiplication. When omitted or set to `TextureChannel.RGBA`, the sample is used\n * as-is. When set to a single channel, that channel's scalar is broadcast to RGB\n * (or all four components for `TextureChannel.A`). Only meaningful when `texture` is set.\n */\n channel?: TextureChannel;\n\n /**\n * Color space of the texture data. When set to `TextureColorSpace.SRGB`, the sampled\n * RGB channels are converted from sRGB to linear space (IEC 61966-2-1) before the channel\n * swizzle, factor multiplication, and any arithmetic operation. Alpha is always linear.\n * Defaults to `TextureColorSpace.Linear` (no conversion). Only meaningful when `texture` is set.\n */\n colorSpace?: TextureColorSpace;\n\n /**\n * Disposes the texture produced by a processing operation. Only present on results\n * returned by the texture processing functions. When a result is passed as an operand\n * to the next operation in a chain, its `dispose` is called automatically after the\n * GPU pass completes. Call `dispose` explicitly on the final result when the texture\n * is no longer needed (or skip it if transferring ownership to a material).\n */\n dispose?: () => void;\n}\n\n/**\n * Create an operand from a texture alone (no constant factor scaling).\n * @param texture - The texture to sample, or null to produce an identity (1,1,1,1) constant operand\n * @param channel - Optional channel selection. When set, the sampled value is swizzled before use\n * (e.g. `TextureChannel.R` → RRRA). Defaults to `TextureChannel.RGBA` (no swizzle).\n * @param colorSpace - Optional color space. When `TextureColorSpace.SRGB`, the sampled RGB channels\n * are linearized before use. Defaults to `TextureColorSpace.Linear`.\n * @returns An operand that evaluates to the sampled texture value\n */\nexport function CreateTextureOperand(texture: Nullable<BaseTexture>, channel?: TextureChannel, colorSpace?: TextureColorSpace): ITextureProcessOperand {\n const op: ITextureProcessOperand = { texture };\n if (channel) {\n op.channel = channel;\n }\n if (colorSpace) {\n op.colorSpace = colorSpace;\n }\n return op;\n}\n\n/**\n * Create an operand from a constant RGBA factor with no texture.\n * @param factor - The constant RGBA value\n * @returns An operand that evaluates to the constant factor\n */\nexport function CreateFactorOperand(factor: Color4): ITextureProcessOperand {\n return { texture: null, factor };\n}\n\n/**\n * Create an operand from a texture multiplied by a constant RGBA factor.\n * This is the standard glTF pattern (e.g. baseColorTexture * baseColorFactor).\n * If `texture` is null, returns a factor-only operand.\n * @param texture - The texture to sample, or null to use the factor alone\n * @param factor - The constant factor to multiply by\n * @param channel - Optional channel selection. When set, the sampled value is swizzled before\n * factor multiplication (e.g. `TextureChannel.G` → GGGA, then multiplied by factor).\n * Defaults to `TextureChannel.RGBA` (no swizzle).\n * @param colorSpace - Optional color space. When `TextureColorSpace.SRGB`, the sampled RGB channels\n * are linearized before factor multiplication. Defaults to `TextureColorSpace.Linear`.\n * @returns An operand that evaluates to `sample(texture) * factor`, or `factor` if texture is null\n */\nexport function CreateTextureWithFactorOperand(texture: Nullable<BaseTexture>, factor: Color4, channel?: TextureChannel, colorSpace?: TextureColorSpace): ITextureProcessOperand {\n const op: ITextureProcessOperand = { texture, factor };\n if (channel) {\n op.channel = channel;\n }\n if (colorSpace) {\n op.colorSpace = colorSpace;\n }\n return op;\n}\n\n/**\n * @internal\n * Evaluate the effective constant Color4 of an operand.\n * When a texture-only operand omits factor, the implicit value is (1, 1, 1, 1).\n */\nfunction _EvalConstant(op: ITextureProcessOperand): Color4 {\n return op.factor ?? new Color4(1, 1, 1, 1);\n}\n\n/** @internal */\nfunction _MultiplyConstants(a: Color4, b: Color4): Color4 {\n return new Color4(a.r * b.r, a.g * b.g, a.b * b.b, a.a * b.a);\n}\n\n/** @internal */\nfunction _MaxConstants(a: Color4, b: Color4): Color4 {\n return new Color4(Math.max(a.r, b.r), Math.max(a.g, b.g), Math.max(a.b, b.b), Math.max(a.a, b.a));\n}\n\n/** @internal */\nfunction _LerpConstants(a: Color4, b: Color4, t: Color4): Color4 {\n return new Color4(a.r + (b.r - a.r) * t.r, a.g + (b.g - a.g) * t.g, a.b + (b.b - a.b) * t.b, a.a + (b.a - a.a) * t.a);\n}\n\n/**\n * @internal\n * Determine the output texture size from a list of operands, using the largest input texture.\n */\nfunction _ResolveOutputSize(operands: ITextureProcessOperand[]): TextureSize {\n let maxDim = 0;\n let result: TextureSize = 512;\n for (const op of operands) {\n if (op.texture) {\n const size = op.texture.getSize();\n const dim = Math.max(size.width, size.height);\n if (dim > maxDim) {\n maxDim = dim;\n result = size.width === size.height ? dim : size;\n }\n }\n }\n return result;\n}\n\n/**\n * @internal\n * Returns true when the texture has a non-identity UV transform (offset, scale, or rotation).\n */\nfunction _HasNonIdentityTransform(texture: BaseTexture): boolean {\n return !texture.getTextureMatrix().isIdentity();\n}\n\n/**\n * @internal\n * Returns true when every texture in the list shares the same UV transform matrix.\n * A single texture (or empty list) trivially satisfies this.\n */\nfunction _AllTransformsMatch(textures: BaseTexture[]): boolean {\n if (textures.length <= 1) {\n return true;\n }\n const ref = textures[0].getTextureMatrix();\n for (let i = 1; i < textures.length; i++) {\n if (!ref.equals(textures[i].getTextureMatrix())) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * @internal\n * Copy sampling metadata from a source texture onto the output ProceduralTexture.\n * `coordinatesIndex` and wrap modes are always copied.\n * When `includeTransform` is true the UV offset/scale/rotation are also copied\n * (used when all inputs share the same transform and it is propagated rather than baked).\n */\nfunction _CopyTextureMetadata(from: BaseTexture, to: ProceduralTexture, includeTransform: boolean): void {\n to.coordinatesIndex = from.coordinatesIndex;\n to.wrapU = from.wrapU;\n to.wrapV = from.wrapV;\n if (includeTransform) {\n const src = from as Texture;\n to.uOffset = src.uOffset ?? 0;\n to.vOffset = src.vOffset ?? 0;\n to.uScale = src.uScale ?? 1;\n to.vScale = src.vScale ?? 1;\n to.wAng = src.wAng ?? 0;\n }\n}\n\n/**\n * @internal\n * Return the shader define suffix for a TextureChannel (e.g. TextureChannel.R → \"R\").\n * Returns an empty string for RGBA (no swizzle needed).\n */\nfunction _ChannelDefine(channel: TextureChannel): string {\n switch (channel) {\n case TextureChannel.R:\n return \"R\";\n case TextureChannel.G:\n return \"G\";\n case TextureChannel.B:\n return \"B\";\n case TextureChannel.A:\n return \"A\";\n default:\n return \"\";\n }\n}\n\n/**\n * @internal\n * Apply a channel swizzle to a constant Color4, matching the GPU behaviour for TextureChannel.\n */\nfunction _ApplyChannelSwizzle(c: Color4, channel: TextureChannel): Color4 {\n switch (channel) {\n case TextureChannel.R:\n return new Color4(c.r, c.r, c.r, c.a);\n case TextureChannel.G:\n return new Color4(c.g, c.g, c.g, c.a);\n case TextureChannel.B:\n return new Color4(c.b, c.b, c.b, c.a);\n case TextureChannel.A:\n return new Color4(c.a, c.a, c.a, c.a);\n default:\n return c;\n }\n}\n\n/**\n * @internal\n * Build the OP_INVERT define plus per-channel INVERT_R/G/B/A defines from an ChannelMask bitmask.\n */\nfunction _BuildInvertDefines(channels: ChannelMask): string[] {\n const defines: string[] = [\"OP_INVERT\"];\n if (channels & ChannelMask.R) {\n defines.push(\"INVERT_R\");\n }\n if (channels & ChannelMask.G) {\n defines.push(\"INVERT_G\");\n }\n if (channels & ChannelMask.B) {\n defines.push(\"INVERT_B\");\n }\n if (channels & ChannelMask.A) {\n defines.push(\"INVERT_A\");\n }\n return defines;\n}\n\n/**\n * @internal\n * Build OUTPUT_MASK_X_ZERO / OUTPUT_MASK_A_ONE defines for excluded channels.\n * Channels present in the mask pass through; excluded channels get defaults (0.0 for RGB, 1.0 for A).\n * Returns an empty array for ChannelMask.RGBA (no masking needed).\n */\nfunction _BuildOutputChannelMaskDefines(mask: ChannelMask): string[] {\n const defines: string[] = [];\n if (!(mask & ChannelMask.R)) {\n defines.push(\"OUTPUT_MASK_R_ZERO\");\n }\n if (!(mask & ChannelMask.G)) {\n defines.push(\"OUTPUT_MASK_G_ZERO\");\n }\n if (!(mask & ChannelMask.B)) {\n defines.push(\"OUTPUT_MASK_B_ZERO\");\n }\n if (!(mask & ChannelMask.A)) {\n defines.push(\"OUTPUT_MASK_A_ONE\");\n }\n return defines;\n}\n\n/**\n * @internal\n * Apply a ChannelMask to a constant Color4: included channels pass through,\n * excluded color channels become 0, excluded alpha becomes 1.\n */\nfunction _ApplyOutputChannelMask(c: Color4, mask: ChannelMask): Color4 {\n return new Color4(mask & ChannelMask.R ? c.r : 0, mask & ChannelMask.G ? c.g : 0, mask & ChannelMask.B ? c.b : 0, mask & ChannelMask.A ? c.a : 1);\n}\n\n/**\n * @internal\n * Build shader defines for a standard A/B operand.\n * When `bakeTransform` is true and the texture has a non-identity UV transform,\n * the OPERAND_X_MATRIX define is emitted so the shader applies the matrix when sampling.\n */\nfunction _BuildOperandDefines(operand: ITextureProcessOperand, prefix: \"A\" | \"B\", bakeTransform: boolean): string[] {\n const defines: string[] = [];\n if (operand.texture) {\n defines.push(`OPERAND_${prefix}_TEXTURE`);\n if (bakeTransform && _HasNonIdentityTransform(operand.texture)) {\n defines.push(`OPERAND_${prefix}_MATRIX`);\n }\n if (operand.colorSpace) {\n defines.push(`OPERAND_${prefix}_SRGB`);\n }\n if (operand.channel) {\n defines.push(`OPERAND_${prefix}_CHANNEL_${_ChannelDefine(operand.channel)}`);\n }\n }\n if (operand.factor !== undefined || !operand.texture) {\n defines.push(`OPERAND_${prefix}_FACTOR`);\n }\n return defines;\n}\n\n/**\n * @internal\n * Build shader defines for the lerp blend operand.\n * When `bakeTransform` is true and the texture has a non-identity UV transform,\n * the LERP_T_MATRIX define is emitted.\n */\nfunction _BuildLerpBlendDefines(t: ITextureProcessOperand, bakeTransform: boolean): string[] {\n const defines: string[] = [];\n if (t.texture) {\n defines.push(\"LERP_T_TEXTURE\");\n if (bakeTransform && _HasNonIdentityTransform(t.texture)) {\n defines.push(\"LERP_T_MATRIX\");\n }\n if (t.factor !== undefined) {\n defines.push(\"LERP_T_FACTOR\");\n }\n if (t.colorSpace) {\n defines.push(\"LERP_T_SRGB\");\n }\n if (t.channel) {\n defines.push(`LERP_T_CHANNEL_${_ChannelDefine(t.channel)}`);\n }\n }\n // factor-only: no additional defines needed; the shader uses factorT when LERP_T_TEXTURE is absent.\n return defines;\n}\n\n/**\n * @internal\n * Set uniforms and textures for a standard A/B operand on a procedural texture.\n * When `bakeTransform` is true and the texture has a non-identity UV matrix,\n * that matrix is uploaded as `<textureName>Matrix` for the shader to apply when sampling.\n */\nfunction _SetOperandUniforms(pt: ProceduralTexture, operand: ITextureProcessOperand, textureName: string, factorName: string, bakeTransform: boolean): void {\n if (operand.texture) {\n pt.setTexture(textureName, operand.texture as Texture);\n if (bakeTransform && _HasNonIdentityTransform(operand.texture)) {\n pt.setMatrix(`${textureName}Matrix`, operand.texture.getTextureMatrix());\n }\n }\n const needsFactor = operand.factor !== undefined || !operand.texture;\n if (needsFactor) {\n pt.setColor4(factorName, _EvalConstant(operand));\n }\n}\n\n/**\n * @internal\n * Set uniforms and textures for the lerp blend operand.\n * When `bakeTransform` is true and the texture has a non-identity UV matrix,\n * that matrix is uploaded as `textureTMatrix`.\n */\nfunction _SetLerpBlendUniforms(pt: ProceduralTexture, t: ITextureProcessOperand, bakeTransform: boolean): void {\n if (t.texture) {\n pt.setTexture(\"textureT\", t.texture as Texture);\n if (bakeTransform && _HasNonIdentityTransform(t.texture)) {\n pt.setMatrix(\"textureTMatrix\", t.texture.getTextureMatrix());\n }\n if (t.factor !== undefined) {\n pt.setColor4(\"factorT\", t.factor);\n }\n } else {\n pt.setColor4(\"factorT\", _EvalConstant(t));\n }\n}\n\n/**\n * @internal\n * Create a textureProcessor procedural texture with the given defines. The returned texture\n * is not yet rendered — uniforms must be set on it before calling _RenderAsync.\n */\nfunction _CreateProcessorTexture(\n name: string,\n defines: string[],\n outputSize: TextureSize,\n scene: Scene,\n outputColorSpace: TextureColorSpace = TextureColorSpace.Linear\n): ProceduralTexture {\n const options: IProceduralTextureCreationOptions = {\n type: Constants.TEXTURETYPE_UNSIGNED_BYTE,\n format: Constants.TEXTUREFORMAT_RGBA,\n samplingMode: Constants.TEXTURE_BILINEAR_SAMPLINGMODE,\n generateDepthBuffer: false,\n generateMipMaps: false,\n gammaSpace: outputColorSpace === TextureColorSpace.SRGB,\n shaderLanguage: scene.getEngine().isWebGPU ? ShaderLanguage.WGSL : ShaderLanguage.GLSL,\n extraInitializationsAsync: async () => {\n if (scene.getEngine().isWebGPU) {\n await Promise.all([import(\"../../ShadersWGSL/textureProcessor.fragment\")]);\n } else {\n await Promise.all([import(\"../../Shaders/textureProcessor.fragment\")]);\n }\n },\n // Opt out of scene-managed rendering. _shouldRender() would re-render the texture\n // on the first scene frame regardless of refreshRate (because _currentRefreshId starts\n // at -1 and is only advanced by _shouldRender() itself, not by a direct render() call).\n // That re-render would sample already-disposed input textures, producing blank output.\n skipSceneRegistration: true,\n };\n\n const pt = new ProceduralTexture(name, outputSize, _ShaderName, scene, options);\n pt.refreshRate = -1; // render on demand only\n pt.defines = defines.length > 0 ? \"#define \" + defines.join(\"\\n#define \") + \"\\n\" : \"\";\n return pt;\n}\n\n/**\n * @internal\n * Wait for a procedural texture's shader to compile then render it. Uniforms must be set\n * on the texture before calling this.\n */\nasync function _RenderAsync(pt: ProceduralTexture): Promise<void> {\n return await new Promise<void>((resolve, reject) => {\n pt.executeWhenReady(() => {\n try {\n pt.render();\n resolve();\n } catch (error) {\n reject(error instanceof Error ? error : new Error(String(error)));\n }\n });\n });\n}\n\n/**\n * Multiply two texture operands together, component-wise: `result = a * b`.\n *\n * Each operand can be a texture, a constant factor, or a texture scaled by a factor.\n * This is useful for applying glTF-style factors to textures (e.g. `baseColorTexture * baseColorFactor`),\n * or for modulating one texture by another.\n *\n * If both operands are constant (no textures), the multiplication is performed on the CPU and\n * the result is returned as a factor-only operand with no texture allocated.\n *\n * When operands are results of previous operations (i.e. they carry a `dispose` function),\n * their intermediate textures are automatically released after the GPU pass completes.\n *\n * @param name - Name for the resulting procedural texture (used only when a GPU pass is needed)\n * @param a - First operand\n * @param b - Second operand\n * @param scene - Scene to create the texture in (used only when a GPU pass is needed)\n * @param outputColorSpace - Optional output color space. When `TextureColorSpace.SRGB`, the linear\n * result is converted to sRGB (IEC 61966-2-1) before being written. Defaults to `TextureColorSpace.Linear`.\n * @param outputChannelMask - Optional bitmask of channels to write. Excluded color channels are set to\n * `0.0`; excluded alpha is set to `1.0`. Defaults to `ChannelMask.RGBA` (all channels written).\n * @returns An operand whose `texture` holds the GPU result, or whose `factor` holds the CPU-folded constant\n */\nexport async function MultiplyTexturesAsync(\n name: string,\n a: ITextureProcessOperand,\n b: ITextureProcessOperand,\n scene: Scene,\n outputColorSpace?: TextureColorSpace,\n outputChannelMask?: ChannelMask\n): Promise<ITextureProcessOperand> {\n if (!a.texture && !b.texture) {\n const factor = _MultiplyConstants(_EvalConstant(a), _EvalConstant(b));\n return { texture: null, factor: outputChannelMask ? _ApplyOutputChannelMask(factor, outputChannelMask) : factor };\n }\n\n const allTextures: BaseTexture[] = [];\n if (a.texture) {\n allTextures.push(a.texture);\n }\n if (b.texture) {\n allTextures.push(b.texture);\n }\n const canPropagate = _AllTransformsMatch(allTextures);\n const bakeTransform = !canPropagate;\n\n const defines = [\n ..._BuildOperandDefines(a, \"A\", bakeTransform),\n ..._BuildOperandDefines(b, \"B\", bakeTransform),\n ...(outputChannelMask ? _BuildOutputChannelMaskDefines(outputChannelMask) : []),\n ];\n if (outputColorSpace) {\n defines.push(\"OUTPUT_SRGB\");\n }\n const pt = _CreateProcessorTexture(name, defines, _ResolveOutputSize([a, b]), scene, outputColorSpace);\n _SetOperandUniforms(pt, a, \"textureA\", \"factorA\", bakeTransform);\n _SetOperandUniforms(pt, b, \"textureB\", \"factorB\", bakeTransform);\n try {\n await _RenderAsync(pt);\n } catch (error) {\n a.dispose?.();\n b.dispose?.();\n throw error;\n }\n\n a.dispose?.();\n b.dispose?.();\n\n _CopyTextureMetadata(allTextures[0], pt, canPropagate);\n const result: ITextureProcessOperand = { texture: pt, dispose: () => pt.dispose() };\n if (outputColorSpace) {\n result.colorSpace = outputColorSpace;\n }\n return result;\n}\n\n/**\n * Take the component-wise maximum of two texture operands: `result = max(a, b)`.\n *\n * Each operand can be a texture, a constant factor, or a texture scaled by a factor.\n * Useful for operations such as combining ambient occlusion maps or taking the\n * brightest contribution from two sources.\n *\n * If both operands are constant (no textures), the operation is performed on the CPU and\n * the result is returned as a factor-only operand with no texture allocated.\n *\n * When operands are results of previous operations (i.e. they carry a `dispose` function),\n * their intermediate textures are automatically released after the GPU pass completes.\n *\n * @param name - Name for the resulting procedural texture (used only when a GPU pass is needed)\n * @param a - First operand\n * @param b - Second operand\n * @param scene - Scene to create the texture in (used only when a GPU pass is needed)\n * @param outputColorSpace - Optional output color space. When `TextureColorSpace.SRGB`, the linear\n * result is converted to sRGB (IEC 61966-2-1) before being written. Defaults to `TextureColorSpace.Linear`.\n * @param outputChannelMask - Optional bitmask of channels to write. Excluded color channels are set to\n * `0.0`; excluded alpha is set to `1.0`. Defaults to `ChannelMask.RGBA` (all channels written).\n * @returns An operand whose `texture` holds the GPU result, or whose `factor` holds the CPU-folded constant\n */\nexport async function MaxTexturesAsync(\n name: string,\n a: ITextureProcessOperand,\n b: ITextureProcessOperand,\n scene: Scene,\n outputColorSpace?: TextureColorSpace,\n outputChannelMask?: ChannelMask\n): Promise<ITextureProcessOperand> {\n if (!a.texture && !b.texture) {\n const factor = _MaxConstants(_EvalConstant(a), _EvalConstant(b));\n return { texture: null, factor: outputChannelMask ? _ApplyOutputChannelMask(factor, outputChannelMask) : factor };\n }\n\n const allTextures: BaseTexture[] = [];\n if (a.texture) {\n allTextures.push(a.texture);\n }\n if (b.texture) {\n allTextures.push(b.texture);\n }\n const canPropagate = _AllTransformsMatch(allTextures);\n const bakeTransform = !canPropagate;\n\n const defines = [\n \"OP_MAX\",\n ..._BuildOperandDefines(a, \"A\", bakeTransform),\n ..._BuildOperandDefines(b, \"B\", bakeTransform),\n ...(outputChannelMask ? _BuildOutputChannelMaskDefines(outputChannelMask) : []),\n ];\n if (outputColorSpace) {\n defines.push(\"OUTPUT_SRGB\");\n }\n const pt = _CreateProcessorTexture(name, defines, _ResolveOutputSize([a, b]), scene, outputColorSpace);\n _SetOperandUniforms(pt, a, \"textureA\", \"factorA\", bakeTransform);\n _SetOperandUniforms(pt, b, \"textureB\", \"factorB\", bakeTransform);\n try {\n await _RenderAsync(pt);\n } catch (error) {\n a.dispose?.();\n b.dispose?.();\n throw error;\n }\n\n a.dispose?.();\n b.dispose?.();\n\n _CopyTextureMetadata(allTextures[0], pt, canPropagate);\n const result: ITextureProcessOperand = { texture: pt, dispose: () => pt.dispose() };\n if (outputColorSpace) {\n result.colorSpace = outputColorSpace;\n }\n return result;\n}\n\n/**\n * Linearly interpolate between two texture operands: `result = mix(a, b, t)`.\n *\n * Each operand can be a texture, a constant factor, or a texture scaled by a factor.\n * The `t` operand controls the blend weight per texel, per channel — a value of 0 returns `a`,\n * a value of 1 returns `b`. Use a grayscale texture or a scalar `Color4(v, v, v, v)` for\n * uniform blending across all channels.\n *\n * If all three operands are constant (no textures), the interpolation is performed on the CPU and\n * the result is returned as a factor-only operand with no texture allocated.\n *\n * When operands are results of previous operations (i.e. they carry a `dispose` function),\n * their intermediate textures are automatically released after the GPU pass completes.\n *\n * @param name - Name for the resulting procedural texture (used only when a GPU pass is needed)\n * @param a - Start value operand (returned when t = 0)\n * @param b - End value operand (returned when t = 1)\n * @param t - Blend weight operand. Each channel independently controls the blend for the corresponding output channel.\n * @param scene - Scene to create the texture in (used only when a GPU pass is needed)\n * @param outputColorSpace - Optional output color space. When `TextureColorSpace.SRGB`, the linear\n * result is converted to sRGB (IEC 61966-2-1) before being written. Defaults to `TextureColorSpace.Linear`.\n * @param outputChannelMask - Optional bitmask of channels to write. Excluded color channels are set to\n * `0.0`; excluded alpha is set to `1.0`. Defaults to `ChannelMask.RGBA` (all channels written).\n * @returns An operand whose `texture` holds the GPU result, or whose `factor` holds the CPU-folded constant\n */\nexport async function LerpTexturesAsync(\n name: string,\n a: ITextureProcessOperand,\n b: ITextureProcessOperand,\n t: ITextureProcessOperand,\n scene: Scene,\n outputColorSpace?: TextureColorSpace,\n outputChannelMask?: ChannelMask\n): Promise<ITextureProcessOperand> {\n if (!a.texture && !b.texture && !t.texture) {\n const factor = _LerpConstants(_EvalConstant(a), _EvalConstant(b), _EvalConstant(t));\n return { texture: null, factor: outputChannelMask ? _ApplyOutputChannelMask(factor, outputChannelMask) : factor };\n }\n\n const allTextures: BaseTexture[] = [];\n if (a.texture) {\n allTextures.push(a.texture);\n }\n if (b.texture) {\n allTextures.push(b.texture);\n }\n if (t.texture) {\n allTextures.push(t.texture);\n }\n const canPropagate = _AllTransformsMatch(allTextures);\n const bakeTransform = !canPropagate;\n\n const defines = [\n \"OP_LERP\",\n ..._BuildOperandDefines(a, \"A\", bakeTransform),\n ..._BuildOperandDefines(b, \"B\", bakeTransform),\n ..._BuildLerpBlendDefines(t, bakeTransform),\n ...(outputChannelMask ? _BuildOutputChannelMaskDefines(outputChannelMask) : []),\n ];\n if (outputColorSpace) {\n defines.push(\"OUTPUT_SRGB\");\n }\n const pt = _CreateProcessorTexture(name, defines, _ResolveOutputSize([a, b, t]), scene, outputColorSpace);\n _SetOperandUniforms(pt, a, \"textureA\", \"factorA\", bakeTransform);\n _SetOperandUniforms(pt, b, \"textureB\", \"factorB\", bakeTransform);\n _SetLerpBlendUniforms(pt, t, bakeTransform);\n try {\n await _RenderAsync(pt);\n } catch (error) {\n a.dispose?.();\n b.dispose?.();\n t.dispose?.();\n throw error;\n }\n\n a.dispose?.();\n b.dispose?.();\n t.dispose?.();\n\n _CopyTextureMetadata(allTextures[0], pt, canPropagate);\n const result: ITextureProcessOperand = { texture: pt, dispose: () => pt.dispose() };\n if (outputColorSpace) {\n result.colorSpace = outputColorSpace;\n }\n return result;\n}\n\n/**\n * Invert selected channels of a texture operand: `result[ch] = 1 - input[ch]`.\n *\n * The `channels` bitmask selects which channels are inverted; unselected channels pass through\n * unchanged. Use `ChannelMask.RGB` for the common roughness↔smoothness conversion, or\n * `ChannelMask.RGBA` (the default) to invert the entire texture.\n *\n * This is a unary operation — only operand A is used. Any `colorSpace` or `channel` properties\n * on the input operand are honoured (sRGB linearization and channel swizzle applied before\n * the invert).\n *\n * If the input is constant (no texture), the invert is performed on the CPU.\n *\n * When the input is the result of a previous operation (i.e. it carries a `dispose` function),\n * its intermediate texture is automatically released after the GPU pass completes.\n *\n * @param name - Name for the resulting procedural texture (used only when a GPU pass is needed)\n * @param input - Operand to invert\n * @param scene - Scene to create the texture in (used only when a GPU pass is needed)\n * @param channels - Bitmask of channels to invert. Defaults to `ChannelMask.RGBA`.\n * @param outputColorSpace - Optional output color space. When `TextureColorSpace.SRGB`, the linear\n * result is converted to sRGB (IEC 61966-2-1) before being written. Defaults to `TextureColorSpace.Linear`.\n * @param outputChannelMask - Optional bitmask of channels to write. Excluded color channels are set to\n * `0.0`; excluded alpha is set to `1.0`. Defaults to `ChannelMask.RGBA` (all channels written).\n * @returns An operand whose `texture` holds the GPU result, or whose `factor` holds the CPU-folded constant\n */\nexport async function InvertTextureAsync(\n name: string,\n input: ITextureProcessOperand,\n scene: Scene,\n channels: ChannelMask = ChannelMask.RGBA,\n outputColorSpace?: TextureColorSpace,\n outputChannelMask?: ChannelMask\n): Promise<ITextureProcessOperand> {\n if (!input.texture) {\n const c = _EvalConstant(input);\n const factor = new Color4(\n channels & ChannelMask.R ? 1 - c.r : c.r,\n channels & ChannelMask.G ? 1 - c.g : c.g,\n channels & ChannelMask.B ? 1 - c.b : c.b,\n channels & ChannelMask.A ? 1 - c.a : c.a\n );\n return { texture: null, factor: outputChannelMask ? _ApplyOutputChannelMask(factor, outputChannelMask) : factor };\n }\n\n // Single input: UV transform is always propagated (no bake needed).\n const defines = [..._BuildOperandDefines(input, \"A\", false), ..._BuildInvertDefines(channels), ...(outputChannelMask ? _BuildOutputChannelMaskDefines(outputChannelMask) : [])];\n if (outputColorSpace) {\n defines.push(\"OUTPUT_SRGB\");\n }\n const pt = _CreateProcessorTexture(name, defines, _ResolveOutputSize([input]), scene, outputColorSpace);\n _SetOperandUniforms(pt, input, \"textureA\", \"factorA\", false);\n try {\n await _RenderAsync(pt);\n } catch (error) {\n input.dispose?.();\n throw error;\n }\n\n input.dispose?.();\n\n _CopyTextureMetadata(input.texture, pt, true);\n const result: ITextureProcessOperand = { texture: pt, dispose: () => pt.dispose() };\n if (outputColorSpace) {\n result.colorSpace = outputColorSpace;\n }\n return result;\n}\n\n/**\n * Extract the per-texel maximum channel value from a texture and broadcast it to all output\n * channels, producing a single-value (greyscale) texture in a single GPU pass.\n *\n * For each texel, computes `max(r, g, b)` — or `max(r, g, b, a)` when `includeAlpha` is true —\n * and writes that scalar to the output:\n * - `includeAlpha = false` (default): output is `(m, m, m, a)` where `m = max(r, g, b)`\n * - `includeAlpha = true`: output is `(m, m, m, m)` where `m = max(r, g, b, a)`\n *\n * This is more efficient than chaining `ExtractChannelAsync` calls through `MaxTexturesAsync`,\n * which would require multiple intermediate textures and GPU passes.\n *\n * Any `colorSpace` or `channel` properties on the input operand are honoured (sRGB linearization\n * and channel swizzle applied before the max reduction).\n *\n * If the input is constant (no texture), the reduction is performed on the CPU.\n *\n * When the input is the result of a previous operation (i.e. it carries a `dispose` function),\n * its intermediate texture is automatically released after the GPU pass completes.\n *\n * @param name - Name for the resulting procedural texture (used only when a GPU pass is needed)\n * @param input - Operand to reduce\n * @param scene - Scene to create the texture in (used only when a GPU pass is needed)\n * @param includeAlpha - When true, alpha participates in the max and is also set to the result.\n * Defaults to false (alpha is preserved from the input).\n * @param outputColorSpace - Optional output color space. When `TextureColorSpace.SRGB`, the linear\n * result is converted to sRGB (IEC 61966-2-1) before being written. Defaults to `TextureColorSpace.Linear`.\n * @param outputChannelMask - Optional bitmask of channels to write. Excluded color channels are set to\n * `0.0`; excluded alpha is set to `1.0`. Defaults to `ChannelMask.RGBA` (all channels written).\n * @returns An operand whose `texture` holds the GPU result, or whose `factor` holds the CPU-folded constant\n */\nexport async function ExtractMaxChannelAsync(\n name: string,\n input: ITextureProcessOperand,\n scene: Scene,\n includeAlpha: boolean = false,\n outputColorSpace?: TextureColorSpace,\n outputChannelMask?: ChannelMask\n): Promise<ITextureProcessOperand> {\n if (!input.texture) {\n const c = _EvalConstant(input);\n const m = includeAlpha ? Math.max(c.r, c.g, c.b, c.a) : Math.max(c.r, c.g, c.b);\n const factor = new Color4(m, m, m, includeAlpha ? m : c.a);\n return { texture: null, factor: outputChannelMask ? _ApplyOutputChannelMask(factor, outputChannelMask) : factor };\n }\n\n // Single input: UV transform is always propagated (no bake needed).\n const defines = [..._BuildOperandDefines(input, \"A\", false), \"OP_CHANNEL_MAX\", ...(outputChannelMask ? _BuildOutputChannelMaskDefines(outputChannelMask) : [])];\n if (includeAlpha) {\n defines.push(\"CHANNEL_MAX_INCLUDE_ALPHA\");\n }\n if (outputColorSpace) {\n defines.push(\"OUTPUT_SRGB\");\n }\n const pt = _CreateProcessorTexture(name, defines, _ResolveOutputSize([input]), scene, outputColorSpace);\n _SetOperandUniforms(pt, input, \"textureA\", \"factorA\", false);\n try {\n await _RenderAsync(pt);\n } catch (error) {\n input.dispose?.();\n throw error;\n }\n\n input.dispose?.();\n\n _CopyTextureMetadata(input.texture, pt, true);\n const result: ITextureProcessOperand = { texture: pt, dispose: () => pt.dispose() };\n if (outputColorSpace) {\n result.colorSpace = outputColorSpace;\n }\n return result;\n}\n\n/**\n * Extract a single channel from a texture and broadcast it to RGB (or all four components for\n * `TextureChannel.A`), producing a new texture. This is a convenience wrapper over\n * `MultiplyTexturesAsync` with a `(1,1,1,1)` factor and the requested channel swizzle applied\n * to the input.\n *\n * Swizzle results per channel:\n * - `TextureChannel.R` → (r, r, r, a)\n * - `TextureChannel.G` → (g, g, g, a)\n * - `TextureChannel.B` → (b, b, b, a)\n * - `TextureChannel.A` → (a, a, a, a)\n *\n * If the input is constant (no texture), the swizzle is applied on the CPU.\n *\n * Any `colorSpace` property on the input operand is honoured (sRGB linearization applied before\n * the swizzle). Any existing `channel` on the input is replaced by the `channel` argument.\n *\n * When the input is the result of a previous operation (i.e. it carries a `dispose` function),\n * its intermediate texture is automatically released after the GPU pass completes.\n *\n * @param name - Name for the resulting procedural texture (used only when a GPU pass is needed)\n * @param input - Operand to extract the channel from\n * @param channel - The channel to extract and broadcast\n * @param scene - Scene to create the texture in (used only when a GPU pass is needed)\n * @param outputColorSpace - Optional output color space. When `TextureColorSpace.SRGB`, the linear\n * result is converted to sRGB (IEC 61966-2-1) before being written. Defaults to `TextureColorSpace.Linear`.\n * @param outputChannelMask - Optional bitmask of channels to write. Excluded color channels are set to\n * `0.0`; excluded alpha is set to `1.0`. Defaults to `ChannelMask.RGBA` (all channels written).\n * @returns An operand whose `texture` holds the GPU result, or whose `factor` holds the CPU-folded constant\n */\nexport async function ExtractChannelAsync(\n name: string,\n input: ITextureProcessOperand,\n channel: TextureChannel,\n scene: Scene,\n outputColorSpace?: TextureColorSpace,\n outputChannelMask?: ChannelMask\n): Promise<ITextureProcessOperand> {\n if (!input.texture) {\n const swizzled = _ApplyChannelSwizzle(_EvalConstant(input), channel);\n return { texture: null, factor: outputChannelMask ? _ApplyOutputChannelMask(swizzled, outputChannelMask) : swizzled };\n }\n return await MultiplyTexturesAsync(name, { ...input, channel }, CreateFactorOperand(new Color4(1, 1, 1, 1)), scene, outputColorSpace, outputChannelMask);\n}\n"]}
1
+ {"version":3,"file":"textureProcessor.js","sourceRoot":"","sources":["../../../../../dev/core/src/Materials/Textures/textureProcessor.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAMzE,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAEpD,MAAM,WAAW,GAAG,kBAAkB,CAAC;AAEvC;;;;GAIG;AACH,MAAM,CAAN,IAAY,iBAKX;AALD,WAAY,iBAAiB;IACzB,gFAAgF;IAChF,6DAAU,CAAA;IACV,qGAAqG;IACrG,yDAAQ,CAAA;AACZ,CAAC,EALW,iBAAiB,KAAjB,iBAAiB,QAK5B;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAN,IAAY,WAaX;AAbD,WAAY,WAAW;IACnB,gDAAgD;IAChD,uCAAO,CAAA;IACP,kDAAkD;IAClD,uCAAO,CAAA;IACP,iDAAiD;IACjD,uCAAO,CAAA;IACP,kDAAkD;IAClD,uCAAO,CAAA;IACP,yDAAyD;IACzD,2CAAS,CAAA;IACT,+DAA+D;IAC/D,8CAAU,CAAA;AACd,CAAC,EAbW,WAAW,KAAX,WAAW,QAatB;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,CAAN,IAAY,cAWX;AAXD,WAAY,cAAc;IACtB,kDAAkD;IAClD,mDAAQ,CAAA;IACR,8DAA8D;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IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;QACjB,MAAM,QAAQ,GAAG,oBAAoB,CAAC,aAAa,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,CAAC;QACrE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,iBAAiB,CAAC,CAAC,CAAC,uBAAuB,CAAC,QAAQ,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;IAC1H,CAAC;IACD,OAAO,MAAM,qBAAqB,CAAC,IAAI,EAAE,EAAE,GAAG,KAAK,EAAE,OAAO,EAAE,EAAE,mBAAmB,CAAC,IAAI,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,aAAa,CAAC,CAAC;AAC5K,CAAC","sourcesContent":["import { type Scene } from \"../../scene\";\nimport { type IProceduralTextureCreationOptions } from \"core/Materials/Textures/Procedurals/proceduralTexture\";\nimport { ProceduralTexture } from \"./Procedurals/proceduralTexture.pure\";\nimport { type BaseTexture } from \"./baseTexture\";\nimport { type Nullable } from \"../../types\";\nimport { type Texture } from \"./texture\";\nimport { type TextureSize } from \"./textureCreationOptions\";\nimport { ShaderLanguage } from \"core/Materials/shaderLanguage\";\nimport { Constants } from \"../../Engines/constants\";\nimport { Color4 } from \"core/Maths/math.color.pure\";\n\nconst _ShaderName = \"textureProcessor\";\n\n/**\n * Specifies the color space of a texture operand.\n * When `sRGB` is set the sampled RGB values are converted to linear space before any channel\n * swizzle, factor multiplication, or arithmetic operation. Alpha is always treated as linear.\n */\nexport enum TextureColorSpace {\n /** Texture data is already in linear space (default). No conversion applied. */\n Linear = 0,\n /** Texture data is in sRGB (gamma) space. RGB channels are linearized (IEC 61966-2-1) before use. */\n SRGB = 1,\n}\n\n/**\n * Bitmask controlling which channels are written to the output texture by a processing operation.\n * Channels excluded from the mask receive a sensible default: `0.0` for RGB channels, `1.0` for alpha.\n * Use `ChannelMask.RGBA` (or omit the parameter) to pass all channels through unchanged.\n *\n * | Flag | Channels written | Excluded channels |\n * |------|-----------------|-------------------|\n * | R | red | G=0, B=0, A=1 |\n * | G | green | R=0, B=0, A=1 |\n * | B | blue | R=0, G=0, A=1 |\n * | A | alpha | R=0, G=0, B=0 |\n * | RGB | red, green, blue | A=1 |\n * | RGBA | all four | (none) |\n */\nexport enum ChannelMask {\n /** Pass only the red channel; G=0, B=0, A=1. */\n R = 0x1,\n /** Pass only the green channel; R=0, B=0, A=1. */\n G = 0x2,\n /** Pass only the blue channel; R=0, G=0, A=1. */\n B = 0x4,\n /** Pass only the alpha channel; R=0, G=0, B=0. */\n A = 0x8,\n /** Pass red, green, and blue; alpha is forced to 1.0. */\n RGB = 0x7,\n /** Pass all four channels unchanged (default — no masking). */\n RGBA = 0xf,\n}\n\n/**\n * Specifies which channel of a texture to read for an operation.\n * When a single channel is selected its scalar value is broadcast to RGB; alpha\n * is either preserved from the original sample or replicated when `A` is chosen.\n *\n * | Value | Swizzle |\n * |-------|---------|\n * | RGBA | (r, g, b, a) — no swizzle (default) |\n * | R | (r, r, r, a) |\n * | G | (g, g, g, a) |\n * | B | (b, b, b, a) |\n * | A | (a, a, a, a) |\n */\nexport enum TextureChannel {\n /** Use all four channels as sampled (default). */\n RGBA = 0,\n /** Broadcast the red channel to RGB; preserve alpha: RRRA. */\n R = 1,\n /** Broadcast the green channel to RGB; preserve alpha: GGGA. */\n G = 2,\n /** Broadcast the blue channel to RGB; preserve alpha: BBBA. */\n B = 3,\n /** Broadcast the alpha channel to all four components: AAAA. */\n A = 4,\n}\n\n/**\n * Represents an operand for a texture processing operation, or the result of one.\n *\n * As an operand, the value evaluates to a vec4 per texel:\n * - `texture` only → `sample(texture)`\n * - `factor` only → `factor` (constant)\n * - both → `sample(texture) * factor`\n *\n * As a result returned by a processing function:\n * - `texture` holds the GPU-processed output; `dispose()` releases it when no longer needed.\n * - `factor` holds a CPU-folded constant when all inputs were texture-free; no `dispose` is set.\n *\n * Results are directly usable as operands to subsequent operations. When a result with a\n * `dispose` function is passed as an operand, the next operation automatically calls `dispose`\n * after consuming it, so intermediate textures are cleaned up without manual tracking.\n *\n * At least one of `texture` or `factor` must be provided when used as an operand.\n */\nexport interface ITextureProcessOperand {\n /**\n * Texture to sample. When combined with `factor`, the sampled value is multiplied\n * component-wise by the factor. Null when the operand or result is a constant.\n */\n texture: Nullable<BaseTexture>;\n /**\n * Optional constant RGBA factor. If `texture` is also set, the sampled value is\n * multiplied by this factor. If `texture` is not set, this becomes the constant output.\n * When omitted and `texture` is set, defaults to (1, 1, 1, 1) — no scaling.\n */\n factor?: Color4;\n /**\n * Optional channel selection applied to the sampled texture value before any factor\n * multiplication. When omitted or set to `TextureChannel.RGBA`, the sample is used\n * as-is. When set to a single channel, that channel's scalar is broadcast to RGB\n * (or all four components for `TextureChannel.A`). Only meaningful when `texture` is set.\n */\n channel?: TextureChannel;\n\n /**\n * Color space of the texture data. When set to `TextureColorSpace.SRGB`, the sampled\n * RGB channels are converted from sRGB to linear space (IEC 61966-2-1) before the channel\n * swizzle, factor multiplication, and any arithmetic operation. Alpha is always linear.\n * Defaults to `TextureColorSpace.Linear` (no conversion). Only meaningful when `texture` is set.\n */\n colorSpace?: TextureColorSpace;\n\n /**\n * Disposes the texture produced by a processing operation. Only present on results\n * returned by the texture processing functions. When a result is passed as an operand\n * to the next operation in a chain, its `dispose` is called automatically after the\n * GPU pass completes. Call `dispose` explicitly on the final result when the texture\n * is no longer needed (or skip it if transferring ownership to a material).\n */\n dispose?: () => void;\n}\n\n/**\n * Controls the GPU texture created by a texture processing operation.\n */\nexport interface ITextureProcessorOutputOptions {\n /**\n * Texture type used by the render target. Defaults to `Constants.TEXTURETYPE_UNSIGNED_BYTE`.\n */\n textureType?: number;\n /**\n * Sampling mode used by the output texture. Defaults to `Constants.TEXTURE_BILINEAR_SAMPLINGMODE`.\n */\n samplingMode?: number;\n /**\n * Whether mipmaps are generated for the output texture. Defaults to `false`.\n */\n generateMipMaps?: boolean;\n}\n\n/**\n * Create an operand from a texture alone (no constant factor scaling).\n * @param texture - The texture to sample, or null to produce an identity (1,1,1,1) constant operand\n * @param channel - Optional channel selection. When set, the sampled value is swizzled before use\n * (e.g. `TextureChannel.R` → RRRA). Defaults to `TextureChannel.RGBA` (no swizzle).\n * @param colorSpace - Optional color space. When `TextureColorSpace.SRGB`, the sampled RGB channels\n * are linearized before use. Defaults to `TextureColorSpace.Linear`.\n * @returns An operand that evaluates to the sampled texture value\n */\nexport function CreateTextureOperand(texture: Nullable<BaseTexture>, channel?: TextureChannel, colorSpace?: TextureColorSpace): ITextureProcessOperand {\n const op: ITextureProcessOperand = { texture };\n if (channel) {\n op.channel = channel;\n }\n if (colorSpace) {\n op.colorSpace = colorSpace;\n }\n return op;\n}\n\n/**\n * Create an operand from a constant RGBA factor with no texture.\n * @param factor - The constant RGBA value\n * @returns An operand that evaluates to the constant factor\n */\nexport function CreateFactorOperand(factor: Color4): ITextureProcessOperand {\n return { texture: null, factor };\n}\n\n/**\n * Create an operand from a texture multiplied by a constant RGBA factor.\n * This is the standard glTF pattern (e.g. baseColorTexture * baseColorFactor).\n * If `texture` is null, returns a factor-only operand.\n * @param texture - The texture to sample, or null to use the factor alone\n * @param factor - The constant factor to multiply by\n * @param channel - Optional channel selection. When set, the sampled value is swizzled before\n * factor multiplication (e.g. `TextureChannel.G` → GGGA, then multiplied by factor).\n * Defaults to `TextureChannel.RGBA` (no swizzle).\n * @param colorSpace - Optional color space. When `TextureColorSpace.SRGB`, the sampled RGB channels\n * are linearized before factor multiplication. Defaults to `TextureColorSpace.Linear`.\n * @returns An operand that evaluates to `sample(texture) * factor`, or `factor` if texture is null\n */\nexport function CreateTextureWithFactorOperand(texture: Nullable<BaseTexture>, factor: Color4, channel?: TextureChannel, colorSpace?: TextureColorSpace): ITextureProcessOperand {\n const op: ITextureProcessOperand = { texture, factor };\n if (channel) {\n op.channel = channel;\n }\n if (colorSpace) {\n op.colorSpace = colorSpace;\n }\n return op;\n}\n\n/**\n * @internal\n * Evaluate the effective constant Color4 of an operand.\n * When a texture-only operand omits factor, the implicit value is (1, 1, 1, 1).\n */\nfunction _EvalConstant(op: ITextureProcessOperand): Color4 {\n return op.factor ?? new Color4(1, 1, 1, 1);\n}\n\n/** @internal */\nfunction _MultiplyConstants(a: Color4, b: Color4): Color4 {\n return new Color4(a.r * b.r, a.g * b.g, a.b * b.b, a.a * b.a);\n}\n\n/** @internal */\nfunction _MaxConstants(a: Color4, b: Color4): Color4 {\n return new Color4(Math.max(a.r, b.r), Math.max(a.g, b.g), Math.max(a.b, b.b), Math.max(a.a, b.a));\n}\n\n/** @internal */\nfunction _LerpConstants(a: Color4, b: Color4, t: Color4): Color4 {\n return new Color4(a.r + (b.r - a.r) * t.r, a.g + (b.g - a.g) * t.g, a.b + (b.b - a.b) * t.b, a.a + (b.a - a.a) * t.a);\n}\n\n/**\n * @internal\n * Determine the output texture size from a list of operands, using the largest input texture.\n */\nfunction _ResolveOutputSize(operands: ITextureProcessOperand[]): TextureSize {\n let maxDim = 0;\n let result: TextureSize = 512;\n for (const op of operands) {\n if (op.texture) {\n const size = op.texture.getSize();\n const dim = Math.max(size.width, size.height);\n if (dim > maxDim) {\n maxDim = dim;\n result = size.width === size.height ? dim : size;\n }\n }\n }\n return result;\n}\n\n/**\n * @internal\n * Returns true when the texture has a non-identity UV transform (offset, scale, or rotation).\n */\nfunction _HasNonIdentityTransform(texture: BaseTexture): boolean {\n return !texture.getTextureMatrix().isIdentity();\n}\n\n/**\n * @internal\n * Returns true when every texture in the list shares the same UV transform matrix.\n * A single texture (or empty list) trivially satisfies this.\n */\nfunction _AllTransformsMatch(textures: BaseTexture[]): boolean {\n if (textures.length <= 1) {\n return true;\n }\n const ref = textures[0].getTextureMatrix();\n for (let i = 1; i < textures.length; i++) {\n if (!ref.equals(textures[i].getTextureMatrix())) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * @internal\n * Copy sampling metadata from a source texture onto the output ProceduralTexture.\n * `coordinatesIndex` and wrap modes are always copied.\n * When `includeTransform` is true the UV offset/scale/rotation are also copied\n * (used when all inputs share the same transform and it is propagated rather than baked).\n */\nfunction _CopyTextureMetadata(from: BaseTexture, to: ProceduralTexture, includeTransform: boolean): void {\n to.coordinatesIndex = from.coordinatesIndex;\n to.wrapU = from.wrapU;\n to.wrapV = from.wrapV;\n if (includeTransform) {\n const src = from as Texture;\n to.uOffset = src.uOffset ?? 0;\n to.vOffset = src.vOffset ?? 0;\n to.uScale = src.uScale ?? 1;\n to.vScale = src.vScale ?? 1;\n to.wAng = src.wAng ?? 0;\n }\n}\n\n/**\n * @internal\n * Return the shader define suffix for a TextureChannel (e.g. TextureChannel.R → \"R\").\n * Returns an empty string for RGBA (no swizzle needed).\n */\nfunction _ChannelDefine(channel: TextureChannel): string {\n switch (channel) {\n case TextureChannel.R:\n return \"R\";\n case TextureChannel.G:\n return \"G\";\n case TextureChannel.B:\n return \"B\";\n case TextureChannel.A:\n return \"A\";\n default:\n return \"\";\n }\n}\n\n/**\n * @internal\n * Apply a channel swizzle to a constant Color4, matching the GPU behaviour for TextureChannel.\n */\nfunction _ApplyChannelSwizzle(c: Color4, channel: TextureChannel): Color4 {\n switch (channel) {\n case TextureChannel.R:\n return new Color4(c.r, c.r, c.r, c.a);\n case TextureChannel.G:\n return new Color4(c.g, c.g, c.g, c.a);\n case TextureChannel.B:\n return new Color4(c.b, c.b, c.b, c.a);\n case TextureChannel.A:\n return new Color4(c.a, c.a, c.a, c.a);\n default:\n return c;\n }\n}\n\n/**\n * @internal\n * Build the OP_INVERT define plus per-channel INVERT_R/G/B/A defines from an ChannelMask bitmask.\n */\nfunction _BuildInvertDefines(channels: ChannelMask): string[] {\n const defines: string[] = [\"OP_INVERT\"];\n if (channels & ChannelMask.R) {\n defines.push(\"INVERT_R\");\n }\n if (channels & ChannelMask.G) {\n defines.push(\"INVERT_G\");\n }\n if (channels & ChannelMask.B) {\n defines.push(\"INVERT_B\");\n }\n if (channels & ChannelMask.A) {\n defines.push(\"INVERT_A\");\n }\n return defines;\n}\n\n/**\n * @internal\n * Build OUTPUT_MASK_X_ZERO / OUTPUT_MASK_A_ONE defines for excluded channels.\n * Channels present in the mask pass through; excluded channels get defaults (0.0 for RGB, 1.0 for A).\n * Returns an empty array for ChannelMask.RGBA (no masking needed).\n */\nfunction _BuildOutputChannelMaskDefines(mask: ChannelMask): string[] {\n const defines: string[] = [];\n if (!(mask & ChannelMask.R)) {\n defines.push(\"OUTPUT_MASK_R_ZERO\");\n }\n if (!(mask & ChannelMask.G)) {\n defines.push(\"OUTPUT_MASK_G_ZERO\");\n }\n if (!(mask & ChannelMask.B)) {\n defines.push(\"OUTPUT_MASK_B_ZERO\");\n }\n if (!(mask & ChannelMask.A)) {\n defines.push(\"OUTPUT_MASK_A_ONE\");\n }\n return defines;\n}\n\n/**\n * @internal\n * Apply a ChannelMask to a constant Color4: included channels pass through,\n * excluded color channels become 0, excluded alpha becomes 1.\n */\nfunction _ApplyOutputChannelMask(c: Color4, mask: ChannelMask): Color4 {\n return new Color4(mask & ChannelMask.R ? c.r : 0, mask & ChannelMask.G ? c.g : 0, mask & ChannelMask.B ? c.b : 0, mask & ChannelMask.A ? c.a : 1);\n}\n\n/**\n * @internal\n * Build shader defines for a standard A/B operand.\n * When `bakeTransform` is true and the texture has a non-identity UV transform,\n * the OPERAND_X_MATRIX define is emitted so the shader applies the matrix when sampling.\n */\nfunction _BuildOperandDefines(operand: ITextureProcessOperand, prefix: \"A\" | \"B\", bakeTransform: boolean): string[] {\n const defines: string[] = [];\n if (operand.texture) {\n defines.push(`OPERAND_${prefix}_TEXTURE`);\n if (bakeTransform && _HasNonIdentityTransform(operand.texture)) {\n defines.push(`OPERAND_${prefix}_MATRIX`);\n }\n if (operand.colorSpace) {\n defines.push(`OPERAND_${prefix}_SRGB`);\n }\n if (operand.channel) {\n defines.push(`OPERAND_${prefix}_CHANNEL_${_ChannelDefine(operand.channel)}`);\n }\n }\n if (operand.factor !== undefined || !operand.texture) {\n defines.push(`OPERAND_${prefix}_FACTOR`);\n }\n return defines;\n}\n\n/**\n * @internal\n * Build shader defines for the lerp blend operand.\n * When `bakeTransform` is true and the texture has a non-identity UV transform,\n * the LERP_T_MATRIX define is emitted.\n */\nfunction _BuildLerpBlendDefines(t: ITextureProcessOperand, bakeTransform: boolean): string[] {\n const defines: string[] = [];\n if (t.texture) {\n defines.push(\"LERP_T_TEXTURE\");\n if (bakeTransform && _HasNonIdentityTransform(t.texture)) {\n defines.push(\"LERP_T_MATRIX\");\n }\n if (t.factor !== undefined) {\n defines.push(\"LERP_T_FACTOR\");\n }\n if (t.colorSpace) {\n defines.push(\"LERP_T_SRGB\");\n }\n if (t.channel) {\n defines.push(`LERP_T_CHANNEL_${_ChannelDefine(t.channel)}`);\n }\n }\n // factor-only: no additional defines needed; the shader uses factorT when LERP_T_TEXTURE is absent.\n return defines;\n}\n\n/**\n * @internal\n * Set uniforms and textures for a standard A/B operand on a procedural texture.\n * When `bakeTransform` is true and the texture has a non-identity UV matrix,\n * that matrix is uploaded as `<textureName>Matrix` for the shader to apply when sampling.\n */\nfunction _SetOperandUniforms(pt: ProceduralTexture, operand: ITextureProcessOperand, textureName: string, factorName: string, bakeTransform: boolean): void {\n if (operand.texture) {\n pt.setTexture(textureName, operand.texture as Texture);\n if (bakeTransform && _HasNonIdentityTransform(operand.texture)) {\n pt.setMatrix(`${textureName}Matrix`, operand.texture.getTextureMatrix());\n }\n }\n const needsFactor = operand.factor !== undefined || !operand.texture;\n if (needsFactor) {\n pt.setColor4(factorName, _EvalConstant(operand));\n }\n}\n\n/**\n * @internal\n * Set uniforms and textures for the lerp blend operand.\n * When `bakeTransform` is true and the texture has a non-identity UV matrix,\n * that matrix is uploaded as `textureTMatrix`.\n */\nfunction _SetLerpBlendUniforms(pt: ProceduralTexture, t: ITextureProcessOperand, bakeTransform: boolean): void {\n if (t.texture) {\n pt.setTexture(\"textureT\", t.texture as Texture);\n if (bakeTransform && _HasNonIdentityTransform(t.texture)) {\n pt.setMatrix(\"textureTMatrix\", t.texture.getTextureMatrix());\n }\n if (t.factor !== undefined) {\n pt.setColor4(\"factorT\", t.factor);\n }\n } else {\n pt.setColor4(\"factorT\", _EvalConstant(t));\n }\n}\n\n/**\n * @internal\n * Create a textureProcessor procedural texture with the given defines. The returned texture\n * is not yet rendered — uniforms must be set on it before calling _RenderAsync.\n */\nfunction _CreateProcessorTexture(\n name: string,\n defines: string[],\n outputSize: TextureSize,\n scene: Scene,\n outputColorSpace: TextureColorSpace = TextureColorSpace.Linear,\n outputOptions?: ITextureProcessorOutputOptions\n): ProceduralTexture {\n const options: IProceduralTextureCreationOptions = {\n type: outputOptions?.textureType ?? Constants.TEXTURETYPE_UNSIGNED_BYTE,\n format: Constants.TEXTUREFORMAT_RGBA,\n samplingMode: outputOptions?.samplingMode ?? Constants.TEXTURE_BILINEAR_SAMPLINGMODE,\n generateDepthBuffer: false,\n generateMipMaps: outputOptions?.generateMipMaps ?? false,\n gammaSpace: outputColorSpace === TextureColorSpace.SRGB,\n shaderLanguage: scene.getEngine().isWebGPU ? ShaderLanguage.WGSL : ShaderLanguage.GLSL,\n extraInitializationsAsync: async () => {\n if (scene.getEngine().isWebGPU) {\n await Promise.all([import(\"../../ShadersWGSL/textureProcessor.fragment\")]);\n } else {\n await Promise.all([import(\"../../Shaders/textureProcessor.fragment\")]);\n }\n },\n // Opt out of scene-managed rendering. _shouldRender() would re-render the texture\n // on the first scene frame regardless of refreshRate (because _currentRefreshId starts\n // at -1 and is only advanced by _shouldRender() itself, not by a direct render() call).\n // That re-render would sample already-disposed input textures, producing blank output.\n skipSceneRegistration: true,\n };\n\n const pt = new ProceduralTexture(name, outputSize, _ShaderName, scene, options);\n pt.refreshRate = -1; // render on demand only\n pt.defines = defines.length > 0 ? \"#define \" + defines.join(\"\\n#define \") + \"\\n\" : \"\";\n return pt;\n}\n\n/**\n * @internal\n * Wait for a procedural texture's shader to compile then render it. Uniforms must be set\n * on the texture before calling this.\n */\nasync function _RenderAsync(pt: ProceduralTexture): Promise<void> {\n return await new Promise<void>((resolve, reject) => {\n pt.executeWhenReady(() => {\n try {\n pt.render();\n resolve();\n } catch (error) {\n reject(error instanceof Error ? error : new Error(String(error)));\n }\n });\n });\n}\n\n/**\n * Multiply two texture operands together, component-wise: `result = a * b`.\n *\n * Each operand can be a texture, a constant factor, or a texture scaled by a factor.\n * This is useful for applying glTF-style factors to textures (e.g. `baseColorTexture * baseColorFactor`),\n * or for modulating one texture by another.\n *\n * If both operands are constant (no textures), the multiplication is performed on the CPU and\n * the result is returned as a factor-only operand with no texture allocated.\n *\n * When operands are results of previous operations (i.e. they carry a `dispose` function),\n * their intermediate textures are automatically released after the GPU pass completes.\n *\n * @param name - Name for the resulting procedural texture (used only when a GPU pass is needed)\n * @param a - First operand\n * @param b - Second operand\n * @param scene - Scene to create the texture in (used only when a GPU pass is needed)\n * @param outputColorSpace - Optional output color space. When `TextureColorSpace.SRGB`, the linear\n * result is converted to sRGB (IEC 61966-2-1) before being written. Defaults to `TextureColorSpace.Linear`.\n * @param outputChannelMask - Optional bitmask of channels to write. Excluded color channels are set to\n * `0.0`; excluded alpha is set to `1.0`. Defaults to `ChannelMask.RGBA` (all channels written).\n * @param outputOptions - Optional render-target type, sampling, and mipmap settings.\n * @returns An operand whose `texture` holds the GPU result, or whose `factor` holds the CPU-folded constant\n */\nexport async function MultiplyTexturesAsync(\n name: string,\n a: ITextureProcessOperand,\n b: ITextureProcessOperand,\n scene: Scene,\n outputColorSpace?: TextureColorSpace,\n outputChannelMask?: ChannelMask,\n outputOptions?: ITextureProcessorOutputOptions\n): Promise<ITextureProcessOperand> {\n if (!a.texture && !b.texture) {\n const factor = _MultiplyConstants(_EvalConstant(a), _EvalConstant(b));\n return { texture: null, factor: outputChannelMask ? _ApplyOutputChannelMask(factor, outputChannelMask) : factor };\n }\n\n const allTextures: BaseTexture[] = [];\n if (a.texture) {\n allTextures.push(a.texture);\n }\n if (b.texture) {\n allTextures.push(b.texture);\n }\n const canPropagate = _AllTransformsMatch(allTextures);\n const bakeTransform = !canPropagate;\n\n const defines = [\n ..._BuildOperandDefines(a, \"A\", bakeTransform),\n ..._BuildOperandDefines(b, \"B\", bakeTransform),\n ...(outputChannelMask ? _BuildOutputChannelMaskDefines(outputChannelMask) : []),\n ];\n if (outputColorSpace) {\n defines.push(\"OUTPUT_SRGB\");\n }\n const pt = _CreateProcessorTexture(name, defines, _ResolveOutputSize([a, b]), scene, outputColorSpace, outputOptions);\n _SetOperandUniforms(pt, a, \"textureA\", \"factorA\", bakeTransform);\n _SetOperandUniforms(pt, b, \"textureB\", \"factorB\", bakeTransform);\n try {\n await _RenderAsync(pt);\n } catch (error) {\n a.dispose?.();\n b.dispose?.();\n throw error;\n }\n\n a.dispose?.();\n b.dispose?.();\n\n _CopyTextureMetadata(allTextures[0], pt, canPropagate);\n const result: ITextureProcessOperand = { texture: pt, dispose: () => pt.dispose() };\n if (outputColorSpace) {\n result.colorSpace = outputColorSpace;\n }\n return result;\n}\n\n/**\n * Take the component-wise maximum of two texture operands: `result = max(a, b)`.\n *\n * Each operand can be a texture, a constant factor, or a texture scaled by a factor.\n * Useful for operations such as combining ambient occlusion maps or taking the\n * brightest contribution from two sources.\n *\n * If both operands are constant (no textures), the operation is performed on the CPU and\n * the result is returned as a factor-only operand with no texture allocated.\n *\n * When operands are results of previous operations (i.e. they carry a `dispose` function),\n * their intermediate textures are automatically released after the GPU pass completes.\n *\n * @param name - Name for the resulting procedural texture (used only when a GPU pass is needed)\n * @param a - First operand\n * @param b - Second operand\n * @param scene - Scene to create the texture in (used only when a GPU pass is needed)\n * @param outputColorSpace - Optional output color space. When `TextureColorSpace.SRGB`, the linear\n * result is converted to sRGB (IEC 61966-2-1) before being written. Defaults to `TextureColorSpace.Linear`.\n * @param outputChannelMask - Optional bitmask of channels to write. Excluded color channels are set to\n * `0.0`; excluded alpha is set to `1.0`. Defaults to `ChannelMask.RGBA` (all channels written).\n * @param outputOptions - Optional render-target type, sampling, and mipmap settings.\n * @returns An operand whose `texture` holds the GPU result, or whose `factor` holds the CPU-folded constant\n */\nexport async function MaxTexturesAsync(\n name: string,\n a: ITextureProcessOperand,\n b: ITextureProcessOperand,\n scene: Scene,\n outputColorSpace?: TextureColorSpace,\n outputChannelMask?: ChannelMask,\n outputOptions?: ITextureProcessorOutputOptions\n): Promise<ITextureProcessOperand> {\n if (!a.texture && !b.texture) {\n const factor = _MaxConstants(_EvalConstant(a), _EvalConstant(b));\n return { texture: null, factor: outputChannelMask ? _ApplyOutputChannelMask(factor, outputChannelMask) : factor };\n }\n\n const allTextures: BaseTexture[] = [];\n if (a.texture) {\n allTextures.push(a.texture);\n }\n if (b.texture) {\n allTextures.push(b.texture);\n }\n const canPropagate = _AllTransformsMatch(allTextures);\n const bakeTransform = !canPropagate;\n\n const defines = [\n \"OP_MAX\",\n ..._BuildOperandDefines(a, \"A\", bakeTransform),\n ..._BuildOperandDefines(b, \"B\", bakeTransform),\n ...(outputChannelMask ? _BuildOutputChannelMaskDefines(outputChannelMask) : []),\n ];\n if (outputColorSpace) {\n defines.push(\"OUTPUT_SRGB\");\n }\n const pt = _CreateProcessorTexture(name, defines, _ResolveOutputSize([a, b]), scene, outputColorSpace, outputOptions);\n _SetOperandUniforms(pt, a, \"textureA\", \"factorA\", bakeTransform);\n _SetOperandUniforms(pt, b, \"textureB\", \"factorB\", bakeTransform);\n try {\n await _RenderAsync(pt);\n } catch (error) {\n a.dispose?.();\n b.dispose?.();\n throw error;\n }\n\n a.dispose?.();\n b.dispose?.();\n\n _CopyTextureMetadata(allTextures[0], pt, canPropagate);\n const result: ITextureProcessOperand = { texture: pt, dispose: () => pt.dispose() };\n if (outputColorSpace) {\n result.colorSpace = outputColorSpace;\n }\n return result;\n}\n\n/**\n * Linearly interpolate between two texture operands: `result = mix(a, b, t)`.\n *\n * Each operand can be a texture, a constant factor, or a texture scaled by a factor.\n * The `t` operand controls the blend weight per texel, per channel — a value of 0 returns `a`,\n * a value of 1 returns `b`. Use a grayscale texture or a scalar `Color4(v, v, v, v)` for\n * uniform blending across all channels.\n *\n * If all three operands are constant (no textures), the interpolation is performed on the CPU and\n * the result is returned as a factor-only operand with no texture allocated.\n *\n * When operands are results of previous operations (i.e. they carry a `dispose` function),\n * their intermediate textures are automatically released after the GPU pass completes.\n *\n * @param name - Name for the resulting procedural texture (used only when a GPU pass is needed)\n * @param a - Start value operand (returned when t = 0)\n * @param b - End value operand (returned when t = 1)\n * @param t - Blend weight operand. Each channel independently controls the blend for the corresponding output channel.\n * @param scene - Scene to create the texture in (used only when a GPU pass is needed)\n * @param outputColorSpace - Optional output color space. When `TextureColorSpace.SRGB`, the linear\n * result is converted to sRGB (IEC 61966-2-1) before being written. Defaults to `TextureColorSpace.Linear`.\n * @param outputChannelMask - Optional bitmask of channels to write. Excluded color channels are set to\n * `0.0`; excluded alpha is set to `1.0`. Defaults to `ChannelMask.RGBA` (all channels written).\n * @param outputOptions - Optional render-target type, sampling, and mipmap settings.\n * @returns An operand whose `texture` holds the GPU result, or whose `factor` holds the CPU-folded constant\n */\nexport async function LerpTexturesAsync(\n name: string,\n a: ITextureProcessOperand,\n b: ITextureProcessOperand,\n t: ITextureProcessOperand,\n scene: Scene,\n outputColorSpace?: TextureColorSpace,\n outputChannelMask?: ChannelMask,\n outputOptions?: ITextureProcessorOutputOptions\n): Promise<ITextureProcessOperand> {\n if (!a.texture && !b.texture && !t.texture) {\n const factor = _LerpConstants(_EvalConstant(a), _EvalConstant(b), _EvalConstant(t));\n return { texture: null, factor: outputChannelMask ? _ApplyOutputChannelMask(factor, outputChannelMask) : factor };\n }\n\n const allTextures: BaseTexture[] = [];\n if (a.texture) {\n allTextures.push(a.texture);\n }\n if (b.texture) {\n allTextures.push(b.texture);\n }\n if (t.texture) {\n allTextures.push(t.texture);\n }\n const canPropagate = _AllTransformsMatch(allTextures);\n const bakeTransform = !canPropagate;\n\n const defines = [\n \"OP_LERP\",\n ..._BuildOperandDefines(a, \"A\", bakeTransform),\n ..._BuildOperandDefines(b, \"B\", bakeTransform),\n ..._BuildLerpBlendDefines(t, bakeTransform),\n ...(outputChannelMask ? _BuildOutputChannelMaskDefines(outputChannelMask) : []),\n ];\n if (outputColorSpace) {\n defines.push(\"OUTPUT_SRGB\");\n }\n const pt = _CreateProcessorTexture(name, defines, _ResolveOutputSize([a, b, t]), scene, outputColorSpace, outputOptions);\n _SetOperandUniforms(pt, a, \"textureA\", \"factorA\", bakeTransform);\n _SetOperandUniforms(pt, b, \"textureB\", \"factorB\", bakeTransform);\n _SetLerpBlendUniforms(pt, t, bakeTransform);\n try {\n await _RenderAsync(pt);\n } catch (error) {\n a.dispose?.();\n b.dispose?.();\n t.dispose?.();\n throw error;\n }\n\n a.dispose?.();\n b.dispose?.();\n t.dispose?.();\n\n _CopyTextureMetadata(allTextures[0], pt, canPropagate);\n const result: ITextureProcessOperand = { texture: pt, dispose: () => pt.dispose() };\n if (outputColorSpace) {\n result.colorSpace = outputColorSpace;\n }\n return result;\n}\n\n/**\n * Invert selected channels of a texture operand: `result[ch] = 1 - input[ch]`.\n *\n * The `channels` bitmask selects which channels are inverted; unselected channels pass through\n * unchanged. Use `ChannelMask.RGB` for the common roughness↔smoothness conversion, or\n * `ChannelMask.RGBA` (the default) to invert the entire texture.\n *\n * This is a unary operation — only operand A is used. Any `colorSpace` or `channel` properties\n * on the input operand are honoured (sRGB linearization and channel swizzle applied before\n * the invert).\n *\n * If the input is constant (no texture), the invert is performed on the CPU.\n *\n * When the input is the result of a previous operation (i.e. it carries a `dispose` function),\n * its intermediate texture is automatically released after the GPU pass completes.\n *\n * @param name - Name for the resulting procedural texture (used only when a GPU pass is needed)\n * @param input - Operand to invert\n * @param scene - Scene to create the texture in (used only when a GPU pass is needed)\n * @param channels - Bitmask of channels to invert. Defaults to `ChannelMask.RGBA`.\n * @param outputColorSpace - Optional output color space. When `TextureColorSpace.SRGB`, the linear\n * result is converted to sRGB (IEC 61966-2-1) before being written. Defaults to `TextureColorSpace.Linear`.\n * @param outputChannelMask - Optional bitmask of channels to write. Excluded color channels are set to\n * `0.0`; excluded alpha is set to `1.0`. Defaults to `ChannelMask.RGBA` (all channels written).\n * @param outputOptions - Optional render-target type, sampling, and mipmap settings.\n * @returns An operand whose `texture` holds the GPU result, or whose `factor` holds the CPU-folded constant\n */\nexport async function InvertTextureAsync(\n name: string,\n input: ITextureProcessOperand,\n scene: Scene,\n channels: ChannelMask = ChannelMask.RGBA,\n outputColorSpace?: TextureColorSpace,\n outputChannelMask?: ChannelMask,\n outputOptions?: ITextureProcessorOutputOptions\n): Promise<ITextureProcessOperand> {\n if (!input.texture) {\n const c = _EvalConstant(input);\n const factor = new Color4(\n channels & ChannelMask.R ? 1 - c.r : c.r,\n channels & ChannelMask.G ? 1 - c.g : c.g,\n channels & ChannelMask.B ? 1 - c.b : c.b,\n channels & ChannelMask.A ? 1 - c.a : c.a\n );\n return { texture: null, factor: outputChannelMask ? _ApplyOutputChannelMask(factor, outputChannelMask) : factor };\n }\n\n // Single input: UV transform is always propagated (no bake needed).\n const defines = [..._BuildOperandDefines(input, \"A\", false), ..._BuildInvertDefines(channels), ...(outputChannelMask ? _BuildOutputChannelMaskDefines(outputChannelMask) : [])];\n if (outputColorSpace) {\n defines.push(\"OUTPUT_SRGB\");\n }\n const pt = _CreateProcessorTexture(name, defines, _ResolveOutputSize([input]), scene, outputColorSpace, outputOptions);\n _SetOperandUniforms(pt, input, \"textureA\", \"factorA\", false);\n try {\n await _RenderAsync(pt);\n } catch (error) {\n input.dispose?.();\n throw error;\n }\n\n input.dispose?.();\n\n _CopyTextureMetadata(input.texture, pt, true);\n const result: ITextureProcessOperand = { texture: pt, dispose: () => pt.dispose() };\n if (outputColorSpace) {\n result.colorSpace = outputColorSpace;\n }\n return result;\n}\n\n/**\n * Extract the per-texel maximum channel value from a texture and broadcast it to all output\n * channels, producing a single-value (greyscale) texture in a single GPU pass.\n *\n * For each texel, computes `max(r, g, b)` — or `max(r, g, b, a)` when `includeAlpha` is true —\n * and writes that scalar to the output:\n * - `includeAlpha = false` (default): output is `(m, m, m, a)` where `m = max(r, g, b)`\n * - `includeAlpha = true`: output is `(m, m, m, m)` where `m = max(r, g, b, a)`\n *\n * This is more efficient than chaining `ExtractChannelAsync` calls through `MaxTexturesAsync`,\n * which would require multiple intermediate textures and GPU passes.\n *\n * Any `colorSpace` or `channel` properties on the input operand are honoured (sRGB linearization\n * and channel swizzle applied before the max reduction).\n *\n * If the input is constant (no texture), the reduction is performed on the CPU.\n *\n * When the input is the result of a previous operation (i.e. it carries a `dispose` function),\n * its intermediate texture is automatically released after the GPU pass completes.\n *\n * @param name - Name for the resulting procedural texture (used only when a GPU pass is needed)\n * @param input - Operand to reduce\n * @param scene - Scene to create the texture in (used only when a GPU pass is needed)\n * @param includeAlpha - When true, alpha participates in the max and is also set to the result.\n * Defaults to false (alpha is preserved from the input).\n * @param outputColorSpace - Optional output color space. When `TextureColorSpace.SRGB`, the linear\n * result is converted to sRGB (IEC 61966-2-1) before being written. Defaults to `TextureColorSpace.Linear`.\n * @param outputChannelMask - Optional bitmask of channels to write. Excluded color channels are set to\n * `0.0`; excluded alpha is set to `1.0`. Defaults to `ChannelMask.RGBA` (all channels written).\n * @param outputOptions - Optional render-target type, sampling, and mipmap settings.\n * @returns An operand whose `texture` holds the GPU result, or whose `factor` holds the CPU-folded constant\n */\nexport async function ExtractMaxChannelAsync(\n name: string,\n input: ITextureProcessOperand,\n scene: Scene,\n includeAlpha: boolean = false,\n outputColorSpace?: TextureColorSpace,\n outputChannelMask?: ChannelMask,\n outputOptions?: ITextureProcessorOutputOptions\n): Promise<ITextureProcessOperand> {\n if (!input.texture) {\n const c = _EvalConstant(input);\n const m = includeAlpha ? Math.max(c.r, c.g, c.b, c.a) : Math.max(c.r, c.g, c.b);\n const factor = new Color4(m, m, m, includeAlpha ? m : c.a);\n return { texture: null, factor: outputChannelMask ? _ApplyOutputChannelMask(factor, outputChannelMask) : factor };\n }\n\n // Single input: UV transform is always propagated (no bake needed).\n const defines = [..._BuildOperandDefines(input, \"A\", false), \"OP_CHANNEL_MAX\", ...(outputChannelMask ? _BuildOutputChannelMaskDefines(outputChannelMask) : [])];\n if (includeAlpha) {\n defines.push(\"CHANNEL_MAX_INCLUDE_ALPHA\");\n }\n if (outputColorSpace) {\n defines.push(\"OUTPUT_SRGB\");\n }\n const pt = _CreateProcessorTexture(name, defines, _ResolveOutputSize([input]), scene, outputColorSpace, outputOptions);\n _SetOperandUniforms(pt, input, \"textureA\", \"factorA\", false);\n try {\n await _RenderAsync(pt);\n } catch (error) {\n input.dispose?.();\n throw error;\n }\n\n input.dispose?.();\n\n _CopyTextureMetadata(input.texture, pt, true);\n const result: ITextureProcessOperand = { texture: pt, dispose: () => pt.dispose() };\n if (outputColorSpace) {\n result.colorSpace = outputColorSpace;\n }\n return result;\n}\n\n/**\n * Extract a single channel from a texture and broadcast it to RGB (or all four components for\n * `TextureChannel.A`), producing a new texture. This is a convenience wrapper over\n * `MultiplyTexturesAsync` with a `(1,1,1,1)` factor and the requested channel swizzle applied\n * to the input.\n *\n * Swizzle results per channel:\n * - `TextureChannel.R` → (r, r, r, a)\n * - `TextureChannel.G` → (g, g, g, a)\n * - `TextureChannel.B` → (b, b, b, a)\n * - `TextureChannel.A` → (a, a, a, a)\n *\n * If the input is constant (no texture), the swizzle is applied on the CPU.\n *\n * Any `colorSpace` property on the input operand is honoured (sRGB linearization applied before\n * the swizzle). Any existing `channel` on the input is replaced by the `channel` argument.\n *\n * When the input is the result of a previous operation (i.e. it carries a `dispose` function),\n * its intermediate texture is automatically released after the GPU pass completes.\n *\n * @param name - Name for the resulting procedural texture (used only when a GPU pass is needed)\n * @param input - Operand to extract the channel from\n * @param channel - The channel to extract and broadcast\n * @param scene - Scene to create the texture in (used only when a GPU pass is needed)\n * @param outputColorSpace - Optional output color space. When `TextureColorSpace.SRGB`, the linear\n * result is converted to sRGB (IEC 61966-2-1) before being written. Defaults to `TextureColorSpace.Linear`.\n * @param outputChannelMask - Optional bitmask of channels to write. Excluded color channels are set to\n * `0.0`; excluded alpha is set to `1.0`. Defaults to `ChannelMask.RGBA` (all channels written).\n * @param outputOptions - Optional render-target type, sampling, and mipmap settings.\n * @returns An operand whose `texture` holds the GPU result, or whose `factor` holds the CPU-folded constant\n */\nexport async function ExtractChannelAsync(\n name: string,\n input: ITextureProcessOperand,\n channel: TextureChannel,\n scene: Scene,\n outputColorSpace?: TextureColorSpace,\n outputChannelMask?: ChannelMask,\n outputOptions?: ITextureProcessorOutputOptions\n): Promise<ITextureProcessOperand> {\n if (!input.texture) {\n const swizzled = _ApplyChannelSwizzle(_EvalConstant(input), channel);\n return { texture: null, factor: outputChannelMask ? _ApplyOutputChannelMask(swizzled, outputChannelMask) : swizzled };\n }\n return await MultiplyTexturesAsync(name, { ...input, channel }, CreateFactorOperand(new Color4(1, 1, 1, 1)), scene, outputColorSpace, outputChannelMask, outputOptions);\n}\n"]}
@@ -1,5 +1,16 @@
1
1
  import { type MaterialDefines, type Effect, type Mesh, type AbstractMesh, type Material } from "../index.js";
2
2
  import { Matrix } from "../Maths/math.vector.pure.js";
3
+ /**
4
+ * Provides the object ID written by geometry rendering for a mesh.
5
+ *
6
+ * IDs must be unsigned integers supported by the object ID texture format. ID 0 is reserved for background or excluded meshes.
7
+ * RGBA textures support IDs up to 0xFFFFFF, while RED textures support IDs up to 0xFF.
8
+ * This callback runs in the render hot path and may be called multiple times for the same mesh in a frame.
9
+ * It should avoid allocations and return a consistent value for a mesh during a render.
10
+ */
11
+ export type GeometryRenderingObjectIdProvider = (mesh: AbstractMesh) => number;
12
+ /** @internal */
13
+ export declare function _GetGeometryRenderingObjectId(mesh: AbstractMesh, provider: GeometryRenderingObjectIdProvider, maxObjectId?: number): number;
3
14
  /**
4
15
  * Type of clear operation to perform on a geometry texture.
5
16
  */
@@ -64,6 +75,14 @@ export type GeometryRenderingConfiguration = {
64
75
  * Whether to reverse culling for the geometry rendering (meaning, if back faces should be culled, front faces are culled instead, and the other way around).
65
76
  */
66
77
  reverseCulling: boolean;
78
+ /**
79
+ * Provides the object ID written for each rendered mesh.
80
+ */
81
+ objectIdProvider?: GeometryRenderingObjectIdProvider;
82
+ /**
83
+ * Whether the object ID texture uses the RED format.
84
+ */
85
+ objectIdIsRedFormat: boolean;
67
86
  };
68
87
  /**
69
88
  * Helper class to manage geometry rendering.
@@ -1,5 +1,13 @@
1
1
 
2
2
  import { Matrix } from "../Maths/math.vector.pure.js";
3
+ /** @internal */
4
+ export function _GetGeometryRenderingObjectId(mesh, provider, maxObjectId = 0xffffff) {
5
+ const objectId = provider(mesh);
6
+ if (!Number.isInteger(objectId) || objectId < 0 || objectId > maxObjectId) {
7
+ throw new Error(`Invalid geometry object ID ${objectId} for mesh "${mesh.name}". Object IDs must be integers between 0 and 0x${maxObjectId.toString(16).toUpperCase()}.`);
8
+ }
9
+ return objectId;
10
+ }
3
11
  /**
4
12
  * Type of clear operation to perform on a geometry texture.
5
13
  */
@@ -41,6 +49,7 @@ export class MaterialHelperGeometryRendering {
41
49
  lastUpdateFrameId: -1,
42
50
  excludedSkinnedMesh: [],
43
51
  reverseCulling: false,
52
+ objectIdIsRedFormat: false,
44
53
  };
45
54
  return MaterialHelperGeometryRendering._Configurations[renderPassId];
46
55
  }
@@ -65,7 +74,7 @@ export class MaterialHelperGeometryRendering {
65
74
  * @param _samplers The array of samplers to add to.
66
75
  */
67
76
  static AddUniformsAndSamplers(uniforms, _samplers) {
68
- uniforms.push("previousWorld", "previousViewProjection", "mPreviousBones");
77
+ uniforms.push("previousWorld", "previousViewProjection", "mPreviousBones", "objectId");
69
78
  }
70
79
  /**
71
80
  * Marks a list of meshes as dirty for geometry rendering.
@@ -113,6 +122,7 @@ export class MaterialHelperGeometryRendering {
113
122
  delete defines[defineIndex];
114
123
  }
115
124
  }
125
+ defines["PREPASS_OBJECT_ID_R8"] = configuration.objectIdIsRedFormat;
116
126
  defines["SCENE_MRT_COUNT"] = numMRT;
117
127
  defines["BONES_VELOCITY_ENABLED"] =
118
128
  mesh.useBones && mesh.computeBonesUsingShaders && mesh.skeleton && !mesh.skeleton.isUsingTextureForMatrices && configuration.excludedSkinnedMesh.indexOf(mesh) === -1;
@@ -135,6 +145,17 @@ export class MaterialHelperGeometryRendering {
135
145
  if (configuration.reverseCulling) {
136
146
  engine.setStateCullFaceType(scene._mirroredCameraPosition ? material.cullBackFaces : !material.cullBackFaces);
137
147
  }
148
+ if (configuration.defines["PREPASS_OBJECT_ID_INDEX"] !== undefined) {
149
+ const maxObjectId = configuration.objectIdIsRedFormat ? 0xff : 0xffffff;
150
+ let objectId = mesh.uniqueId;
151
+ if (configuration.objectIdProvider) {
152
+ objectId = _GetGeometryRenderingObjectId(mesh, configuration.objectIdProvider, maxObjectId);
153
+ }
154
+ else if (objectId > maxObjectId) {
155
+ throw new Error(`Invalid geometry object ID ${objectId} for mesh "${mesh.name}". Object IDs must be integers between 0 and 0x${maxObjectId.toString(16).toUpperCase()}.`);
156
+ }
157
+ effect.setFloat("objectId", objectId);
158
+ }
138
159
  if (configuration.defines["PREPASS_VELOCITY_INDEX"] !== undefined || configuration.defines["PREPASS_VELOCITY_LINEAR_INDEX"] !== undefined) {
139
160
  if (!configuration.previousWorldMatrices[mesh.uniqueId]) {
140
161
  configuration.previousWorldMatrices[mesh.uniqueId] = world.clone();
@@ -282,6 +303,13 @@ MaterialHelperGeometryRendering.GeometryTextureDescriptions = [
282
303
  define: "PREPASS_IRRADIANCE",
283
304
  defineIndex: "PREPASS_IRRADIANCE_INDEX",
284
305
  },
306
+ {
307
+ type: 15,
308
+ name: "ObjectId",
309
+ clearType: 0 /* GeometryRenderingTextureClearType.Zero */,
310
+ define: "PREPASS_OBJECT_ID",
311
+ defineIndex: "PREPASS_OBJECT_ID_INDEX",
312
+ },
285
313
  ];
286
314
  MaterialHelperGeometryRendering._Configurations = {};
287
315
  //# sourceMappingURL=materialHelper.geometryrendering.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"materialHelper.geometryrendering.js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ACD;QACI,IAAI,EAAE,SAAS,CAAC,2BAA2B;QAC3C,IAAI,EAAE,QAAQ;QACd,SAAS,gDAAwC;QACjD,MAAM,EAAE,gBAAgB;QACxB,WAAW,EAAE,sBAAsB;KACtC;IACD;QACI,IAAI,EAAE,SAAS,CAAC,0CAA0C;QAC1D,IAAI,EAAE,qBAAqB;QAC3B,SAAS,+CAAuC;QAChD,MAAM,EAAE,+BAA+B;QACvC,WAAW,EAAE,qCAAqC;KACrD;IACD;QACI,IAAI,EAAE,SAAS,CAAC,0BAA0B;QAC1C,IAAI,EAAE,OAAO;QACb,SAAS,mDAA2C;QACpD,MAAM,EAAE,eAAe;QACvB,WAAW,EAAE,qBAAqB;KACrC;IACD;QACI,IAAI,EAAE,SAAS,CAAC,+BAA+B;QAC/C,IAAI,EAAE,YAAY;QAClB,SAAS,gDAAwC;QACjD,MAAM,EAAE,oBAAoB;QAC5B,WAAW,EAAE,0BAA0B;KAC1C;CACJ,CAAC;AAEa,+CAAe,GAA+D,EAAE,CAAC","sourcesContent":["import { type MaterialDefines, type Effect, type Mesh, type AbstractMesh, type Material } from \"core/index\";\r\nimport { Constants } from \"core/Engines/constants\";\r\nimport { Matrix } from \"core/Maths/math.vector.pure\";\r\n\r\n/**\r\n * Type of clear operation to perform on a geometry texture.\r\n */\r\nexport const enum GeometryRenderingTextureClearType {\r\n /**\r\n * Clear the texture with zero.\r\n */\r\n Zero = 0,\r\n\r\n /**\r\n * Clear the texture with one.\r\n */\r\n One = 1,\r\n\r\n /**\r\n * Clear the texture with the maximum view Z value.\r\n */\r\n MaxViewZ = 2,\r\n\r\n /**\r\n * Do not clear the texture.\r\n */\r\n NoClear = 3,\r\n}\r\n\r\n/**\r\n * Configuration for geometry rendering.\r\n * A configuration is created for each rendering pass a geometry rendering is used in.\r\n */\r\nexport type GeometryRenderingConfiguration = {\r\n /**\r\n * Defines used for the geometry rendering.\r\n */\r\n defines: { [name: string]: number };\r\n\r\n /**\r\n * Previous world matrices for meshes.\r\n */\r\n previousWorldMatrices: { [index: number]: Matrix };\r\n\r\n /**\r\n * Previous view projection matrix.\r\n */\r\n previousViewProjection: Matrix;\r\n\r\n /**\r\n * Current view projection matrix.\r\n */\r\n currentViewProjection: Matrix;\r\n\r\n /**\r\n * Previous bones for skinned meshes.\r\n */\r\n previousBones: { [index: number]: Float32Array };\r\n\r\n /**\r\n * Last frame id the configuration was updated.\r\n */\r\n lastUpdateFrameId: number;\r\n\r\n /**\r\n * List of excluded skinned meshes.\r\n */\r\n excludedSkinnedMesh: AbstractMesh[];\r\n\r\n /**\r\n * Whether to reverse culling for the geometry rendering (meaning, if back faces should be culled, front faces are culled instead, and the other way around).\r\n */\r\n reverseCulling: boolean;\r\n};\r\n\r\n/**\r\n * Helper class to manage geometry rendering.\r\n */\r\nexport class MaterialHelperGeometryRendering {\r\n /**\r\n * Descriptions of the geometry textures.\r\n */\r\n public static readonly GeometryTextureDescriptions = [\r\n {\r\n type: Constants.PREPASS_IRRADIANCE_LEGACY_TEXTURE_TYPE,\r\n name: \"IrradianceLegacy\",\r\n clearType: GeometryRenderingTextureClearType.Zero,\r\n define: \"PREPASS_IRRADIANCE_LEGACY\",\r\n defineIndex: \"PREPASS_IRRADIANCE_LEGACY_INDEX\",\r\n },\r\n {\r\n type: Constants.PREPASS_POSITION_TEXTURE_TYPE,\r\n name: \"WorldPosition\",\r\n clearType: GeometryRenderingTextureClearType.Zero,\r\n define: \"PREPASS_POSITION\",\r\n defineIndex: \"PREPASS_POSITION_INDEX\",\r\n },\r\n {\r\n type: Constants.PREPASS_VELOCITY_TEXTURE_TYPE,\r\n name: \"Velocity\",\r\n clearType: GeometryRenderingTextureClearType.Zero,\r\n define: \"PREPASS_VELOCITY\",\r\n defineIndex: \"PREPASS_VELOCITY_INDEX\",\r\n },\r\n {\r\n type: Constants.PREPASS_REFLECTIVITY_TEXTURE_TYPE,\r\n name: \"Reflectivity\",\r\n clearType: GeometryRenderingTextureClearType.Zero,\r\n define: \"PREPASS_REFLECTIVITY\",\r\n defineIndex: \"PREPASS_REFLECTIVITY_INDEX\",\r\n },\r\n {\r\n type: Constants.PREPASS_DEPTH_TEXTURE_TYPE,\r\n name: \"ViewDepth\",\r\n clearType: GeometryRenderingTextureClearType.MaxViewZ,\r\n define: \"PREPASS_DEPTH\",\r\n defineIndex: \"PREPASS_DEPTH_INDEX\",\r\n },\r\n {\r\n type: Constants.PREPASS_NORMAL_TEXTURE_TYPE,\r\n name: \"ViewNormal\",\r\n clearType: GeometryRenderingTextureClearType.Zero,\r\n define: \"PREPASS_NORMAL\",\r\n defineIndex: \"PREPASS_NORMAL_INDEX\",\r\n },\r\n {\r\n type: Constants.PREPASS_ALBEDO_SQRT_TEXTURE_TYPE,\r\n name: \"AlbedoSqrt\",\r\n clearType: GeometryRenderingTextureClearType.Zero,\r\n define: \"PREPASS_ALBEDO_SQRT\",\r\n defineIndex: \"PREPASS_ALBEDO_SQRT_INDEX\",\r\n },\r\n {\r\n type: Constants.PREPASS_WORLD_NORMAL_TEXTURE_TYPE,\r\n name: \"WorldNormal\",\r\n clearType: GeometryRenderingTextureClearType.Zero,\r\n define: \"PREPASS_WORLD_NORMAL\",\r\n defineIndex: \"PREPASS_WORLD_NORMAL_INDEX\",\r\n },\r\n {\r\n type: Constants.PREPASS_LOCAL_POSITION_TEXTURE_TYPE,\r\n name: \"LocalPosition\",\r\n clearType: GeometryRenderingTextureClearType.Zero,\r\n define: \"PREPASS_LOCAL_POSITION\",\r\n defineIndex: \"PREPASS_LOCAL_POSITION_INDEX\",\r\n },\r\n {\r\n type: Constants.PREPASS_SCREENSPACE_DEPTH_TEXTURE_TYPE,\r\n name: \"ScreenDepth\",\r\n clearType: GeometryRenderingTextureClearType.One,\r\n define: \"PREPASS_SCREENSPACE_DEPTH\",\r\n defineIndex: \"PREPASS_SCREENSPACE_DEPTH_INDEX\",\r\n },\r\n {\r\n type: Constants.PREPASS_VELOCITY_LINEAR_TEXTURE_TYPE,\r\n name: \"LinearVelocity\",\r\n clearType: GeometryRenderingTextureClearType.Zero,\r\n define: \"PREPASS_VELOCITY_LINEAR\",\r\n defineIndex: \"PREPASS_VELOCITY_LINEAR_INDEX\",\r\n },\r\n {\r\n type: Constants.PREPASS_ALBEDO_TEXTURE_TYPE,\r\n name: \"Albedo\",\r\n clearType: GeometryRenderingTextureClearType.Zero,\r\n define: \"PREPASS_ALBEDO\",\r\n defineIndex: \"PREPASS_ALBEDO_INDEX\",\r\n },\r\n {\r\n type: Constants.PREPASS_NORMALIZED_VIEW_DEPTH_TEXTURE_TYPE,\r\n name: \"NormalizedViewDepth\",\r\n clearType: GeometryRenderingTextureClearType.One,\r\n define: \"PREPASS_NORMALIZED_VIEW_DEPTH\",\r\n defineIndex: \"PREPASS_NORMALIZED_VIEW_DEPTH_INDEX\",\r\n },\r\n {\r\n type: Constants.PREPASS_COLOR_TEXTURE_TYPE,\r\n name: \"Color\",\r\n clearType: GeometryRenderingTextureClearType.NoClear,\r\n define: \"PREPASS_COLOR\",\r\n defineIndex: \"PREPASS_COLOR_INDEX\",\r\n },\r\n {\r\n type: Constants.PREPASS_IRRADIANCE_TEXTURE_TYPE,\r\n name: \"Irradiance\",\r\n clearType: GeometryRenderingTextureClearType.Zero,\r\n define: \"PREPASS_IRRADIANCE\",\r\n defineIndex: \"PREPASS_IRRADIANCE_INDEX\",\r\n },\r\n ];\r\n\r\n private static _Configurations: { [renderPassId: number]: GeometryRenderingConfiguration } = {};\r\n\r\n /**\r\n * Creates a new geometry rendering configuration.\r\n * @param renderPassId Render pass id the configuration is created for.\r\n * @returns The created configuration.\r\n */\r\n public static CreateConfiguration(renderPassId: number) {\r\n MaterialHelperGeometryRendering._Configurations[renderPassId] = {\r\n defines: {},\r\n previousWorldMatrices: {},\r\n previousViewProjection: Matrix.Zero(),\r\n currentViewProjection: Matrix.Zero(),\r\n previousBones: {},\r\n lastUpdateFrameId: -1,\r\n excludedSkinnedMesh: [],\r\n reverseCulling: false,\r\n };\r\n return MaterialHelperGeometryRendering._Configurations[renderPassId];\r\n }\r\n\r\n /**\r\n * Deletes a geometry rendering configuration.\r\n * @param renderPassId The render pass id of the configuration to delete.\r\n */\r\n public static DeleteConfiguration(renderPassId: number) {\r\n delete MaterialHelperGeometryRendering._Configurations[renderPassId];\r\n }\r\n\r\n /**\r\n * Gets a geometry rendering configuration.\r\n * @param renderPassId The render pass id of the configuration to get.\r\n * @returns The configuration.\r\n */\r\n public static GetConfiguration(renderPassId: number): GeometryRenderingConfiguration {\r\n return MaterialHelperGeometryRendering._Configurations[renderPassId];\r\n }\r\n\r\n /**\r\n * Adds uniforms and samplers for geometry rendering.\r\n * @param uniforms The array of uniforms to add to.\r\n * @param _samplers The array of samplers to add to.\r\n */\r\n public static AddUniformsAndSamplers(uniforms: string[], _samplers: string[]) {\r\n uniforms.push(\"previousWorld\", \"previousViewProjection\", \"mPreviousBones\");\r\n }\r\n\r\n /**\r\n * Marks a list of meshes as dirty for geometry rendering.\r\n * @param renderPassId The render pass id the meshes are marked as dirty for.\r\n * @param meshes The list of meshes to mark as dirty.\r\n */\r\n public static MarkAsDirty(renderPassId: number, meshes: AbstractMesh[]) {\r\n for (const mesh of meshes) {\r\n if (!mesh.subMeshes) {\r\n continue;\r\n }\r\n\r\n for (const subMesh of mesh.subMeshes) {\r\n subMesh._removeDrawWrapper(renderPassId);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Prepares defines for geometry rendering.\r\n * @param renderPassId The render pass id the defines are prepared for.\r\n * @param mesh The mesh the defines are prepared for.\r\n * @param defines The defines to update according to the geometry rendering configuration.\r\n */\r\n public static PrepareDefines(renderPassId: number, mesh: AbstractMesh, defines: MaterialDefines) {\r\n if (!defines._arePrePassDirty) {\r\n return;\r\n }\r\n\r\n const configuration = MaterialHelperGeometryRendering._Configurations[renderPassId];\r\n if (!configuration) {\r\n return;\r\n }\r\n\r\n defines[\"PREPASS\"] = true;\r\n\r\n let numMRT = 0;\r\n\r\n for (let i = 0; i < MaterialHelperGeometryRendering.GeometryTextureDescriptions.length; i++) {\r\n const geometryTextureDescription = MaterialHelperGeometryRendering.GeometryTextureDescriptions[i];\r\n const defineName = geometryTextureDescription.define;\r\n const defineIndex = geometryTextureDescription.defineIndex;\r\n const index = configuration.defines[defineIndex];\r\n\r\n if (index !== undefined) {\r\n defines[defineName] = true;\r\n defines[defineIndex] = index;\r\n numMRT++;\r\n } else {\r\n defines[defineName] = false;\r\n delete defines[defineIndex];\r\n }\r\n }\r\n\r\n defines[\"SCENE_MRT_COUNT\"] = numMRT;\r\n\r\n defines[\"BONES_VELOCITY_ENABLED\"] =\r\n mesh.useBones && mesh.computeBonesUsingShaders && mesh.skeleton && !mesh.skeleton.isUsingTextureForMatrices && configuration.excludedSkinnedMesh.indexOf(mesh) === -1;\r\n }\r\n\r\n /**\r\n * Binds geometry rendering data for a mesh.\r\n * @param renderPassId The render pass id the geometry rendering data is bound for.\r\n * @param effect The effect to bind the geometry rendering data to.\r\n * @param mesh The mesh to bind the geometry rendering data for.\r\n * @param world The world matrix of the mesh.\r\n * @param material The material of the mesh.\r\n */\r\n public static Bind(renderPassId: number, effect: Effect, mesh: Mesh, world: Matrix, material: Material) {\r\n const configuration = MaterialHelperGeometryRendering._Configurations[renderPassId];\r\n if (!configuration) {\r\n return;\r\n }\r\n\r\n const scene = mesh.getScene();\r\n const engine = scene.getEngine();\r\n\r\n if (configuration.reverseCulling) {\r\n engine.setStateCullFaceType(scene._mirroredCameraPosition ? material.cullBackFaces : !material.cullBackFaces);\r\n }\r\n\r\n if (configuration.defines[\"PREPASS_VELOCITY_INDEX\"] !== undefined || configuration.defines[\"PREPASS_VELOCITY_LINEAR_INDEX\"] !== undefined) {\r\n if (!configuration.previousWorldMatrices[mesh.uniqueId]) {\r\n configuration.previousWorldMatrices[mesh.uniqueId] = world.clone();\r\n }\r\n\r\n if (!configuration.previousViewProjection) {\r\n configuration.previousViewProjection = scene.getTransformMatrix().clone();\r\n configuration.currentViewProjection = scene.getTransformMatrix().clone();\r\n }\r\n\r\n if (configuration.currentViewProjection.updateFlag !== scene.getTransformMatrix().updateFlag) {\r\n // First update of the prepass configuration for this rendering pass\r\n configuration.lastUpdateFrameId = engine.frameId;\r\n configuration.previousViewProjection.copyFrom(configuration.currentViewProjection);\r\n configuration.currentViewProjection.copyFrom(scene.getTransformMatrix());\r\n } else if (configuration.lastUpdateFrameId !== engine.frameId) {\r\n // The scene transformation did not change from the previous frame (so no camera motion), we must update previousViewProjection accordingly\r\n configuration.lastUpdateFrameId = engine.frameId;\r\n configuration.previousViewProjection.copyFrom(configuration.currentViewProjection);\r\n }\r\n\r\n effect.setMatrix(\"previousWorld\", configuration.previousWorldMatrices[mesh.uniqueId]);\r\n effect.setMatrix(\"previousViewProjection\", configuration.previousViewProjection);\r\n\r\n configuration.previousWorldMatrices[mesh.uniqueId] = world.clone();\r\n\r\n if (mesh.useBones && mesh.computeBonesUsingShaders && mesh.skeleton) {\r\n const skeleton = mesh.skeleton;\r\n\r\n if (!skeleton.isUsingTextureForMatrices || effect.getUniformIndex(\"boneTextureInfo\") === -1) {\r\n const matrices = skeleton.getTransformMatrices(mesh);\r\n\r\n if (matrices) {\r\n if (!configuration.previousBones[mesh.uniqueId]) {\r\n configuration.previousBones[mesh.uniqueId] = matrices.slice();\r\n }\r\n effect.setMatrices(\"mPreviousBones\", configuration.previousBones[mesh.uniqueId]);\r\n configuration.previousBones[mesh.uniqueId].set(matrices);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"materialHelper.geometryrendering.js","sourceRoot":"","sources":["../../../../dev/core/src/Materials/materialHelper.geometryrendering.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAYrD,gBAAgB;AAChB,MAAM,UAAU,6BAA6B,CAAC,IAAkB,EAAE,QAA2C,EAAE,WAAW,GAAG,QAAQ;IACjI,MAAM,QAAQ,GAAG,QAAQ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IACD;QACI,IAAI,EAAE,SAAS,CAAC,0BAA0B;QAC1C,IAAI,EAAE,OAAO;QACb,SAAS,mDAA2C;QACpD,MAAM,EAAE,eAAe;QACvB,WAAW,EAAE,qBAAqB;KACrC;IACD;QACI,IAAI,EAAE,SAAS,CAAC,+BAA+B;QAC/C,IAAI,EAAE,YAAY;QAClB,SAAS,gDAAwC;QACjD,MAAM,EAAE,oBAAoB;QAC5B,WAAW,EAAE,0BAA0B;KAC1C;IACD;QACI,IAAI,EAAE,SAAS,CAAC,8BAA8B;QAC9C,IAAI,EAAE,UAAU;QAChB,SAAS,gDAAwC;QACjD,MAAM,EAAE,mBAAmB;QAC3B,WAAW,EAAE,yBAAyB;KACzC;CACJ,CAAC;AAEa,+CAAe,GAA+D,EAAE,CAAC","sourcesContent":["import { type MaterialDefines, type Effect, type Mesh, type AbstractMesh, type Material } from \"core/index\";\r\nimport { Constants } from \"core/Engines/constants\";\r\nimport { Matrix } from \"core/Maths/math.vector.pure\";\r\n\r\n/**\r\n * Provides the object ID written by geometry rendering for a mesh.\r\n *\r\n * IDs must be unsigned integers supported by the object ID texture format. ID 0 is reserved for background or excluded meshes.\r\n * RGBA textures support IDs up to 0xFFFFFF, while RED textures support IDs up to 0xFF.\r\n * This callback runs in the render hot path and may be called multiple times for the same mesh in a frame.\r\n * It should avoid allocations and return a consistent value for a mesh during a render.\r\n */\r\nexport type GeometryRenderingObjectIdProvider = (mesh: AbstractMesh) => number;\r\n\r\n/** @internal */\r\nexport function _GetGeometryRenderingObjectId(mesh: AbstractMesh, provider: GeometryRenderingObjectIdProvider, maxObjectId = 0xffffff): number {\r\n const objectId = provider(mesh);\r\n\r\n if (!Number.isInteger(objectId) || objectId < 0 || objectId > maxObjectId) {\r\n throw new Error(`Invalid geometry object ID ${objectId} for mesh \"${mesh.name}\". Object IDs must be integers between 0 and 0x${maxObjectId.toString(16).toUpperCase()}.`);\r\n }\r\n\r\n return objectId;\r\n}\r\n\r\n/**\r\n * Type of clear operation to perform on a geometry texture.\r\n */\r\nexport const enum GeometryRenderingTextureClearType {\r\n /**\r\n * Clear the texture with zero.\r\n */\r\n Zero = 0,\r\n\r\n /**\r\n * Clear the texture with one.\r\n */\r\n One = 1,\r\n\r\n /**\r\n * Clear the texture with the maximum view Z value.\r\n */\r\n MaxViewZ = 2,\r\n\r\n /**\r\n * Do not clear the texture.\r\n */\r\n NoClear = 3,\r\n}\r\n\r\n/**\r\n * Configuration for geometry rendering.\r\n * A configuration is created for each rendering pass a geometry rendering is used in.\r\n */\r\nexport type GeometryRenderingConfiguration = {\r\n /**\r\n * Defines used for the geometry rendering.\r\n */\r\n defines: { [name: string]: number };\r\n\r\n /**\r\n * Previous world matrices for meshes.\r\n */\r\n previousWorldMatrices: { [index: number]: Matrix };\r\n\r\n /**\r\n * Previous view projection matrix.\r\n */\r\n previousViewProjection: Matrix;\r\n\r\n /**\r\n * Current view projection matrix.\r\n */\r\n currentViewProjection: Matrix;\r\n\r\n /**\r\n * Previous bones for skinned meshes.\r\n */\r\n previousBones: { [index: number]: Float32Array };\r\n\r\n /**\r\n * Last frame id the configuration was updated.\r\n */\r\n lastUpdateFrameId: number;\r\n\r\n /**\r\n * List of excluded skinned meshes.\r\n */\r\n excludedSkinnedMesh: AbstractMesh[];\r\n\r\n /**\r\n * Whether to reverse culling for the geometry rendering (meaning, if back faces should be culled, front faces are culled instead, and the other way around).\r\n */\r\n reverseCulling: boolean;\r\n\r\n /**\r\n * Provides the object ID written for each rendered mesh.\r\n */\r\n objectIdProvider?: GeometryRenderingObjectIdProvider;\r\n\r\n /**\r\n * Whether the object ID texture uses the RED format.\r\n */\r\n objectIdIsRedFormat: boolean;\r\n};\r\n\r\n/**\r\n * Helper class to manage geometry rendering.\r\n */\r\nexport class MaterialHelperGeometryRendering {\r\n /**\r\n * Descriptions of the geometry textures.\r\n */\r\n public static readonly GeometryTextureDescriptions = [\r\n {\r\n type: Constants.PREPASS_IRRADIANCE_LEGACY_TEXTURE_TYPE,\r\n name: \"IrradianceLegacy\",\r\n clearType: GeometryRenderingTextureClearType.Zero,\r\n define: \"PREPASS_IRRADIANCE_LEGACY\",\r\n defineIndex: \"PREPASS_IRRADIANCE_LEGACY_INDEX\",\r\n },\r\n {\r\n type: Constants.PREPASS_POSITION_TEXTURE_TYPE,\r\n name: \"WorldPosition\",\r\n clearType: GeometryRenderingTextureClearType.Zero,\r\n define: \"PREPASS_POSITION\",\r\n defineIndex: \"PREPASS_POSITION_INDEX\",\r\n },\r\n {\r\n type: Constants.PREPASS_VELOCITY_TEXTURE_TYPE,\r\n name: \"Velocity\",\r\n clearType: GeometryRenderingTextureClearType.Zero,\r\n define: \"PREPASS_VELOCITY\",\r\n defineIndex: \"PREPASS_VELOCITY_INDEX\",\r\n },\r\n {\r\n type: Constants.PREPASS_REFLECTIVITY_TEXTURE_TYPE,\r\n name: \"Reflectivity\",\r\n clearType: GeometryRenderingTextureClearType.Zero,\r\n define: \"PREPASS_REFLECTIVITY\",\r\n defineIndex: \"PREPASS_REFLECTIVITY_INDEX\",\r\n },\r\n {\r\n type: Constants.PREPASS_DEPTH_TEXTURE_TYPE,\r\n name: \"ViewDepth\",\r\n clearType: GeometryRenderingTextureClearType.MaxViewZ,\r\n define: \"PREPASS_DEPTH\",\r\n defineIndex: \"PREPASS_DEPTH_INDEX\",\r\n },\r\n {\r\n type: Constants.PREPASS_NORMAL_TEXTURE_TYPE,\r\n name: \"ViewNormal\",\r\n clearType: GeometryRenderingTextureClearType.Zero,\r\n define: \"PREPASS_NORMAL\",\r\n defineIndex: \"PREPASS_NORMAL_INDEX\",\r\n },\r\n {\r\n type: Constants.PREPASS_ALBEDO_SQRT_TEXTURE_TYPE,\r\n name: \"AlbedoSqrt\",\r\n clearType: GeometryRenderingTextureClearType.Zero,\r\n define: \"PREPASS_ALBEDO_SQRT\",\r\n defineIndex: \"PREPASS_ALBEDO_SQRT_INDEX\",\r\n },\r\n {\r\n type: Constants.PREPASS_WORLD_NORMAL_TEXTURE_TYPE,\r\n name: \"WorldNormal\",\r\n clearType: GeometryRenderingTextureClearType.Zero,\r\n define: \"PREPASS_WORLD_NORMAL\",\r\n defineIndex: \"PREPASS_WORLD_NORMAL_INDEX\",\r\n },\r\n {\r\n type: Constants.PREPASS_LOCAL_POSITION_TEXTURE_TYPE,\r\n name: \"LocalPosition\",\r\n clearType: GeometryRenderingTextureClearType.Zero,\r\n define: \"PREPASS_LOCAL_POSITION\",\r\n defineIndex: \"PREPASS_LOCAL_POSITION_INDEX\",\r\n },\r\n {\r\n type: Constants.PREPASS_SCREENSPACE_DEPTH_TEXTURE_TYPE,\r\n name: \"ScreenDepth\",\r\n clearType: GeometryRenderingTextureClearType.One,\r\n define: \"PREPASS_SCREENSPACE_DEPTH\",\r\n defineIndex: \"PREPASS_SCREENSPACE_DEPTH_INDEX\",\r\n },\r\n {\r\n type: Constants.PREPASS_VELOCITY_LINEAR_TEXTURE_TYPE,\r\n name: \"LinearVelocity\",\r\n clearType: GeometryRenderingTextureClearType.Zero,\r\n define: \"PREPASS_VELOCITY_LINEAR\",\r\n defineIndex: \"PREPASS_VELOCITY_LINEAR_INDEX\",\r\n },\r\n {\r\n type: Constants.PREPASS_ALBEDO_TEXTURE_TYPE,\r\n name: \"Albedo\",\r\n clearType: GeometryRenderingTextureClearType.Zero,\r\n define: \"PREPASS_ALBEDO\",\r\n defineIndex: \"PREPASS_ALBEDO_INDEX\",\r\n },\r\n {\r\n type: Constants.PREPASS_NORMALIZED_VIEW_DEPTH_TEXTURE_TYPE,\r\n name: \"NormalizedViewDepth\",\r\n clearType: GeometryRenderingTextureClearType.One,\r\n define: \"PREPASS_NORMALIZED_VIEW_DEPTH\",\r\n defineIndex: \"PREPASS_NORMALIZED_VIEW_DEPTH_INDEX\",\r\n },\r\n {\r\n type: Constants.PREPASS_COLOR_TEXTURE_TYPE,\r\n name: \"Color\",\r\n clearType: GeometryRenderingTextureClearType.NoClear,\r\n define: \"PREPASS_COLOR\",\r\n defineIndex: \"PREPASS_COLOR_INDEX\",\r\n },\r\n {\r\n type: Constants.PREPASS_IRRADIANCE_TEXTURE_TYPE,\r\n name: \"Irradiance\",\r\n clearType: GeometryRenderingTextureClearType.Zero,\r\n define: \"PREPASS_IRRADIANCE\",\r\n defineIndex: \"PREPASS_IRRADIANCE_INDEX\",\r\n },\r\n {\r\n type: Constants.PREPASS_OBJECT_ID_TEXTURE_TYPE,\r\n name: \"ObjectId\",\r\n clearType: GeometryRenderingTextureClearType.Zero,\r\n define: \"PREPASS_OBJECT_ID\",\r\n defineIndex: \"PREPASS_OBJECT_ID_INDEX\",\r\n },\r\n ];\r\n\r\n private static _Configurations: { [renderPassId: number]: GeometryRenderingConfiguration } = {};\r\n\r\n /**\r\n * Creates a new geometry rendering configuration.\r\n * @param renderPassId Render pass id the configuration is created for.\r\n * @returns The created configuration.\r\n */\r\n public static CreateConfiguration(renderPassId: number) {\r\n MaterialHelperGeometryRendering._Configurations[renderPassId] = {\r\n defines: {},\r\n previousWorldMatrices: {},\r\n previousViewProjection: Matrix.Zero(),\r\n currentViewProjection: Matrix.Zero(),\r\n previousBones: {},\r\n lastUpdateFrameId: -1,\r\n excludedSkinnedMesh: [],\r\n reverseCulling: false,\r\n objectIdIsRedFormat: false,\r\n };\r\n return MaterialHelperGeometryRendering._Configurations[renderPassId];\r\n }\r\n\r\n /**\r\n * Deletes a geometry rendering configuration.\r\n * @param renderPassId The render pass id of the configuration to delete.\r\n */\r\n public static DeleteConfiguration(renderPassId: number) {\r\n delete MaterialHelperGeometryRendering._Configurations[renderPassId];\r\n }\r\n\r\n /**\r\n * Gets a geometry rendering configuration.\r\n * @param renderPassId The render pass id of the configuration to get.\r\n * @returns The configuration.\r\n */\r\n public static GetConfiguration(renderPassId: number): GeometryRenderingConfiguration {\r\n return MaterialHelperGeometryRendering._Configurations[renderPassId];\r\n }\r\n\r\n /**\r\n * Adds uniforms and samplers for geometry rendering.\r\n * @param uniforms The array of uniforms to add to.\r\n * @param _samplers The array of samplers to add to.\r\n */\r\n public static AddUniformsAndSamplers(uniforms: string[], _samplers: string[]) {\r\n uniforms.push(\"previousWorld\", \"previousViewProjection\", \"mPreviousBones\", \"objectId\");\r\n }\r\n\r\n /**\r\n * Marks a list of meshes as dirty for geometry rendering.\r\n * @param renderPassId The render pass id the meshes are marked as dirty for.\r\n * @param meshes The list of meshes to mark as dirty.\r\n */\r\n public static MarkAsDirty(renderPassId: number, meshes: AbstractMesh[]) {\r\n for (const mesh of meshes) {\r\n if (!mesh.subMeshes) {\r\n continue;\r\n }\r\n\r\n for (const subMesh of mesh.subMeshes) {\r\n subMesh._removeDrawWrapper(renderPassId);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Prepares defines for geometry rendering.\r\n * @param renderPassId The render pass id the defines are prepared for.\r\n * @param mesh The mesh the defines are prepared for.\r\n * @param defines The defines to update according to the geometry rendering configuration.\r\n */\r\n public static PrepareDefines(renderPassId: number, mesh: AbstractMesh, defines: MaterialDefines) {\r\n if (!defines._arePrePassDirty) {\r\n return;\r\n }\r\n\r\n const configuration = MaterialHelperGeometryRendering._Configurations[renderPassId];\r\n if (!configuration) {\r\n return;\r\n }\r\n\r\n defines[\"PREPASS\"] = true;\r\n\r\n let numMRT = 0;\r\n\r\n for (let i = 0; i < MaterialHelperGeometryRendering.GeometryTextureDescriptions.length; i++) {\r\n const geometryTextureDescription = MaterialHelperGeometryRendering.GeometryTextureDescriptions[i];\r\n const defineName = geometryTextureDescription.define;\r\n const defineIndex = geometryTextureDescription.defineIndex;\r\n const index = configuration.defines[defineIndex];\r\n\r\n if (index !== undefined) {\r\n defines[defineName] = true;\r\n defines[defineIndex] = index;\r\n numMRT++;\r\n } else {\r\n defines[defineName] = false;\r\n delete defines[defineIndex];\r\n }\r\n }\r\n\r\n defines[\"PREPASS_OBJECT_ID_R8\"] = configuration.objectIdIsRedFormat;\r\n defines[\"SCENE_MRT_COUNT\"] = numMRT;\r\n\r\n defines[\"BONES_VELOCITY_ENABLED\"] =\r\n mesh.useBones && mesh.computeBonesUsingShaders && mesh.skeleton && !mesh.skeleton.isUsingTextureForMatrices && configuration.excludedSkinnedMesh.indexOf(mesh) === -1;\r\n }\r\n\r\n /**\r\n * Binds geometry rendering data for a mesh.\r\n * @param renderPassId The render pass id the geometry rendering data is bound for.\r\n * @param effect The effect to bind the geometry rendering data to.\r\n * @param mesh The mesh to bind the geometry rendering data for.\r\n * @param world The world matrix of the mesh.\r\n * @param material The material of the mesh.\r\n */\r\n public static Bind(renderPassId: number, effect: Effect, mesh: Mesh, world: Matrix, material: Material) {\r\n const configuration = MaterialHelperGeometryRendering._Configurations[renderPassId];\r\n if (!configuration) {\r\n return;\r\n }\r\n\r\n const scene = mesh.getScene();\r\n const engine = scene.getEngine();\r\n\r\n if (configuration.reverseCulling) {\r\n engine.setStateCullFaceType(scene._mirroredCameraPosition ? material.cullBackFaces : !material.cullBackFaces);\r\n }\r\n\r\n if (configuration.defines[\"PREPASS_OBJECT_ID_INDEX\"] !== undefined) {\r\n const maxObjectId = configuration.objectIdIsRedFormat ? 0xff : 0xffffff;\r\n let objectId = mesh.uniqueId;\r\n if (configuration.objectIdProvider) {\r\n objectId = _GetGeometryRenderingObjectId(mesh, configuration.objectIdProvider, maxObjectId);\r\n } else if (objectId > maxObjectId) {\r\n throw new Error(\r\n `Invalid geometry object ID ${objectId} for mesh \"${mesh.name}\". Object IDs must be integers between 0 and 0x${maxObjectId.toString(16).toUpperCase()}.`\r\n );\r\n }\r\n effect.setFloat(\"objectId\", objectId);\r\n }\r\n\r\n if (configuration.defines[\"PREPASS_VELOCITY_INDEX\"] !== undefined || configuration.defines[\"PREPASS_VELOCITY_LINEAR_INDEX\"] !== undefined) {\r\n if (!configuration.previousWorldMatrices[mesh.uniqueId]) {\r\n configuration.previousWorldMatrices[mesh.uniqueId] = world.clone();\r\n }\r\n\r\n if (!configuration.previousViewProjection) {\r\n configuration.previousViewProjection = scene.getTransformMatrix().clone();\r\n configuration.currentViewProjection = scene.getTransformMatrix().clone();\r\n }\r\n\r\n if (configuration.currentViewProjection.updateFlag !== scene.getTransformMatrix().updateFlag) {\r\n // First update of the prepass configuration for this rendering pass\r\n configuration.lastUpdateFrameId = engine.frameId;\r\n configuration.previousViewProjection.copyFrom(configuration.currentViewProjection);\r\n configuration.currentViewProjection.copyFrom(scene.getTransformMatrix());\r\n } else if (configuration.lastUpdateFrameId !== engine.frameId) {\r\n // The scene transformation did not change from the previous frame (so no camera motion), we must update previousViewProjection accordingly\r\n configuration.lastUpdateFrameId = engine.frameId;\r\n configuration.previousViewProjection.copyFrom(configuration.currentViewProjection);\r\n }\r\n\r\n effect.setMatrix(\"previousWorld\", configuration.previousWorldMatrices[mesh.uniqueId]);\r\n effect.setMatrix(\"previousViewProjection\", configuration.previousViewProjection);\r\n\r\n configuration.previousWorldMatrices[mesh.uniqueId] = world.clone();\r\n\r\n if (mesh.useBones && mesh.computeBonesUsingShaders && mesh.skeleton) {\r\n const skeleton = mesh.skeleton;\r\n\r\n if (!skeleton.isUsingTextureForMatrices || effect.getUniformIndex(\"boneTextureInfo\") === -1) {\r\n const matrices = skeleton.getTransformMatrices(mesh);\r\n\r\n if (matrices) {\r\n if (!configuration.previousBones[mesh.uniqueId]) {\r\n configuration.previousBones[mesh.uniqueId] = matrices.slice();\r\n }\r\n effect.setMatrices(\"mPreviousBones\", configuration.previousBones[mesh.uniqueId]);\r\n configuration.previousBones[mesh.uniqueId].set(matrices);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}\r\n"]}
@@ -37,6 +37,9 @@ export declare function PrepassDefinesMixin<Tbase extends PrepassDefinesMixinCon
37
37
  PREPASS_VELOCITY_LINEAR_INDEX: number;
38
38
  PREPASS_REFLECTIVITY: boolean;
39
39
  PREPASS_REFLECTIVITY_INDEX: number;
40
+ PREPASS_OBJECT_ID: boolean;
41
+ PREPASS_OBJECT_ID_INDEX: number;
42
+ PREPASS_OBJECT_ID_R8: boolean;
40
43
  SCENE_MRT_COUNT: number;
41
44
  };
42
45
  } & Tbase;
@@ -38,6 +38,9 @@ export function PrepassDefinesMixin(base) {
38
38
  this.PREPASS_VELOCITY_LINEAR_INDEX = -1;
39
39
  this.PREPASS_REFLECTIVITY = false;
40
40
  this.PREPASS_REFLECTIVITY_INDEX = -1;
41
+ this.PREPASS_OBJECT_ID = false;
42
+ this.PREPASS_OBJECT_ID_INDEX = -1;
43
+ this.PREPASS_OBJECT_ID_R8 = false;
41
44
  this.SCENE_MRT_COUNT = 0;
42
45
  }
43
46
  };
@@ -1 +1 @@
1
- {"version":3,"file":"prepass.defines.js","sourceRoot":"","sources":["../../../../dev/core/src/Materials/prepass.defines.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAA+C,IAAW;IACzF,OAAO,KAAM,SAAQ,IAAI;QAAlB;;YACI,YAAO,GAAG,KAAK,CAAC;YAChB,kBAAa,GAAG,KAAK,CAAC;YACtB,wBAAmB,GAAG,CAAC,CAAC,CAAC;YACzB,8BAAyB,GAAG,KAAK,CAAC;YAClC,oCAA+B,GAAG,CAAC,CAAC,CAAC;YACrC,uBAAkB,GAAG,KAAK,CAAC;YAC3B,6BAAwB,GAAG,CAAC,CAAC,CAAC;YAC9B,mBAAc,GAAG,KAAK,CAAC;YACvB,yBAAoB,GAAG,CAAC,CAAC,CAAC;YAC1B,wBAAmB,GAAG,KAAK,CAAC;YAC5B,8BAAyB,GAAG,CAAC,CAAC,CAAC;YAC/B,kBAAa,GAAG,KAAK,CAAC;YACtB,wBAAmB,GAAG,CAAC,CAAC,CAAC;YACzB,8BAAyB,GAAG,KAAK,CAAC;YAClC,oCAA+B,GAAG,CAAC,CAAC,CAAC;YACrC,kCAA6B,GAAG,KAAK,CAAC;YACtC,wCAAmC,GAAG,CAAC,CAAC,CAAC;YACzC,mBAAc,GAAG,KAAK,CAAC;YACvB,yBAAoB,GAAG,CAAC,CAAC,CAAC;YAC1B,8BAAyB,GAAG,KAAK,CAAC;YAClC,yBAAoB,GAAG,KAAK,CAAC;YAC7B,+BAA0B,GAAG,CAAC,CAAC,CAAC;YAChC,qBAAgB,GAAG,KAAK,CAAC;YACzB,2BAAsB,GAAG,CAAC,CAAC,CAAC;YAC5B,2BAAsB,GAAG,KAAK,CAAC;YAC/B,iCAA4B,GAAG,CAAC,CAAC,CAAC;YAClC,qBAAgB,GAAG,KAAK,CAAC;YACzB,2BAAsB,GAAG,CAAC,CAAC,CAAC;YAC5B,4BAAuB,GAAG,KAAK,CAAC;YAChC,kCAA6B,GAAG,CAAC,CAAC,CAAC;YACnC,yBAAoB,GAAG,KAAK,CAAC;YAC7B,+BAA0B,GAAG,CAAC,CAAC,CAAC;YAChC,oBAAe,GAAG,CAAC,CAAC;QAC/B,CAAC;KAAA,CAAC;AACN,CAAC","sourcesContent":["type PrepassDefinesMixinConstructor<T = {}> = new (...args: any[]) => T;\r\n\r\n/**\r\n * Mixin to add prepass defines to your material defines\r\n * @internal\r\n */\r\nexport function PrepassDefinesMixin<Tbase extends PrepassDefinesMixinConstructor>(base: Tbase) {\r\n return class extends base {\r\n public PREPASS = false;\r\n public PREPASS_COLOR = false;\r\n public PREPASS_COLOR_INDEX = -1;\r\n public PREPASS_IRRADIANCE_LEGACY = false;\r\n public PREPASS_IRRADIANCE_LEGACY_INDEX = -1;\r\n public PREPASS_IRRADIANCE = false;\r\n public PREPASS_IRRADIANCE_INDEX = -1;\r\n public PREPASS_ALBEDO = false;\r\n public PREPASS_ALBEDO_INDEX = -1;\r\n public PREPASS_ALBEDO_SQRT = false;\r\n public PREPASS_ALBEDO_SQRT_INDEX = -1;\r\n public PREPASS_DEPTH = false;\r\n public PREPASS_DEPTH_INDEX = -1;\r\n public PREPASS_SCREENSPACE_DEPTH = false;\r\n public PREPASS_SCREENSPACE_DEPTH_INDEX = -1;\r\n public PREPASS_NORMALIZED_VIEW_DEPTH = false;\r\n public PREPASS_NORMALIZED_VIEW_DEPTH_INDEX = -1;\r\n public PREPASS_NORMAL = false;\r\n public PREPASS_NORMAL_INDEX = -1;\r\n public PREPASS_NORMAL_WORLDSPACE = false;\r\n public PREPASS_WORLD_NORMAL = false;\r\n public PREPASS_WORLD_NORMAL_INDEX = -1;\r\n public PREPASS_POSITION = false;\r\n public PREPASS_POSITION_INDEX = -1;\r\n public PREPASS_LOCAL_POSITION = false;\r\n public PREPASS_LOCAL_POSITION_INDEX = -1;\r\n public PREPASS_VELOCITY = false;\r\n public PREPASS_VELOCITY_INDEX = -1;\r\n public PREPASS_VELOCITY_LINEAR = false;\r\n public PREPASS_VELOCITY_LINEAR_INDEX = -1;\r\n public PREPASS_REFLECTIVITY = false;\r\n public PREPASS_REFLECTIVITY_INDEX = -1;\r\n public SCENE_MRT_COUNT = 0;\r\n };\r\n}\r\n"]}
1
+ {"version":3,"file":"prepass.defines.js","sourceRoot":"","sources":["../../../../dev/core/src/Materials/prepass.defines.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAA+C,IAAW;IACzF,OAAO,KAAM,SAAQ,IAAI;QAAlB;;YACI,YAAO,GAAG,KAAK,CAAC;YAChB,kBAAa,GAAG,KAAK,CAAC;YACtB,wBAAmB,GAAG,CAAC,CAAC,CAAC;YACzB,8BAAyB,GAAG,KAAK,CAAC;YAClC,oCAA+B,GAAG,CAAC,CAAC,CAAC;YACrC,uBAAkB,GAAG,KAAK,CAAC;YAC3B,6BAAwB,GAAG,CAAC,CAAC,CAAC;YAC9B,mBAAc,GAAG,KAAK,CAAC;YACvB,yBAAoB,GAAG,CAAC,CAAC,CAAC;YAC1B,wBAAmB,GAAG,KAAK,CAAC;YAC5B,8BAAyB,GAAG,CAAC,CAAC,CAAC;YAC/B,kBAAa,GAAG,KAAK,CAAC;YACtB,wBAAmB,GAAG,CAAC,CAAC,CAAC;YACzB,8BAAyB,GAAG,KAAK,CAAC;YAClC,oCAA+B,GAAG,CAAC,CAAC,CAAC;YACrC,kCAA6B,GAAG,KAAK,CAAC;YACtC,wCAAmC,GAAG,CAAC,CAAC,CAAC;YACzC,mBAAc,GAAG,KAAK,CAAC;YACvB,yBAAoB,GAAG,CAAC,CAAC,CAAC;YAC1B,8BAAyB,GAAG,KAAK,CAAC;YAClC,yBAAoB,GAAG,KAAK,CAAC;YAC7B,+BAA0B,GAAG,CAAC,CAAC,CAAC;YAChC,qBAAgB,GAAG,KAAK,CAAC;YACzB,2BAAsB,GAAG,CAAC,CAAC,CAAC;YAC5B,2BAAsB,GAAG,KAAK,CAAC;YAC/B,iCAA4B,GAAG,CAAC,CAAC,CAAC;YAClC,qBAAgB,GAAG,KAAK,CAAC;YACzB,2BAAsB,GAAG,CAAC,CAAC,CAAC;YAC5B,4BAAuB,GAAG,KAAK,CAAC;YAChC,kCAA6B,GAAG,CAAC,CAAC,CAAC;YACnC,yBAAoB,GAAG,KAAK,CAAC;YAC7B,+BAA0B,GAAG,CAAC,CAAC,CAAC;YAChC,sBAAiB,GAAG,KAAK,CAAC;YAC1B,4BAAuB,GAAG,CAAC,CAAC,CAAC;YAC7B,yBAAoB,GAAG,KAAK,CAAC;YAC7B,oBAAe,GAAG,CAAC,CAAC;QAC/B,CAAC;KAAA,CAAC;AACN,CAAC","sourcesContent":["type PrepassDefinesMixinConstructor<T = {}> = new (...args: any[]) => T;\r\n\r\n/**\r\n * Mixin to add prepass defines to your material defines\r\n * @internal\r\n */\r\nexport function PrepassDefinesMixin<Tbase extends PrepassDefinesMixinConstructor>(base: Tbase) {\r\n return class extends base {\r\n public PREPASS = false;\r\n public PREPASS_COLOR = false;\r\n public PREPASS_COLOR_INDEX = -1;\r\n public PREPASS_IRRADIANCE_LEGACY = false;\r\n public PREPASS_IRRADIANCE_LEGACY_INDEX = -1;\r\n public PREPASS_IRRADIANCE = false;\r\n public PREPASS_IRRADIANCE_INDEX = -1;\r\n public PREPASS_ALBEDO = false;\r\n public PREPASS_ALBEDO_INDEX = -1;\r\n public PREPASS_ALBEDO_SQRT = false;\r\n public PREPASS_ALBEDO_SQRT_INDEX = -1;\r\n public PREPASS_DEPTH = false;\r\n public PREPASS_DEPTH_INDEX = -1;\r\n public PREPASS_SCREENSPACE_DEPTH = false;\r\n public PREPASS_SCREENSPACE_DEPTH_INDEX = -1;\r\n public PREPASS_NORMALIZED_VIEW_DEPTH = false;\r\n public PREPASS_NORMALIZED_VIEW_DEPTH_INDEX = -1;\r\n public PREPASS_NORMAL = false;\r\n public PREPASS_NORMAL_INDEX = -1;\r\n public PREPASS_NORMAL_WORLDSPACE = false;\r\n public PREPASS_WORLD_NORMAL = false;\r\n public PREPASS_WORLD_NORMAL_INDEX = -1;\r\n public PREPASS_POSITION = false;\r\n public PREPASS_POSITION_INDEX = -1;\r\n public PREPASS_LOCAL_POSITION = false;\r\n public PREPASS_LOCAL_POSITION_INDEX = -1;\r\n public PREPASS_VELOCITY = false;\r\n public PREPASS_VELOCITY_INDEX = -1;\r\n public PREPASS_VELOCITY_LINEAR = false;\r\n public PREPASS_VELOCITY_LINEAR_INDEX = -1;\r\n public PREPASS_REFLECTIVITY = false;\r\n public PREPASS_REFLECTIVITY_INDEX = -1;\r\n public PREPASS_OBJECT_ID = false;\r\n public PREPASS_OBJECT_ID_INDEX = -1;\r\n public PREPASS_OBJECT_ID_R8 = false;\r\n public SCENE_MRT_COUNT = 0;\r\n };\r\n}\r\n"]}
@@ -50,6 +50,9 @@ declare const StandardMaterialDefinesBase_base: {
50
50
  PREPASS_VELOCITY_LINEAR_INDEX: number;
51
51
  PREPASS_REFLECTIVITY: boolean;
52
52
  PREPASS_REFLECTIVITY_INDEX: number;
53
+ PREPASS_OBJECT_ID: boolean;
54
+ PREPASS_OBJECT_ID_INDEX: number;
55
+ PREPASS_OBJECT_ID_R8: boolean;
53
56
  SCENE_MRT_COUNT: number;
54
57
  };
55
58
  } & {
@@ -842,11 +842,7 @@ export declare class Vector3 implements Vector<Tuple<number, 3>, IVector3LikeInt
842
842
  * Intercept the x,y,z value change
843
843
  * @param interceptor
844
844
  */
845
- setInterceptor(interceptor?: (newValue: {
846
- x?: number;
847
- y?: number;
848
- z?: number;
849
- }) => boolean): void;
845
+ setInterceptor(interceptor?: VectorInterceptor): void;
850
846
  /**
851
847
  * Get the current interceptor
852
848
  * @returns the current vector interceptor