@babylonjs/core 7.53.0 → 7.53.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 (126) hide show
  1. package/Culling/Helper/boundingInfoHelper.d.ts +2 -2
  2. package/Culling/Helper/boundingInfoHelper.js +2 -2
  3. package/Culling/Helper/boundingInfoHelper.js.map +1 -1
  4. package/Engines/abstractEngine.js +2 -2
  5. package/Engines/abstractEngine.js.map +1 -1
  6. package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.js +1 -1
  7. package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.js.map +1 -1
  8. package/FlowGraph/Blocks/Data/Math/flowGraphMatrixMathBlocks.js +7 -2
  9. package/FlowGraph/Blocks/Data/Math/flowGraphMatrixMathBlocks.js.map +1 -1
  10. package/FlowGraph/CustomTypes/flowGraphMatrix.d.ts +1 -0
  11. package/FlowGraph/CustomTypes/flowGraphMatrix.js +18 -17
  12. package/FlowGraph/CustomTypes/flowGraphMatrix.js.map +1 -1
  13. package/FlowGraph/flowGraphDataConnection.d.ts +10 -1
  14. package/FlowGraph/flowGraphDataConnection.js +23 -13
  15. package/FlowGraph/flowGraphDataConnection.js.map +1 -1
  16. package/FlowGraph/flowGraphRichTypes.d.ts +5 -0
  17. package/FlowGraph/flowGraphRichTypes.js +12 -0
  18. package/FlowGraph/flowGraphRichTypes.js.map +1 -1
  19. package/FrameGraph/Node/Blocks/Layers/glowLayerBlock.d.ts +2 -2
  20. package/FrameGraph/Node/Blocks/Layers/glowLayerBlock.js +6 -6
  21. package/FrameGraph/Node/Blocks/Layers/glowLayerBlock.js.map +1 -1
  22. package/FrameGraph/Node/Blocks/Layers/highlightLayerBlock.d.ts +2 -2
  23. package/FrameGraph/Node/Blocks/Layers/highlightLayerBlock.js +6 -6
  24. package/FrameGraph/Node/Blocks/Layers/highlightLayerBlock.js.map +1 -1
  25. package/FrameGraph/Node/Blocks/PostProcesses/anaglyphPostProcessBlock.d.ts +30 -0
  26. package/FrameGraph/Node/Blocks/PostProcesses/anaglyphPostProcessBlock.js +48 -0
  27. package/FrameGraph/Node/Blocks/PostProcesses/anaglyphPostProcessBlock.js.map +1 -0
  28. package/FrameGraph/Node/Blocks/PostProcesses/basePostProcessBlock.d.ts +3 -3
  29. package/FrameGraph/Node/Blocks/PostProcesses/basePostProcessBlock.js +6 -6
  30. package/FrameGraph/Node/Blocks/PostProcesses/basePostProcessBlock.js.map +1 -1
  31. package/FrameGraph/Node/Blocks/PostProcesses/chromaticAberrationPostProcessBlock.d.ts +38 -0
  32. package/FrameGraph/Node/Blocks/PostProcesses/chromaticAberrationPostProcessBlock.js +88 -0
  33. package/FrameGraph/Node/Blocks/PostProcesses/chromaticAberrationPostProcessBlock.js.map +1 -0
  34. package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.d.ts +2 -2
  35. package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js +6 -6
  36. package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js.map +1 -1
  37. package/FrameGraph/Node/Blocks/Rendering/utilityLayerRendererBlock.d.ts +2 -2
  38. package/FrameGraph/Node/Blocks/Rendering/utilityLayerRendererBlock.js +6 -6
  39. package/FrameGraph/Node/Blocks/Rendering/utilityLayerRendererBlock.js.map +1 -1
  40. package/FrameGraph/Node/Blocks/Textures/clearBlock.d.ts +2 -2
  41. package/FrameGraph/Node/Blocks/Textures/clearBlock.js +7 -7
  42. package/FrameGraph/Node/Blocks/Textures/clearBlock.js.map +1 -1
  43. package/FrameGraph/Node/Blocks/Textures/copyTextureBlock.d.ts +2 -2
  44. package/FrameGraph/Node/Blocks/Textures/copyTextureBlock.js +6 -6
  45. package/FrameGraph/Node/Blocks/Textures/copyTextureBlock.js.map +1 -1
  46. package/FrameGraph/Node/Blocks/Textures/generateMipmapsBlock.d.ts +2 -2
  47. package/FrameGraph/Node/Blocks/Textures/generateMipmapsBlock.js +7 -7
  48. package/FrameGraph/Node/Blocks/Textures/generateMipmapsBlock.js.map +1 -1
  49. package/FrameGraph/Node/Blocks/index.d.ts +2 -0
  50. package/FrameGraph/Node/Blocks/index.js +2 -0
  51. package/FrameGraph/Node/Blocks/index.js.map +1 -1
  52. package/FrameGraph/Node/nodeRenderGraph.js +2 -2
  53. package/FrameGraph/Node/nodeRenderGraph.js.map +1 -1
  54. package/FrameGraph/Tasks/Layers/baseLayerTask.d.ts +3 -3
  55. package/FrameGraph/Tasks/Layers/baseLayerTask.js +12 -12
  56. package/FrameGraph/Tasks/Layers/baseLayerTask.js.map +1 -1
  57. package/FrameGraph/Tasks/PostProcesses/anaglyphTask.d.ts +21 -0
  58. package/FrameGraph/Tasks/PostProcesses/anaglyphTask.js +27 -0
  59. package/FrameGraph/Tasks/PostProcesses/anaglyphTask.js.map +1 -0
  60. package/FrameGraph/Tasks/PostProcesses/bloomTask.d.ts +2 -2
  61. package/FrameGraph/Tasks/PostProcesses/bloomTask.js +5 -5
  62. package/FrameGraph/Tasks/PostProcesses/bloomTask.js.map +1 -1
  63. package/FrameGraph/Tasks/PostProcesses/chromaticAberrationTask.d.ts +17 -0
  64. package/FrameGraph/Tasks/PostProcesses/chromaticAberrationTask.js +23 -0
  65. package/FrameGraph/Tasks/PostProcesses/chromaticAberrationTask.js.map +1 -0
  66. package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.d.ts +2 -2
  67. package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.js +5 -5
  68. package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.js.map +1 -1
  69. package/FrameGraph/Tasks/PostProcesses/postProcessTask.d.ts +2 -2
  70. package/FrameGraph/Tasks/PostProcesses/postProcessTask.js +1 -1
  71. package/FrameGraph/Tasks/PostProcesses/postProcessTask.js.map +1 -1
  72. package/FrameGraph/Tasks/PostProcesses/ssrRenderingPipelineTask.d.ts +2 -2
  73. package/FrameGraph/Tasks/PostProcesses/ssrRenderingPipelineTask.js +8 -8
  74. package/FrameGraph/Tasks/PostProcesses/ssrRenderingPipelineTask.js.map +1 -1
  75. package/FrameGraph/Tasks/Rendering/objectRendererTask.d.ts +3 -3
  76. package/FrameGraph/Tasks/Rendering/objectRendererTask.js +9 -9
  77. package/FrameGraph/Tasks/Rendering/objectRendererTask.js.map +1 -1
  78. package/FrameGraph/Tasks/Rendering/taaObjectRendererTask.js +7 -7
  79. package/FrameGraph/Tasks/Rendering/taaObjectRendererTask.js.map +1 -1
  80. package/FrameGraph/Tasks/Rendering/utilityLayerRendererTask.d.ts +3 -3
  81. package/FrameGraph/Tasks/Rendering/utilityLayerRendererTask.js +3 -3
  82. package/FrameGraph/Tasks/Rendering/utilityLayerRendererTask.js.map +1 -1
  83. package/FrameGraph/Tasks/Texture/clearTextureTask.d.ts +3 -3
  84. package/FrameGraph/Tasks/Texture/clearTextureTask.js +8 -8
  85. package/FrameGraph/Tasks/Texture/clearTextureTask.js.map +1 -1
  86. package/FrameGraph/Tasks/Texture/copyToTextureTask.d.ts +3 -3
  87. package/FrameGraph/Tasks/Texture/copyToTextureTask.js +3 -3
  88. package/FrameGraph/Tasks/Texture/copyToTextureTask.js.map +1 -1
  89. package/FrameGraph/Tasks/Texture/generateMipMapsTask.d.ts +2 -2
  90. package/FrameGraph/Tasks/Texture/generateMipMapsTask.js +5 -5
  91. package/FrameGraph/Tasks/Texture/generateMipMapsTask.js.map +1 -1
  92. package/FrameGraph/index.d.ts +2 -0
  93. package/FrameGraph/index.js +2 -0
  94. package/FrameGraph/index.js.map +1 -1
  95. package/Materials/Textures/internalTexture.js +2 -2
  96. package/Materials/Textures/internalTexture.js.map +1 -1
  97. package/Materials/material.js +1 -1
  98. package/Materials/material.js.map +1 -1
  99. package/Materials/materialDefines.js +1 -1
  100. package/Materials/materialDefines.js.map +1 -1
  101. package/Meshes/Builders/shapeBuilder.d.ts +6 -2
  102. package/Meshes/Builders/shapeBuilder.js.map +1 -1
  103. package/Meshes/subMesh.js +1 -1
  104. package/Meshes/subMesh.js.map +1 -1
  105. package/Physics/v2/characterController.d.ts +3 -2
  106. package/Physics/v2/characterController.js +12 -0
  107. package/Physics/v2/characterController.js.map +1 -1
  108. package/PostProcesses/anaglyphPostProcess.d.ts +0 -1
  109. package/PostProcesses/anaglyphPostProcess.js +14 -11
  110. package/PostProcesses/anaglyphPostProcess.js.map +1 -1
  111. package/PostProcesses/chromaticAberrationPostProcess.d.ts +15 -8
  112. package/PostProcesses/chromaticAberrationPostProcess.js +72 -42
  113. package/PostProcesses/chromaticAberrationPostProcess.js.map +1 -1
  114. package/PostProcesses/index.d.ts +2 -0
  115. package/PostProcesses/index.js +2 -0
  116. package/PostProcesses/index.js.map +1 -1
  117. package/PostProcesses/thinAnaglyphPostProcess.d.ts +23 -0
  118. package/PostProcesses/thinAnaglyphPostProcess.js +42 -0
  119. package/PostProcesses/thinAnaglyphPostProcess.js.map +1 -0
  120. package/PostProcesses/thinChromaticAberrationPostProcess.d.ts +45 -0
  121. package/PostProcesses/thinChromaticAberrationPostProcess.js +69 -0
  122. package/PostProcesses/thinChromaticAberrationPostProcess.js.map +1 -0
  123. package/package.json +1 -1
  124. package/scene.d.ts +3 -0
  125. package/scene.js +5 -0
  126. package/scene.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"objectRendererTask.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Tasks/Rendering/objectRendererTask.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,4BAA4B,EAAE,mCAAmC,EAAE,MAAM,uBAAuB,CAAC;AAC1G,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAE,qCAAqC,EAAE,MAAM,0BAA0B,CAAC;AAEjF;;GAEG;AACH,MAAM,OAAO,4BAA6B,SAAQ,cAAc;IAkB5D;;OAEG;IACH,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAED,IAAW,MAAM,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AAC,CAAC;gBACpC,aAAa,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC;gBAC9C,KAAK,CAAC,aAAa,GAAG,CAAC,IAAI,CAAC,cAAc,IAAI,eAAe,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;YAC7E,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,SAAS,CAAC,uBAAuB,CAAC,MAAM,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;QAC7E,IAAI,CAAC,wBAAwB,GAAG,IAAI,CAAC,SAAS,CAAC,uBAAuB,CAAC,GAAG,CAAC,GAAG,EAAE;YAC5E,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBACjD,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;gBACpC,KAAK,CAAC,aAAa,GAAG,aAAa,CAAC,GAAG,CAAC,KAAK,CAAE,CAAC;YACpD,CAAC;QACL,CAAC,CAAC,CAAC;IACP,CAAC;CACJ","sourcesContent":["import type {\r\n FrameGraph,\r\n FrameGraphTextureHandle,\r\n Scene,\r\n Camera,\r\n FrameGraphObjectList,\r\n FrameGraphRenderContext,\r\n ObjectRendererOptions,\r\n Light,\r\n Nullable,\r\n Observer,\r\n FrameGraphShadowGeneratorTask,\r\n FrameGraphRenderPass,\r\n // eslint-disable-next-line import/no-internal-modules\r\n} from \"core/index\";\r\nimport { backbufferColorTextureHandle, backbufferDepthStencilTextureHandle } from \"../../frameGraphTypes\";\r\nimport { FrameGraphTask } from \"../../frameGraphTask\";\r\nimport { ObjectRenderer } from \"../../../Rendering/objectRenderer\";\r\nimport { FrameGraphCascadedShadowGeneratorTask } from \"./csmShadowGeneratorTask\";\r\n\r\n/**\r\n * Task used to render objects to a texture.\r\n */\r\nexport class FrameGraphObjectRendererTask extends FrameGraphTask {\r\n /**\r\n * The destination texture where the objects will be rendered.\r\n */\r\n public destinationTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The depth attachment texture where the objects will be rendered (optional).\r\n */\r\n public depthTexture?: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The shadow generators used to render the objects (optional).\r\n */\r\n public shadowGenerators?: FrameGraphShadowGeneratorTask[] = [];\r\n\r\n private _camera: Camera;\r\n\r\n /**\r\n * Gets or sets the camera used to render the objects.\r\n */\r\n public get camera() {\r\n return this._camera;\r\n }\r\n\r\n public set camera(camera: Camera) {\r\n this._camera = camera;\r\n this._renderer.activeCamera = this.camera;\r\n }\r\n\r\n /**\r\n * The list of objects to render.\r\n */\r\n public objectList: FrameGraphObjectList;\r\n\r\n /**\r\n * If depth testing should be enabled (default is true).\r\n */\r\n public depthTest = true;\r\n\r\n /**\r\n * If depth writing should be enabled (default is true).\r\n */\r\n public depthWrite = true;\r\n\r\n /**\r\n * If shadows should be disabled (default is false).\r\n */\r\n public disableShadows = false;\r\n\r\n /**\r\n * The output texture.\r\n * This texture will point to the same texture than the destinationTexture property if it is set.\r\n * Note, however, that the handle itself will be different!\r\n */\r\n public readonly outputTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The output depth attachment texture.\r\n * This texture will point to the same texture than the depthTexture property if it is set.\r\n * Note, however, that the handle itself will be different!\r\n */\r\n public readonly outputDepthTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The object renderer used to render the objects.\r\n */\r\n public get objectRenderer() {\r\n return this._renderer;\r\n }\r\n\r\n public override get name() {\r\n return this._name;\r\n }\r\n\r\n public override set name(value: string) {\r\n this._name = value;\r\n if (this._renderer) {\r\n this._renderer.name = value;\r\n }\r\n }\r\n\r\n protected readonly _scene: Scene;\r\n protected readonly _renderer: ObjectRenderer;\r\n protected _textureWidth: number;\r\n protected _textureHeight: number;\r\n protected _onBeforeRenderObservable: Nullable<Observer<number>> = null;\r\n protected _onAfterRenderObservable: Nullable<Observer<number>> = null;\r\n protected _externalObjectRenderer = false;\r\n\r\n /**\r\n * Constructs a new object renderer task.\r\n * @param name The name of the task.\r\n * @param frameGraph The frame graph the task belongs to.\r\n * @param scene The scene the frame graph is associated with.\r\n * @param options The options of the object renderer.\r\n * @param existingObjectRenderer An existing object renderer to use (optional). If provided, the options parameter will be ignored.\r\n */\r\n constructor(name: string, frameGraph: FrameGraph, scene: Scene, options?: ObjectRendererOptions, existingObjectRenderer?: ObjectRenderer) {\r\n super(name, frameGraph);\r\n\r\n this._scene = scene;\r\n this._externalObjectRenderer = !!existingObjectRenderer;\r\n this._renderer = existingObjectRenderer ?? new ObjectRenderer(name, scene, options);\r\n this.name = name;\r\n\r\n if (!this._externalObjectRenderer) {\r\n this._renderer.onBeforeRenderingManagerRenderObservable.add(() => {\r\n if (!this._renderer.options.doNotChangeAspectRatio) {\r\n scene.updateTransformMatrix(true);\r\n }\r\n });\r\n }\r\n\r\n this.outputTexture = this._frameGraph.textureManager.createDanglingHandle();\r\n this.outputDepthTexture = this._frameGraph.textureManager.createDanglingHandle();\r\n }\r\n\r\n public override isReady() {\r\n return this._renderer.isReadyForRendering(this._textureWidth, this._textureHeight);\r\n }\r\n\r\n public record(skipCreationOfDisabledPasses = false, additionalExecute?: (context: FrameGraphRenderContext) => void): FrameGraphRenderPass {\r\n if (this.destinationTexture === undefined || this.objectList === undefined) {\r\n throw new Error(`FrameGraphObjectRendererTask ${this.name}: destinationTexture and objectList are required`);\r\n }\r\n\r\n // Make sure the renderList / particleSystemList are set when FrameGraphObjectRendererTask.isReady() is called!\r\n this._renderer.renderList = this.objectList.meshes;\r\n this._renderer.particleSystemList = this.objectList.particleSystems;\r\n\r\n const outputTextureDescription = this._frameGraph.textureManager.getTextureDescription(this.destinationTexture);\r\n\r\n let depthEnabled = false;\r\n\r\n if (this.depthTexture !== undefined) {\r\n if (this.depthTexture === backbufferDepthStencilTextureHandle && this.destinationTexture !== backbufferColorTextureHandle) {\r\n throw new Error(\r\n `FrameGraphObjectRendererTask ${this.name}: the back buffer color texture is the only color texture allowed when the depth is the back buffer depth/stencil`\r\n );\r\n }\r\n if (this.depthTexture !== backbufferDepthStencilTextureHandle && this.destinationTexture === backbufferColorTextureHandle) {\r\n throw new Error(\r\n `FrameGraphObjectRendererTask ${this.name}: the back buffer depth/stencil texture is the only depth texture allowed when the destination is the back buffer color`\r\n );\r\n }\r\n\r\n const depthTextureDescription = this._frameGraph.textureManager.getTextureDescription(this.depthTexture);\r\n if (depthTextureDescription.options.samples !== outputTextureDescription.options.samples) {\r\n throw new Error(`FrameGraphObjectRendererTask ${this.name}: the depth texture and the output texture must have the same number of samples`);\r\n }\r\n\r\n depthEnabled = true;\r\n }\r\n\r\n this._frameGraph.textureManager.resolveDanglingHandle(this.outputTexture, this.destinationTexture);\r\n if (this.depthTexture !== undefined) {\r\n this._frameGraph.textureManager.resolveDanglingHandle(this.outputDepthTexture, this.depthTexture);\r\n }\r\n\r\n this._textureWidth = outputTextureDescription.size.width;\r\n this._textureHeight = outputTextureDescription.size.height;\r\n\r\n this._setLightsForShadow();\r\n\r\n const pass = this._frameGraph.addRenderPass(this.name);\r\n\r\n pass.setRenderTarget(this.destinationTexture);\r\n pass.setRenderTargetDepth(this.depthTexture);\r\n pass.setExecuteFunc((context) => {\r\n this._renderer.renderList = this.objectList.meshes;\r\n this._renderer.particleSystemList = this.objectList.particleSystems;\r\n\r\n context.setDepthStates(this.depthTest && depthEnabled, this.depthWrite && depthEnabled);\r\n context.render(this._renderer, this._textureWidth, this._textureHeight);\r\n\r\n additionalExecute?.(context);\r\n });\r\n\r\n if (!skipCreationOfDisabledPasses) {\r\n const passDisabled = this._frameGraph.addRenderPass(this.name + \"_disabled\", true);\r\n\r\n passDisabled.setRenderTarget(this.destinationTexture);\r\n passDisabled.setRenderTargetDepth(this.depthTexture);\r\n passDisabled.setExecuteFunc((_context) => {});\r\n }\r\n\r\n return pass;\r\n }\r\n\r\n public override dispose(): void {\r\n this._renderer.onBeforeRenderObservable.remove(this._onBeforeRenderObservable);\r\n this._renderer.onAfterRenderObservable.remove(this._onAfterRenderObservable);\r\n if (!this._externalObjectRenderer) {\r\n this._renderer.dispose();\r\n }\r\n super.dispose();\r\n }\r\n\r\n protected _setLightsForShadow() {\r\n const lightsForShadow: Set<Light> = new Set();\r\n const shadowEnabled: Map<Light, boolean> = new Map();\r\n\r\n if (this.shadowGenerators) {\r\n for (const shadowGeneratorTask of this.shadowGenerators) {\r\n const shadowGenerator = shadowGeneratorTask.shadowGenerator;\r\n const light = shadowGenerator.getLight();\r\n if (light.isEnabled() && light.shadowEnabled) {\r\n lightsForShadow.add(light);\r\n if (FrameGraphCascadedShadowGeneratorTask.IsCascadedShadowGenerator(shadowGeneratorTask)) {\r\n light._shadowGenerators!.set(shadowGeneratorTask.camera, shadowGenerator);\r\n } else {\r\n light._shadowGenerators!.set(null, shadowGenerator);\r\n }\r\n }\r\n }\r\n }\r\n\r\n this._renderer.onBeforeRenderObservable.remove(this._onBeforeRenderObservable);\r\n this._onBeforeRenderObservable = this._renderer.onBeforeRenderObservable.add(() => {\r\n for (let i = 0; i < this._scene.lights.length; i++) {\r\n const light = this._scene.lights[i];\r\n shadowEnabled.set(light, light.shadowEnabled);\r\n light.shadowEnabled = !this.disableShadows && lightsForShadow.has(light);\r\n }\r\n });\r\n\r\n this._renderer.onAfterRenderObservable.remove(this._onAfterRenderObservable);\r\n this._onAfterRenderObservable = this._renderer.onAfterRenderObservable.add(() => {\r\n for (let i = 0; i < this._scene.lights.length; i++) {\r\n const light = this._scene.lights[i];\r\n light.shadowEnabled = shadowEnabled.get(light)!;\r\n }\r\n });\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"objectRendererTask.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Tasks/Rendering/objectRendererTask.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,4BAA4B,EAAE,mCAAmC,EAAE,MAAM,uBAAuB,CAAC;AAC1G,OAAO,EAA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BAAyB,GAAG,IAAI,CAAC,SAAS,CAAC,wBAAwB,CAAC,GAAG,CAAC,GAAG,EAAE;YAC9E,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBACjD,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;gBACpC,aAAa,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC;gBAC9C,KAAK,CAAC,aAAa,GAAG,CAAC,IAAI,CAAC,cAAc,IAAI,eAAe,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;YAC7E,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,SAAS,CAAC,uBAAuB,CAAC,MAAM,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;QAC7E,IAAI,CAAC,wBAAwB,GAAG,IAAI,CAAC,SAAS,CAAC,uBAAuB,CAAC,GAAG,CAAC,GAAG,EAAE;YAC5E,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBACjD,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;gBACpC,KAAK,CAAC,aAAa,GAAG,aAAa,CAAC,GAAG,CAAC,KAAK,CAAE,CAAC;YACpD,CAAC;QACL,CAAC,CAAC,CAAC;IACP,CAAC;CACJ","sourcesContent":["import type {\r\n FrameGraph,\r\n FrameGraphTextureHandle,\r\n Scene,\r\n Camera,\r\n FrameGraphObjectList,\r\n FrameGraphRenderContext,\r\n ObjectRendererOptions,\r\n Light,\r\n Nullable,\r\n Observer,\r\n FrameGraphShadowGeneratorTask,\r\n FrameGraphRenderPass,\r\n // eslint-disable-next-line import/no-internal-modules\r\n} from \"core/index\";\r\nimport { backbufferColorTextureHandle, backbufferDepthStencilTextureHandle } from \"../../frameGraphTypes\";\r\nimport { FrameGraphTask } from \"../../frameGraphTask\";\r\nimport { ObjectRenderer } from \"../../../Rendering/objectRenderer\";\r\nimport { FrameGraphCascadedShadowGeneratorTask } from \"./csmShadowGeneratorTask\";\r\n\r\n/**\r\n * Task used to render objects to a texture.\r\n */\r\nexport class FrameGraphObjectRendererTask extends FrameGraphTask {\r\n /**\r\n * The target texture where the objects will be rendered.\r\n */\r\n public targetTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The depth attachment texture where the objects will be rendered (optional).\r\n */\r\n public depthTexture?: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The shadow generators used to render the objects (optional).\r\n */\r\n public shadowGenerators?: FrameGraphShadowGeneratorTask[] = [];\r\n\r\n private _camera: Camera;\r\n\r\n /**\r\n * Gets or sets the camera used to render the objects.\r\n */\r\n public get camera() {\r\n return this._camera;\r\n }\r\n\r\n public set camera(camera: Camera) {\r\n this._camera = camera;\r\n this._renderer.activeCamera = this.camera;\r\n }\r\n\r\n /**\r\n * The list of objects to render.\r\n */\r\n public objectList: FrameGraphObjectList;\r\n\r\n /**\r\n * If depth testing should be enabled (default is true).\r\n */\r\n public depthTest = true;\r\n\r\n /**\r\n * If depth writing should be enabled (default is true).\r\n */\r\n public depthWrite = true;\r\n\r\n /**\r\n * If shadows should be disabled (default is false).\r\n */\r\n public disableShadows = false;\r\n\r\n /**\r\n * The output texture.\r\n * This texture will point to the same texture than the targetTexture property if it is set.\r\n * Note, however, that the handle itself will be different!\r\n */\r\n public readonly outputTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The output depth attachment texture.\r\n * This texture will point to the same texture than the depthTexture property if it is set.\r\n * Note, however, that the handle itself will be different!\r\n */\r\n public readonly outputDepthTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The object renderer used to render the objects.\r\n */\r\n public get objectRenderer() {\r\n return this._renderer;\r\n }\r\n\r\n public override get name() {\r\n return this._name;\r\n }\r\n\r\n public override set name(value: string) {\r\n this._name = value;\r\n if (this._renderer) {\r\n this._renderer.name = value;\r\n }\r\n }\r\n\r\n protected readonly _scene: Scene;\r\n protected readonly _renderer: ObjectRenderer;\r\n protected _textureWidth: number;\r\n protected _textureHeight: number;\r\n protected _onBeforeRenderObservable: Nullable<Observer<number>> = null;\r\n protected _onAfterRenderObservable: Nullable<Observer<number>> = null;\r\n protected _externalObjectRenderer = false;\r\n\r\n /**\r\n * Constructs a new object renderer task.\r\n * @param name The name of the task.\r\n * @param frameGraph The frame graph the task belongs to.\r\n * @param scene The scene the frame graph is associated with.\r\n * @param options The options of the object renderer.\r\n * @param existingObjectRenderer An existing object renderer to use (optional). If provided, the options parameter will be ignored.\r\n */\r\n constructor(name: string, frameGraph: FrameGraph, scene: Scene, options?: ObjectRendererOptions, existingObjectRenderer?: ObjectRenderer) {\r\n super(name, frameGraph);\r\n\r\n this._scene = scene;\r\n this._externalObjectRenderer = !!existingObjectRenderer;\r\n this._renderer = existingObjectRenderer ?? new ObjectRenderer(name, scene, options);\r\n this.name = name;\r\n\r\n if (!this._externalObjectRenderer) {\r\n this._renderer.onBeforeRenderingManagerRenderObservable.add(() => {\r\n if (!this._renderer.options.doNotChangeAspectRatio) {\r\n scene.updateTransformMatrix(true);\r\n }\r\n });\r\n }\r\n\r\n this.outputTexture = this._frameGraph.textureManager.createDanglingHandle();\r\n this.outputDepthTexture = this._frameGraph.textureManager.createDanglingHandle();\r\n }\r\n\r\n public override isReady() {\r\n return this._renderer.isReadyForRendering(this._textureWidth, this._textureHeight);\r\n }\r\n\r\n public record(skipCreationOfDisabledPasses = false, additionalExecute?: (context: FrameGraphRenderContext) => void): FrameGraphRenderPass {\r\n if (this.targetTexture === undefined || this.objectList === undefined) {\r\n throw new Error(`FrameGraphObjectRendererTask ${this.name}: targetTexture and objectList are required`);\r\n }\r\n\r\n // Make sure the renderList / particleSystemList are set when FrameGraphObjectRendererTask.isReady() is called!\r\n this._renderer.renderList = this.objectList.meshes;\r\n this._renderer.particleSystemList = this.objectList.particleSystems;\r\n\r\n const outputTextureDescription = this._frameGraph.textureManager.getTextureDescription(this.targetTexture);\r\n\r\n let depthEnabled = false;\r\n\r\n if (this.depthTexture !== undefined) {\r\n if (this.depthTexture === backbufferDepthStencilTextureHandle && this.targetTexture !== backbufferColorTextureHandle) {\r\n throw new Error(\r\n `FrameGraphObjectRendererTask ${this.name}: the back buffer color texture is the only color texture allowed when the depth is the back buffer depth/stencil`\r\n );\r\n }\r\n if (this.depthTexture !== backbufferDepthStencilTextureHandle && this.targetTexture === backbufferColorTextureHandle) {\r\n throw new Error(\r\n `FrameGraphObjectRendererTask ${this.name}: the back buffer depth/stencil texture is the only depth texture allowed when the target is the back buffer color`\r\n );\r\n }\r\n\r\n const depthTextureDescription = this._frameGraph.textureManager.getTextureDescription(this.depthTexture);\r\n if (depthTextureDescription.options.samples !== outputTextureDescription.options.samples) {\r\n throw new Error(`FrameGraphObjectRendererTask ${this.name}: the depth texture and the output texture must have the same number of samples`);\r\n }\r\n\r\n depthEnabled = true;\r\n }\r\n\r\n this._frameGraph.textureManager.resolveDanglingHandle(this.outputTexture, this.targetTexture);\r\n if (this.depthTexture !== undefined) {\r\n this._frameGraph.textureManager.resolveDanglingHandle(this.outputDepthTexture, this.depthTexture);\r\n }\r\n\r\n this._textureWidth = outputTextureDescription.size.width;\r\n this._textureHeight = outputTextureDescription.size.height;\r\n\r\n this._setLightsForShadow();\r\n\r\n const pass = this._frameGraph.addRenderPass(this.name);\r\n\r\n pass.setRenderTarget(this.targetTexture);\r\n pass.setRenderTargetDepth(this.depthTexture);\r\n pass.setExecuteFunc((context) => {\r\n this._renderer.renderList = this.objectList.meshes;\r\n this._renderer.particleSystemList = this.objectList.particleSystems;\r\n\r\n context.setDepthStates(this.depthTest && depthEnabled, this.depthWrite && depthEnabled);\r\n context.render(this._renderer, this._textureWidth, this._textureHeight);\r\n\r\n additionalExecute?.(context);\r\n });\r\n\r\n if (!skipCreationOfDisabledPasses) {\r\n const passDisabled = this._frameGraph.addRenderPass(this.name + \"_disabled\", true);\r\n\r\n passDisabled.setRenderTarget(this.targetTexture);\r\n passDisabled.setRenderTargetDepth(this.depthTexture);\r\n passDisabled.setExecuteFunc((_context) => {});\r\n }\r\n\r\n return pass;\r\n }\r\n\r\n public override dispose(): void {\r\n this._renderer.onBeforeRenderObservable.remove(this._onBeforeRenderObservable);\r\n this._renderer.onAfterRenderObservable.remove(this._onAfterRenderObservable);\r\n if (!this._externalObjectRenderer) {\r\n this._renderer.dispose();\r\n }\r\n super.dispose();\r\n }\r\n\r\n protected _setLightsForShadow() {\r\n const lightsForShadow: Set<Light> = new Set();\r\n const shadowEnabled: Map<Light, boolean> = new Map();\r\n\r\n if (this.shadowGenerators) {\r\n for (const shadowGeneratorTask of this.shadowGenerators) {\r\n const shadowGenerator = shadowGeneratorTask.shadowGenerator;\r\n const light = shadowGenerator.getLight();\r\n if (light.isEnabled() && light.shadowEnabled) {\r\n lightsForShadow.add(light);\r\n if (FrameGraphCascadedShadowGeneratorTask.IsCascadedShadowGenerator(shadowGeneratorTask)) {\r\n light._shadowGenerators!.set(shadowGeneratorTask.camera, shadowGenerator);\r\n } else {\r\n light._shadowGenerators!.set(null, shadowGenerator);\r\n }\r\n }\r\n }\r\n }\r\n\r\n this._renderer.onBeforeRenderObservable.remove(this._onBeforeRenderObservable);\r\n this._onBeforeRenderObservable = this._renderer.onBeforeRenderObservable.add(() => {\r\n for (let i = 0; i < this._scene.lights.length; i++) {\r\n const light = this._scene.lights[i];\r\n shadowEnabled.set(light, light.shadowEnabled);\r\n light.shadowEnabled = !this.disableShadows && lightsForShadow.has(light);\r\n }\r\n });\r\n\r\n this._renderer.onAfterRenderObservable.remove(this._onAfterRenderObservable);\r\n this._onAfterRenderObservable = this._renderer.onAfterRenderObservable.add(() => {\r\n for (let i = 0; i < this._scene.lights.length; i++) {\r\n const light = this._scene.lights[i];\r\n light.shadowEnabled = shadowEnabled.get(light)!;\r\n }\r\n });\r\n }\r\n}\r\n"]}
@@ -19,16 +19,16 @@ export class FrameGraphTAAObjectRendererTask extends FrameGraphObjectRendererTas
19
19
  this._postProcessDrawWrapper = this.postProcess.drawWrapper;
20
20
  }
21
21
  record() {
22
- if (this.destinationTexture === undefined || this.objectList === undefined) {
22
+ if (this.targetTexture === undefined || this.objectList === undefined) {
23
23
  throw new Error(`FrameGraphTAAObjectRendererTask ${this.name}: destinationTexture and objectList are required`);
24
24
  }
25
- if (this.destinationTexture === backbufferColorTextureHandle || this.depthTexture === backbufferDepthStencilTextureHandle) {
25
+ if (this.targetTexture === backbufferColorTextureHandle || this.depthTexture === backbufferDepthStencilTextureHandle) {
26
26
  throw new Error(`FrameGraphTAAObjectRendererTask ${this.name}: the back buffer color/depth textures are not allowed. Use regular textures instead.`);
27
27
  }
28
28
  // Make sure the renderList / particleSystemList are set when FrameGraphObjectRendererTask.isReady() is called!
29
29
  this._renderer.renderList = this.objectList.meshes;
30
30
  this._renderer.particleSystemList = this.objectList.particleSystems;
31
- const outputTextureDescription = this._frameGraph.textureManager.getTextureDescription(this.destinationTexture);
31
+ const outputTextureDescription = this._frameGraph.textureManager.getTextureDescription(this.targetTexture);
32
32
  let depthEnabled = false;
33
33
  if (this.depthTexture !== undefined) {
34
34
  const depthTextureDescription = this._frameGraph.textureManager.getTextureDescription(this.depthTexture);
@@ -64,7 +64,7 @@ export class FrameGraphTAAObjectRendererTask extends FrameGraphObjectRendererTas
64
64
  let pingPongRenderTargetWrapper;
65
65
  this._setLightsForShadow();
66
66
  const pass = this._frameGraph.addRenderPass(this.name);
67
- pass.setRenderTarget(this.destinationTexture);
67
+ pass.setRenderTarget(this.targetTexture);
68
68
  pass.setRenderTargetDepth(this.depthTexture);
69
69
  pass.setExecuteFunc((context) => {
70
70
  this._renderer.renderList = this.objectList.meshes;
@@ -84,19 +84,19 @@ export class FrameGraphTAAObjectRendererTask extends FrameGraphObjectRendererTas
84
84
  if (!this.postProcess.disabled) {
85
85
  context.applyFullScreenEffect(this._postProcessDrawWrapper, () => {
86
86
  this.postProcess.bind();
87
- context.bindTextureHandle(this._postProcessDrawWrapper.effect, "textureSampler", this.destinationTexture);
87
+ context.bindTextureHandle(this._postProcessDrawWrapper.effect, "textureSampler", this.targetTexture);
88
88
  context.bindTextureHandle(this._postProcessDrawWrapper.effect, "historySampler", pingPongHandle);
89
89
  });
90
90
  }
91
91
  else {
92
- context.copyTexture(this.destinationTexture);
92
+ context.copyTexture(this.targetTexture);
93
93
  }
94
94
  });
95
95
  const passDisabled = this._frameGraph.addRenderPass(this.name + "_disabled", true);
96
96
  passDisabled.setRenderTarget(this.outputTexture);
97
97
  passDisabled.setRenderTargetDepth(this.depthTexture);
98
98
  passDisabled.setExecuteFunc((context) => {
99
- context.copyTexture(this.destinationTexture);
99
+ context.copyTexture(this.targetTexture);
100
100
  });
101
101
  return pass;
102
102
  }
@@ -1 +1 @@
1
- {"version":3,"file":"taaObjectRendererTask.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Tasks/Rendering/taaObjectRendererTask.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,4BAA4B,EAAE,mCAAmC,EAAE,MAAM,uBAAuB,CAAC;AAC1G,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,qDAA8C;AAC3E,OAAO,EAAE,SAAS,EAAE,sCAA+B;AAEnD;;GAEG;AACH,MAAM,OAAO,+BAAgC,SAAQ,4BAA4B;IAQ7E;;;;;;OAMG;IACH,YAAY,IAAY,EAAE,UAAsB,EAAE,KAAY,EAAE,OAA+B;QAC3F,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;QAExC,IAAI,CAAC,WAAW,GAAG,IAAI,kBAAkB,CAAC,GAAG,IAAI,eAAe,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC;Q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,CAAC,CAAC;YAEtG,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC;gBAC7B,OAAO,CAAC,qBAAqB,CAAC,IAAI,CAAC,uBAAuB,EAAE,GAAG,EAAE;oBAC7D,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;oBACxB,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,uBAAuB,CAAC,MAAO,EAAE,gBAAgB,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC;oBAC3G,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,uBAAuB,CAAC,MAAO,EAAE,gBAAgB,EAAE,cAAc,CAAC,CAAC;gBACtG,CAAC,CAAC,CAAC;YACP,CAAC;iBAAM,CAAC;gBACJ,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;YACjD,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,MAAM,YAAY,GAAG,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,GAAG,WAAW,EAAE,IAAI,CAAC,CAAC;QAEnF,YAAY,CAAC,eAAe,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACjD,YAAY,CAAC,oBAAoB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACrD,YAAY,CAAC,cAAc,CAAC,CAAC,OAAO,EAAE,EAAE;YACpC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;QACjD,CAAC,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { FrameGraph, Scene, DrawWrapper, FrameGraphTextureCreationOptions, ObjectRendererOptions, FrameGraphRenderTarget, FrameGraphRenderPass } from \"core/index\";\r\nimport { backbufferColorTextureHandle, backbufferDepthStencilTextureHandle } from \"../../frameGraphTypes\";\r\nimport { FrameGraphObjectRendererTask } from \"./objectRendererTask\";\r\nimport { ThinTAAPostProcess } from \"core/PostProcesses/thinTAAPostProcess\";\r\nimport { Constants } from \"core/Engines/constants\";\r\n\r\n/**\r\n * Task used to render objects to a texture with Temporal Anti-Aliasing (TAA).\r\n */\r\nexport class FrameGraphTAAObjectRendererTask extends FrameGraphObjectRendererTask {\r\n /**\r\n * The TAA post process.\r\n */\r\n public readonly postProcess: ThinTAAPostProcess;\r\n\r\n protected readonly _postProcessDrawWrapper: DrawWrapper;\r\n\r\n /**\r\n * Constructs a new TAA object renderer task.\r\n * @param name The name of the task\r\n * @param frameGraph The frame graph the task belongs to.\r\n * @param scene The scene the frame graph is associated with.\r\n * @param options The options of the object renderer.\r\n */\r\n constructor(name: string, frameGraph: FrameGraph, scene: Scene, options?: ObjectRendererOptions) {\r\n super(name, frameGraph, scene, options);\r\n\r\n this.postProcess = new ThinTAAPostProcess(`${name} post-process`, scene.getEngine());\r\n this._postProcessDrawWrapper = this.postProcess.drawWrapper;\r\n }\r\n\r\n public override record(): FrameGraphRenderPass {\r\n if (this.destinationTexture === undefined || this.objectList === undefined) {\r\n throw new Error(`FrameGraphTAAObjectRendererTask ${this.name}: destinationTexture and objectList are required`);\r\n }\r\n\r\n if (this.destinationTexture === backbufferColorTextureHandle || this.depthTexture === backbufferDepthStencilTextureHandle) {\r\n throw new Error(`FrameGraphTAAObjectRendererTask ${this.name}: the back buffer color/depth textures are not allowed. Use regular textures instead.`);\r\n }\r\n\r\n // Make sure the renderList / particleSystemList are set when FrameGraphObjectRendererTask.isReady() is called!\r\n this._renderer.renderList = this.objectList.meshes;\r\n this._renderer.particleSystemList = this.objectList.particleSystems;\r\n\r\n const outputTextureDescription = this._frameGraph.textureManager.getTextureDescription(this.destinationTexture);\r\n\r\n let depthEnabled = false;\r\n\r\n if (this.depthTexture !== undefined) {\r\n const depthTextureDescription = this._frameGraph.textureManager.getTextureDescription(this.depthTexture);\r\n if (depthTextureDescription.options.samples !== outputTextureDescription.options.samples) {\r\n throw new Error(`FrameGraphTAAObjectRendererTask ${this.name}: the depth texture and the output texture must have the same number of samples`);\r\n }\r\n\r\n depthEnabled = true;\r\n }\r\n\r\n this.postProcess.camera = this.camera;\r\n this.postProcess.textureWidth = outputTextureDescription.size.width;\r\n this.postProcess.textureHeight = outputTextureDescription.size.height;\r\n\r\n const textureCreationOptions: FrameGraphTextureCreationOptions = {\r\n size: outputTextureDescription.size,\r\n options: {\r\n createMipMaps: outputTextureDescription.options.createMipMaps,\r\n types: [Constants.TEXTURETYPE_HALF_FLOAT],\r\n formats: [Constants.TEXTUREFORMAT_RGBA],\r\n samples: 1,\r\n useSRGBBuffers: [false],\r\n creationFlags: [0],\r\n labels: [\"\"],\r\n },\r\n sizeIsPercentage: false,\r\n isHistoryTexture: true,\r\n };\r\n\r\n const pingPongHandle = this._frameGraph.textureManager.createRenderTargetTexture(`${this.name} history`, textureCreationOptions);\r\n\r\n this._frameGraph.textureManager.resolveDanglingHandle(this.outputTexture, pingPongHandle);\r\n if (this.depthTexture !== undefined) {\r\n this._frameGraph.textureManager.resolveDanglingHandle(this.outputDepthTexture, this.depthTexture);\r\n }\r\n\r\n this._textureWidth = outputTextureDescription.size.width;\r\n this._textureHeight = outputTextureDescription.size.height;\r\n\r\n let pingPongRenderTargetWrapper: FrameGraphRenderTarget | undefined;\r\n\r\n this._setLightsForShadow();\r\n\r\n const pass = this._frameGraph.addRenderPass(this.name);\r\n\r\n pass.setRenderTarget(this.destinationTexture);\r\n pass.setRenderTargetDepth(this.depthTexture);\r\n pass.setExecuteFunc((context) => {\r\n this._renderer.renderList = this.objectList.meshes;\r\n this._renderer.particleSystemList = this.objectList.particleSystems;\r\n\r\n this.postProcess.updateProjectionMatrix();\r\n\r\n context.setDepthStates(this.depthTest && depthEnabled, this.depthWrite && depthEnabled);\r\n\r\n // We define the active camera and transformation matrices ourselves, otherwise this will be done by calling context.render, in which case\r\n // getProjectionMatrix will be called with a \"true\" parameter, forcing recalculation of the projection matrix and losing our changes.\r\n if (!this.postProcess.disabled) {\r\n this._scene.activeCamera = this.camera;\r\n this._scene.setTransformMatrix(this.camera.getViewMatrix(), this.camera.getProjectionMatrix());\r\n }\r\n\r\n context.render(this._renderer, this._textureWidth, this._textureHeight);\r\n\r\n this._scene.activeCamera = null;\r\n\r\n pingPongRenderTargetWrapper = pingPongRenderTargetWrapper || context.createRenderTarget(`${this.name} ping/pong`, pingPongHandle);\r\n\r\n context.bindRenderTarget(pingPongRenderTargetWrapper, \"frame graph - TAA merge with history texture\");\r\n\r\n if (!this.postProcess.disabled) {\r\n context.applyFullScreenEffect(this._postProcessDrawWrapper, () => {\r\n this.postProcess.bind();\r\n context.bindTextureHandle(this._postProcessDrawWrapper.effect!, \"textureSampler\", this.destinationTexture);\r\n context.bindTextureHandle(this._postProcessDrawWrapper.effect!, \"historySampler\", pingPongHandle);\r\n });\r\n } else {\r\n context.copyTexture(this.destinationTexture);\r\n }\r\n });\r\n\r\n const passDisabled = this._frameGraph.addRenderPass(this.name + \"_disabled\", true);\r\n\r\n passDisabled.setRenderTarget(this.outputTexture);\r\n passDisabled.setRenderTargetDepth(this.depthTexture);\r\n passDisabled.setExecuteFunc((context) => {\r\n context.copyTexture(this.destinationTexture);\r\n });\r\n\r\n return pass;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"taaObjectRendererTask.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Tasks/Rendering/taaObjectRendererTask.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,4BAA4B,EAAE,mCAAmC,EAAE,MAAM,uBAAuB,CAAC;AAC1G,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,qDAA8C;AAC3E,OAAO,EAAE,SAAS,EAAE,sCAA+B;AAEnD;;GAEG;AACH,MAAM,OAAO,+BAAgC,SAAQ,4BAA4B;IAQ7E;;;;;;OAMG;IACH,YAAY,IAAY,EAAE,UAAsB,EAAE,KAAY,EAAE,OAA+B;QAC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TextureCreationOptions, ObjectRendererOptions, FrameGraphRenderTarget, FrameGraphRenderPass } from \"core/index\";\r\nimport { backbufferColorTextureHandle, backbufferDepthStencilTextureHandle } from \"../../frameGraphTypes\";\r\nimport { FrameGraphObjectRendererTask } from \"./objectRendererTask\";\r\nimport { ThinTAAPostProcess } from \"core/PostProcesses/thinTAAPostProcess\";\r\nimport { Constants } from \"core/Engines/constants\";\r\n\r\n/**\r\n * Task used to render objects to a texture with Temporal Anti-Aliasing (TAA).\r\n */\r\nexport class FrameGraphTAAObjectRendererTask extends FrameGraphObjectRendererTask {\r\n /**\r\n * The TAA post process.\r\n */\r\n public readonly postProcess: ThinTAAPostProcess;\r\n\r\n protected readonly _postProcessDrawWrapper: DrawWrapper;\r\n\r\n /**\r\n * Constructs a new TAA object renderer task.\r\n * @param name The name of the task\r\n * @param frameGraph The frame graph the task belongs to.\r\n * @param scene The scene the frame graph is associated with.\r\n * @param options The options of the object renderer.\r\n */\r\n constructor(name: string, frameGraph: FrameGraph, scene: Scene, options?: ObjectRendererOptions) {\r\n super(name, frameGraph, scene, options);\r\n\r\n this.postProcess = new ThinTAAPostProcess(`${name} post-process`, scene.getEngine());\r\n this._postProcessDrawWrapper = this.postProcess.drawWrapper;\r\n }\r\n\r\n public override record(): FrameGraphRenderPass {\r\n if (this.targetTexture === undefined || this.objectList === undefined) {\r\n throw new Error(`FrameGraphTAAObjectRendererTask ${this.name}: destinationTexture and objectList are required`);\r\n }\r\n\r\n if (this.targetTexture === backbufferColorTextureHandle || this.depthTexture === backbufferDepthStencilTextureHandle) {\r\n throw new Error(`FrameGraphTAAObjectRendererTask ${this.name}: the back buffer color/depth textures are not allowed. Use regular textures instead.`);\r\n }\r\n\r\n // Make sure the renderList / particleSystemList are set when FrameGraphObjectRendererTask.isReady() is called!\r\n this._renderer.renderList = this.objectList.meshes;\r\n this._renderer.particleSystemList = this.objectList.particleSystems;\r\n\r\n const outputTextureDescription = this._frameGraph.textureManager.getTextureDescription(this.targetTexture);\r\n\r\n let depthEnabled = false;\r\n\r\n if (this.depthTexture !== undefined) {\r\n const depthTextureDescription = this._frameGraph.textureManager.getTextureDescription(this.depthTexture);\r\n if (depthTextureDescription.options.samples !== outputTextureDescription.options.samples) {\r\n throw new Error(`FrameGraphTAAObjectRendererTask ${this.name}: the depth texture and the output texture must have the same number of samples`);\r\n }\r\n\r\n depthEnabled = true;\r\n }\r\n\r\n this.postProcess.camera = this.camera;\r\n this.postProcess.textureWidth = outputTextureDescription.size.width;\r\n this.postProcess.textureHeight = outputTextureDescription.size.height;\r\n\r\n const textureCreationOptions: FrameGraphTextureCreationOptions = {\r\n size: outputTextureDescription.size,\r\n options: {\r\n createMipMaps: outputTextureDescription.options.createMipMaps,\r\n types: [Constants.TEXTURETYPE_HALF_FLOAT],\r\n formats: [Constants.TEXTUREFORMAT_RGBA],\r\n samples: 1,\r\n useSRGBBuffers: [false],\r\n creationFlags: [0],\r\n labels: [\"\"],\r\n },\r\n sizeIsPercentage: false,\r\n isHistoryTexture: true,\r\n };\r\n\r\n const pingPongHandle = this._frameGraph.textureManager.createRenderTargetTexture(`${this.name} history`, textureCreationOptions);\r\n\r\n this._frameGraph.textureManager.resolveDanglingHandle(this.outputTexture, pingPongHandle);\r\n if (this.depthTexture !== undefined) {\r\n this._frameGraph.textureManager.resolveDanglingHandle(this.outputDepthTexture, this.depthTexture);\r\n }\r\n\r\n this._textureWidth = outputTextureDescription.size.width;\r\n this._textureHeight = outputTextureDescription.size.height;\r\n\r\n let pingPongRenderTargetWrapper: FrameGraphRenderTarget | undefined;\r\n\r\n this._setLightsForShadow();\r\n\r\n const pass = this._frameGraph.addRenderPass(this.name);\r\n\r\n pass.setRenderTarget(this.targetTexture);\r\n pass.setRenderTargetDepth(this.depthTexture);\r\n pass.setExecuteFunc((context) => {\r\n this._renderer.renderList = this.objectList.meshes;\r\n this._renderer.particleSystemList = this.objectList.particleSystems;\r\n\r\n this.postProcess.updateProjectionMatrix();\r\n\r\n context.setDepthStates(this.depthTest && depthEnabled, this.depthWrite && depthEnabled);\r\n\r\n // We define the active camera and transformation matrices ourselves, otherwise this will be done by calling context.render, in which case\r\n // getProjectionMatrix will be called with a \"true\" parameter, forcing recalculation of the projection matrix and losing our changes.\r\n if (!this.postProcess.disabled) {\r\n this._scene.activeCamera = this.camera;\r\n this._scene.setTransformMatrix(this.camera.getViewMatrix(), this.camera.getProjectionMatrix());\r\n }\r\n\r\n context.render(this._renderer, this._textureWidth, this._textureHeight);\r\n\r\n this._scene.activeCamera = null;\r\n\r\n pingPongRenderTargetWrapper = pingPongRenderTargetWrapper || context.createRenderTarget(`${this.name} ping/pong`, pingPongHandle);\r\n\r\n context.bindRenderTarget(pingPongRenderTargetWrapper, \"frame graph - TAA merge with history texture\");\r\n\r\n if (!this.postProcess.disabled) {\r\n context.applyFullScreenEffect(this._postProcessDrawWrapper, () => {\r\n this.postProcess.bind();\r\n context.bindTextureHandle(this._postProcessDrawWrapper.effect!, \"textureSampler\", this.targetTexture);\r\n context.bindTextureHandle(this._postProcessDrawWrapper.effect!, \"historySampler\", pingPongHandle);\r\n });\r\n } else {\r\n context.copyTexture(this.targetTexture);\r\n }\r\n });\r\n\r\n const passDisabled = this._frameGraph.addRenderPass(this.name + \"_disabled\", true);\r\n\r\n passDisabled.setRenderTarget(this.outputTexture);\r\n passDisabled.setRenderTargetDepth(this.depthTexture);\r\n passDisabled.setExecuteFunc((context) => {\r\n context.copyTexture(this.targetTexture);\r\n });\r\n\r\n return pass;\r\n }\r\n}\r\n"]}
@@ -6,16 +6,16 @@ import { UtilityLayerRenderer } from "../../../Rendering/utilityLayerRenderer.js
6
6
  */
7
7
  export declare class FrameGraphUtilityLayerRendererTask extends FrameGraphTask {
8
8
  /**
9
- * The destination texture of the task.
9
+ * The target texture of the task.
10
10
  */
11
- destinationTexture: FrameGraphTextureHandle;
11
+ targetTexture: FrameGraphTextureHandle;
12
12
  /**
13
13
  * The camera used to render the utility layer.
14
14
  */
15
15
  camera: Camera;
16
16
  /**
17
17
  * The output texture of the task.
18
- * This is the same texture as the destination texture, but the handles are different!
18
+ * This is the same texture as the target texture, but the handles are different!
19
19
  */
20
20
  readonly outputTexture: FrameGraphTextureHandle;
21
21
  /**
@@ -18,10 +18,10 @@ export class FrameGraphUtilityLayerRendererTask extends FrameGraphTask {
18
18
  this.outputTexture = this._frameGraph.textureManager.createDanglingHandle();
19
19
  }
20
20
  record() {
21
- if (!this.destinationTexture || !this.camera) {
22
- throw new Error("FrameGraphUtilityLayerRendererTask: destinationTexture and camera are required");
21
+ if (!this.targetTexture || !this.camera) {
22
+ throw new Error("FrameGraphUtilityLayerRendererTask: targetTexture and camera are required");
23
23
  }
24
- this._frameGraph.textureManager.resolveDanglingHandle(this.outputTexture, this.destinationTexture);
24
+ this._frameGraph.textureManager.resolveDanglingHandle(this.outputTexture, this.targetTexture);
25
25
  const pass = this._frameGraph.addRenderPass(this.name);
26
26
  pass.setRenderTarget(this.outputTexture);
27
27
  pass.setExecuteFunc((context) => {
@@ -1 +1 @@
1
- {"version":3,"file":"utilityLayerRendererTask.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Tasks/Rendering/utilityLayerRendererTask.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,mDAA4C;AAE3E;;GAEG;AACH,MAAM,OAAO,kCAAmC,SAAQ,cAAc;IAsBlE;;;;;;OAMG;IACH,YAAY,IAAY,EAAE,UAAsB,EAAE,KAAY,EAAE,YAAY,GAAG,IAAI;QAC/E,KAAK,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QAExB,IAAI,CAAC,KAAK,GAAG,IAAI,oBAAoB,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,CAAC,CAAC;QACjE,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,sBAAsB,GAAG,IAAI,CAAC;QAE3D,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,oBAAoB,EAAE,CAAC;IAChF,CAAC;IAEM,MAAM;QACT,IAAI,CAAC,IAAI,CAAC,kBAAkB,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YAC3C,MAAM,IAAI,KAAK,CAAC,gFAAgF,CAAC,CAAC;QACtG,CAAC;QAED,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,qBAAqB,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC;QAEnG,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEvD,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACzC,IAAI,CAAC,cAAc,CAAC,CAAC,OAAO,EAAE,EAAE;YAC5B,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YAExC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC/B,CAAC,CAAC,CAAC;QAEH,MAAM,YAAY,GAAG,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,GAAG,WAAW,EAAE,IAAI,CAAC,CAAC;QAEnF,YAAY,CAAC,eAAe,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACjD,YAAY,CAAC,cAAc,CAAC,CAAC,QAAQ,EAAE,EAAE,GAAE,CAAC,CAAC,CAAC;IAClD,CAAC;IAEe,OAAO;QACnB,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;QACrB,KAAK,CAAC,OAAO,EAAE,CAAC;IACpB,CAAC;CACJ","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { Camera, FrameGraph, FrameGraphTextureHandle, Scene } from \"core/index\";\r\nimport { FrameGraphTask } from \"../../frameGraphTask\";\r\nimport { UtilityLayerRenderer } from \"core/Rendering/utilityLayerRenderer\";\r\n\r\n/**\r\n * Task used to render an utility layer.\r\n */\r\nexport class FrameGraphUtilityLayerRendererTask extends FrameGraphTask {\r\n /**\r\n * The destination texture of the task.\r\n */\r\n public destinationTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The camera used to render the utility layer.\r\n */\r\n public camera: Camera;\r\n\r\n /**\r\n * The output texture of the task.\r\n * This is the same texture as the destination texture, but the handles are different!\r\n */\r\n public readonly outputTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The utility layer renderer.\r\n */\r\n public readonly layer: UtilityLayerRenderer;\r\n\r\n /**\r\n * Creates a new utility layer renderer task.\r\n * @param name The name of the task.\r\n * @param frameGraph The frame graph the task belongs to.\r\n * @param scene The scene the task belongs to.\r\n * @param handleEvents If the utility layer should handle events.\r\n */\r\n constructor(name: string, frameGraph: FrameGraph, scene: Scene, handleEvents = true) {\r\n super(name, frameGraph);\r\n\r\n this.layer = new UtilityLayerRenderer(scene, handleEvents, true);\r\n this.layer.utilityLayerScene._useCurrentFrameBuffer = true;\r\n\r\n this.outputTexture = this._frameGraph.textureManager.createDanglingHandle();\r\n }\r\n\r\n public record(): void {\r\n if (!this.destinationTexture || !this.camera) {\r\n throw new Error(\"FrameGraphUtilityLayerRendererTask: destinationTexture and camera are required\");\r\n }\r\n\r\n this._frameGraph.textureManager.resolveDanglingHandle(this.outputTexture, this.destinationTexture);\r\n\r\n const pass = this._frameGraph.addRenderPass(this.name);\r\n\r\n pass.setRenderTarget(this.outputTexture);\r\n pass.setExecuteFunc((context) => {\r\n this.layer.setRenderCamera(this.camera);\r\n\r\n context.render(this.layer);\r\n });\r\n\r\n const passDisabled = this._frameGraph.addRenderPass(this.name + \"_disabled\", true);\r\n\r\n passDisabled.setRenderTarget(this.outputTexture);\r\n passDisabled.setExecuteFunc((_context) => {});\r\n }\r\n\r\n public override dispose(): void {\r\n this.layer.dispose();\r\n super.dispose();\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"utilityLayerRenderer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AC;QAC/B,CAAC,CAAC,CAAC;QAEH,MAAM,YAAY,GAAG,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,GAAG,WAAW,EAAE,IAAI,CAAC,CAAC;QAEnF,YAAY,CAAC,eAAe,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACjD,YAAY,CAAC,cAAc,CAAC,CAAC,QAAQ,EAAE,EAAE,GAAE,CAAC,CAAC,CAAC;IAClD,CAAC;IAEe,OAAO;QACnB,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;QACrB,KAAK,CAAC,OAAO,EAAE,CAAC;IACpB,CAAC;CACJ","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { Camera, FrameGraph, FrameGraphTextureHandle, Scene } from \"core/index\";\r\nimport { FrameGraphTask } from \"../../frameGraphTask\";\r\nimport { UtilityLayerRenderer } from \"core/Rendering/utilityLayerRenderer\";\r\n\r\n/**\r\n * Task used to render an utility layer.\r\n */\r\nexport class FrameGraphUtilityLayerRendererTask extends FrameGraphTask {\r\n /**\r\n * The target texture of the task.\r\n */\r\n public targetTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The camera used to render the utility layer.\r\n */\r\n public camera: Camera;\r\n\r\n /**\r\n * The output texture of the task.\r\n * This is the same texture as the target texture, but the handles are different!\r\n */\r\n public readonly outputTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The utility layer renderer.\r\n */\r\n public readonly layer: UtilityLayerRenderer;\r\n\r\n /**\r\n * Creates a new utility layer renderer task.\r\n * @param name The name of the task.\r\n * @param frameGraph The frame graph the task belongs to.\r\n * @param scene The scene the task belongs to.\r\n * @param handleEvents If the utility layer should handle events.\r\n */\r\n constructor(name: string, frameGraph: FrameGraph, scene: Scene, handleEvents = true) {\r\n super(name, frameGraph);\r\n\r\n this.layer = new UtilityLayerRenderer(scene, handleEvents, true);\r\n this.layer.utilityLayerScene._useCurrentFrameBuffer = true;\r\n\r\n this.outputTexture = this._frameGraph.textureManager.createDanglingHandle();\r\n }\r\n\r\n public record(): void {\r\n if (!this.targetTexture || !this.camera) {\r\n throw new Error(\"FrameGraphUtilityLayerRendererTask: targetTexture and camera are required\");\r\n }\r\n\r\n this._frameGraph.textureManager.resolveDanglingHandle(this.outputTexture, this.targetTexture);\r\n\r\n const pass = this._frameGraph.addRenderPass(this.name);\r\n\r\n pass.setRenderTarget(this.outputTexture);\r\n pass.setExecuteFunc((context) => {\r\n this.layer.setRenderCamera(this.camera);\r\n\r\n context.render(this.layer);\r\n });\r\n\r\n const passDisabled = this._frameGraph.addRenderPass(this.name + \"_disabled\", true);\r\n\r\n passDisabled.setRenderTarget(this.outputTexture);\r\n passDisabled.setExecuteFunc((_context) => {});\r\n }\r\n\r\n public override dispose(): void {\r\n this.layer.dispose();\r\n super.dispose();\r\n }\r\n}\r\n"]}
@@ -22,15 +22,15 @@ export declare class FrameGraphClearTextureTask extends FrameGraphTask {
22
22
  */
23
23
  clearStencil: boolean;
24
24
  /**
25
- * The texture to clear.
25
+ * The color texture to clear.
26
26
  */
27
- destinationTexture?: FrameGraphTextureHandle;
27
+ targetTexture?: FrameGraphTextureHandle;
28
28
  /**
29
29
  * The depth attachment texture to clear.
30
30
  */
31
31
  depthTexture?: FrameGraphTextureHandle;
32
32
  /**
33
- * The output texture (same as destinationTexture, but the handle will be different).
33
+ * The output texture (same as targetTexture, but the handle will be different).
34
34
  */
35
35
  readonly outputTexture: FrameGraphTextureHandle;
36
36
  /**
@@ -31,30 +31,30 @@ export class FrameGraphClearTextureTask extends FrameGraphTask {
31
31
  this.outputDepthTexture = this._frameGraph.textureManager.createDanglingHandle();
32
32
  }
33
33
  record() {
34
- if (this.destinationTexture === undefined && this.depthTexture === undefined) {
35
- throw new Error(`FrameGraphClearTextureTask ${this.name}: destinationTexture and depthTexture can't both be undefined.`);
34
+ if (this.targetTexture === undefined && this.depthTexture === undefined) {
35
+ throw new Error(`FrameGraphClearTextureTask ${this.name}: targetTexture and depthTexture can't both be undefined.`);
36
36
  }
37
37
  let textureSamples = 0;
38
38
  let depthSamples = 0;
39
- if (this.destinationTexture !== undefined) {
40
- textureSamples = this._frameGraph.textureManager.getTextureDescription(this.destinationTexture).options.samples || 1;
41
- this._frameGraph.textureManager.resolveDanglingHandle(this.outputTexture, this.destinationTexture);
39
+ if (this.targetTexture !== undefined) {
40
+ textureSamples = this._frameGraph.textureManager.getTextureDescription(this.targetTexture).options.samples || 1;
41
+ this._frameGraph.textureManager.resolveDanglingHandle(this.outputTexture, this.targetTexture);
42
42
  }
43
43
  if (this.depthTexture !== undefined) {
44
44
  depthSamples = this._frameGraph.textureManager.getTextureDescription(this.depthTexture).options.samples || 1;
45
45
  this._frameGraph.textureManager.resolveDanglingHandle(this.outputDepthTexture, this.depthTexture);
46
46
  }
47
47
  if (textureSamples !== depthSamples && textureSamples !== 0 && depthSamples !== 0) {
48
- throw new Error(`FrameGraphClearTextureTask ${this.name}: the depth texture and the output texture must have the same number of samples.`);
48
+ throw new Error(`FrameGraphClearTextureTask ${this.name}: the depth texture and the target texture must have the same number of samples.`);
49
49
  }
50
50
  const pass = this._frameGraph.addRenderPass(this.name);
51
- pass.setRenderTarget(this.destinationTexture);
51
+ pass.setRenderTarget(this.targetTexture);
52
52
  pass.setRenderTargetDepth(this.depthTexture);
53
53
  pass.setExecuteFunc((context) => {
54
54
  context.clear(this.color, !!this.clearColor, !!this.clearDepth, !!this.clearStencil);
55
55
  });
56
56
  const passDisabled = this._frameGraph.addRenderPass(this.name + "_disabled", true);
57
- passDisabled.setRenderTarget(this.destinationTexture);
57
+ passDisabled.setRenderTarget(this.targetTexture);
58
58
  passDisabled.setRenderTargetDepth(this.depthTexture);
59
59
  passDisabled.setExecuteFunc((_context) => { });
60
60
  return pass;
@@ -1 +1 @@
1
- {"version":3,"file":"clearTextureTask.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Tasks/Texture/clearTextureTask.ts"],"names":[],"mappings":"AAEA,OAAO,EA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C,cAAc,CAAC,CAAC,QAAQ,EAAE,EAAE,GAAE,CAAC,CAAC,CAAC;QAE9C,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { FrameGraph, FrameGraphTextureHandle, FrameGraphRenderPass } from \"core/index\";\r\nimport { Color4 } from \"../../../Maths/math.color\";\r\nimport { FrameGraphTask } from \"../../frameGraphTask\";\r\n\r\n/**\r\n * Task used to clear a texture.\r\n */\r\nexport class FrameGraphClearTextureTask extends FrameGraphTask {\r\n /**\r\n * The color to clear the texture with.\r\n */\r\n public color = new Color4(0.2, 0.2, 0.3, 1);\r\n\r\n /**\r\n * If the color should be cleared.\r\n */\r\n public clearColor = true;\r\n\r\n /**\r\n * If the depth should be cleared.\r\n */\r\n public clearDepth = false;\r\n\r\n /**\r\n * If the stencil should be cleared.\r\n */\r\n public clearStencil = false;\r\n\r\n /**\r\n * The texture to clear.\r\n */\r\n public destinationTexture?: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The depth attachment texture to clear.\r\n */\r\n public depthTexture?: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The output texture (same as destinationTexture, but the handle will be different).\r\n */\r\n public readonly outputTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The output depth texture (same as depthTexture, but the handle will be different).\r\n */\r\n public readonly outputDepthTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * Constructs a new clear task.\r\n * @param name The name of the task.\r\n * @param frameGraph The frame graph the task belongs to.\r\n */\r\n constructor(name: string, frameGraph: FrameGraph) {\r\n super(name, frameGraph);\r\n\r\n this.outputTexture = this._frameGraph.textureManager.createDanglingHandle();\r\n this.outputDepthTexture = this._frameGraph.textureManager.createDanglingHandle();\r\n }\r\n\r\n public record(): FrameGraphRenderPass {\r\n if (this.destinationTexture === undefined && this.depthTexture === undefined) {\r\n throw new Error(`FrameGraphClearTextureTask ${this.name}: destinationTexture and depthTexture can't both be undefined.`);\r\n }\r\n\r\n let textureSamples = 0;\r\n let depthSamples = 0;\r\n\r\n if (this.destinationTexture !== undefined) {\r\n textureSamples = this._frameGraph.textureManager.getTextureDescription(this.destinationTexture).options.samples || 1;\r\n this._frameGraph.textureManager.resolveDanglingHandle(this.outputTexture, this.destinationTexture);\r\n }\r\n if (this.depthTexture !== undefined) {\r\n depthSamples = this._frameGraph.textureManager.getTextureDescription(this.depthTexture).options.samples || 1;\r\n this._frameGraph.textureManager.resolveDanglingHandle(this.outputDepthTexture, this.depthTexture);\r\n }\r\n\r\n if (textureSamples !== depthSamples && textureSamples !== 0 && depthSamples !== 0) {\r\n throw new Error(`FrameGraphClearTextureTask ${this.name}: the depth texture and the output texture must have the same number of samples.`);\r\n }\r\n\r\n const pass = this._frameGraph.addRenderPass(this.name);\r\n\r\n pass.setRenderTarget(this.destinationTexture);\r\n pass.setRenderTargetDepth(this.depthTexture);\r\n pass.setExecuteFunc((context) => {\r\n context.clear(this.color, !!this.clearColor, !!this.clearDepth, !!this.clearStencil);\r\n });\r\n\r\n const passDisabled = this._frameGraph.addRenderPass(this.name + \"_disabled\", true);\r\n\r\n passDisabled.setRenderTarget(this.destinationTexture);\r\n passDisabled.setRenderTargetDepth(this.depthTexture);\r\n passDisabled.setExecuteFunc((_context) => {});\r\n\r\n return pass;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"clearTextureTask.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Tasks/Texture/clearTextureTask.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD;;GAEG;AACH,MAAM,OAAO,0BAA2B,SAAQ,cAAc;IAyC1D;;;;OAIG;IACH,YAAY,IAAY,EAAE,UAAsB;QAC5C,KAAK,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QA9C5B;;WAEG;QACI,UAAK,GAAG,IAAI,MAAM,CAAC,G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YAAY,CAAC,CAAC;QACtG,CAAC;QAED,IAAI,cAAc,KAAK,YAAY,IAAI,cAAc,KAAK,CAAC,IAAI,YAAY,KAAK,CAAC,EAAE,CAAC;YAChF,MAAM,IAAI,KAAK,CAAC,8BAA8B,IAAI,CAAC,IAAI,kFAAkF,CAAC,CAAC;QAC/I,CAAC;QAED,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEvD,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACzC,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAC7C,IAAI,CAAC,cAAc,CAAC,CAAC,OAAO,EAAE,EAAE;YAC5B,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACzF,CAAC,CAAC,CAAC;QAEH,MAAM,YAAY,GAAG,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,GAAG,WAAW,EAAE,IAAI,CAAC,CAAC;QAEnF,YAAY,CAAC,eAAe,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACjD,YAAY,CAAC,oBAAoB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACrD,YAAY,CAAC,cAAc,CAAC,CAAC,QAAQ,EAAE,EAAE,GAAE,CAAC,CAAC,CAAC;QAE9C,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { FrameGraph, FrameGraphTextureHandle, FrameGraphRenderPass } from \"core/index\";\r\nimport { Color4 } from \"../../../Maths/math.color\";\r\nimport { FrameGraphTask } from \"../../frameGraphTask\";\r\n\r\n/**\r\n * Task used to clear a texture.\r\n */\r\nexport class FrameGraphClearTextureTask extends FrameGraphTask {\r\n /**\r\n * The color to clear the texture with.\r\n */\r\n public color = new Color4(0.2, 0.2, 0.3, 1);\r\n\r\n /**\r\n * If the color should be cleared.\r\n */\r\n public clearColor = true;\r\n\r\n /**\r\n * If the depth should be cleared.\r\n */\r\n public clearDepth = false;\r\n\r\n /**\r\n * If the stencil should be cleared.\r\n */\r\n public clearStencil = false;\r\n\r\n /**\r\n * The color texture to clear.\r\n */\r\n public targetTexture?: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The depth attachment texture to clear.\r\n */\r\n public depthTexture?: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The output texture (same as targetTexture, but the handle will be different).\r\n */\r\n public readonly outputTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The output depth texture (same as depthTexture, but the handle will be different).\r\n */\r\n public readonly outputDepthTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * Constructs a new clear task.\r\n * @param name The name of the task.\r\n * @param frameGraph The frame graph the task belongs to.\r\n */\r\n constructor(name: string, frameGraph: FrameGraph) {\r\n super(name, frameGraph);\r\n\r\n this.outputTexture = this._frameGraph.textureManager.createDanglingHandle();\r\n this.outputDepthTexture = this._frameGraph.textureManager.createDanglingHandle();\r\n }\r\n\r\n public record(): FrameGraphRenderPass {\r\n if (this.targetTexture === undefined && this.depthTexture === undefined) {\r\n throw new Error(`FrameGraphClearTextureTask ${this.name}: targetTexture and depthTexture can't both be undefined.`);\r\n }\r\n\r\n let textureSamples = 0;\r\n let depthSamples = 0;\r\n\r\n if (this.targetTexture !== undefined) {\r\n textureSamples = this._frameGraph.textureManager.getTextureDescription(this.targetTexture).options.samples || 1;\r\n this._frameGraph.textureManager.resolveDanglingHandle(this.outputTexture, this.targetTexture);\r\n }\r\n if (this.depthTexture !== undefined) {\r\n depthSamples = this._frameGraph.textureManager.getTextureDescription(this.depthTexture).options.samples || 1;\r\n this._frameGraph.textureManager.resolveDanglingHandle(this.outputDepthTexture, this.depthTexture);\r\n }\r\n\r\n if (textureSamples !== depthSamples && textureSamples !== 0 && depthSamples !== 0) {\r\n throw new Error(`FrameGraphClearTextureTask ${this.name}: the depth texture and the target texture must have the same number of samples.`);\r\n }\r\n\r\n const pass = this._frameGraph.addRenderPass(this.name);\r\n\r\n pass.setRenderTarget(this.targetTexture);\r\n pass.setRenderTargetDepth(this.depthTexture);\r\n pass.setExecuteFunc((context) => {\r\n context.clear(this.color, !!this.clearColor, !!this.clearDepth, !!this.clearStencil);\r\n });\r\n\r\n const passDisabled = this._frameGraph.addRenderPass(this.name + \"_disabled\", true);\r\n\r\n passDisabled.setRenderTarget(this.targetTexture);\r\n passDisabled.setRenderTargetDepth(this.depthTexture);\r\n passDisabled.setExecuteFunc((_context) => {});\r\n\r\n return pass;\r\n }\r\n}\r\n"]}
@@ -9,11 +9,11 @@ export declare class FrameGraphCopyToTextureTask extends FrameGraphTask {
9
9
  */
10
10
  sourceTexture: FrameGraphTextureHandle;
11
11
  /**
12
- * The destination texture to copy to.
12
+ * The target texture to copy to.
13
13
  */
14
- destinationTexture: FrameGraphTextureHandle;
14
+ targetTexture: FrameGraphTextureHandle;
15
15
  /**
16
- * The output texture (same as destinationTexture, but the handle may be different).
16
+ * The output texture (same as targetTexture, but the handle may be different).
17
17
  */
18
18
  readonly outputTexture: FrameGraphTextureHandle;
19
19
  /**
@@ -13,10 +13,10 @@ export class FrameGraphCopyToTextureTask extends FrameGraphTask {
13
13
  this.outputTexture = this._frameGraph.textureManager.createDanglingHandle();
14
14
  }
15
15
  record() {
16
- if (this.sourceTexture === undefined || this.destinationTexture === undefined) {
17
- throw new Error(`FrameGraphCopyToTextureTask "${this.name}": sourceTexture and destinationTexture are required`);
16
+ if (this.sourceTexture === undefined || this.targetTexture === undefined) {
17
+ throw new Error(`FrameGraphCopyToTextureTask "${this.name}": sourceTexture and targetTexture are required`);
18
18
  }
19
- this._frameGraph.textureManager.resolveDanglingHandle(this.outputTexture, this.destinationTexture);
19
+ this._frameGraph.textureManager.resolveDanglingHandle(this.outputTexture, this.targetTexture);
20
20
  const pass = this._frameGraph.addRenderPass(this.name);
21
21
  pass.addDependencies(this.sourceTexture);
22
22
  pass.setRenderTarget(this.outputTexture);
@@ -1 +1 @@
1
- {"version":3,"file":"copyToTextureTask.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Tasks/Texture/copyToTextureTask.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD;;GAEG;AACH,MAAM,OAAO,2BAA4B,SAAQ,cAAc;IAgB3D;;;;OAIG;IACH,YAAY,IAAY,EAAE,UAAsB;QAC5C,KAAK,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QAExB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,oBAAoB,EAAE,CAAC;IAChF,CAAC;IAEM,MAAM;QACT,IAAI,IAAI,CAAC,aAAa,KAAK,SAAS,IAAI,IAAI,CAAC,kBAAkB,KAAK,SAAS,EAAE,CAAC;YAC5E,MAAM,IAAI,KAAK,CAAC,gCAAgC,IAAI,CAAC,IAAI,sDAAsD,CAAC,CAAC;QACrH,CAAC;QAED,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,qBAAqB,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC;QAEnG,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEvD,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAEzC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACzC,IAAI,CAAC,cAAc,CAAC,CAAC,OAAO,EAAE,EAAE;YAC5B,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAC5C,CAAC,CAAC,CAAC;QAEH,MAAM,YAAY,GAAG,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,GAAG,WAAW,EAAE,IAAI,CAAC,CAAC;QAEnF,YAAY,CAAC,eAAe,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACjD,YAAY,CAAC,cAAc,CAAC,CAAC,QAAQ,EAAE,EAAE,GAAE,CAAC,CAAC,CAAC;IAClD,CAAC;CACJ","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { FrameGraph, FrameGraphTextureHandle } from \"core/index\";\r\nimport { FrameGraphTask } from \"../../frameGraphTask\";\r\n\r\n/**\r\n * Task used to copy a texture to another texture.\r\n */\r\nexport class FrameGraphCopyToTextureTask extends FrameGraphTask {\r\n /**\r\n * The source texture to copy from.\r\n */\r\n public sourceTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The destination texture to copy to.\r\n */\r\n public destinationTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The output texture (same as destinationTexture, but the handle may be different).\r\n */\r\n public readonly outputTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * Constructs a new FrameGraphCopyToTextureTask.\r\n * @param name The name of the task.\r\n * @param frameGraph The frame graph the task belongs to.\r\n */\r\n constructor(name: string, frameGraph: FrameGraph) {\r\n super(name, frameGraph);\r\n\r\n this.outputTexture = this._frameGraph.textureManager.createDanglingHandle();\r\n }\r\n\r\n public record() {\r\n if (this.sourceTexture === undefined || this.destinationTexture === undefined) {\r\n throw new Error(`FrameGraphCopyToTextureTask \"${this.name}\": sourceTexture and destinationTexture are required`);\r\n }\r\n\r\n this._frameGraph.textureManager.resolveDanglingHandle(this.outputTexture, this.destinationTexture);\r\n\r\n const pass = this._frameGraph.addRenderPass(this.name);\r\n\r\n pass.addDependencies(this.sourceTexture);\r\n\r\n pass.setRenderTarget(this.outputTexture);\r\n pass.setExecuteFunc((context) => {\r\n context.copyTexture(this.sourceTexture);\r\n });\r\n\r\n const passDisabled = this._frameGraph.addRenderPass(this.name + \"_disabled\", true);\r\n\r\n passDisabled.setRenderTarget(this.outputTexture);\r\n passDisabled.setExecuteFunc((_context) => {});\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"copyToTextureTask.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Tasks/Texture/copyToTextureTask.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD;;GAEG;AACH,MAAM,OAAO,2BAA4B,SAAQ,cAAc;IAgB3D;;;;OAIG;IACH,YAAY,IAAY,EAAE,UAAsB;QAC5C,KAAK,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QAExB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,oBAAoB,EAAE,CAAC;IAChF,CAAC;IAEM,MAAM;QACT,IAAI,IAAI,CAAC,aAAa,KAAK,SAAS,IAAI,IAAI,CAAC,aAAa,KAAK,SAAS,EAAE,CAAC;YACvE,MAAM,IAAI,KAAK,CAAC,gCAAgC,IAAI,CAAC,IAAI,iDAAiD,CAAC,CAAC;QAChH,CAAC;QAED,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,qBAAqB,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;QAE9F,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEvD,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAEzC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACzC,IAAI,CAAC,cAAc,CAAC,CAAC,OAAO,EAAE,EAAE;YAC5B,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAC5C,CAAC,CAAC,CAAC;QAEH,MAAM,YAAY,GAAG,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,GAAG,WAAW,EAAE,IAAI,CAAC,CAAC;QAEnF,YAAY,CAAC,eAAe,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACjD,YAAY,CAAC,cAAc,CAAC,CAAC,QAAQ,EAAE,EAAE,GAAE,CAAC,CAAC,CAAC;IAClD,CAAC;CACJ","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { FrameGraph, FrameGraphTextureHandle } from \"core/index\";\r\nimport { FrameGraphTask } from \"../../frameGraphTask\";\r\n\r\n/**\r\n * Task used to copy a texture to another texture.\r\n */\r\nexport class FrameGraphCopyToTextureTask extends FrameGraphTask {\r\n /**\r\n * The source texture to copy from.\r\n */\r\n public sourceTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The target texture to copy to.\r\n */\r\n public targetTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The output texture (same as targetTexture, but the handle may be different).\r\n */\r\n public readonly outputTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * Constructs a new FrameGraphCopyToTextureTask.\r\n * @param name The name of the task.\r\n * @param frameGraph The frame graph the task belongs to.\r\n */\r\n constructor(name: string, frameGraph: FrameGraph) {\r\n super(name, frameGraph);\r\n\r\n this.outputTexture = this._frameGraph.textureManager.createDanglingHandle();\r\n }\r\n\r\n public record() {\r\n if (this.sourceTexture === undefined || this.targetTexture === undefined) {\r\n throw new Error(`FrameGraphCopyToTextureTask \"${this.name}\": sourceTexture and targetTexture are required`);\r\n }\r\n\r\n this._frameGraph.textureManager.resolveDanglingHandle(this.outputTexture, this.targetTexture);\r\n\r\n const pass = this._frameGraph.addRenderPass(this.name);\r\n\r\n pass.addDependencies(this.sourceTexture);\r\n\r\n pass.setRenderTarget(this.outputTexture);\r\n pass.setExecuteFunc((context) => {\r\n context.copyTexture(this.sourceTexture);\r\n });\r\n\r\n const passDisabled = this._frameGraph.addRenderPass(this.name + \"_disabled\", true);\r\n\r\n passDisabled.setRenderTarget(this.outputTexture);\r\n passDisabled.setExecuteFunc((_context) => {});\r\n }\r\n}\r\n"]}
@@ -7,9 +7,9 @@ export declare class FrameGraphGenerateMipMapsTask extends FrameGraphTask {
7
7
  /**
8
8
  * The texture to generate mipmaps for.
9
9
  */
10
- destinationTexture: FrameGraphTextureHandle;
10
+ targetTexture: FrameGraphTextureHandle;
11
11
  /**
12
- * The output texture (same as destinationTexture, but the handle may be different).
12
+ * The output texture (same as targetTexture, but the handle may be different).
13
13
  */
14
14
  readonly outputTexture: FrameGraphTextureHandle;
15
15
  /**
@@ -13,13 +13,13 @@ export class FrameGraphGenerateMipMapsTask extends FrameGraphTask {
13
13
  this.outputTexture = this._frameGraph.textureManager.createDanglingHandle();
14
14
  }
15
15
  record() {
16
- if (this.destinationTexture === undefined) {
17
- throw new Error(`FrameGraphGenerateMipMapsTask ${this.name}: destinationTexture is required`);
16
+ if (this.targetTexture === undefined) {
17
+ throw new Error(`FrameGraphGenerateMipMapsTask ${this.name}: targetTexture is required`);
18
18
  }
19
- this._frameGraph.textureManager.resolveDanglingHandle(this.outputTexture, this.destinationTexture);
20
- const outputTextureDescription = this._frameGraph.textureManager.getTextureDescription(this.destinationTexture);
19
+ this._frameGraph.textureManager.resolveDanglingHandle(this.outputTexture, this.targetTexture);
20
+ const outputTextureDescription = this._frameGraph.textureManager.getTextureDescription(this.targetTexture);
21
21
  if (!outputTextureDescription.options.createMipMaps) {
22
- throw new Error(`FrameGraphGenerateMipMapsTask ${this.name}: destinationTexture must have createMipMaps set to true`);
22
+ throw new Error(`FrameGraphGenerateMipMapsTask ${this.name}: targetTexture must have createMipMaps set to true`);
23
23
  }
24
24
  const pass = this._frameGraph.addRenderPass(this.name);
25
25
  pass.setRenderTarget(this.outputTexture);
@@ -1 +1 @@
1
- {"version":3,"file":"generateMipMapsTask.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Tasks/Texture/generateMipMapsTask.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,sB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AC;QACjD,YAAY,CAAC,cAAc,CAAC,CAAC,QAAQ,EAAE,EAAE,GAAE,CAAC,CAAC,CAAC;IAClD,CAAC;CACJ","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { FrameGraph, FrameGraphTextureHandle } from \"core/index\";\r\nimport { FrameGraphTask } from \"../../frameGraphTask\";\r\n\r\n/**\r\n * Task which generates mipmaps for a texture.\r\n */\r\nexport class FrameGraphGenerateMipMapsTask extends FrameGraphTask {\r\n /**\r\n * The texture to generate mipmaps for.\r\n */\r\n public destinationTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The output texture (same as destinationTexture, but the handle may be different).\r\n */\r\n public readonly outputTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * Constructs a new FrameGraphGenerateMipMapsTask.\r\n * @param name The name of the task.\r\n * @param frameGraph The frame graph the task belongs to.\r\n */\r\n constructor(name: string, frameGraph: FrameGraph) {\r\n super(name, frameGraph);\r\n\r\n this.outputTexture = this._frameGraph.textureManager.createDanglingHandle();\r\n }\r\n\r\n public record() {\r\n if (this.destinationTexture === undefined) {\r\n throw new Error(`FrameGraphGenerateMipMapsTask ${this.name}: destinationTexture is required`);\r\n }\r\n\r\n this._frameGraph.textureManager.resolveDanglingHandle(this.outputTexture, this.destinationTexture);\r\n\r\n const outputTextureDescription = this._frameGraph.textureManager.getTextureDescription(this.destinationTexture);\r\n\r\n if (!outputTextureDescription.options.createMipMaps) {\r\n throw new Error(`FrameGraphGenerateMipMapsTask ${this.name}: destinationTexture must have createMipMaps set to true`);\r\n }\r\n\r\n const pass = this._frameGraph.addRenderPass(this.name);\r\n\r\n pass.setRenderTarget(this.outputTexture);\r\n pass.setExecuteFunc((context) => {\r\n context.generateMipMaps();\r\n });\r\n\r\n const passDisabled = this._frameGraph.addRenderPass(this.name + \"_disabled\", true);\r\n\r\n passDisabled.setRenderTarget(this.outputTexture);\r\n passDisabled.setExecuteFunc((_context) => {});\r\n }\r\n}\r\n"]}
1
+ {"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WAAW,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,GAAG,WAAW,EAAE,IAAI,CAAC,CAAC;QAEnF,YAAY,CAAC,eAAe,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACjD,YAAY,CAAC,cAAc,CAAC,CAAC,QAAQ,EAAE,EAAE,GAAE,CAAC,CAAC,CAAC;IAClD,CAAC;CACJ","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { FrameGraph, FrameGraphTextureHandle } from \"core/index\";\r\nimport { FrameGraphTask } from \"../../frameGraphTask\";\r\n\r\n/**\r\n * Task which generates mipmaps for a texture.\r\n */\r\nexport class FrameGraphGenerateMipMapsTask extends FrameGraphTask {\r\n /**\r\n * The texture to generate mipmaps for.\r\n */\r\n public targetTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The output texture (same as targetTexture, but the handle may be different).\r\n */\r\n public readonly outputTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * Constructs a new FrameGraphGenerateMipMapsTask.\r\n * @param name The name of the task.\r\n * @param frameGraph The frame graph the task belongs to.\r\n */\r\n constructor(name: string, frameGraph: FrameGraph) {\r\n super(name, frameGraph);\r\n\r\n this.outputTexture = this._frameGraph.textureManager.createDanglingHandle();\r\n }\r\n\r\n public record() {\r\n if (this.targetTexture === undefined) {\r\n throw new Error(`FrameGraphGenerateMipMapsTask ${this.name}: targetTexture is required`);\r\n }\r\n\r\n this._frameGraph.textureManager.resolveDanglingHandle(this.outputTexture, this.targetTexture);\r\n\r\n const outputTextureDescription = this._frameGraph.textureManager.getTextureDescription(this.targetTexture);\r\n\r\n if (!outputTextureDescription.options.createMipMaps) {\r\n throw new Error(`FrameGraphGenerateMipMapsTask ${this.name}: targetTexture must have createMipMaps set to true`);\r\n }\r\n\r\n const pass = this._frameGraph.addRenderPass(this.name);\r\n\r\n pass.setRenderTarget(this.outputTexture);\r\n pass.setExecuteFunc((context) => {\r\n context.generateMipMaps();\r\n });\r\n\r\n const passDisabled = this._frameGraph.addRenderPass(this.name + \"_disabled\", true);\r\n\r\n passDisabled.setRenderTarget(this.outputTexture);\r\n passDisabled.setExecuteFunc((_context) => {});\r\n }\r\n}\r\n"]}
@@ -10,9 +10,11 @@ export * from "./Passes/renderPass";
10
10
  export * from "./Tasks/Layers/glowLayerTask";
11
11
  export * from "./Tasks/Layers/highlightLayerTask";
12
12
  export * from "./Tasks/Misc/executeTask";
13
+ export * from "./Tasks/PostProcesses/anaglyphTask";
13
14
  export * from "./Tasks/PostProcesses/blackAndWhiteTask";
14
15
  export * from "./Tasks/PostProcesses/bloomTask";
15
16
  export * from "./Tasks/PostProcesses/blurTask";
17
+ export * from "./Tasks/PostProcesses/chromaticAberrationTask";
16
18
  export * from "./Tasks/PostProcesses/circleOfConfusionTask";
17
19
  export * from "./Tasks/PostProcesses/depthOfFieldTask";
18
20
  export * from "./Tasks/PostProcesses/extractHighlightsTask";
@@ -11,9 +11,11 @@ export * from "./Passes/renderPass.js";
11
11
  export * from "./Tasks/Layers/glowLayerTask.js";
12
12
  export * from "./Tasks/Layers/highlightLayerTask.js";
13
13
  export * from "./Tasks/Misc/executeTask.js";
14
+ export * from "./Tasks/PostProcesses/anaglyphTask.js";
14
15
  export * from "./Tasks/PostProcesses/blackAndWhiteTask.js";
15
16
  export * from "./Tasks/PostProcesses/bloomTask.js";
16
17
  export * from "./Tasks/PostProcesses/blurTask.js";
18
+ export * from "./Tasks/PostProcesses/chromaticAberrationTask.js";
17
19
  export * from "./Tasks/PostProcesses/circleOfConfusionTask.js";
18
20
  export * from "./Tasks/PostProcesses/depthOfFieldTask.js";
19
21
  export * from "./Tasks/PostProcesses/extractHighlightsTask.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../dev/core/src/FrameGraph/index.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4CAA4C,CAAC;AAC3D,cAAc,kCAAkC,CAAC;AACjD,cAAc,mCAAmC,CAAC;AAClD,cAAc,qBAAqB,CAAC;AAEpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AAEpC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mCAAmC,CAAC;AAElD,cAAc,0BAA0B,CAAC;AAEzC,cAAc,yCAAyC,CAAC;AACxD,cAAc,iCAAiC,CAAC;AAChD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,6CAA6C,CAAC;AAC5D,cAAc,wCAAwC,CAAC;AACvD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uCAAuC,CAAC;AACtD,cAAc,gDAAgD,CAAC;AAE/D,cAAc,kCAAkC,CAAC;AACjD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,mCAAmC,CAAC;AAClD,cAAc,qCAAqC,CAAC;AAEpD,cAAc,0CAA0C,CAAC;AACzD,cAAc,mCAAmC,CAAC;AAClD,cAAc,wCAAwC,CAAC;AACvD,cAAc,sCAAsC,CAAC;AACrD,cAAc,uCAAuC,CAAC;AACtD,cAAc,yCAAyC,CAAC;AACxD,cAAc,4CAA4C,CAAC;AAE3D,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mBAAmB,CAAC","sourcesContent":["/* eslint-disable import/no-internal-modules */\r\nexport * from \"./Node/nodeRenderGraph\";\r\nexport * from \"./Node/nodeRenderGraphBlock\";\r\nexport * from \"./Node/nodeRenderGraphBlockConnectionPoint\";\r\nexport * from \"./Node/nodeRenderGraphBuildState\";\r\nexport * from \"./Node/Types/nodeRenderGraphTypes\";\r\nexport * from \"./Node/Blocks/index\";\r\n\r\nexport * from \"./Passes/cullPass\";\r\nexport * from \"./Passes/pass\";\r\nexport * from \"./Passes/renderPass\";\r\n\r\nexport * from \"./Tasks/Layers/glowLayerTask\";\r\nexport * from \"./Tasks/Layers/highlightLayerTask\";\r\n\r\nexport * from \"./Tasks/Misc/executeTask\";\r\n\r\nexport * from \"./Tasks/PostProcesses/blackAndWhiteTask\";\r\nexport * from \"./Tasks/PostProcesses/bloomTask\";\r\nexport * from \"./Tasks/PostProcesses/blurTask\";\r\nexport * from \"./Tasks/PostProcesses/circleOfConfusionTask\";\r\nexport * from \"./Tasks/PostProcesses/depthOfFieldTask\";\r\nexport * from \"./Tasks/PostProcesses/extractHighlightsTask\";\r\nexport * from \"./Tasks/PostProcesses/passTask\";\r\nexport * from \"./Tasks/PostProcesses/postProcessTask\";\r\nexport * from \"./Tasks/PostProcesses/ssrRenderingPipelineTask\";\r\n\r\nexport * from \"./Tasks/Texture/clearTextureTask\";\r\nexport * from \"./Tasks/Texture/copyToBackbufferColorTask\";\r\nexport * from \"./Tasks/Texture/copyToTextureTask\";\r\nexport * from \"./Tasks/Texture/generateMipMapsTask\";\r\n\r\nexport * from \"./Tasks/Rendering/csmShadowGeneratorTask\";\r\nexport * from \"./Tasks/Rendering/cullObjectsTask\";\r\nexport * from \"./Tasks/Rendering/geometryRendererTask\";\r\nexport * from \"./Tasks/Rendering/objectRendererTask\";\r\nexport * from \"./Tasks/Rendering/shadowGeneratorTask\";\r\nexport * from \"./Tasks/Rendering/taaObjectRendererTask\";\r\nexport * from \"./Tasks/Rendering/utilityLayerRendererTask\";\r\n\r\nexport * from \"./frameGraph\";\r\nexport * from \"./frameGraphContext\";\r\nexport * from \"./frameGraphObjectList\";\r\nexport * from \"./frameGraphRenderContext\";\r\nexport * from \"./frameGraphRenderTarget\";\r\nexport * from \"./frameGraphTask\";\r\nexport * from \"./frameGraphTextureManager\";\r\nexport * from \"./frameGraphTypes\";\r\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../dev/core/src/FrameGraph/index.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4CAA4C,CAAC;AAC3D,cAAc,kCAAkC,CAAC;AACjD,cAAc,mCAAmC,CAAC;AAClD,cAAc,qBAAqB,CAAC;AAEpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AAEpC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mCAAmC,CAAC;AAElD,cAAc,0BAA0B,CAAC;AAEzC,cAAc,oCAAoC,CAAC;AACnD,cAAc,yCAAyC,CAAC;AACxD,cAAc,iCAAiC,CAAC;AAChD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,+CAA+C,CAAC;AAC9D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,wCAAwC,CAAC;AACvD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uCAAuC,CAAC;AACtD,cAAc,gDAAgD,CAAC;AAE/D,cAAc,kCAAkC,CAAC;AACjD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,mCAAmC,CAAC;AAClD,cAAc,qCAAqC,CAAC;AAEpD,cAAc,0CAA0C,CAAC;AACzD,cAAc,mCAAmC,CAAC;AAClD,cAAc,wCAAwC,CAAC;AACvD,cAAc,sCAAsC,CAAC;AACrD,cAAc,uCAAuC,CAAC;AACtD,cAAc,yCAAyC,CAAC;AACxD,cAAc,4CAA4C,CAAC;AAE3D,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mBAAmB,CAAC","sourcesContent":["/* eslint-disable import/no-internal-modules */\r\nexport * from \"./Node/nodeRenderGraph\";\r\nexport * from \"./Node/nodeRenderGraphBlock\";\r\nexport * from \"./Node/nodeRenderGraphBlockConnectionPoint\";\r\nexport * from \"./Node/nodeRenderGraphBuildState\";\r\nexport * from \"./Node/Types/nodeRenderGraphTypes\";\r\nexport * from \"./Node/Blocks/index\";\r\n\r\nexport * from \"./Passes/cullPass\";\r\nexport * from \"./Passes/pass\";\r\nexport * from \"./Passes/renderPass\";\r\n\r\nexport * from \"./Tasks/Layers/glowLayerTask\";\r\nexport * from \"./Tasks/Layers/highlightLayerTask\";\r\n\r\nexport * from \"./Tasks/Misc/executeTask\";\r\n\r\nexport * from \"./Tasks/PostProcesses/anaglyphTask\";\r\nexport * from \"./Tasks/PostProcesses/blackAndWhiteTask\";\r\nexport * from \"./Tasks/PostProcesses/bloomTask\";\r\nexport * from \"./Tasks/PostProcesses/blurTask\";\r\nexport * from \"./Tasks/PostProcesses/chromaticAberrationTask\";\r\nexport * from \"./Tasks/PostProcesses/circleOfConfusionTask\";\r\nexport * from \"./Tasks/PostProcesses/depthOfFieldTask\";\r\nexport * from \"./Tasks/PostProcesses/extractHighlightsTask\";\r\nexport * from \"./Tasks/PostProcesses/passTask\";\r\nexport * from \"./Tasks/PostProcesses/postProcessTask\";\r\nexport * from \"./Tasks/PostProcesses/ssrRenderingPipelineTask\";\r\n\r\nexport * from \"./Tasks/Texture/clearTextureTask\";\r\nexport * from \"./Tasks/Texture/copyToBackbufferColorTask\";\r\nexport * from \"./Tasks/Texture/copyToTextureTask\";\r\nexport * from \"./Tasks/Texture/generateMipMapsTask\";\r\n\r\nexport * from \"./Tasks/Rendering/csmShadowGeneratorTask\";\r\nexport * from \"./Tasks/Rendering/cullObjectsTask\";\r\nexport * from \"./Tasks/Rendering/geometryRendererTask\";\r\nexport * from \"./Tasks/Rendering/objectRendererTask\";\r\nexport * from \"./Tasks/Rendering/shadowGeneratorTask\";\r\nexport * from \"./Tasks/Rendering/taaObjectRendererTask\";\r\nexport * from \"./Tasks/Rendering/utilityLayerRendererTask\";\r\n\r\nexport * from \"./frameGraph\";\r\nexport * from \"./frameGraphContext\";\r\nexport * from \"./frameGraphObjectList\";\r\nexport * from \"./frameGraphRenderContext\";\r\nexport * from \"./frameGraphRenderTarget\";\r\nexport * from \"./frameGraphTask\";\r\nexport * from \"./frameGraphTextureManager\";\r\nexport * from \"./frameGraphTypes\";\r\n"]}
@@ -431,9 +431,9 @@ export class InternalTexture extends TextureSampler {
431
431
  */
432
432
  dispose() {
433
433
  this._references--;
434
- this.onLoadedObservable.clear();
435
- this.onErrorObservable.clear();
436
434
  if (this._references === 0) {
435
+ this.onLoadedObservable.clear();
436
+ this.onErrorObservable.clear();
437
437
  this._engine._releaseTexture(this);
438
438
  this._hardwareTexture = null;
439
439
  this._dynamicTextureSource = null;