@babylonjs/core 8.37.0 → 8.37.1

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 (193) hide show
  1. package/Animations/animationGroup.js +1 -4
  2. package/Animations/animationGroup.js.map +1 -1
  3. package/Behaviors/Cameras/interpolatingBehavior.d.ts +58 -0
  4. package/Behaviors/Cameras/interpolatingBehavior.js +157 -0
  5. package/Behaviors/Cameras/interpolatingBehavior.js.map +1 -0
  6. package/Cameras/Inputs/arcRotateCameraPointersInput.d.ts +5 -20
  7. package/Cameras/Inputs/arcRotateCameraPointersInput.js +9 -69
  8. package/Cameras/Inputs/arcRotateCameraPointersInput.js.map +1 -1
  9. package/Cameras/Inputs/geospatialCameraKeyboardInput.d.ts +81 -0
  10. package/Cameras/Inputs/geospatialCameraKeyboardInput.js +223 -0
  11. package/Cameras/Inputs/geospatialCameraKeyboardInput.js.map +1 -0
  12. package/Cameras/Inputs/geospatialCameraMouseWheelInput.js +1 -1
  13. package/Cameras/Inputs/geospatialCameraMouseWheelInput.js.map +1 -1
  14. package/Cameras/Inputs/geospatialCameraPointersInput.d.ts +17 -21
  15. package/Cameras/Inputs/geospatialCameraPointersInput.js +49 -71
  16. package/Cameras/Inputs/geospatialCameraPointersInput.js.map +1 -1
  17. package/Cameras/Inputs/orbitCameraPointersInput.d.ts +49 -0
  18. package/Cameras/Inputs/orbitCameraPointersInput.js +105 -0
  19. package/Cameras/Inputs/orbitCameraPointersInput.js.map +1 -0
  20. package/Cameras/Limits/geospatialLimits.d.ts +60 -0
  21. package/Cameras/Limits/geospatialLimits.js +89 -0
  22. package/Cameras/Limits/geospatialLimits.js.map +1 -0
  23. package/Cameras/cameraMovement.d.ts +150 -0
  24. package/Cameras/cameraMovement.js +190 -0
  25. package/Cameras/cameraMovement.js.map +1 -0
  26. package/Cameras/geospatialCamera.d.ts +78 -49
  27. package/Cameras/geospatialCamera.js +210 -191
  28. package/Cameras/geospatialCamera.js.map +1 -1
  29. package/Cameras/geospatialCameraInputsManager.d.ts +5 -0
  30. package/Cameras/geospatialCameraInputsManager.js +9 -0
  31. package/Cameras/geospatialCameraInputsManager.js.map +1 -1
  32. package/Cameras/geospatialCameraMovement.d.ts +66 -0
  33. package/Cameras/geospatialCameraMovement.js +199 -0
  34. package/Cameras/geospatialCameraMovement.js.map +1 -0
  35. package/Decorators/nodeDecorator.d.ts +9 -7
  36. package/Decorators/nodeDecorator.js +9 -7
  37. package/Decorators/nodeDecorator.js.map +1 -1
  38. package/Engines/Native/nativeInterfaces.d.ts +14 -6
  39. package/Engines/Native/nativeInterfaces.js +6 -1
  40. package/Engines/Native/nativeInterfaces.js.map +1 -1
  41. package/Engines/WebGPU/webgpuTextureManager.js +2 -2
  42. package/Engines/WebGPU/webgpuTextureManager.js.map +1 -1
  43. package/Engines/abstractEngine.js +2 -2
  44. package/Engines/abstractEngine.js.map +1 -1
  45. package/Engines/nativeEngine.js +2 -2
  46. package/Engines/nativeEngine.js.map +1 -1
  47. package/FlowGraph/Blocks/Data/Math/flowGraphVectorMathBlocks.js +1 -1
  48. package/FlowGraph/Blocks/Data/Math/flowGraphVectorMathBlocks.js.map +1 -1
  49. package/FlowGraph/flowGraphMath.d.ts +25 -0
  50. package/FlowGraph/flowGraphMath.js +40 -0
  51. package/FlowGraph/flowGraphMath.js.map +1 -0
  52. package/FrameGraph/Node/Blocks/Layers/glowLayerBlock.js +1 -1
  53. package/FrameGraph/Node/Blocks/Layers/glowLayerBlock.js.map +1 -1
  54. package/FrameGraph/Node/Blocks/Layers/highlightLayerBlock.js +1 -1
  55. package/FrameGraph/Node/Blocks/Layers/highlightLayerBlock.js.map +1 -1
  56. package/FrameGraph/Node/Blocks/PostProcesses/basePostProcessBlock.js +1 -1
  57. package/FrameGraph/Node/Blocks/PostProcesses/baseWithPropertiesPostProcessBlock.js +1 -1
  58. package/FrameGraph/Node/Blocks/PostProcesses/circleOfConfusionPostProcessBlock.js +1 -1
  59. package/FrameGraph/Node/Blocks/PostProcesses/colorCorrectionPostProcessBlock.js +1 -1
  60. package/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.js +1 -1
  61. package/FrameGraph/Node/Blocks/PostProcesses/filterPostProcessBlock.js +1 -1
  62. package/FrameGraph/Node/Blocks/PostProcesses/imageProcessingPostProcessBlock.js +1 -1
  63. package/FrameGraph/Node/Blocks/PostProcesses/ssao2PostProcessBlock.js +1 -1
  64. package/FrameGraph/Node/Blocks/PostProcesses/ssao2PostProcessBlock.js.map +1 -1
  65. package/FrameGraph/Node/Blocks/PostProcesses/ssrPostProcessBlock.js +1 -1
  66. package/FrameGraph/Node/Blocks/PostProcesses/ssrPostProcessBlock.js.map +1 -1
  67. package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.d.ts +6 -0
  68. package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js +26 -0
  69. package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js.map +1 -1
  70. package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.d.ts +6 -0
  71. package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.js +48 -22
  72. package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.js.map +1 -1
  73. package/FrameGraph/Node/Blocks/Textures/clearBlock.js +3 -3
  74. package/FrameGraph/Node/Blocks/Textures/clearBlock.js.map +1 -1
  75. package/FrameGraph/Node/Blocks/Textures/copyTextureBlock.js +1 -1
  76. package/FrameGraph/Node/Blocks/Textures/generateMipmapsBlock.js +1 -1
  77. package/FrameGraph/Node/Blocks/Textures/generateMipmapsBlock.js.map +1 -1
  78. package/FrameGraph/Node/nodeRenderGraph.js +2 -1
  79. package/FrameGraph/Node/nodeRenderGraph.js.map +1 -1
  80. package/FrameGraph/Passes/{cullPass.d.ts → objectListPass.d.ts} +8 -8
  81. package/FrameGraph/Passes/{cullPass.js → objectListPass.js} +9 -9
  82. package/FrameGraph/Passes/objectListPass.js.map +1 -0
  83. package/FrameGraph/Passes/renderPass.d.ts +6 -2
  84. package/FrameGraph/Passes/renderPass.js +14 -2
  85. package/FrameGraph/Passes/renderPass.js.map +1 -1
  86. package/FrameGraph/Tasks/Misc/cullObjectsTask.js +2 -2
  87. package/FrameGraph/Tasks/Misc/cullObjectsTask.js.map +1 -1
  88. package/FrameGraph/Tasks/Rendering/geometryRendererTask.d.ts +8 -0
  89. package/FrameGraph/Tasks/Rendering/geometryRendererTask.js +10 -0
  90. package/FrameGraph/Tasks/Rendering/geometryRendererTask.js.map +1 -1
  91. package/FrameGraph/Tasks/Rendering/objectRendererTask.d.ts +8 -0
  92. package/FrameGraph/Tasks/Rendering/objectRendererTask.js +13 -0
  93. package/FrameGraph/Tasks/Rendering/objectRendererTask.js.map +1 -1
  94. package/FrameGraph/Tasks/Texture/clearTextureTask.d.ts +1 -1
  95. package/FrameGraph/Tasks/Texture/clearTextureTask.js +7 -5
  96. package/FrameGraph/Tasks/Texture/clearTextureTask.js.map +1 -1
  97. package/FrameGraph/frameGraph.d.ts +10 -4
  98. package/FrameGraph/frameGraph.js +22 -9
  99. package/FrameGraph/frameGraph.js.map +1 -1
  100. package/FrameGraph/frameGraphTask.js +3 -3
  101. package/FrameGraph/frameGraphTask.js.map +1 -1
  102. package/FrameGraph/index.d.ts +1 -1
  103. package/FrameGraph/index.js +1 -1
  104. package/FrameGraph/index.js.map +1 -1
  105. package/Materials/GaussianSplatting/gaussianSplattingMaterial.js +1 -1
  106. package/Materials/GaussianSplatting/gaussianSplattingMaterial.js.map +1 -1
  107. package/Materials/Node/Blocks/GaussianSplatting/gaussianSplattingBlock.js +5 -1
  108. package/Materials/Node/Blocks/GaussianSplatting/gaussianSplattingBlock.js.map +1 -1
  109. package/Materials/Node/Blocks/GaussianSplatting/splatReaderBlock.js +6 -5
  110. package/Materials/Node/Blocks/GaussianSplatting/splatReaderBlock.js.map +1 -1
  111. package/Materials/shaderMaterial.d.ts +9 -0
  112. package/Materials/shaderMaterial.js +39 -2
  113. package/Materials/shaderMaterial.js.map +1 -1
  114. package/Maths/math.vector.functions.d.ts +5 -24
  115. package/Maths/math.vector.functions.js +32 -35
  116. package/Maths/math.vector.functions.js.map +1 -1
  117. package/Meshes/GaussianSplatting/gaussianSplattingMesh.d.ts +1 -0
  118. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +51 -16
  119. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
  120. package/Meshes/csg2.js +1 -1
  121. package/Meshes/csg2.js.map +1 -1
  122. package/Meshes/thinInstanceMesh.js +15 -0
  123. package/Meshes/thinInstanceMesh.js.map +1 -1
  124. package/Misc/fileTools.js.map +1 -1
  125. package/Misc/tools.d.ts +3 -0
  126. package/Misc/tools.js +43 -4
  127. package/Misc/tools.js.map +1 -1
  128. package/Particles/EmitterTypes/coneParticleEmitter.d.ts +3 -1
  129. package/Particles/EmitterTypes/coneParticleEmitter.js +7 -1
  130. package/Particles/EmitterTypes/coneParticleEmitter.js.map +1 -1
  131. package/Particles/Node/Blocks/Emitters/coneShapeBlock.d.ts +9 -0
  132. package/Particles/Node/Blocks/Emitters/coneShapeBlock.js +43 -12
  133. package/Particles/Node/Blocks/Emitters/coneShapeBlock.js.map +1 -1
  134. package/Particles/Node/Blocks/Update/basicColorUpdateBlock.d.ts +1 -1
  135. package/Particles/Node/Blocks/Update/basicColorUpdateBlock.js +1 -1
  136. package/Particles/Node/Blocks/Update/basicColorUpdateBlock.js.map +1 -1
  137. package/Particles/Node/Blocks/Update/basicPositionUpdateBlock.d.ts +1 -1
  138. package/Particles/Node/Blocks/Update/basicPositionUpdateBlock.js +3 -3
  139. package/Particles/Node/Blocks/Update/basicPositionUpdateBlock.js.map +1 -1
  140. package/Particles/Node/Blocks/Update/updateSizeBlock.d.ts +35 -0
  141. package/Particles/Node/Blocks/Update/updateSizeBlock.js +73 -0
  142. package/Particles/Node/Blocks/Update/updateSizeBlock.js.map +1 -0
  143. package/Particles/Node/Blocks/index.d.ts +1 -0
  144. package/Particles/Node/Blocks/index.js +1 -0
  145. package/Particles/Node/Blocks/index.js.map +1 -1
  146. package/Particles/Node/Blocks/particleInputBlock.js +2 -0
  147. package/Particles/Node/Blocks/particleInputBlock.js.map +1 -1
  148. package/Particles/Node/Blocks/particleRandomBlock.d.ts +5 -2
  149. package/Particles/Node/Blocks/particleRandomBlock.js +32 -14
  150. package/Particles/Node/Blocks/particleRandomBlock.js.map +1 -1
  151. package/Particles/Node/Blocks/systemBlock.d.ts +20 -12
  152. package/Particles/Node/Blocks/systemBlock.js +26 -22
  153. package/Particles/Node/Blocks/systemBlock.js.map +1 -1
  154. package/Particles/Node/Enums/nodeParticleContextualSources.d.ts +5 -1
  155. package/Particles/Node/Enums/nodeParticleContextualSources.js +4 -0
  156. package/Particles/Node/Enums/nodeParticleContextualSources.js.map +1 -1
  157. package/Particles/Node/nodeParticleBuildState.d.ts +5 -5
  158. package/Particles/Node/nodeParticleBuildState.js +11 -7
  159. package/Particles/Node/nodeParticleBuildState.js.map +1 -1
  160. package/Particles/Node/nodeParticleSystemSet.helper.d.ts +0 -2
  161. package/Particles/Node/nodeParticleSystemSet.helper.js +524 -147
  162. package/Particles/Node/nodeParticleSystemSet.helper.js.map +1 -1
  163. package/Particles/particle.d.ts +4 -0
  164. package/Particles/particle.js +2 -0
  165. package/Particles/particle.js.map +1 -1
  166. package/Particles/thinParticleSystem.d.ts +3 -7
  167. package/Particles/thinParticleSystem.function.d.ts +1 -1
  168. package/Particles/thinParticleSystem.function.js +9 -6
  169. package/Particles/thinParticleSystem.function.js.map +1 -1
  170. package/Particles/thinParticleSystem.js +5 -7
  171. package/Particles/thinParticleSystem.js.map +1 -1
  172. package/Shaders/ShadersInclude/gaussianSplatting.js +5 -1
  173. package/Shaders/ShadersInclude/gaussianSplatting.js.map +1 -1
  174. package/Shaders/ShadersInclude/gaussianSplattingUboDeclaration.js +2 -1
  175. package/Shaders/ShadersInclude/gaussianSplattingUboDeclaration.js.map +1 -1
  176. package/Shaders/ShadersInclude/gaussianSplattingVertexDeclaration.js +1 -1
  177. package/Shaders/ShadersInclude/gaussianSplattingVertexDeclaration.js.map +1 -1
  178. package/Shaders/gaussianSplatting.vertex.js +3 -3
  179. package/Shaders/gaussianSplatting.vertex.js.map +1 -1
  180. package/Shaders/gaussianSplattingDepth.vertex.js +2 -2
  181. package/Shaders/gaussianSplattingDepth.vertex.js.map +1 -1
  182. package/ShadersWGSL/ShadersInclude/gaussianSplatting.js +35 -1
  183. package/ShadersWGSL/ShadersInclude/gaussianSplatting.js.map +1 -1
  184. package/ShadersWGSL/ShadersInclude/gaussianSplattingUboDeclaration.js +2 -1
  185. package/ShadersWGSL/ShadersInclude/gaussianSplattingUboDeclaration.js.map +1 -1
  186. package/ShadersWGSL/ShadersInclude/gaussianSplattingVertexDeclaration.js +1 -2
  187. package/ShadersWGSL/ShadersInclude/gaussianSplattingVertexDeclaration.js.map +1 -1
  188. package/ShadersWGSL/gaussianSplatting.vertex.js +3 -3
  189. package/ShadersWGSL/gaussianSplatting.vertex.js.map +1 -1
  190. package/ShadersWGSL/gaussianSplattingDepth.vertex.js +2 -2
  191. package/ShadersWGSL/gaussianSplattingDepth.vertex.js.map +1 -1
  192. package/package.json +1 -1
  193. package/FrameGraph/Passes/cullPass.js.map +0 -1
@@ -5,7 +5,7 @@ import { FlowGraphBinaryOperationBlock } from "../flowGraphBinaryOperationBlock.
5
5
  import { FlowGraphUnaryOperationBlock } from "../flowGraphUnaryOperationBlock.js";
6
6
  import { Quaternion, Vector3, Vector4 } from "../../../../Maths/math.vector.js";
7
7
  import { _GetClassNameOf } from "../../../utils.js";
8
- import { GetAngleBetweenQuaternions, GetQuaternionFromDirections } from "../../../../Maths/math.vector.functions.js";
8
+ import { GetAngleBetweenQuaternions, GetQuaternionFromDirections } from "../../../flowGraphMath.js";
9
9
  const AxisCacheName = "cachedOperationAxis";
10
10
  const AngleCacheName = "cachedOperationAngle";
11
11
  const CacheExecIdName = "cachedExecutionId";
@@ -1 +1 @@
1
- {"version":3,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AAC,OAAO,CAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;YAC1C,CAAC;QACL,CAAC;IACL,CAAC;IAED,gBAAgB;IACA,YAAY;QACxB,iGAAmD;IACvD,CAAC;CACJ;AAED,aAAa,4FAA8C,qCAAqC,CAAC,CAAC;AAElG;;GAEG;AACH,MAAM,OAAO,sCAAuC,SAAQ,6BAA2D;IACnH,YAAY,MAAqC;QAC7C,KAAK,CAAC,eAAe,EAAE,eAAe,EAAE,kBAAkB,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,2BAA2B,CAAC,CAAC,EAAE,CAAC,CAAC,+FAAgD,MAAM,CAAC,CAAC;IACnK,CAAC;CACJ","sourcesContent":["import { FlowGraphBlock, type IFlowGraphBlockConfiguration } from \"core/FlowGraph/flowGraphBlock\";\nimport {\n RichTypeVector3,\n FlowGraphTypes,\n RichTypeNumber,\n RichTypeAny,\n RichTypeVector2,\n RichTypeMatrix,\n getRichTypeByFlowGraphType,\n RichTypeQuaternion,\n RichTypeBoolean,\n} from \"core/FlowGraph/flowGraphRichTypes\";\nimport { RegisterClass } from \"core/Misc/typeStore\";\nimport { FlowGraphBlockNames } from \"../../flowGraphBlockNames\";\nimport { FlowGraphBinaryOperationBlock } from \"../flowGraphBinaryOperationBlock\";\nimport { FlowGraphUnaryOperationBlock } from \"../flowGraphUnaryOperationBlock\";\nimport { Quaternion, Vector3, Vector4 } from \"core/Maths/math.vector\";\nimport type { Matrix, Vector2 } from \"core/Maths/math.vector\";\nimport type { FlowGraphMatrix2D, FlowGraphMatrix3D } from \"core/FlowGraph/CustomTypes\";\nimport type { FlowGraphMatrix, FlowGraphVector } from \"core/FlowGraph/utils\";\nimport { _GetClassNameOf } from \"core/FlowGraph/utils\";\nimport type { FlowGraphDataConnection } from \"../../../flowGraphDataConnection\";\nimport type { FlowGraphContext } from \"../../../flowGraphContext\";\nimport { GetAngleBetweenQuaternions, GetQuaternionFromDirections } from \"../../../../Maths/math.vector.functions\";\nimport type { Nullable } from \"../../../../types\";\n\nconst AxisCacheName = \"cachedOperationAxis\";\nconst AngleCacheName = \"cachedOperationAngle\";\nconst CacheExecIdName = \"cachedExecutionId\";\n\n/**\n * Vector length block.\n */\nexport class FlowGraphLengthBlock extends FlowGraphUnaryOperationBlock<FlowGraphVector, number> {\n constructor(config?: IFlowGraphBlockConfiguration) {\n super(RichTypeAny, RichTypeNumber, (a) => this._polymorphicLength(a), FlowGraphBlockNames.Length, config);\n }\n\n private _polymorphicLength(a: FlowGraphVector) {\n const aClassName = _GetClassNameOf(a);\n switch (aClassName) {\n case FlowGraphTypes.Vector2:\n case FlowGraphTypes.Vector3:\n case FlowGraphTypes.Vector4:\n case FlowGraphTypes.Quaternion:\n return (a as Vector3).length();\n default:\n throw new Error(`Cannot compute length of value ${a}`);\n }\n }\n}\nRegisterClass(FlowGraphBlockNames.Length, FlowGraphLengthBlock);\n\n/**\n * Configuration for normalized vector\n */\nexport interface IFlowGraphNormalizeBlockConfiguration extends IFlowGraphBlockConfiguration {\n /**\n * If true, the block will return NaN if the input vector has a length of 0.\n * This is the expected behavior for glTF interactivity graphs.\n */\n nanOnZeroLength?: boolean;\n}\n\n/**\n * Vector normalize block.\n */\nexport class FlowGraphNormalizeBlock extends FlowGraphUnaryOperationBlock<FlowGraphVector, FlowGraphVector> {\n constructor(config?: IFlowGraphNormalizeBlockConfiguration) {\n super(RichTypeAny, RichTypeAny, (a) => this._polymorphicNormalize(a), FlowGraphBlockNames.Normalize, config);\n }\n\n private _polymorphicNormalize(a: FlowGraphVector) {\n const aClassName = _GetClassNameOf(a);\n let normalized: FlowGraphVector;\n switch (aClassName) {\n case FlowGraphTypes.Vector2:\n case FlowGraphTypes.Vector3:\n case FlowGraphTypes.Vector4:\n case FlowGraphTypes.Quaternion:\n normalized = a.normalizeToNew();\n if (this.config?.nanOnZeroLength) {\n const length = a.length();\n if (length === 0) {\n normalized.setAll(NaN);\n }\n }\n return normalized;\n default:\n throw new Error(`Cannot normalize value ${a}`);\n }\n }\n}\nRegisterClass(FlowGraphBlockNames.Normalize, FlowGraphNormalizeBlock);\n\n/**\n * Dot product block.\n */\nexport class FlowGraphDotBlock extends FlowGraphBinaryOperationBlock<FlowGraphVector, FlowGraphVector, number> {\n constructor(config?: IFlowGraphBlockConfiguration) {\n super(RichTypeAny, RichTypeAny, RichTypeNumber, (a, b) => this._polymorphicDot(a, b), FlowGraphBlockNames.Dot, config);\n }\n\n private _polymorphicDot(a: FlowGraphVector, b: FlowGraphVector) {\n const className = _GetClassNameOf(a);\n switch (className) {\n case FlowGraphTypes.Vector2:\n case FlowGraphTypes.Vector3:\n case FlowGraphTypes.Vector4:\n case FlowGraphTypes.Quaternion:\n // casting is needed because dot requires both to be the same type\n return (a as Vector3).dot(b as Vector3);\n default:\n throw new Error(`Cannot get dot product of ${a} and ${b}`);\n }\n }\n}\nRegisterClass(FlowGraphBlockNames.Dot, FlowGraphDotBlock);\n\n/**\n * Cross product block.\n */\nexport class FlowGraphCrossBlock extends FlowGraphBinaryOperationBlock<Vector3, Vector3, Vector3> {\n constructor(config?: IFlowGraphBlockConfiguration) {\n super(RichTypeVector3, RichTypeVector3, RichTypeVector3, (a, b) => Vector3.Cross(a, b), FlowGraphBlockNames.Cross, config);\n }\n}\nRegisterClass(FlowGraphBlockNames.Cross, FlowGraphCrossBlock);\n\n/**\n * 2D rotation block.\n */\nexport class FlowGraphRotate2DBlock extends FlowGraphBinaryOperationBlock<Vector2, number, Vector2> {\n constructor(config?: IFlowGraphBlockConfiguration) {\n super(RichTypeVector2, RichTypeNumber, RichTypeVector2, (a, b) => a.rotate(b), FlowGraphBlockNames.Rotate2D, config);\n }\n}\nRegisterClass(FlowGraphBlockNames.Rotate2D, FlowGraphRotate2DBlock);\n\n/**\n * 3D rotation block.\n */\nexport class FlowGraphRotate3DBlock extends FlowGraphBinaryOperationBlock<Vector3, Quaternion, Vector3> {\n constructor(config?: IFlowGraphBlockConfiguration) {\n super(RichTypeVector3, RichTypeQuaternion, RichTypeVector3, (a, b) => a.applyRotationQuaternion(b), FlowGraphBlockNames.Rotate3D, config);\n }\n}\nRegisterClass(FlowGraphBlockNames.Rotate3D, FlowGraphRotate3DBlock);\n\nfunction TransformVector(a: FlowGraphVector, b: FlowGraphMatrix): FlowGraphVector {\n const className = _GetClassNameOf(a);\n switch (className) {\n case FlowGraphTypes.Vector2:\n return (b as FlowGraphMatrix2D).transformVector(a as Vector2);\n case FlowGraphTypes.Vector3:\n return (b as FlowGraphMatrix3D).transformVector(a as Vector3);\n case FlowGraphTypes.Vector4:\n a = a as Vector4;\n // transform the vector 4 with the matrix here. Vector4.TransformCoordinates transforms a 3D coordinate, not Vector4\n return new Vector4(\n a.x * b.m[0] + a.y * b.m[1] + a.z * b.m[2] + a.w * b.m[3],\n a.x * b.m[4] + a.y * b.m[5] + a.z * b.m[6] + a.w * b.m[7],\n a.x * b.m[8] + a.y * b.m[9] + a.z * b.m[10] + a.w * b.m[11],\n a.x * b.m[12] + a.y * b.m[13] + a.z * b.m[14] + a.w * b.m[15]\n );\n default:\n throw new Error(`Cannot transform value ${a}`);\n }\n}\n\n/**\n * Configuration for the transform block.\n */\nexport interface IFlowGraphTransformBlockConfiguration extends IFlowGraphBlockConfiguration {\n /**\n * The vector type\n */\n vectorType: FlowGraphTypes;\n}\n\n/**\n * Transform a vector3 by a matrix.\n */\nexport class FlowGraphTransformBlock extends FlowGraphBinaryOperationBlock<FlowGraphVector, FlowGraphMatrix, FlowGraphVector> {\n constructor(config?: IFlowGraphTransformBlockConfiguration) {\n const vectorType = config?.vectorType || FlowGraphTypes.Vector3;\n const matrixType =\n vectorType === FlowGraphTypes.Vector2 ? FlowGraphTypes.Matrix2D : vectorType === FlowGraphTypes.Vector3 ? FlowGraphTypes.Matrix3D : FlowGraphTypes.Matrix;\n super(\n getRichTypeByFlowGraphType(vectorType),\n getRichTypeByFlowGraphType(matrixType),\n getRichTypeByFlowGraphType(vectorType),\n TransformVector,\n FlowGraphBlockNames.TransformVector,\n config\n );\n }\n}\n\nRegisterClass(FlowGraphBlockNames.TransformVector, FlowGraphTransformBlock);\n\n/**\n * Transform a vector3 by a matrix.\n */\nexport class FlowGraphTransformCoordinatesBlock extends FlowGraphBinaryOperationBlock<Vector3, Matrix, Vector3> {\n constructor(config?: IFlowGraphBlockConfiguration) {\n super(RichTypeVector3, RichTypeMatrix, RichTypeVector3, (a, b) => Vector3.TransformCoordinates(a, b), FlowGraphBlockNames.TransformCoordinates, config);\n }\n}\n\nRegisterClass(FlowGraphBlockNames.TransformCoordinates, FlowGraphTransformCoordinatesBlock);\n\n/**\n * Conjugate the quaternion.\n */\nexport class FlowGraphConjugateBlock extends FlowGraphUnaryOperationBlock<Quaternion, Quaternion> {\n constructor(config?: IFlowGraphBlockConfiguration) {\n super(RichTypeQuaternion, RichTypeQuaternion, (a) => a.conjugate(), FlowGraphBlockNames.Conjugate, config);\n }\n}\n\nRegisterClass(FlowGraphBlockNames.Conjugate, FlowGraphConjugateBlock);\n\n/**\n * Get the angle between two quaternions.\n */\nexport class FlowGraphAngleBetweenBlock extends FlowGraphBinaryOperationBlock<Quaternion, Quaternion, number> {\n constructor(config?: IFlowGraphBlockConfiguration) {\n super(RichTypeQuaternion, RichTypeQuaternion, RichTypeNumber, (a, b) => GetAngleBetweenQuaternions(a, b), FlowGraphBlockNames.AngleBetween, config);\n }\n}\n\nRegisterClass(FlowGraphBlockNames.AngleBetween, FlowGraphAngleBetweenBlock);\n\n/**\n * Get the quaternion from an axis and an angle.\n */\nexport class FlowGraphQuaternionFromAxisAngleBlock extends FlowGraphBinaryOperationBlock<Vector3, number, Quaternion> {\n constructor(config?: IFlowGraphBlockConfiguration) {\n super(RichTypeVector3, RichTypeNumber, RichTypeQuaternion, (a, b) => Quaternion.RotationAxis(a, b), FlowGraphBlockNames.QuaternionFromAxisAngle, config);\n }\n}\n\nRegisterClass(FlowGraphBlockNames.QuaternionFromAxisAngle, FlowGraphQuaternionFromAxisAngleBlock);\n\n/**\n * Get the axis and angle from a quaternion.\n */\nexport class FlowGraphAxisAngleFromQuaternionBlock extends FlowGraphBlock {\n /**\n * The input of this block.\n */\n public readonly a: FlowGraphDataConnection<Quaternion>;\n\n /**\n * The output axis of rotation.\n */\n public readonly axis: FlowGraphDataConnection<Vector3>;\n\n /**\n * The output angle of rotation.\n */\n public readonly angle: FlowGraphDataConnection<number>;\n\n /**\n * Output connection: Whether the value is valid.\n */\n public readonly isValid: FlowGraphDataConnection<boolean>;\n\n constructor(config?: IFlowGraphBlockConfiguration) {\n super(config);\n\n this.a = this.registerDataInput(\"a\", RichTypeQuaternion);\n\n this.axis = this.registerDataOutput(\"axis\", RichTypeVector3);\n this.angle = this.registerDataOutput(\"angle\", RichTypeNumber);\n\n this.isValid = this.registerDataOutput(\"isValid\", RichTypeBoolean);\n }\n\n /** @override */\n public override _updateOutputs(context: FlowGraphContext) {\n const cachedExecutionId = context._getExecutionVariable(this, CacheExecIdName, -1);\n const cachedAxis = context._getExecutionVariable<Nullable<Vector3>>(this, AxisCacheName, null);\n const cachedAngle = context._getExecutionVariable<Nullable<number>>(this, AngleCacheName, null);\n if (cachedAxis !== undefined && cachedAxis !== null && cachedAngle !== undefined && cachedAngle !== null && cachedExecutionId === context.executionId) {\n this.axis.setValue(cachedAxis, context);\n this.angle.setValue(cachedAngle, context);\n } else {\n try {\n const { axis, angle } = this.a.getValue(context).toAxisAngle();\n context._setExecutionVariable(this, AxisCacheName, axis);\n context._setExecutionVariable(this, AngleCacheName, angle);\n context._setExecutionVariable(this, CacheExecIdName, context.executionId);\n this.axis.setValue(axis, context);\n this.angle.setValue(angle, context);\n this.isValid.setValue(true, context);\n } catch (e) {\n this.isValid.setValue(false, context);\n }\n }\n }\n\n /** @override */\n public override getClassName(): string {\n return FlowGraphBlockNames.AxisAngleFromQuaternion;\n }\n}\n\nRegisterClass(FlowGraphBlockNames.AxisAngleFromQuaternion, FlowGraphAxisAngleFromQuaternionBlock);\n\n/**\n * Get the quaternion from two direction vectors.\n */\nexport class FlowGraphQuaternionFromDirectionsBlock extends FlowGraphBinaryOperationBlock<Vector3, Vector3, Quaternion> {\n constructor(config?: IFlowGraphBlockConfiguration) {\n super(RichTypeVector3, RichTypeVector3, RichTypeQuaternion, (a, b) => GetQuaternionFromDirections(a, b), FlowGraphBlockNames.QuaternionFromDirections, config);\n }\n}\n"]}
1
+ {"version":3,"file":"flowGraphVectorMathBlocks.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Data/Math/flowGraphVectorMathBlocks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAqC,mCAAsC;AAClG,OAAO,EACH,eAAe,EAEf,cAAc,EACd,WAAW,EACX,eAAe,EACf,cAAc,EACd,0BAA0B,EAC1B,kBAAkB,EAClB,eAAe,GAClB,uCAA0C;AAC3C,OAAO,EAAE,aAAa,EAAE,sCAA4B;AAEpD,OAAO,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,EAAE,4BAA4B,EAAE,MAAM,iCAAiC,CAAC;AAC/E,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,yCAA+B;AAItE,OAAO,EAAE,eAAe,EAAE,0BAA6B;AAIvD,OAAO,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,kCAAqC;AAEvG,MAAM,aAAa,GAAG,qBAAqB,CAAC;AAC5C,MAAM,cAAc,GAAG,sBAAsB,CAAC;AAC9C,MAAM,eAAe,GAAG,mBAAmB,CAAC;AAE5C;;GAEG;AACH,MAAM,OAAO,oBAAqB,SAAQ,4BAAqD;IAC3F,YAAY,MAAqC;QAC7C,KAAK,CAAC,WAAW,EAAE,cAAc,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,2DAA8B,MAAM,CAAC,CAAC;IAC9G,CAAC;IAEO,kBAAkB,CAAC,CAAkB;QACzC,MAAM,UAAU,GAAG,eAAe,CAAC,CAAC,C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O,CAAC,CAAC;gBAClC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;gBACpC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YACzC,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACT,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;YAC1C,CAAC;QACL,CAAC;IACL,CAAC;IAED,gBAAgB;IACA,YAAY;QACxB,iGAAmD;IACvD,CAAC;CACJ;AAED,aAAa,4FAA8C,qCAAqC,CAAC,CAAC;AAElG;;GAEG;AACH,MAAM,OAAO,sCAAuC,SAAQ,6BAA2D;IACnH,YAAY,MAAqC;QAC7C,KAAK,CAAC,eAAe,EAAE,eAAe,EAAE,kBAAkB,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,2BAA2B,CAAC,CAAC,EAAE,CAAC,CAAC,+FAAgD,MAAM,CAAC,CAAC;IACnK,CAAC;CACJ","sourcesContent":["import { FlowGraphBlock, type IFlowGraphBlockConfiguration } from \"core/FlowGraph/flowGraphBlock\";\nimport {\n RichTypeVector3,\n FlowGraphTypes,\n RichTypeNumber,\n RichTypeAny,\n RichTypeVector2,\n RichTypeMatrix,\n getRichTypeByFlowGraphType,\n RichTypeQuaternion,\n RichTypeBoolean,\n} from \"core/FlowGraph/flowGraphRichTypes\";\nimport { RegisterClass } from \"core/Misc/typeStore\";\nimport { FlowGraphBlockNames } from \"../../flowGraphBlockNames\";\nimport { FlowGraphBinaryOperationBlock } from \"../flowGraphBinaryOperationBlock\";\nimport { FlowGraphUnaryOperationBlock } from \"../flowGraphUnaryOperationBlock\";\nimport { Quaternion, Vector3, Vector4 } from \"core/Maths/math.vector\";\nimport type { Matrix, Vector2 } from \"core/Maths/math.vector\";\nimport type { FlowGraphMatrix2D, FlowGraphMatrix3D } from \"core/FlowGraph/CustomTypes\";\nimport type { FlowGraphMatrix, FlowGraphVector } from \"core/FlowGraph/utils\";\nimport { _GetClassNameOf } from \"core/FlowGraph/utils\";\nimport type { FlowGraphDataConnection } from \"../../../flowGraphDataConnection\";\nimport type { FlowGraphContext } from \"../../../flowGraphContext\";\nimport type { Nullable } from \"../../../../types\";\nimport { GetAngleBetweenQuaternions, GetQuaternionFromDirections } from \"core/FlowGraph/flowGraphMath\";\n\nconst AxisCacheName = \"cachedOperationAxis\";\nconst AngleCacheName = \"cachedOperationAngle\";\nconst CacheExecIdName = \"cachedExecutionId\";\n\n/**\n * Vector length block.\n */\nexport class FlowGraphLengthBlock extends FlowGraphUnaryOperationBlock<FlowGraphVector, number> {\n constructor(config?: IFlowGraphBlockConfiguration) {\n super(RichTypeAny, RichTypeNumber, (a) => this._polymorphicLength(a), FlowGraphBlockNames.Length, config);\n }\n\n private _polymorphicLength(a: FlowGraphVector) {\n const aClassName = _GetClassNameOf(a);\n switch (aClassName) {\n case FlowGraphTypes.Vector2:\n case FlowGraphTypes.Vector3:\n case FlowGraphTypes.Vector4:\n case FlowGraphTypes.Quaternion:\n return (a as Vector3).length();\n default:\n throw new Error(`Cannot compute length of value ${a}`);\n }\n }\n}\nRegisterClass(FlowGraphBlockNames.Length, FlowGraphLengthBlock);\n\n/**\n * Configuration for normalized vector\n */\nexport interface IFlowGraphNormalizeBlockConfiguration extends IFlowGraphBlockConfiguration {\n /**\n * If true, the block will return NaN if the input vector has a length of 0.\n * This is the expected behavior for glTF interactivity graphs.\n */\n nanOnZeroLength?: boolean;\n}\n\n/**\n * Vector normalize block.\n */\nexport class FlowGraphNormalizeBlock extends FlowGraphUnaryOperationBlock<FlowGraphVector, FlowGraphVector> {\n constructor(config?: IFlowGraphNormalizeBlockConfiguration) {\n super(RichTypeAny, RichTypeAny, (a) => this._polymorphicNormalize(a), FlowGraphBlockNames.Normalize, config);\n }\n\n private _polymorphicNormalize(a: FlowGraphVector) {\n const aClassName = _GetClassNameOf(a);\n let normalized: FlowGraphVector;\n switch (aClassName) {\n case FlowGraphTypes.Vector2:\n case FlowGraphTypes.Vector3:\n case FlowGraphTypes.Vector4:\n case FlowGraphTypes.Quaternion:\n normalized = a.normalizeToNew();\n if (this.config?.nanOnZeroLength) {\n const length = a.length();\n if (length === 0) {\n normalized.setAll(NaN);\n }\n }\n return normalized;\n default:\n throw new Error(`Cannot normalize value ${a}`);\n }\n }\n}\nRegisterClass(FlowGraphBlockNames.Normalize, FlowGraphNormalizeBlock);\n\n/**\n * Dot product block.\n */\nexport class FlowGraphDotBlock extends FlowGraphBinaryOperationBlock<FlowGraphVector, FlowGraphVector, number> {\n constructor(config?: IFlowGraphBlockConfiguration) {\n super(RichTypeAny, RichTypeAny, RichTypeNumber, (a, b) => this._polymorphicDot(a, b), FlowGraphBlockNames.Dot, config);\n }\n\n private _polymorphicDot(a: FlowGraphVector, b: FlowGraphVector) {\n const className = _GetClassNameOf(a);\n switch (className) {\n case FlowGraphTypes.Vector2:\n case FlowGraphTypes.Vector3:\n case FlowGraphTypes.Vector4:\n case FlowGraphTypes.Quaternion:\n // casting is needed because dot requires both to be the same type\n return (a as Vector3).dot(b as Vector3);\n default:\n throw new Error(`Cannot get dot product of ${a} and ${b}`);\n }\n }\n}\nRegisterClass(FlowGraphBlockNames.Dot, FlowGraphDotBlock);\n\n/**\n * Cross product block.\n */\nexport class FlowGraphCrossBlock extends FlowGraphBinaryOperationBlock<Vector3, Vector3, Vector3> {\n constructor(config?: IFlowGraphBlockConfiguration) {\n super(RichTypeVector3, RichTypeVector3, RichTypeVector3, (a, b) => Vector3.Cross(a, b), FlowGraphBlockNames.Cross, config);\n }\n}\nRegisterClass(FlowGraphBlockNames.Cross, FlowGraphCrossBlock);\n\n/**\n * 2D rotation block.\n */\nexport class FlowGraphRotate2DBlock extends FlowGraphBinaryOperationBlock<Vector2, number, Vector2> {\n constructor(config?: IFlowGraphBlockConfiguration) {\n super(RichTypeVector2, RichTypeNumber, RichTypeVector2, (a, b) => a.rotate(b), FlowGraphBlockNames.Rotate2D, config);\n }\n}\nRegisterClass(FlowGraphBlockNames.Rotate2D, FlowGraphRotate2DBlock);\n\n/**\n * 3D rotation block.\n */\nexport class FlowGraphRotate3DBlock extends FlowGraphBinaryOperationBlock<Vector3, Quaternion, Vector3> {\n constructor(config?: IFlowGraphBlockConfiguration) {\n super(RichTypeVector3, RichTypeQuaternion, RichTypeVector3, (a, b) => a.applyRotationQuaternion(b), FlowGraphBlockNames.Rotate3D, config);\n }\n}\nRegisterClass(FlowGraphBlockNames.Rotate3D, FlowGraphRotate3DBlock);\n\nfunction TransformVector(a: FlowGraphVector, b: FlowGraphMatrix): FlowGraphVector {\n const className = _GetClassNameOf(a);\n switch (className) {\n case FlowGraphTypes.Vector2:\n return (b as FlowGraphMatrix2D).transformVector(a as Vector2);\n case FlowGraphTypes.Vector3:\n return (b as FlowGraphMatrix3D).transformVector(a as Vector3);\n case FlowGraphTypes.Vector4:\n a = a as Vector4;\n // transform the vector 4 with the matrix here. Vector4.TransformCoordinates transforms a 3D coordinate, not Vector4\n return new Vector4(\n a.x * b.m[0] + a.y * b.m[1] + a.z * b.m[2] + a.w * b.m[3],\n a.x * b.m[4] + a.y * b.m[5] + a.z * b.m[6] + a.w * b.m[7],\n a.x * b.m[8] + a.y * b.m[9] + a.z * b.m[10] + a.w * b.m[11],\n a.x * b.m[12] + a.y * b.m[13] + a.z * b.m[14] + a.w * b.m[15]\n );\n default:\n throw new Error(`Cannot transform value ${a}`);\n }\n}\n\n/**\n * Configuration for the transform block.\n */\nexport interface IFlowGraphTransformBlockConfiguration extends IFlowGraphBlockConfiguration {\n /**\n * The vector type\n */\n vectorType: FlowGraphTypes;\n}\n\n/**\n * Transform a vector3 by a matrix.\n */\nexport class FlowGraphTransformBlock extends FlowGraphBinaryOperationBlock<FlowGraphVector, FlowGraphMatrix, FlowGraphVector> {\n constructor(config?: IFlowGraphTransformBlockConfiguration) {\n const vectorType = config?.vectorType || FlowGraphTypes.Vector3;\n const matrixType =\n vectorType === FlowGraphTypes.Vector2 ? FlowGraphTypes.Matrix2D : vectorType === FlowGraphTypes.Vector3 ? FlowGraphTypes.Matrix3D : FlowGraphTypes.Matrix;\n super(\n getRichTypeByFlowGraphType(vectorType),\n getRichTypeByFlowGraphType(matrixType),\n getRichTypeByFlowGraphType(vectorType),\n TransformVector,\n FlowGraphBlockNames.TransformVector,\n config\n );\n }\n}\n\nRegisterClass(FlowGraphBlockNames.TransformVector, FlowGraphTransformBlock);\n\n/**\n * Transform a vector3 by a matrix.\n */\nexport class FlowGraphTransformCoordinatesBlock extends FlowGraphBinaryOperationBlock<Vector3, Matrix, Vector3> {\n constructor(config?: IFlowGraphBlockConfiguration) {\n super(RichTypeVector3, RichTypeMatrix, RichTypeVector3, (a, b) => Vector3.TransformCoordinates(a, b), FlowGraphBlockNames.TransformCoordinates, config);\n }\n}\n\nRegisterClass(FlowGraphBlockNames.TransformCoordinates, FlowGraphTransformCoordinatesBlock);\n\n/**\n * Conjugate the quaternion.\n */\nexport class FlowGraphConjugateBlock extends FlowGraphUnaryOperationBlock<Quaternion, Quaternion> {\n constructor(config?: IFlowGraphBlockConfiguration) {\n super(RichTypeQuaternion, RichTypeQuaternion, (a) => a.conjugate(), FlowGraphBlockNames.Conjugate, config);\n }\n}\n\nRegisterClass(FlowGraphBlockNames.Conjugate, FlowGraphConjugateBlock);\n\n/**\n * Get the angle between two quaternions.\n */\nexport class FlowGraphAngleBetweenBlock extends FlowGraphBinaryOperationBlock<Quaternion, Quaternion, number> {\n constructor(config?: IFlowGraphBlockConfiguration) {\n super(RichTypeQuaternion, RichTypeQuaternion, RichTypeNumber, (a, b) => GetAngleBetweenQuaternions(a, b), FlowGraphBlockNames.AngleBetween, config);\n }\n}\n\nRegisterClass(FlowGraphBlockNames.AngleBetween, FlowGraphAngleBetweenBlock);\n\n/**\n * Get the quaternion from an axis and an angle.\n */\nexport class FlowGraphQuaternionFromAxisAngleBlock extends FlowGraphBinaryOperationBlock<Vector3, number, Quaternion> {\n constructor(config?: IFlowGraphBlockConfiguration) {\n super(RichTypeVector3, RichTypeNumber, RichTypeQuaternion, (a, b) => Quaternion.RotationAxis(a, b), FlowGraphBlockNames.QuaternionFromAxisAngle, config);\n }\n}\n\nRegisterClass(FlowGraphBlockNames.QuaternionFromAxisAngle, FlowGraphQuaternionFromAxisAngleBlock);\n\n/**\n * Get the axis and angle from a quaternion.\n */\nexport class FlowGraphAxisAngleFromQuaternionBlock extends FlowGraphBlock {\n /**\n * The input of this block.\n */\n public readonly a: FlowGraphDataConnection<Quaternion>;\n\n /**\n * The output axis of rotation.\n */\n public readonly axis: FlowGraphDataConnection<Vector3>;\n\n /**\n * The output angle of rotation.\n */\n public readonly angle: FlowGraphDataConnection<number>;\n\n /**\n * Output connection: Whether the value is valid.\n */\n public readonly isValid: FlowGraphDataConnection<boolean>;\n\n constructor(config?: IFlowGraphBlockConfiguration) {\n super(config);\n\n this.a = this.registerDataInput(\"a\", RichTypeQuaternion);\n\n this.axis = this.registerDataOutput(\"axis\", RichTypeVector3);\n this.angle = this.registerDataOutput(\"angle\", RichTypeNumber);\n\n this.isValid = this.registerDataOutput(\"isValid\", RichTypeBoolean);\n }\n\n /** @override */\n public override _updateOutputs(context: FlowGraphContext) {\n const cachedExecutionId = context._getExecutionVariable(this, CacheExecIdName, -1);\n const cachedAxis = context._getExecutionVariable<Nullable<Vector3>>(this, AxisCacheName, null);\n const cachedAngle = context._getExecutionVariable<Nullable<number>>(this, AngleCacheName, null);\n if (cachedAxis !== undefined && cachedAxis !== null && cachedAngle !== undefined && cachedAngle !== null && cachedExecutionId === context.executionId) {\n this.axis.setValue(cachedAxis, context);\n this.angle.setValue(cachedAngle, context);\n } else {\n try {\n const { axis, angle } = this.a.getValue(context).toAxisAngle();\n context._setExecutionVariable(this, AxisCacheName, axis);\n context._setExecutionVariable(this, AngleCacheName, angle);\n context._setExecutionVariable(this, CacheExecIdName, context.executionId);\n this.axis.setValue(axis, context);\n this.angle.setValue(angle, context);\n this.isValid.setValue(true, context);\n } catch (e) {\n this.isValid.setValue(false, context);\n }\n }\n }\n\n /** @override */\n public override getClassName(): string {\n return FlowGraphBlockNames.AxisAngleFromQuaternion;\n }\n}\n\nRegisterClass(FlowGraphBlockNames.AxisAngleFromQuaternion, FlowGraphAxisAngleFromQuaternionBlock);\n\n/**\n * Get the quaternion from two direction vectors.\n */\nexport class FlowGraphQuaternionFromDirectionsBlock extends FlowGraphBinaryOperationBlock<Vector3, Vector3, Quaternion> {\n constructor(config?: IFlowGraphBlockConfiguration) {\n super(RichTypeVector3, RichTypeVector3, RichTypeQuaternion, (a, b) => GetQuaternionFromDirections(a, b), FlowGraphBlockNames.QuaternionFromDirections, config);\n }\n}\n"]}
@@ -0,0 +1,25 @@
1
+ import type { IQuaternionLike } from "../Maths/math.like.js";
2
+ import { Quaternion, Vector3 } from "../Maths/math.vector.js";
3
+ import type { DeepImmutable } from "../types.js";
4
+ /**
5
+ * Returns the angle in radians between two quaternions
6
+ * @param q1 defines the first quaternion
7
+ * @param q2 defines the second quaternion
8
+ * @returns the angle in radians between the two quaternions
9
+ */
10
+ export declare function GetAngleBetweenQuaternions(q1: DeepImmutable<IQuaternionLike>, q2: DeepImmutable<IQuaternionLike>): number;
11
+ /**
12
+ * Creates a quaternion from two direction vectors
13
+ * @param a defines the first direction vector
14
+ * @param b defines the second direction vector
15
+ * @returns the target quaternion
16
+ */
17
+ export declare function GetQuaternionFromDirections<T extends Vector3>(a: DeepImmutable<T>, b: DeepImmutable<T>): Quaternion;
18
+ /**
19
+ * Creates a quaternion from two direction vectors
20
+ * @param a defines the first direction vector
21
+ * @param b defines the second direction vector
22
+ * @param result defines the target quaternion
23
+ * @returns the target quaternion
24
+ */
25
+ export declare function GetQuaternionFromDirectionsToRef<T extends Vector3, ResultT extends Quaternion>(a: DeepImmutable<T>, b: DeepImmutable<T>, result: ResultT): ResultT;
@@ -0,0 +1,40 @@
1
+ import { Clamp } from "../Maths/math.scalar.functions.js";
2
+ import { Quaternion, Vector3 } from "../Maths/math.vector.js";
3
+ import { Vector3Dot, Vector4Dot } from "../Maths/math.vector.functions.js";
4
+ // *** NOTE ***
5
+ // These functions should ideally go in math.vector.functions.ts, but they require math.vector.ts to
6
+ // be imported which is big. To avoid the larger bundle size, they are kept inside flow graph for now.
7
+ /**
8
+ * Returns the angle in radians between two quaternions
9
+ * @param q1 defines the first quaternion
10
+ * @param q2 defines the second quaternion
11
+ * @returns the angle in radians between the two quaternions
12
+ */
13
+ export function GetAngleBetweenQuaternions(q1, q2) {
14
+ return Math.acos(Clamp(Vector4Dot(q1, q2), -1, 1)) * 2;
15
+ }
16
+ /**
17
+ * Creates a quaternion from two direction vectors
18
+ * @param a defines the first direction vector
19
+ * @param b defines the second direction vector
20
+ * @returns the target quaternion
21
+ */
22
+ export function GetQuaternionFromDirections(a, b) {
23
+ const result = new Quaternion();
24
+ GetQuaternionFromDirectionsToRef(a, b, result);
25
+ return result;
26
+ }
27
+ /**
28
+ * Creates a quaternion from two direction vectors
29
+ * @param a defines the first direction vector
30
+ * @param b defines the second direction vector
31
+ * @param result defines the target quaternion
32
+ * @returns the target quaternion
33
+ */
34
+ export function GetQuaternionFromDirectionsToRef(a, b, result) {
35
+ const axis = Vector3.Cross(a, b);
36
+ const angle = Math.acos(Clamp(Vector3Dot(a, b), -1, 1));
37
+ Quaternion.RotationAxisToRef(axis, angle, result);
38
+ return result;
39
+ }
40
+ //# sourceMappingURL=flowGraphMath.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flowGraphMath.js","sourceRoot":"","sources":["../../../../dev/core/src/FlowGraph/flowGraphMath.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAGxE,eAAe;AACf,oGAAoG;AACpG,sGAAsG;AAEtG;;;;;GAKG;AACH,MAAM,UAAU,0BAA0B,CAAC,EAAkC,EAAE,EAAkC;IAC7G,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AAC3D,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,2BAA2B,CAAoB,CAAmB,EAAE,CAAmB;IACnG,MAAM,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;IAChC,gCAAgC,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;IAC/C,OAAO,MAAM,CAAC;AAClB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,gCAAgC,CAAgD,CAAmB,EAAE,CAAmB,EAAE,MAAe;IACrJ,MAAM,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACjC,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACxD,UAAU,CAAC,iBAAiB,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;IAClD,OAAO,MAAM,CAAC;AAClB,CAAC","sourcesContent":["import type { IQuaternionLike } from \"../Maths/math.like\";\r\nimport { Clamp } from \"../Maths/math.scalar.functions\";\r\nimport { Quaternion, Vector3 } from \"../Maths/math.vector\";\r\nimport { Vector3Dot, Vector4Dot } from \"../Maths/math.vector.functions\";\r\nimport type { DeepImmutable } from \"../types\";\r\n\r\n// *** NOTE ***\r\n// These functions should ideally go in math.vector.functions.ts, but they require math.vector.ts to\r\n// be imported which is big. To avoid the larger bundle size, they are kept inside flow graph for now.\r\n\r\n/**\r\n * Returns the angle in radians between two quaternions\r\n * @param q1 defines the first quaternion\r\n * @param q2 defines the second quaternion\r\n * @returns the angle in radians between the two quaternions\r\n */\r\nexport function GetAngleBetweenQuaternions(q1: DeepImmutable<IQuaternionLike>, q2: DeepImmutable<IQuaternionLike>): number {\r\n return Math.acos(Clamp(Vector4Dot(q1, q2), -1, 1)) * 2;\r\n}\r\n\r\n/**\r\n * Creates a quaternion from two direction vectors\r\n * @param a defines the first direction vector\r\n * @param b defines the second direction vector\r\n * @returns the target quaternion\r\n */\r\nexport function GetQuaternionFromDirections<T extends Vector3>(a: DeepImmutable<T>, b: DeepImmutable<T>): Quaternion {\r\n const result = new Quaternion();\r\n GetQuaternionFromDirectionsToRef(a, b, result);\r\n return result;\r\n}\r\n\r\n/**\r\n * Creates a quaternion from two direction vectors\r\n * @param a defines the first direction vector\r\n * @param b defines the second direction vector\r\n * @param result defines the target quaternion\r\n * @returns the target quaternion\r\n */\r\nexport function GetQuaternionFromDirectionsToRef<T extends Vector3, ResultT extends Quaternion>(a: DeepImmutable<T>, b: DeepImmutable<T>, result: ResultT): ResultT {\r\n const axis = Vector3.Cross(a, b);\r\n const angle = Math.acos(Clamp(Vector3Dot(a, b), -1, 1));\r\n Quaternion.RotationAxisToRef(axis, angle, result);\r\n return result;\r\n}\r\n"]}
@@ -171,7 +171,7 @@ __decorate([
171
171
  editableInPropertyPage("Layer texture fixed size", 1 /* PropertyTypeForEdition.Float */, "PROPERTIES")
172
172
  ], NodeRenderGraphGlowLayerBlock.prototype, "layerTextureFixedSize", null);
173
173
  __decorate([
174
- editableInPropertyPage("Layer texture type", 9 /* PropertyTypeForEdition.TextureType */, "PROPERTIES")
174
+ editableInPropertyPage("Layer texture type", 10 /* PropertyTypeForEdition.TextureType */, "PROPERTIES")
175
175
  ], NodeRenderGraphGlowLayerBlock.prototype, "layerTextureType", null);
176
176
  __decorate([
177
177
  editableInPropertyPage("Blur kernel size", 2 /* PropertyTypeForEdition.Int */, "PROPERTIES", { min: 1, max: 256 })
@@ -1 +1 @@
1
- {"version":3,"file":"glowLayerBlock.js","sourceRoot":"","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,qBAAqB,wCAAgC,YAAY,CAAC;sEAGzF;AAUD;IADC,sBAAsB,CAAC,0BAA0B,wCAAgC,YAAY,CAAC;0EAG9F;AAUD;IADC,sBAAsB,CAAC,oBAAoB,8CAAsC,YAAY,CAAC;qEAG9F;AAUD;IADC,sBAAsB,CAAC,kBAAkB,sCAA8B,YAAY,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;mEAG1G;AAQD;IADC,sBAAsB,CAAC,WAAW,wCAAgC,YAAY,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;8DAGnG;AAyEL,aAAa,CAAC,uCAAuC,EAAE,6BAA6B,CAAC,CAAC","sourcesContent":["import type { Scene, NodeRenderGraphBuildState, FrameGraph, FrameGraphTextureHandle, NodeRenderGraphConnectionPoint, FrameGraphObjectRendererTask } from \"core/index\";\r\nimport { NodeRenderGraphBlock } from \"../../nodeRenderGraphBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { NodeRenderGraphBlockConnectionPointTypes, NodeRenderGraphConnectionPointDirection } from \"../../Types/nodeRenderGraphTypes\";\r\nimport { editableInPropertyPage, PropertyTypeForEdition } from \"../../../../Decorators/nodeDecorator\";\r\nimport { FrameGraphGlowLayerTask } from \"core/FrameGraph/Tasks/Layers/glowLayerTask\";\r\nimport { Constants } from \"core/Engines/constants\";\r\nimport { NodeRenderGraphConnectionPointCustomObject } from \"../../nodeRenderGraphConnectionPointCustomObject\";\r\nimport { NodeRenderGraphBaseObjectRendererBlock } from \"../Rendering/baseObjectRendererBlock\";\r\n\r\n/**\r\n * Block that implements the glow layer\r\n */\r\nexport class NodeRenderGraphGlowLayerBlock extends NodeRenderGraphBlock {\r\n protected override _frameGraphTask: FrameGraphGlowLayerTask;\r\n\r\n public override _additionalConstructionParameters: [boolean, number, number | undefined, number];\r\n\r\n /**\r\n * Gets the frame graph task associated with this block\r\n */\r\n public override get task() {\r\n return this._frameGraphTask;\r\n }\r\n\r\n /**\r\n * Create a new NodeRenderGraphGlowLayerBlock\r\n * @param name defines the block name\r\n * @param frameGraph defines the hosting frame graph\r\n * @param scene defines the hosting scene\r\n * @param ldrMerge Forces the merge step to be done in ldr (clamp values &gt; 1). Default: false\r\n * @param layerTextureRatio multiplication factor applied to the main texture size to compute the size of the layer render target texture (default: 0.5)\r\n * @param layerTextureFixedSize defines the fixed size of the layer render target texture. Takes precedence over layerTextureRatio if provided (default: undefined)\r\n * @param layerTextureType defines the type of the layer texture (default: Constants.TEXTURETYPE_UNSIGNED_BYTE)\r\n */\r\n public constructor(\r\n name: string,\r\n frameGraph: FrameGraph,\r\n scene: Scene,\r\n ldrMerge = false,\r\n layerTextureRatio = 0.5,\r\n layerTextureFixedSize?: number,\r\n layerTextureType = Constants.TEXTURETYPE_UNSIGNED_BYTE\r\n ) {\r\n super(name, frameGraph, scene);\r\n\r\n this._additionalConstructionParameters = [ldrMerge, layerTextureRatio, layerTextureFixedSize, layerTextureType];\r\n\r\n this.registerInput(\"target\", NodeRenderGraphBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"layer\", NodeRenderGraphBlockConnectionPointTypes.AutoDetect, true);\r\n this.registerInput(\r\n \"objectRenderer\",\r\n NodeRenderGraphBlockConnectionPointTypes.Object,\r\n false,\r\n new NodeRenderGraphConnectionPointCustomObject(\r\n \"objectRenderer\",\r\n this,\r\n NodeRenderGraphConnectionPointDirection.Input,\r\n NodeRenderGraphBaseObjectRendererBlock,\r\n \"NodeRenderGraphBaseObjectRendererBlock\"\r\n )\r\n );\r\n this._addDependenciesInput();\r\n\r\n this.registerOutput(\"output\", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this.target.addExcludedConnectionPointFromAllowedTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBufferDepthStencil);\r\n this.layer.addExcludedConnectionPointFromAllowedTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);\r\n\r\n this.output._typeConnectionSource = this.target;\r\n\r\n this._frameGraphTask = new FrameGraphGlowLayerTask(this.name, this._frameGraph, this._scene, {\r\n ldrMerge,\r\n mainTextureRatio: layerTextureRatio,\r\n mainTextureFixedSize: layerTextureFixedSize,\r\n mainTextureType: layerTextureType,\r\n });\r\n }\r\n\r\n private _createTask(ldrMerge: boolean, layerTextureRatio: number, layerTextureFixedSize: number, layerTextureType: number) {\r\n const blurKernelSize = this.blurKernelSize;\r\n const intensity = this.intensity;\r\n\r\n this._frameGraphTask?.dispose();\r\n\r\n this._frameGraphTask = new FrameGraphGlowLayerTask(this.name, this._frameGraph, this._scene, {\r\n ldrMerge,\r\n mainTextureRatio: layerTextureRatio,\r\n mainTextureFixedSize: layerTextureFixedSize,\r\n mainTextureType: layerTextureType,\r\n });\r\n\r\n this.blurKernelSize = blurKernelSize;\r\n this.intensity = intensity;\r\n\r\n this._additionalConstructionParameters = [ldrMerge, layerTextureRatio, layerTextureFixedSize, layerTextureType];\r\n }\r\n\r\n /** Forces the merge step to be done in ldr (clamp values &gt; 1). Default: false */\r\n @editableInPropertyPage(\"LDR merge\", PropertyTypeForEdition.Boolean, \"PROPERTIES\")\r\n public get ldrMerge() {\r\n return this._frameGraphTask.layer.ldrMerge;\r\n }\r\n\r\n public set ldrMerge(value: boolean) {\r\n const options = this._frameGraphTask.layer._options;\r\n\r\n this._createTask(value, options.mainTextureRatio, options.mainTextureFixedSize, options.mainTextureType);\r\n }\r\n\r\n /** Multiplication factor applied to the main texture size to compute the size of the layer render target texture */\r\n @editableInPropertyPage(\"Layer texture ratio\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get layerTextureRatio() {\r\n return this._frameGraphTask.layer._options.mainTextureRatio;\r\n }\r\n\r\n public set layerTextureRatio(value: number) {\r\n const options = this._frameGraphTask.layer._options;\r\n\r\n this._createTask(options.ldrMerge, value, options.mainTextureFixedSize, options.mainTextureType);\r\n }\r\n\r\n /** Defines the fixed size of the layer render target texture. Takes precedence over layerTextureRatio if provided */\r\n @editableInPropertyPage(\"Layer texture fixed size\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get layerTextureFixedSize() {\r\n return this._frameGraphTask.layer._options.mainTextureFixedSize;\r\n }\r\n\r\n public set layerTextureFixedSize(value: number) {\r\n const options = this._frameGraphTask.layer._options;\r\n\r\n this._createTask(options.ldrMerge, options.mainTextureRatio, value, options.mainTextureType);\r\n }\r\n\r\n /** Defines the type of the layer texture */\r\n @editableInPropertyPage(\"Layer texture type\", PropertyTypeForEdition.TextureType, \"PROPERTIES\")\r\n public get layerTextureType() {\r\n return this._frameGraphTask.layer._options.mainTextureType;\r\n }\r\n\r\n public set layerTextureType(value: number) {\r\n const options = this._frameGraphTask.layer._options;\r\n\r\n this._createTask(options.ldrMerge, options.mainTextureRatio, options.mainTextureFixedSize, value);\r\n }\r\n\r\n /** How big is the kernel of the blur texture */\r\n @editableInPropertyPage(\"Blur kernel size\", PropertyTypeForEdition.Int, \"PROPERTIES\", { min: 1, max: 256 })\r\n public get blurKernelSize() {\r\n return this._frameGraphTask.layer.blurKernelSize;\r\n }\r\n\r\n public set blurKernelSize(value: number) {\r\n this._frameGraphTask.layer.blurKernelSize = value;\r\n }\r\n\r\n /** The intensity of the glow */\r\n @editableInPropertyPage(\"Intensity\", PropertyTypeForEdition.Float, \"PROPERTIES\", { min: 0, max: 5 })\r\n public get intensity() {\r\n return this._frameGraphTask.layer.intensity;\r\n }\r\n\r\n public set intensity(value: number) {\r\n this._frameGraphTask.layer.intensity = value;\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"NodeRenderGraphGlowLayerBlock\";\r\n }\r\n\r\n /**\r\n * Gets the target texture input component\r\n */\r\n public get target(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the layer texture input component\r\n */\r\n public get layer(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the objectRenderer input component\r\n */\r\n public get objectRenderer(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeRenderGraphConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected override _buildBlock(state: NodeRenderGraphBuildState) {\r\n super._buildBlock(state);\r\n\r\n this.output.value = this._frameGraphTask.outputTexture;\r\n\r\n this._frameGraphTask.targetTexture = this.target.connectedPoint?.value as FrameGraphTextureHandle;\r\n this._frameGraphTask.layerTexture = this.layer.connectedPoint?.value as FrameGraphTextureHandle;\r\n this._frameGraphTask.objectRendererTask = this.objectRenderer.connectedPoint?.value as FrameGraphObjectRendererTask;\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codes: string[] = [];\r\n codes.push(`${this._codeVariableName}.blurKernelSize = ${this.blurKernelSize};`);\r\n codes.push(`${this._codeVariableName}.intensity = ${this.intensity};`);\r\n return super._dumpPropertiesCode() + codes.join(\"\\n\");\r\n }\r\n\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n serializationObject.blurKernelSize = this.blurKernelSize;\r\n serializationObject.intensity = this.intensity;\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n this.blurKernelSize = serializationObject.blurKernelSize;\r\n this.intensity = serializationObject.intensity;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.NodeRenderGraphGlowLayerBlock\", NodeRenderGraphGlowLayerBlock);\r\n"]}
1
+ {"version":3,"file":"glowLayerBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FrameGraph/Node/Blocks/Layers/glowLayerBlock.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,wCAAwC,EAA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AAY,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;mEAG1G;AAQD;IADC,sBAAsB,CAAC,WAAW,wCAAgC,YAAY,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;8DAGnG;AAyEL,aAAa,CAAC,uCAAuC,EAAE,6BAA6B,CAAC,CAAC","sourcesContent":["import type { Scene, NodeRenderGraphBuildState, FrameGraph, FrameGraphTextureHandle, NodeRenderGraphConnectionPoint, FrameGraphObjectRendererTask } from \"core/index\";\r\nimport { NodeRenderGraphBlock } from \"../../nodeRenderGraphBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { NodeRenderGraphBlockConnectionPointTypes, NodeRenderGraphConnectionPointDirection } from \"../../Types/nodeRenderGraphTypes\";\r\nimport { editableInPropertyPage, PropertyTypeForEdition } from \"../../../../Decorators/nodeDecorator\";\r\nimport { FrameGraphGlowLayerTask } from \"core/FrameGraph/Tasks/Layers/glowLayerTask\";\r\nimport { Constants } from \"core/Engines/constants\";\r\nimport { NodeRenderGraphConnectionPointCustomObject } from \"../../nodeRenderGraphConnectionPointCustomObject\";\r\nimport { NodeRenderGraphBaseObjectRendererBlock } from \"../Rendering/baseObjectRendererBlock\";\r\n\r\n/**\r\n * Block that implements the glow layer\r\n */\r\nexport class NodeRenderGraphGlowLayerBlock extends NodeRenderGraphBlock {\r\n protected override _frameGraphTask: FrameGraphGlowLayerTask;\r\n\r\n public override _additionalConstructionParameters: [boolean, number, number | undefined, number];\r\n\r\n /**\r\n * Gets the frame graph task associated with this block\r\n */\r\n public override get task() {\r\n return this._frameGraphTask;\r\n }\r\n\r\n /**\r\n * Create a new NodeRenderGraphGlowLayerBlock\r\n * @param name defines the block name\r\n * @param frameGraph defines the hosting frame graph\r\n * @param scene defines the hosting scene\r\n * @param ldrMerge Forces the merge step to be done in ldr (clamp values &gt; 1). Default: false\r\n * @param layerTextureRatio multiplication factor applied to the main texture size to compute the size of the layer render target texture (default: 0.5)\r\n * @param layerTextureFixedSize defines the fixed size of the layer render target texture. Takes precedence over layerTextureRatio if provided (default: undefined)\r\n * @param layerTextureType defines the type of the layer texture (default: Constants.TEXTURETYPE_UNSIGNED_BYTE)\r\n */\r\n public constructor(\r\n name: string,\r\n frameGraph: FrameGraph,\r\n scene: Scene,\r\n ldrMerge = false,\r\n layerTextureRatio = 0.5,\r\n layerTextureFixedSize?: number,\r\n layerTextureType = Constants.TEXTURETYPE_UNSIGNED_BYTE\r\n ) {\r\n super(name, frameGraph, scene);\r\n\r\n this._additionalConstructionParameters = [ldrMerge, layerTextureRatio, layerTextureFixedSize, layerTextureType];\r\n\r\n this.registerInput(\"target\", NodeRenderGraphBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"layer\", NodeRenderGraphBlockConnectionPointTypes.AutoDetect, true);\r\n this.registerInput(\r\n \"objectRenderer\",\r\n NodeRenderGraphBlockConnectionPointTypes.Object,\r\n false,\r\n new NodeRenderGraphConnectionPointCustomObject(\r\n \"objectRenderer\",\r\n this,\r\n NodeRenderGraphConnectionPointDirection.Input,\r\n NodeRenderGraphBaseObjectRendererBlock,\r\n \"NodeRenderGraphBaseObjectRendererBlock\"\r\n )\r\n );\r\n this._addDependenciesInput();\r\n\r\n this.registerOutput(\"output\", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this.target.addExcludedConnectionPointFromAllowedTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBufferDepthStencil);\r\n this.layer.addExcludedConnectionPointFromAllowedTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);\r\n\r\n this.output._typeConnectionSource = this.target;\r\n\r\n this._frameGraphTask = new FrameGraphGlowLayerTask(this.name, this._frameGraph, this._scene, {\r\n ldrMerge,\r\n mainTextureRatio: layerTextureRatio,\r\n mainTextureFixedSize: layerTextureFixedSize,\r\n mainTextureType: layerTextureType,\r\n });\r\n }\r\n\r\n private _createTask(ldrMerge: boolean, layerTextureRatio: number, layerTextureFixedSize: number, layerTextureType: number) {\r\n const blurKernelSize = this.blurKernelSize;\r\n const intensity = this.intensity;\r\n\r\n this._frameGraphTask?.dispose();\r\n\r\n this._frameGraphTask = new FrameGraphGlowLayerTask(this.name, this._frameGraph, this._scene, {\r\n ldrMerge,\r\n mainTextureRatio: layerTextureRatio,\r\n mainTextureFixedSize: layerTextureFixedSize,\r\n mainTextureType: layerTextureType,\r\n });\r\n\r\n this.blurKernelSize = blurKernelSize;\r\n this.intensity = intensity;\r\n\r\n this._additionalConstructionParameters = [ldrMerge, layerTextureRatio, layerTextureFixedSize, layerTextureType];\r\n }\r\n\r\n /** Forces the merge step to be done in ldr (clamp values &gt; 1). Default: false */\r\n @editableInPropertyPage(\"LDR merge\", PropertyTypeForEdition.Boolean, \"PROPERTIES\")\r\n public get ldrMerge() {\r\n return this._frameGraphTask.layer.ldrMerge;\r\n }\r\n\r\n public set ldrMerge(value: boolean) {\r\n const options = this._frameGraphTask.layer._options;\r\n\r\n this._createTask(value, options.mainTextureRatio, options.mainTextureFixedSize, options.mainTextureType);\r\n }\r\n\r\n /** Multiplication factor applied to the main texture size to compute the size of the layer render target texture */\r\n @editableInPropertyPage(\"Layer texture ratio\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get layerTextureRatio() {\r\n return this._frameGraphTask.layer._options.mainTextureRatio;\r\n }\r\n\r\n public set layerTextureRatio(value: number) {\r\n const options = this._frameGraphTask.layer._options;\r\n\r\n this._createTask(options.ldrMerge, value, options.mainTextureFixedSize, options.mainTextureType);\r\n }\r\n\r\n /** Defines the fixed size of the layer render target texture. Takes precedence over layerTextureRatio if provided */\r\n @editableInPropertyPage(\"Layer texture fixed size\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get layerTextureFixedSize() {\r\n return this._frameGraphTask.layer._options.mainTextureFixedSize;\r\n }\r\n\r\n public set layerTextureFixedSize(value: number) {\r\n const options = this._frameGraphTask.layer._options;\r\n\r\n this._createTask(options.ldrMerge, options.mainTextureRatio, value, options.mainTextureType);\r\n }\r\n\r\n /** Defines the type of the layer texture */\r\n @editableInPropertyPage(\"Layer texture type\", PropertyTypeForEdition.TextureType, \"PROPERTIES\")\r\n public get layerTextureType() {\r\n return this._frameGraphTask.layer._options.mainTextureType;\r\n }\r\n\r\n public set layerTextureType(value: number) {\r\n const options = this._frameGraphTask.layer._options;\r\n\r\n this._createTask(options.ldrMerge, options.mainTextureRatio, options.mainTextureFixedSize, value);\r\n }\r\n\r\n /** How big is the kernel of the blur texture */\r\n @editableInPropertyPage(\"Blur kernel size\", PropertyTypeForEdition.Int, \"PROPERTIES\", { min: 1, max: 256 })\r\n public get blurKernelSize() {\r\n return this._frameGraphTask.layer.blurKernelSize;\r\n }\r\n\r\n public set blurKernelSize(value: number) {\r\n this._frameGraphTask.layer.blurKernelSize = value;\r\n }\r\n\r\n /** The intensity of the glow */\r\n @editableInPropertyPage(\"Intensity\", PropertyTypeForEdition.Float, \"PROPERTIES\", { min: 0, max: 5 })\r\n public get intensity() {\r\n return this._frameGraphTask.layer.intensity;\r\n }\r\n\r\n public set intensity(value: number) {\r\n this._frameGraphTask.layer.intensity = value;\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"NodeRenderGraphGlowLayerBlock\";\r\n }\r\n\r\n /**\r\n * Gets the target texture input component\r\n */\r\n public get target(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the layer texture input component\r\n */\r\n public get layer(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the objectRenderer input component\r\n */\r\n public get objectRenderer(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeRenderGraphConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected override _buildBlock(state: NodeRenderGraphBuildState) {\r\n super._buildBlock(state);\r\n\r\n this.output.value = this._frameGraphTask.outputTexture;\r\n\r\n this._frameGraphTask.targetTexture = this.target.connectedPoint?.value as FrameGraphTextureHandle;\r\n this._frameGraphTask.layerTexture = this.layer.connectedPoint?.value as FrameGraphTextureHandle;\r\n this._frameGraphTask.objectRendererTask = this.objectRenderer.connectedPoint?.value as FrameGraphObjectRendererTask;\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codes: string[] = [];\r\n codes.push(`${this._codeVariableName}.blurKernelSize = ${this.blurKernelSize};`);\r\n codes.push(`${this._codeVariableName}.intensity = ${this.intensity};`);\r\n return super._dumpPropertiesCode() + codes.join(\"\\n\");\r\n }\r\n\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n serializationObject.blurKernelSize = this.blurKernelSize;\r\n serializationObject.intensity = this.intensity;\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n this.blurKernelSize = serializationObject.blurKernelSize;\r\n this.intensity = serializationObject.intensity;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.NodeRenderGraphGlowLayerBlock\", NodeRenderGraphGlowLayerBlock);\r\n"]}
@@ -185,7 +185,7 @@ __decorate([
185
185
  editableInPropertyPage("Is stroke", 0 /* PropertyTypeForEdition.Boolean */, "PROPERTIES")
186
186
  ], NodeRenderGraphHighlightLayerBlock.prototype, "isStroke", null);
187
187
  __decorate([
188
- editableInPropertyPage("Layer texture type", 9 /* PropertyTypeForEdition.TextureType */, "PROPERTIES")
188
+ editableInPropertyPage("Layer texture type", 10 /* PropertyTypeForEdition.TextureType */, "PROPERTIES")
189
189
  ], NodeRenderGraphHighlightLayerBlock.prototype, "layerTextureType", null);
190
190
  __decorate([
191
191
  editableInPropertyPage("Blur horizontal size", 1 /* PropertyTypeForEdition.Float */, "PROPERTIES", { min: 0, max: 4 })
@@ -1 +1 @@
1
- {"version":3,"file":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C","sourcesContent":["import type { Scene, NodeRenderGraphBuildState, FrameGraph, FrameGraphTextureHandle, NodeRenderGraphConnectionPoint, FrameGraphObjectRendererTask } from \"core/index\";\r\nimport { NodeRenderGraphBlock } from \"../../nodeRenderGraphBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { NodeRenderGraphBlockConnectionPointTypes, NodeRenderGraphConnectionPointDirection } from \"../../Types/nodeRenderGraphTypes\";\r\nimport { editableInPropertyPage, PropertyTypeForEdition } from \"../../../../Decorators/nodeDecorator\";\r\nimport { FrameGraphHighlightLayerTask } from \"core/FrameGraph/Tasks/Layers/highlightLayerTask\";\r\nimport { Constants } from \"core/Engines/constants\";\r\nimport { NodeRenderGraphConnectionPointCustomObject } from \"../../nodeRenderGraphConnectionPointCustomObject\";\r\nimport { NodeRenderGraphBaseObjectRendererBlock } from \"../Rendering/baseObjectRendererBlock\";\r\n\r\n/**\r\n * Block that implements the highlight layer\r\n */\r\nexport class NodeRenderGraphHighlightLayerBlock extends NodeRenderGraphBlock {\r\n protected override _frameGraphTask: FrameGraphHighlightLayerTask;\r\n\r\n public override _additionalConstructionParameters: [number, number | undefined, number, boolean, number];\r\n\r\n /**\r\n * Gets the frame graph task associated with this block\r\n */\r\n public override get task() {\r\n return this._frameGraphTask;\r\n }\r\n\r\n /**\r\n * Create a new NodeRenderGraphHighlightLayerBlock\r\n * @param name defines the block name\r\n * @param frameGraph defines the hosting frame graph\r\n * @param scene defines the hosting scene\r\n * @param layerTextureRatio multiplication factor applied to the main texture size to compute the size of the layer render target texture (default: 0.5)\r\n * @param layerTextureFixedSize defines the fixed size of the layer render target texture. Takes precedence over layerTextureRatio if provided (default: undefined)\r\n * @param blurTextureSizeRatio defines the factor to apply to the layer texture size to create the blur textures (default: 0.5)\r\n * @param isStroke should we display highlight as a solid stroke? (default: false)\r\n * @param layerTextureType defines the type of the layer texture (default: Constants.TEXTURETYPE_UNSIGNED_BYTE)\r\n */\r\n public constructor(\r\n name: string,\r\n frameGraph: FrameGraph,\r\n scene: Scene,\r\n layerTextureRatio = 0.5,\r\n layerTextureFixedSize?: number,\r\n blurTextureSizeRatio = 0.5,\r\n isStroke = false,\r\n layerTextureType = Constants.TEXTURETYPE_UNSIGNED_BYTE\r\n ) {\r\n super(name, frameGraph, scene);\r\n\r\n this._additionalConstructionParameters = [layerTextureRatio, layerTextureFixedSize, blurTextureSizeRatio, isStroke, layerTextureType];\r\n\r\n this.registerInput(\"target\", NodeRenderGraphBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"layer\", NodeRenderGraphBlockConnectionPointTypes.AutoDetect, true);\r\n this.registerInput(\r\n \"objectRenderer\",\r\n NodeRenderGraphBlockConnectionPointTypes.Object,\r\n true,\r\n new NodeRenderGraphConnectionPointCustomObject(\r\n \"objectRenderer\",\r\n this,\r\n NodeRenderGraphConnectionPointDirection.Input,\r\n NodeRenderGraphBaseObjectRendererBlock,\r\n \"NodeRenderGraphBaseObjectRendererBlock\"\r\n )\r\n );\r\n this._addDependenciesInput();\r\n\r\n this.registerOutput(\"output\", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this.target.addExcludedConnectionPointFromAllowedTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBufferDepthStencil);\r\n this.layer.addExcludedConnectionPointFromAllowedTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);\r\n\r\n this.output._typeConnectionSource = this.target;\r\n\r\n this._frameGraphTask = new FrameGraphHighlightLayerTask(this.name, this._frameGraph, this._scene, {\r\n mainTextureRatio: layerTextureRatio,\r\n mainTextureFixedSize: layerTextureFixedSize,\r\n blurTextureSizeRatio,\r\n isStroke,\r\n mainTextureType: layerTextureType,\r\n });\r\n }\r\n\r\n private _createTask(layerTextureRatio: number, layerTextureFixedSize: number, blurTextureSizeRatio: number, isStroke: boolean, layerTextureType: number) {\r\n const blurHorizontalSize = this.blurHorizontalSize;\r\n const blurVerticalSize = this.blurVerticalSize;\r\n\r\n this._frameGraphTask?.dispose();\r\n\r\n this._frameGraphTask = new FrameGraphHighlightLayerTask(this.name, this._frameGraph, this._scene, {\r\n mainTextureRatio: layerTextureRatio,\r\n mainTextureFixedSize: layerTextureFixedSize,\r\n blurTextureSizeRatio,\r\n isStroke,\r\n mainTextureType: layerTextureType,\r\n });\r\n\r\n this.blurHorizontalSize = blurHorizontalSize;\r\n this.blurVerticalSize = blurVerticalSize;\r\n\r\n this._additionalConstructionParameters = [layerTextureRatio, layerTextureFixedSize, blurTextureSizeRatio, isStroke, layerTextureType];\r\n }\r\n\r\n /** Multiplication factor applied to the main texture size to compute the size of the layer render target texture */\r\n @editableInPropertyPage(\"Layer texture ratio\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get layerTextureRatio() {\r\n return this._frameGraphTask.layer._options.mainTextureRatio;\r\n }\r\n\r\n public set layerTextureRatio(value: number) {\r\n const options = this._frameGraphTask.layer._options;\r\n\r\n this._createTask(value, options.mainTextureFixedSize, options.blurTextureSizeRatio, options.isStroke, options.mainTextureType);\r\n }\r\n\r\n /** Defines the fixed size of the layer render target texture. Takes precedence over layerTextureRatio if provided */\r\n @editableInPropertyPage(\"Layer texture fixed size\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get layerTextureFixedSize() {\r\n return this._frameGraphTask.layer._options.mainTextureFixedSize;\r\n }\r\n\r\n public set layerTextureFixedSize(value: number) {\r\n const options = this._frameGraphTask.layer._options;\r\n\r\n this._createTask(options.mainTextureRatio, value, options.blurTextureSizeRatio, options.isStroke, options.mainTextureType);\r\n }\r\n\r\n /** Defines the factor to apply to the layer texture size to create the blur textures */\r\n @editableInPropertyPage(\"Blur texture size ratio\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get blurTextureSizeRatio() {\r\n return this._frameGraphTask.layer._options.blurTextureSizeRatio;\r\n }\r\n\r\n public set blurTextureSizeRatio(value: number) {\r\n const options = this._frameGraphTask.layer._options;\r\n\r\n this._createTask(options.mainTextureRatio, options.mainTextureFixedSize, value, options.isStroke, options.mainTextureType);\r\n }\r\n\r\n /** Should we display highlight as a solid stroke? */\r\n @editableInPropertyPage(\"Is stroke\", PropertyTypeForEdition.Boolean, \"PROPERTIES\")\r\n public get isStroke() {\r\n return this._frameGraphTask.layer._options.isStroke;\r\n }\r\n\r\n public set isStroke(value: boolean) {\r\n const options = this._frameGraphTask.layer._options;\r\n\r\n this._createTask(options.mainTextureRatio, options.mainTextureFixedSize, options.blurTextureSizeRatio, value, options.mainTextureType);\r\n }\r\n\r\n /** Defines the type of the layer texture */\r\n @editableInPropertyPage(\"Layer texture type\", PropertyTypeForEdition.TextureType, \"PROPERTIES\")\r\n public get layerTextureType() {\r\n return this._frameGraphTask.layer._options.mainTextureType;\r\n }\r\n\r\n public set layerTextureType(value: number) {\r\n const options = this._frameGraphTask.layer._options;\r\n\r\n this._createTask(options.mainTextureRatio, options.mainTextureFixedSize, options.blurTextureSizeRatio, options.isStroke, value);\r\n }\r\n\r\n /** How big is the horizontal kernel of the blur texture */\r\n @editableInPropertyPage(\"Blur horizontal size\", PropertyTypeForEdition.Float, \"PROPERTIES\", { min: 0, max: 4 })\r\n public get blurHorizontalSize() {\r\n return this._frameGraphTask.layer.blurHorizontalSize;\r\n }\r\n\r\n public set blurHorizontalSize(value: number) {\r\n this._frameGraphTask.layer.blurHorizontalSize = value;\r\n }\r\n\r\n /** How big is the vertical kernel of the blur texture */\r\n @editableInPropertyPage(\"Blur vertical size\", PropertyTypeForEdition.Float, \"PROPERTIES\", { min: 0, max: 4 })\r\n public get blurVerticalSize() {\r\n return this._frameGraphTask.layer.blurVerticalSize;\r\n }\r\n\r\n public set blurVerticalSize(value: number) {\r\n this._frameGraphTask.layer.blurVerticalSize = value;\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"NodeRenderGraphHighlightLayerBlock\";\r\n }\r\n\r\n /**\r\n * Gets the target texture input component\r\n */\r\n public get target(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the layer input component\r\n */\r\n public get layer(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the objectRenderer input component\r\n */\r\n public get objectRenderer(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeRenderGraphConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected override _buildBlock(state: NodeRenderGraphBuildState) {\r\n super._buildBlock(state);\r\n\r\n this.output.value = this._frameGraphTask.outputTexture;\r\n\r\n this._frameGraphTask.targetTexture = this.target.connectedPoint?.value as FrameGraphTextureHandle;\r\n this._frameGraphTask.layerTexture = this.layer.connectedPoint?.value as FrameGraphTextureHandle;\r\n this._frameGraphTask.objectRendererTask = this.objectRenderer.connectedPoint?.value as FrameGraphObjectRendererTask;\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codes: string[] = [];\r\n codes.push(`${this._codeVariableName}.blurHorizontalSize = ${this.blurHorizontalSize};`);\r\n codes.push(`${this._codeVariableName}.blurVerticalSize = ${this.blurVerticalSize};`);\r\n return super._dumpPropertiesCode() + codes.join(\"\\n\");\r\n }\r\n\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n serializationObject.blurHorizontalSize = this.blurHorizontalSize;\r\n serializationObject.blurVerticalSize = this.blurVerticalSize;\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n this.blurHorizontalSize = serializationObject.blurHorizontalSize;\r\n this.blurVerticalSize = serializationObject.blurVerticalSize;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.NodeRenderGraphHighlightLayerBlock\", NodeRenderGraphHighlightLayerBlock);\r\n"]}
1
+ {"version":3,"file":"highlightLayerBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FrameGraph/Node/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, NodeRenderGraphConnectionPoint, FrameGraphObjectRendererTask } from \"core/index\";\r\nimport { NodeRenderGraphBlock } from \"../../nodeRenderGraphBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { NodeRenderGraphBlockConnectionPointTypes, NodeRenderGraphConnectionPointDirection } from \"../../Types/nodeRenderGraphTypes\";\r\nimport { editableInPropertyPage, PropertyTypeForEdition } from \"../../../../Decorators/nodeDecorator\";\r\nimport { FrameGraphHighlightLayerTask } from \"core/FrameGraph/Tasks/Layers/highlightLayerTask\";\r\nimport { Constants } from \"core/Engines/constants\";\r\nimport { NodeRenderGraphConnectionPointCustomObject } from \"../../nodeRenderGraphConnectionPointCustomObject\";\r\nimport { NodeRenderGraphBaseObjectRendererBlock } from \"../Rendering/baseObjectRendererBlock\";\r\n\r\n/**\r\n * Block that implements the highlight layer\r\n */\r\nexport class NodeRenderGraphHighlightLayerBlock extends NodeRenderGraphBlock {\r\n protected override _frameGraphTask: FrameGraphHighlightLayerTask;\r\n\r\n public override _additionalConstructionParameters: [number, number | undefined, number, boolean, number];\r\n\r\n /**\r\n * Gets the frame graph task associated with this block\r\n */\r\n public override get task() {\r\n return this._frameGraphTask;\r\n }\r\n\r\n /**\r\n * Create a new NodeRenderGraphHighlightLayerBlock\r\n * @param name defines the block name\r\n * @param frameGraph defines the hosting frame graph\r\n * @param scene defines the hosting scene\r\n * @param layerTextureRatio multiplication factor applied to the main texture size to compute the size of the layer render target texture (default: 0.5)\r\n * @param layerTextureFixedSize defines the fixed size of the layer render target texture. Takes precedence over layerTextureRatio if provided (default: undefined)\r\n * @param blurTextureSizeRatio defines the factor to apply to the layer texture size to create the blur textures (default: 0.5)\r\n * @param isStroke should we display highlight as a solid stroke? (default: false)\r\n * @param layerTextureType defines the type of the layer texture (default: Constants.TEXTURETYPE_UNSIGNED_BYTE)\r\n */\r\n public constructor(\r\n name: string,\r\n frameGraph: FrameGraph,\r\n scene: Scene,\r\n layerTextureRatio = 0.5,\r\n layerTextureFixedSize?: number,\r\n blurTextureSizeRatio = 0.5,\r\n isStroke = false,\r\n layerTextureType = Constants.TEXTURETYPE_UNSIGNED_BYTE\r\n ) {\r\n super(name, frameGraph, scene);\r\n\r\n this._additionalConstructionParameters = [layerTextureRatio, layerTextureFixedSize, blurTextureSizeRatio, isStroke, layerTextureType];\r\n\r\n this.registerInput(\"target\", NodeRenderGraphBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"layer\", NodeRenderGraphBlockConnectionPointTypes.AutoDetect, true);\r\n this.registerInput(\r\n \"objectRenderer\",\r\n NodeRenderGraphBlockConnectionPointTypes.Object,\r\n true,\r\n new NodeRenderGraphConnectionPointCustomObject(\r\n \"objectRenderer\",\r\n this,\r\n NodeRenderGraphConnectionPointDirection.Input,\r\n NodeRenderGraphBaseObjectRendererBlock,\r\n \"NodeRenderGraphBaseObjectRendererBlock\"\r\n )\r\n );\r\n this._addDependenciesInput();\r\n\r\n this.registerOutput(\"output\", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this.target.addExcludedConnectionPointFromAllowedTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBufferDepthStencil);\r\n this.layer.addExcludedConnectionPointFromAllowedTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);\r\n\r\n this.output._typeConnectionSource = this.target;\r\n\r\n this._frameGraphTask = new FrameGraphHighlightLayerTask(this.name, this._frameGraph, this._scene, {\r\n mainTextureRatio: layerTextureRatio,\r\n mainTextureFixedSize: layerTextureFixedSize,\r\n blurTextureSizeRatio,\r\n isStroke,\r\n mainTextureType: layerTextureType,\r\n });\r\n }\r\n\r\n private _createTask(layerTextureRatio: number, layerTextureFixedSize: number, blurTextureSizeRatio: number, isStroke: boolean, layerTextureType: number) {\r\n const blurHorizontalSize = this.blurHorizontalSize;\r\n const blurVerticalSize = this.blurVerticalSize;\r\n\r\n this._frameGraphTask?.dispose();\r\n\r\n this._frameGraphTask = new FrameGraphHighlightLayerTask(this.name, this._frameGraph, this._scene, {\r\n mainTextureRatio: layerTextureRatio,\r\n mainTextureFixedSize: layerTextureFixedSize,\r\n blurTextureSizeRatio,\r\n isStroke,\r\n mainTextureType: layerTextureType,\r\n });\r\n\r\n this.blurHorizontalSize = blurHorizontalSize;\r\n this.blurVerticalSize = blurVerticalSize;\r\n\r\n this._additionalConstructionParameters = [layerTextureRatio, layerTextureFixedSize, blurTextureSizeRatio, isStroke, layerTextureType];\r\n }\r\n\r\n /** Multiplication factor applied to the main texture size to compute the size of the layer render target texture */\r\n @editableInPropertyPage(\"Layer texture ratio\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get layerTextureRatio() {\r\n return this._frameGraphTask.layer._options.mainTextureRatio;\r\n }\r\n\r\n public set layerTextureRatio(value: number) {\r\n const options = this._frameGraphTask.layer._options;\r\n\r\n this._createTask(value, options.mainTextureFixedSize, options.blurTextureSizeRatio, options.isStroke, options.mainTextureType);\r\n }\r\n\r\n /** Defines the fixed size of the layer render target texture. Takes precedence over layerTextureRatio if provided */\r\n @editableInPropertyPage(\"Layer texture fixed size\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get layerTextureFixedSize() {\r\n return this._frameGraphTask.layer._options.mainTextureFixedSize;\r\n }\r\n\r\n public set layerTextureFixedSize(value: number) {\r\n const options = this._frameGraphTask.layer._options;\r\n\r\n this._createTask(options.mainTextureRatio, value, options.blurTextureSizeRatio, options.isStroke, options.mainTextureType);\r\n }\r\n\r\n /** Defines the factor to apply to the layer texture size to create the blur textures */\r\n @editableInPropertyPage(\"Blur texture size ratio\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get blurTextureSizeRatio() {\r\n return this._frameGraphTask.layer._options.blurTextureSizeRatio;\r\n }\r\n\r\n public set blurTextureSizeRatio(value: number) {\r\n const options = this._frameGraphTask.layer._options;\r\n\r\n this._createTask(options.mainTextureRatio, options.mainTextureFixedSize, value, options.isStroke, options.mainTextureType);\r\n }\r\n\r\n /** Should we display highlight as a solid stroke? */\r\n @editableInPropertyPage(\"Is stroke\", PropertyTypeForEdition.Boolean, \"PROPERTIES\")\r\n public get isStroke() {\r\n return this._frameGraphTask.layer._options.isStroke;\r\n }\r\n\r\n public set isStroke(value: boolean) {\r\n const options = this._frameGraphTask.layer._options;\r\n\r\n this._createTask(options.mainTextureRatio, options.mainTextureFixedSize, options.blurTextureSizeRatio, value, options.mainTextureType);\r\n }\r\n\r\n /** Defines the type of the layer texture */\r\n @editableInPropertyPage(\"Layer texture type\", PropertyTypeForEdition.TextureType, \"PROPERTIES\")\r\n public get layerTextureType() {\r\n return this._frameGraphTask.layer._options.mainTextureType;\r\n }\r\n\r\n public set layerTextureType(value: number) {\r\n const options = this._frameGraphTask.layer._options;\r\n\r\n this._createTask(options.mainTextureRatio, options.mainTextureFixedSize, options.blurTextureSizeRatio, options.isStroke, value);\r\n }\r\n\r\n /** How big is the horizontal kernel of the blur texture */\r\n @editableInPropertyPage(\"Blur horizontal size\", PropertyTypeForEdition.Float, \"PROPERTIES\", { min: 0, max: 4 })\r\n public get blurHorizontalSize() {\r\n return this._frameGraphTask.layer.blurHorizontalSize;\r\n }\r\n\r\n public set blurHorizontalSize(value: number) {\r\n this._frameGraphTask.layer.blurHorizontalSize = value;\r\n }\r\n\r\n /** How big is the vertical kernel of the blur texture */\r\n @editableInPropertyPage(\"Blur vertical size\", PropertyTypeForEdition.Float, \"PROPERTIES\", { min: 0, max: 4 })\r\n public get blurVerticalSize() {\r\n return this._frameGraphTask.layer.blurVerticalSize;\r\n }\r\n\r\n public set blurVerticalSize(value: number) {\r\n this._frameGraphTask.layer.blurVerticalSize = value;\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"NodeRenderGraphHighlightLayerBlock\";\r\n }\r\n\r\n /**\r\n * Gets the target texture input component\r\n */\r\n public get target(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the layer input component\r\n */\r\n public get layer(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the objectRenderer input component\r\n */\r\n public get objectRenderer(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeRenderGraphConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected override _buildBlock(state: NodeRenderGraphBuildState) {\r\n super._buildBlock(state);\r\n\r\n this.output.value = this._frameGraphTask.outputTexture;\r\n\r\n this._frameGraphTask.targetTexture = this.target.connectedPoint?.value as FrameGraphTextureHandle;\r\n this._frameGraphTask.layerTexture = this.layer.connectedPoint?.value as FrameGraphTextureHandle;\r\n this._frameGraphTask.objectRendererTask = this.objectRenderer.connectedPoint?.value as FrameGraphObjectRendererTask;\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codes: string[] = [];\r\n codes.push(`${this._codeVariableName}.blurHorizontalSize = ${this.blurHorizontalSize};`);\r\n codes.push(`${this._codeVariableName}.blurVerticalSize = ${this.blurVerticalSize};`);\r\n return super._dumpPropertiesCode() + codes.join(\"\\n\");\r\n }\r\n\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n serializationObject.blurHorizontalSize = this.blurHorizontalSize;\r\n serializationObject.blurVerticalSize = this.blurVerticalSize;\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n this.blurHorizontalSize = serializationObject.blurHorizontalSize;\r\n this.blurVerticalSize = serializationObject.blurVerticalSize;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.NodeRenderGraphHighlightLayerBlock\", NodeRenderGraphHighlightLayerBlock);\r\n"]}
@@ -80,6 +80,6 @@ export class NodeRenderGraphBasePostProcessBlock extends NodeRenderGraphBlock {
80
80
  }
81
81
  }
82
82
  __decorate([
83
- editableInPropertyPage("Source sampling mode", 7 /* PropertyTypeForEdition.SamplingMode */, "BASE PROPERTIES")
83
+ editableInPropertyPage("Source sampling mode", 8 /* PropertyTypeForEdition.SamplingMode */, "BASE PROPERTIES")
84
84
  ], NodeRenderGraphBasePostProcessBlock.prototype, "sourceSamplingMode", null);
85
85
  //# sourceMappingURL=basePostProcessBlock.js.map
@@ -147,6 +147,6 @@ __decorate([
147
147
  editableInPropertyPage("Use full screen viewport", 0 /* PropertyTypeForEdition.Boolean */, "BASE PROPERTIES")
148
148
  ], NodeRenderGraphBaseWithPropertiesPostProcessBlock.prototype, "useFullScreenViewport", null);
149
149
  __decorate([
150
- editableInPropertyPage("Viewport", 12 /* PropertyTypeForEdition.Viewport */, "BASE PROPERTIES")
150
+ editableInPropertyPage("Viewport", 13 /* PropertyTypeForEdition.Viewport */, "BASE PROPERTIES")
151
151
  ], NodeRenderGraphBaseWithPropertiesPostProcessBlock.prototype, "viewport", null);
152
152
  //# sourceMappingURL=baseWithPropertiesPostProcessBlock.js.map
@@ -115,7 +115,7 @@ export class NodeRenderGraphCircleOfConfusionPostProcessBlock extends NodeRender
115
115
  }
116
116
  }
117
117
  __decorate([
118
- editableInPropertyPage("Depth sampling mode", 7 /* PropertyTypeForEdition.SamplingMode */, "PROPERTIES")
118
+ editableInPropertyPage("Depth sampling mode", 8 /* PropertyTypeForEdition.SamplingMode */, "PROPERTIES")
119
119
  ], NodeRenderGraphCircleOfConfusionPostProcessBlock.prototype, "depthSamplingMode", null);
120
120
  __decorate([
121
121
  editableInPropertyPage("Lens size", 1 /* PropertyTypeForEdition.Float */, "PROPERTIES")
@@ -50,7 +50,7 @@ export class NodeRenderGraphColorCorrectionPostProcessBlock extends NodeRenderGr
50
50
  }
51
51
  }
52
52
  __decorate([
53
- editableInPropertyPage("Color Table URL", 10 /* PropertyTypeForEdition.String */, "PROPERTIES")
53
+ editableInPropertyPage("Color Table URL", 11 /* PropertyTypeForEdition.String */, "PROPERTIES")
54
54
  ], NodeRenderGraphColorCorrectionPostProcessBlock.prototype, "colorTableUrl", null);
55
55
  RegisterClass("BABYLON.NodeRenderGraphColorCorrectionPostProcessBlock", NodeRenderGraphColorCorrectionPostProcessBlock);
56
56
  //# sourceMappingURL=colorCorrectionPostProcessBlock.js.map
@@ -161,7 +161,7 @@ __decorate([
161
161
  editableInPropertyPage("HDR", 0 /* PropertyTypeForEdition.Boolean */, "PROPERTIES")
162
162
  ], NodeRenderGraphDepthOfFieldPostProcessBlock.prototype, "hdr", null);
163
163
  __decorate([
164
- editableInPropertyPage("Depth sampling mode", 7 /* PropertyTypeForEdition.SamplingMode */, "PROPERTIES")
164
+ editableInPropertyPage("Depth sampling mode", 8 /* PropertyTypeForEdition.SamplingMode */, "PROPERTIES")
165
165
  ], NodeRenderGraphDepthOfFieldPostProcessBlock.prototype, "depthSamplingMode", null);
166
166
  __decorate([
167
167
  editableInPropertyPage("Focal length", 1 /* PropertyTypeForEdition.Float */, "PROPERTIES")
@@ -56,7 +56,7 @@ export class NodeRenderGraphFilterPostProcessBlock extends NodeRenderGraphBaseWi
56
56
  }
57
57
  }
58
58
  __decorate([
59
- editableInPropertyPage("Matrix", 11 /* PropertyTypeForEdition.Matrix */, "PROPERTIES")
59
+ editableInPropertyPage("Matrix", 12 /* PropertyTypeForEdition.Matrix */, "PROPERTIES")
60
60
  ], NodeRenderGraphFilterPostProcessBlock.prototype, "kernelMatrix", null);
61
61
  RegisterClass("BABYLON.NodeRenderGraphFilterPostProcessBlock", NodeRenderGraphFilterPostProcessBlock);
62
62
  //# sourceMappingURL=filterPostProcessBlock.js.map
@@ -226,7 +226,7 @@ __decorate([
226
226
  editableInPropertyPage("Center Y", 1 /* PropertyTypeForEdition.Float */, "VIGNETTE", { min: 0, max: 1 })
227
227
  ], NodeRenderGraphImageProcessingPostProcessBlock.prototype, "vignetteCenterY", null);
228
228
  __decorate([
229
- editableInPropertyPage("Color", 6 /* PropertyTypeForEdition.Color4 */, "VIGNETTE")
229
+ editableInPropertyPage("Color", 7 /* PropertyTypeForEdition.Color4 */, "VIGNETTE")
230
230
  ], NodeRenderGraphImageProcessingPostProcessBlock.prototype, "vignetteColor", null);
231
231
  __decorate([
232
232
  editableInPropertyPage("Blend mode", 5 /* PropertyTypeForEdition.List */, "VIGNETTE", {
@@ -261,7 +261,7 @@ export class NodeRenderGraphSSAO2PostProcessBlock extends NodeRenderGraphBasePos
261
261
  }
262
262
  }
263
263
  __decorate([
264
- editableInPropertyPage("Texture type", 9 /* PropertyTypeForEdition.TextureType */, "TEXTURE")
264
+ editableInPropertyPage("Texture type", 10 /* PropertyTypeForEdition.TextureType */, "TEXTURE")
265
265
  ], NodeRenderGraphSSAO2PostProcessBlock.prototype, "textureType", null);
266
266
  __decorate([
267
267
  editableInPropertyPage("SSAO texture ratio", 1 /* PropertyTypeForEdition.Float */, "TEXTURE", { min: 0.1, max: 1 })
@@ -1 +1 @@
1
- {"version":3,"file":"ssao2PostProcessBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FrameGraph/Node/Blocks/PostProcesses/ssao2PostProcessBlock.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,yCAA+B;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,wCAAwC,EAAE,MAAM,kCAAkC,CAAC;AAC5F,OAAO,EAAE,sBAAsB,EAA0B,MAAM,sCAAsC,CAAC;AACtG,OAAO,EAAE,oCAAoC,EAAE,MAAM,yDAAyD,CAAC;AAC/G,OAAO,EAAE,mCAAmC,EAAE,MAAM,wBAAwB,CAAC;AAE7E;;GAEG;AACH,MAAM,OAAO,oCAAqC,SAAQ,mCAAmC;IAKzF;;OAEG;IACH,IAAoB,IAAI;QACpB,OAAO,IAAI,CAAC,eAAe,CAAC;IAChC,CAAC;IAED;;;;;;;;OAQG;IACH,YAAmB,IAAY,EAAE,UAAsB,EAAE,KAAY,EAAE,SAAS,GAAG,CAAC,EAAE,SAAS,GAAG,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC,yBAA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EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;4EAG3F;AAQD;IADC,sBAAsB,CAAC,QAAQ,wCAAgC,MAAM,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;2EAG1F;AAQD;IADC,sBAAsB,CAAC,WAAW,wCAAgC,MAAM,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;8EAG7F;AAiGL,aAAa,CAAC,8CAA8C,EAAE,oCAAoC,CAAC,CAAC","sourcesContent":["import type { Scene, FrameGraph, NodeRenderGraphConnectionPoint, NodeRenderGraphBuildState, FrameGraphTextureHandle, Camera } from \"core/index\";\r\nimport { Constants } from \"core/Engines/constants\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { NodeRenderGraphBlockConnectionPointTypes } from \"../../Types/nodeRenderGraphTypes\";\r\nimport { editableInPropertyPage, PropertyTypeForEdition } from \"../../../../Decorators/nodeDecorator\";\r\nimport { FrameGraphSSAO2RenderingPipelineTask } from \"../../../Tasks/PostProcesses/ssao2RenderingPipelineTask\";\r\nimport { NodeRenderGraphBasePostProcessBlock } from \"./basePostProcessBlock\";\r\n\r\n/**\r\n * Block that implements the SSAO2 post process\r\n */\r\nexport class NodeRenderGraphSSAO2PostProcessBlock extends NodeRenderGraphBasePostProcessBlock {\r\n protected override _frameGraphTask: FrameGraphSSAO2RenderingPipelineTask;\r\n\r\n public override _additionalConstructionParameters: [number, number, number];\r\n\r\n /**\r\n * Gets the frame graph task associated with this block\r\n */\r\n public override get task() {\r\n return this._frameGraphTask;\r\n }\r\n\r\n /**\r\n * Create a new NodeRenderGraphSSAO2PostProcessBlock\r\n * @param name defines the block name\r\n * @param frameGraph defines the hosting frame graph\r\n * @param scene defines the hosting scene\r\n * @param ratioSSAO The ratio between the SSAO texture size and the source texture size (default: 1)\r\n * @param ratioBlur The ratio between the SSAO blur texture size and the source texture size (default: 1)\r\n * @param textureType The texture type used by the different post processes created by SSAO2 (default: Constants.TEXTURETYPE_UNSIGNED_BYTE)\r\n */\r\n public constructor(name: string, frameGraph: FrameGraph, scene: Scene, ratioSSAO = 1, ratioBlur = 1, textureType = Constants.TEXTURETYPE_UNSIGNED_BYTE) {\r\n super(name, frameGraph, scene);\r\n\r\n this._additionalConstructionParameters = [ratioSSAO, ratioBlur, textureType];\r\n\r\n this.registerInput(\"camera\", NodeRenderGraphBlockConnectionPointTypes.Camera);\r\n this.registerInput(\"geomDepth\", NodeRenderGraphBlockConnectionPointTypes.TextureViewDepth);\r\n this.registerInput(\"geomNormal\", NodeRenderGraphBlockConnectionPointTypes.TextureViewNormal);\r\n\r\n this._finalizeInputOutputRegistering();\r\n\r\n this._frameGraphTask = new FrameGraphSSAO2RenderingPipelineTask(this.name, frameGraph, ratioSSAO, ratioBlur, textureType);\r\n }\r\n\r\n private _createTask(ratioSSAO: number, ratioBlur: number, textureType: number) {\r\n const sourceSamplingMode = this.sourceSamplingMode;\r\n const samples = this.samples;\r\n const totalStrength = this.totalStrength;\r\n const base = this.base;\r\n const maxZ = this.maxZ;\r\n const minZAspect = this.minZAspect;\r\n const radius = this.radius;\r\n const epsilon = this.epsilon;\r\n const useViewportInCombineStage = this.useViewportInCombineStage;\r\n const bypassBlur = this.bypassBlur;\r\n const expensiveBlur = this.expensiveBlur;\r\n const bilateralSoften = this.bilateralSoften;\r\n const bilateralSamples = this.bilateralSamples;\r\n const bilateralTolerance = this.bilateralTolerance;\r\n\r\n this._frameGraphTask.dispose();\r\n this._frameGraphTask = new FrameGraphSSAO2RenderingPipelineTask(this.name, this._frameGraph, ratioSSAO, ratioBlur, textureType);\r\n\r\n this.sourceSamplingMode = sourceSamplingMode;\r\n this.samples = samples;\r\n this.totalStrength = totalStrength;\r\n this.base = base;\r\n this.maxZ = maxZ;\r\n this.minZAspect = minZAspect;\r\n this.radius = radius;\r\n this.epsilon = epsilon;\r\n this.useViewportInCombineStage = useViewportInCombineStage;\r\n this.bypassBlur = bypassBlur;\r\n this.expensiveBlur = expensiveBlur;\r\n this.bilateralSoften = bilateralSoften;\r\n this.bilateralSamples = bilateralSamples;\r\n this.bilateralTolerance = bilateralTolerance;\r\n\r\n this._additionalConstructionParameters = [ratioSSAO, ratioBlur, textureType];\r\n }\r\n\r\n /** The texture type used by the different post processes created by SSAO2 */\r\n @editableInPropertyPage(\"Texture type\", PropertyTypeForEdition.TextureType, \"TEXTURE\")\r\n public get textureType() {\r\n return this._frameGraphTask.textureType;\r\n }\r\n\r\n public set textureType(value: number) {\r\n this._createTask(this._frameGraphTask.ratioSSAO, this._frameGraphTask.ratioBlur, value);\r\n }\r\n\r\n /** The ratio between the SSAO texture size and the source texture size */\r\n @editableInPropertyPage(\"SSAO texture ratio\", PropertyTypeForEdition.Float, \"TEXTURE\", { min: 0.1, max: 1 })\r\n public get ratioSSAO() {\r\n return this._frameGraphTask.ratioSSAO;\r\n }\r\n\r\n public set ratioSSAO(value: number) {\r\n this._createTask(value, this._frameGraphTask.ratioBlur, this._frameGraphTask.textureType);\r\n }\r\n\r\n /** The ratio between the SSAO blur texture size and the source texture size */\r\n @editableInPropertyPage(\"SSAO blur texture ratio\", PropertyTypeForEdition.Float, \"TEXTURE\", { min: 0.1, max: 1 })\r\n public get ratioBlur() {\r\n return this._frameGraphTask.ratioBlur;\r\n }\r\n\r\n public set ratioBlur(value: number) {\r\n this._createTask(this._frameGraphTask.ratioSSAO, value, this._frameGraphTask.textureType);\r\n }\r\n\r\n /** Number of samples used for the SSAO calculations. Default value is 8. */\r\n @editableInPropertyPage(\"Samples\", PropertyTypeForEdition.Int, \"SSAO\", { min: 1, max: 128 })\r\n public get samples() {\r\n return this._frameGraphTask.ssao.samples;\r\n }\r\n\r\n public set samples(value: number) {\r\n this._frameGraphTask.ssao.samples = value;\r\n }\r\n\r\n /** The strength of the SSAO post-process. Default value is 1.0. */\r\n @editableInPropertyPage(\"Strength\", PropertyTypeForEdition.Float, \"SSAO\", { min: 0, max: 3 })\r\n public get totalStrength() {\r\n return this._frameGraphTask.ssao.totalStrength;\r\n }\r\n\r\n public set totalStrength(value: number) {\r\n this._frameGraphTask.ssao.totalStrength = value;\r\n }\r\n\r\n /** The base color of the SSAO post-process. The final result is \"base + ssao\" between [0, 1] */\r\n @editableInPropertyPage(\"Base\", PropertyTypeForEdition.Float, \"SSAO\", { min: 0, max: 1 })\r\n public get base() {\r\n return this._frameGraphTask.ssao.base;\r\n }\r\n\r\n public set base(value: number) {\r\n this._frameGraphTask.ssao.base = value;\r\n }\r\n\r\n /** Maximum depth value to still render AO. A smooth falloff makes the dimming more natural, so there will be no abrupt shading change. */\r\n @editableInPropertyPage(\"Max Z\", PropertyTypeForEdition.Float, \"SSAO\", { min: 0, max: 10000 })\r\n public get maxZ() {\r\n return this._frameGraphTask.ssao.maxZ;\r\n }\r\n\r\n public set maxZ(value: number) {\r\n this._frameGraphTask.ssao.maxZ = value;\r\n }\r\n\r\n /** In order to save performances, SSAO radius is clamped on close geometry. This ratio changes by how much. */\r\n @editableInPropertyPage(\"Min Z aspect\", PropertyTypeForEdition.Float, \"SSAO\", { min: 0, max: 0.5 })\r\n public get minZAspect() {\r\n return this._frameGraphTask.ssao.minZAspect;\r\n }\r\n\r\n public set minZAspect(value: number) {\r\n this._frameGraphTask.ssao.minZAspect = value;\r\n }\r\n\r\n /** The radius around the analyzed pixel used by the SSAO post-process. */\r\n @editableInPropertyPage(\"Radius\", PropertyTypeForEdition.Float, \"SSAO\", { min: 0, max: 10 })\r\n public get radius() {\r\n return this._frameGraphTask.ssao.radius;\r\n }\r\n\r\n public set radius(value: number) {\r\n this._frameGraphTask.ssao.radius = value;\r\n }\r\n\r\n /** Used in SSAO calculations to compensate for accuracy issues with depth values. */\r\n @editableInPropertyPage(\"Epsilon\", PropertyTypeForEdition.Float, \"SSAO\", { min: 0, max: 1 })\r\n public get epsilon() {\r\n return this._frameGraphTask.ssao.epsilon;\r\n }\r\n\r\n public set epsilon(value: number) {\r\n this._frameGraphTask.ssao.epsilon = value;\r\n }\r\n\r\n /** Indicates that the combine stage should use the current camera viewport to render the SSAO result on only a portion of the output texture. */\r\n @editableInPropertyPage(\"Use viewport in combine stage\", PropertyTypeForEdition.Boolean, \"SSAO\")\r\n public get useViewportInCombineStage() {\r\n return this._frameGraphTask.ssao.useViewportInCombineStage;\r\n }\r\n\r\n public set useViewportInCombineStage(value: boolean) {\r\n this._frameGraphTask.ssao.useViewportInCombineStage = value;\r\n }\r\n\r\n /** Skips the denoising (blur) stage of the SSAO calculations. */\r\n @editableInPropertyPage(\"Bypass blur\", PropertyTypeForEdition.Boolean, \"Blur\")\r\n public get bypassBlur() {\r\n return this._frameGraphTask.ssao.bypassBlur;\r\n }\r\n\r\n public set bypassBlur(value: boolean) {\r\n this._frameGraphTask.ssao.bypassBlur = value;\r\n }\r\n\r\n /** Enables the configurable bilateral denoising (blurring) filter. */\r\n @editableInPropertyPage(\"Expensive blur\", PropertyTypeForEdition.Boolean, \"Blur\")\r\n public get expensiveBlur() {\r\n return this._frameGraphTask.ssao.expensiveBlur;\r\n }\r\n\r\n public set expensiveBlur(value: boolean) {\r\n this._frameGraphTask.ssao.expensiveBlur = value;\r\n }\r\n\r\n /** The number of samples the bilateral filter uses in both dimensions when denoising the SSAO calculations. */\r\n @editableInPropertyPage(\"Samples\", PropertyTypeForEdition.Int, \"Blur\", { min: 1, max: 128 })\r\n public get bilateralSamples() {\r\n return this._frameGraphTask.ssao.bilateralSamples;\r\n }\r\n\r\n public set bilateralSamples(value: number) {\r\n this._frameGraphTask.ssao.bilateralSamples = value;\r\n }\r\n\r\n /** Controls the shape of the denoising kernel used by the bilateral filter. */\r\n @editableInPropertyPage(\"Soften\", PropertyTypeForEdition.Float, \"Blur\", { min: 0, max: 1 })\r\n public get bilateralSoften() {\r\n return this._frameGraphTask.ssao.bilateralSoften;\r\n }\r\n\r\n public set bilateralSoften(value: number) {\r\n this._frameGraphTask.ssao.bilateralSoften = value;\r\n }\r\n\r\n /** How forgiving the bilateral denoiser should be when rejecting samples. */\r\n @editableInPropertyPage(\"Tolerance\", PropertyTypeForEdition.Float, \"Blur\", { min: 0, max: 1 })\r\n public get bilateralTolerance() {\r\n return this._frameGraphTask.ssao.bilateralTolerance;\r\n }\r\n\r\n public set bilateralTolerance(value: number) {\r\n this._frameGraphTask.ssao.bilateralTolerance = value;\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"NodeRenderGraphSSAO2PostProcessBlock\";\r\n }\r\n\r\n /**\r\n * Gets the camera input component\r\n */\r\n public get camera(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the geometry depth input component\r\n */\r\n public get geomDepth(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[3];\r\n }\r\n\r\n /**\r\n * Gets the geometry normal input component\r\n */\r\n public get geomNormal(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[4];\r\n }\r\n\r\n protected override _buildBlock(state: NodeRenderGraphBuildState) {\r\n super._buildBlock(state);\r\n\r\n this._frameGraphTask.normalTexture = this.geomNormal.connectedPoint?.value as FrameGraphTextureHandle;\r\n this._frameGraphTask.depthTexture = this.geomDepth.connectedPoint?.value as FrameGraphTextureHandle;\r\n this._frameGraphTask.camera = this.camera.connectedPoint?.value as Camera;\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codes: string[] = [];\r\n codes.push(`${this._codeVariableName}.samples = ${this.samples};`);\r\n codes.push(`${this._codeVariableName}.totalStrength = ${this.totalStrength};`);\r\n codes.push(`${this._codeVariableName}.base = ${this.base};`);\r\n codes.push(`${this._codeVariableName}.maxZ = ${this.maxZ};`);\r\n codes.push(`${this._codeVariableName}.minZAspect = ${this.minZAspect};`);\r\n codes.push(`${this._codeVariableName}.radius = ${this.radius};`);\r\n codes.push(`${this._codeVariableName}.epsilon = ${this.epsilon};`);\r\n codes.push(`${this._codeVariableName}.useViewportInCombineStage = ${this.useViewportInCombineStage};`);\r\n codes.push(`${this._codeVariableName}.bypassBlur = ${this.bypassBlur};`);\r\n codes.push(`${this._codeVariableName}.expensiveBlur = ${this.expensiveBlur};`);\r\n codes.push(`${this._codeVariableName}.bilateralSamples = ${this.bilateralSamples};`);\r\n codes.push(`${this._codeVariableName}.bilateralSoften = ${this.bilateralSoften};`);\r\n codes.push(`${this._codeVariableName}.bilateralTolerance = ${this.bilateralTolerance};`);\r\n return super._dumpPropertiesCode() + codes.join(\"\\n\");\r\n }\r\n\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n serializationObject.samples = this.samples;\r\n serializationObject.totalStrength = this.totalStrength;\r\n serializationObject.base = this.base;\r\n serializationObject.maxZ = this.maxZ;\r\n serializationObject.minZAspect = this.minZAspect;\r\n serializationObject.radius = this.radius;\r\n serializationObject.epsilon = this.epsilon;\r\n serializationObject.useViewportInCombineStage = this.useViewportInCombineStage;\r\n serializationObject.bypassBlur = this.bypassBlur;\r\n serializationObject.expensiveBlur = this.expensiveBlur;\r\n serializationObject.bilateralSoften = this.bilateralSoften;\r\n serializationObject.bilateralSamples = this.bilateralSamples;\r\n serializationObject.bilateralTolerance = this.bilateralTolerance;\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n this.samples = serializationObject.samples;\r\n this.totalStrength = serializationObject.totalStrength;\r\n this.base = serializationObject.base;\r\n this.maxZ = serializationObject.maxZ;\r\n this.minZAspect = serializationObject.minZAspect;\r\n this.radius = serializationObject.radius;\r\n this.epsilon = serializationObject.epsilon;\r\n this.useViewportInCombineStage = serializationObject.useViewportInCombineStage;\r\n this.bypassBlur = serializationObject.bypassBlur;\r\n this.expensiveBlur = serializationObject.expensiveBlur;\r\n this.bilateralSoften = serializationObject.bilateralSoften;\r\n this.bilateralSamples = serializationObject.bilateralSamples;\r\n this.bilateralTolerance = serializationObject.bilateralTolerance;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.NodeRenderGraphSSAO2PostProcessBlock\", NodeRenderGraphSSAO2PostProcessBlock);\r\n"]}
1
+ {"version":3,"file":"ssao2PostProcessBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FrameGraph/Node/Blocks/PostProcesses/ssao2PostProcessBlock.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,yCAA+B;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,wCAAwC,EAAE,MAAM,kCAAkC,CAAC;AAC5F,OAAO,EAAE,sBAAsB,EAA0B,MAAM,sCAAsC,CAAC;AACtG,OAAO,EAAE,oCAAoC,EAAE,MAAM,yDAAyD,CAAC;AAC/G,OAAO,EAAE,mCAAmC,EAAE,MAAM,wBAAwB,CAAC;AAE7E;;GAEG;AACH,MAAM,OAAO,oCAAqC,SAAQ,mCAAmC;IAKzF;;OAEG;IACH,IAAoB,IAAI;QACpB,OAAO,IAAI,CAAC,eAAe,CAAC;IAChC,CAAC;IAED;;;;;;;;OAQG;IACH,YAAmB,IAAY,EAAE,UAAsB,EAAE,KAAY,EAAE,SAAS,GAAG,CAAC,EAAE,SAAS,GAAG,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC,yBAAyB;QAClJ,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;QAE/B,IAAI,CAAC,iCAAiC,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC;QAE7E,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,wCAAwC,CAAC,MAAM,CAAC,CAAC;QAC9E,IAAI,CAAC,aAAa,CAAC,WAAW,EAAE,wCAAwC,CAAC,gBAAgB,CAAC,CAAC;QAC3F,IAAI,CAAC,aAAa,CAAC,YAAY,EAAE,wCAAwC,CAAC,iBAAiB,CAAC,CAAC;QAE7F,IAAI,CAAC,+BAA+B,EAAE,CAAC;QAEvC,IAAI,CAAC,eAAe,GAAG,IAAI,oCAAoC,C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,EAAE,CAAC;gEAGxF;AAQD;IADC,sBAAsB,CAAC,OAAO,wCAAgC,MAAM,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC;gEAG7F;AAQD;IADC,sBAAsB,CAAC,cAAc,wCAAgC,MAAM,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;sEAGlG;AAQD;IADC,sBAAsB,CAAC,QAAQ,wCAAgC,MAAM,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC;kEAG3F;AAQD;IADC,sBAAsB,CAAC,SAAS,wCAAgC,MAAM,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;mEAG3F;AAQD;IADC,sBAAsB,CAAC,+BAA+B,0CAAkC,MAAM,CAAC;qFAG/F;AAQD;IADC,sBAAsB,CAAC,aAAa,0CAAkC,MAAM,CAAC;sEAG7E;AAQD;IADC,sBAAsB,CAAC,gBAAgB,0CAAkC,MAAM,CAAC;yEAGhF;AAQD;IADC,sBAAsB,CAAC,SAAS,sCAA8B,MAAM,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;4EAG3F;AAQD;IADC,sBAAsB,CAAC,QAAQ,wCAAgC,MAAM,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;2EAG1F;AAQD;IADC,sBAAsB,CAAC,WAAW,wCAAgC,MAAM,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;8EAG7F;AAiGL,aAAa,CAAC,8CAA8C,EAAE,oCAAoC,CAAC,CAAC","sourcesContent":["import type { Scene, FrameGraph, NodeRenderGraphConnectionPoint, NodeRenderGraphBuildState, FrameGraphTextureHandle, Camera } from \"core/index\";\r\nimport { Constants } from \"core/Engines/constants\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { NodeRenderGraphBlockConnectionPointTypes } from \"../../Types/nodeRenderGraphTypes\";\r\nimport { editableInPropertyPage, PropertyTypeForEdition } from \"../../../../Decorators/nodeDecorator\";\r\nimport { FrameGraphSSAO2RenderingPipelineTask } from \"../../../Tasks/PostProcesses/ssao2RenderingPipelineTask\";\r\nimport { NodeRenderGraphBasePostProcessBlock } from \"./basePostProcessBlock\";\r\n\r\n/**\r\n * Block that implements the SSAO2 post process\r\n */\r\nexport class NodeRenderGraphSSAO2PostProcessBlock extends NodeRenderGraphBasePostProcessBlock {\r\n protected override _frameGraphTask: FrameGraphSSAO2RenderingPipelineTask;\r\n\r\n public override _additionalConstructionParameters: [number, number, number];\r\n\r\n /**\r\n * Gets the frame graph task associated with this block\r\n */\r\n public override get task() {\r\n return this._frameGraphTask;\r\n }\r\n\r\n /**\r\n * Create a new NodeRenderGraphSSAO2PostProcessBlock\r\n * @param name defines the block name\r\n * @param frameGraph defines the hosting frame graph\r\n * @param scene defines the hosting scene\r\n * @param ratioSSAO The ratio between the SSAO texture size and the source texture size (default: 1)\r\n * @param ratioBlur The ratio between the SSAO blur texture size and the source texture size (default: 1)\r\n * @param textureType The texture type used by the different post processes created by SSAO2 (default: Constants.TEXTURETYPE_UNSIGNED_BYTE)\r\n */\r\n public constructor(name: string, frameGraph: FrameGraph, scene: Scene, ratioSSAO = 1, ratioBlur = 1, textureType = Constants.TEXTURETYPE_UNSIGNED_BYTE) {\r\n super(name, frameGraph, scene);\r\n\r\n this._additionalConstructionParameters = [ratioSSAO, ratioBlur, textureType];\r\n\r\n this.registerInput(\"camera\", NodeRenderGraphBlockConnectionPointTypes.Camera);\r\n this.registerInput(\"geomDepth\", NodeRenderGraphBlockConnectionPointTypes.TextureViewDepth);\r\n this.registerInput(\"geomNormal\", NodeRenderGraphBlockConnectionPointTypes.TextureViewNormal);\r\n\r\n this._finalizeInputOutputRegistering();\r\n\r\n this._frameGraphTask = new FrameGraphSSAO2RenderingPipelineTask(this.name, frameGraph, ratioSSAO, ratioBlur, textureType);\r\n }\r\n\r\n private _createTask(ratioSSAO: number, ratioBlur: number, textureType: number) {\r\n const sourceSamplingMode = this.sourceSamplingMode;\r\n const samples = this.samples;\r\n const totalStrength = this.totalStrength;\r\n const base = this.base;\r\n const maxZ = this.maxZ;\r\n const minZAspect = this.minZAspect;\r\n const radius = this.radius;\r\n const epsilon = this.epsilon;\r\n const useViewportInCombineStage = this.useViewportInCombineStage;\r\n const bypassBlur = this.bypassBlur;\r\n const expensiveBlur = this.expensiveBlur;\r\n const bilateralSoften = this.bilateralSoften;\r\n const bilateralSamples = this.bilateralSamples;\r\n const bilateralTolerance = this.bilateralTolerance;\r\n\r\n this._frameGraphTask.dispose();\r\n this._frameGraphTask = new FrameGraphSSAO2RenderingPipelineTask(this.name, this._frameGraph, ratioSSAO, ratioBlur, textureType);\r\n\r\n this.sourceSamplingMode = sourceSamplingMode;\r\n this.samples = samples;\r\n this.totalStrength = totalStrength;\r\n this.base = base;\r\n this.maxZ = maxZ;\r\n this.minZAspect = minZAspect;\r\n this.radius = radius;\r\n this.epsilon = epsilon;\r\n this.useViewportInCombineStage = useViewportInCombineStage;\r\n this.bypassBlur = bypassBlur;\r\n this.expensiveBlur = expensiveBlur;\r\n this.bilateralSoften = bilateralSoften;\r\n this.bilateralSamples = bilateralSamples;\r\n this.bilateralTolerance = bilateralTolerance;\r\n\r\n this._additionalConstructionParameters = [ratioSSAO, ratioBlur, textureType];\r\n }\r\n\r\n /** The texture type used by the different post processes created by SSAO2 */\r\n @editableInPropertyPage(\"Texture type\", PropertyTypeForEdition.TextureType, \"TEXTURE\")\r\n public get textureType() {\r\n return this._frameGraphTask.textureType;\r\n }\r\n\r\n public set textureType(value: number) {\r\n this._createTask(this._frameGraphTask.ratioSSAO, this._frameGraphTask.ratioBlur, value);\r\n }\r\n\r\n /** The ratio between the SSAO texture size and the source texture size */\r\n @editableInPropertyPage(\"SSAO texture ratio\", PropertyTypeForEdition.Float, \"TEXTURE\", { min: 0.1, max: 1 })\r\n public get ratioSSAO() {\r\n return this._frameGraphTask.ratioSSAO;\r\n }\r\n\r\n public set ratioSSAO(value: number) {\r\n this._createTask(value, this._frameGraphTask.ratioBlur, this._frameGraphTask.textureType);\r\n }\r\n\r\n /** The ratio between the SSAO blur texture size and the source texture size */\r\n @editableInPropertyPage(\"SSAO blur texture ratio\", PropertyTypeForEdition.Float, \"TEXTURE\", { min: 0.1, max: 1 })\r\n public get ratioBlur() {\r\n return this._frameGraphTask.ratioBlur;\r\n }\r\n\r\n public set ratioBlur(value: number) {\r\n this._createTask(this._frameGraphTask.ratioSSAO, value, this._frameGraphTask.textureType);\r\n }\r\n\r\n /** Number of samples used for the SSAO calculations. Default value is 8. */\r\n @editableInPropertyPage(\"Samples\", PropertyTypeForEdition.Int, \"SSAO\", { min: 1, max: 128 })\r\n public get samples() {\r\n return this._frameGraphTask.ssao.samples;\r\n }\r\n\r\n public set samples(value: number) {\r\n this._frameGraphTask.ssao.samples = value;\r\n }\r\n\r\n /** The strength of the SSAO post-process. Default value is 1.0. */\r\n @editableInPropertyPage(\"Strength\", PropertyTypeForEdition.Float, \"SSAO\", { min: 0, max: 3 })\r\n public get totalStrength() {\r\n return this._frameGraphTask.ssao.totalStrength;\r\n }\r\n\r\n public set totalStrength(value: number) {\r\n this._frameGraphTask.ssao.totalStrength = value;\r\n }\r\n\r\n /** The base color of the SSAO post-process. The final result is \"base + ssao\" between [0, 1] */\r\n @editableInPropertyPage(\"Base\", PropertyTypeForEdition.Float, \"SSAO\", { min: 0, max: 1 })\r\n public get base() {\r\n return this._frameGraphTask.ssao.base;\r\n }\r\n\r\n public set base(value: number) {\r\n this._frameGraphTask.ssao.base = value;\r\n }\r\n\r\n /** Maximum depth value to still render AO. A smooth falloff makes the dimming more natural, so there will be no abrupt shading change. */\r\n @editableInPropertyPage(\"Max Z\", PropertyTypeForEdition.Float, \"SSAO\", { min: 0, max: 10000 })\r\n public get maxZ() {\r\n return this._frameGraphTask.ssao.maxZ;\r\n }\r\n\r\n public set maxZ(value: number) {\r\n this._frameGraphTask.ssao.maxZ = value;\r\n }\r\n\r\n /** In order to save performances, SSAO radius is clamped on close geometry. This ratio changes by how much. */\r\n @editableInPropertyPage(\"Min Z aspect\", PropertyTypeForEdition.Float, \"SSAO\", { min: 0, max: 0.5 })\r\n public get minZAspect() {\r\n return this._frameGraphTask.ssao.minZAspect;\r\n }\r\n\r\n public set minZAspect(value: number) {\r\n this._frameGraphTask.ssao.minZAspect = value;\r\n }\r\n\r\n /** The radius around the analyzed pixel used by the SSAO post-process. */\r\n @editableInPropertyPage(\"Radius\", PropertyTypeForEdition.Float, \"SSAO\", { min: 0, max: 10 })\r\n public get radius() {\r\n return this._frameGraphTask.ssao.radius;\r\n }\r\n\r\n public set radius(value: number) {\r\n this._frameGraphTask.ssao.radius = value;\r\n }\r\n\r\n /** Used in SSAO calculations to compensate for accuracy issues with depth values. */\r\n @editableInPropertyPage(\"Epsilon\", PropertyTypeForEdition.Float, \"SSAO\", { min: 0, max: 1 })\r\n public get epsilon() {\r\n return this._frameGraphTask.ssao.epsilon;\r\n }\r\n\r\n public set epsilon(value: number) {\r\n this._frameGraphTask.ssao.epsilon = value;\r\n }\r\n\r\n /** Indicates that the combine stage should use the current camera viewport to render the SSAO result on only a portion of the output texture. */\r\n @editableInPropertyPage(\"Use viewport in combine stage\", PropertyTypeForEdition.Boolean, \"SSAO\")\r\n public get useViewportInCombineStage() {\r\n return this._frameGraphTask.ssao.useViewportInCombineStage;\r\n }\r\n\r\n public set useViewportInCombineStage(value: boolean) {\r\n this._frameGraphTask.ssao.useViewportInCombineStage = value;\r\n }\r\n\r\n /** Skips the denoising (blur) stage of the SSAO calculations. */\r\n @editableInPropertyPage(\"Bypass blur\", PropertyTypeForEdition.Boolean, \"Blur\")\r\n public get bypassBlur() {\r\n return this._frameGraphTask.ssao.bypassBlur;\r\n }\r\n\r\n public set bypassBlur(value: boolean) {\r\n this._frameGraphTask.ssao.bypassBlur = value;\r\n }\r\n\r\n /** Enables the configurable bilateral denoising (blurring) filter. */\r\n @editableInPropertyPage(\"Expensive blur\", PropertyTypeForEdition.Boolean, \"Blur\")\r\n public get expensiveBlur() {\r\n return this._frameGraphTask.ssao.expensiveBlur;\r\n }\r\n\r\n public set expensiveBlur(value: boolean) {\r\n this._frameGraphTask.ssao.expensiveBlur = value;\r\n }\r\n\r\n /** The number of samples the bilateral filter uses in both dimensions when denoising the SSAO calculations. */\r\n @editableInPropertyPage(\"Samples\", PropertyTypeForEdition.Int, \"Blur\", { min: 1, max: 128 })\r\n public get bilateralSamples() {\r\n return this._frameGraphTask.ssao.bilateralSamples;\r\n }\r\n\r\n public set bilateralSamples(value: number) {\r\n this._frameGraphTask.ssao.bilateralSamples = value;\r\n }\r\n\r\n /** Controls the shape of the denoising kernel used by the bilateral filter. */\r\n @editableInPropertyPage(\"Soften\", PropertyTypeForEdition.Float, \"Blur\", { min: 0, max: 1 })\r\n public get bilateralSoften() {\r\n return this._frameGraphTask.ssao.bilateralSoften;\r\n }\r\n\r\n public set bilateralSoften(value: number) {\r\n this._frameGraphTask.ssao.bilateralSoften = value;\r\n }\r\n\r\n /** How forgiving the bilateral denoiser should be when rejecting samples. */\r\n @editableInPropertyPage(\"Tolerance\", PropertyTypeForEdition.Float, \"Blur\", { min: 0, max: 1 })\r\n public get bilateralTolerance() {\r\n return this._frameGraphTask.ssao.bilateralTolerance;\r\n }\r\n\r\n public set bilateralTolerance(value: number) {\r\n this._frameGraphTask.ssao.bilateralTolerance = value;\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"NodeRenderGraphSSAO2PostProcessBlock\";\r\n }\r\n\r\n /**\r\n * Gets the camera input component\r\n */\r\n public get camera(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the geometry depth input component\r\n */\r\n public get geomDepth(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[3];\r\n }\r\n\r\n /**\r\n * Gets the geometry normal input component\r\n */\r\n public get geomNormal(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[4];\r\n }\r\n\r\n protected override _buildBlock(state: NodeRenderGraphBuildState) {\r\n super._buildBlock(state);\r\n\r\n this._frameGraphTask.normalTexture = this.geomNormal.connectedPoint?.value as FrameGraphTextureHandle;\r\n this._frameGraphTask.depthTexture = this.geomDepth.connectedPoint?.value as FrameGraphTextureHandle;\r\n this._frameGraphTask.camera = this.camera.connectedPoint?.value as Camera;\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codes: string[] = [];\r\n codes.push(`${this._codeVariableName}.samples = ${this.samples};`);\r\n codes.push(`${this._codeVariableName}.totalStrength = ${this.totalStrength};`);\r\n codes.push(`${this._codeVariableName}.base = ${this.base};`);\r\n codes.push(`${this._codeVariableName}.maxZ = ${this.maxZ};`);\r\n codes.push(`${this._codeVariableName}.minZAspect = ${this.minZAspect};`);\r\n codes.push(`${this._codeVariableName}.radius = ${this.radius};`);\r\n codes.push(`${this._codeVariableName}.epsilon = ${this.epsilon};`);\r\n codes.push(`${this._codeVariableName}.useViewportInCombineStage = ${this.useViewportInCombineStage};`);\r\n codes.push(`${this._codeVariableName}.bypassBlur = ${this.bypassBlur};`);\r\n codes.push(`${this._codeVariableName}.expensiveBlur = ${this.expensiveBlur};`);\r\n codes.push(`${this._codeVariableName}.bilateralSamples = ${this.bilateralSamples};`);\r\n codes.push(`${this._codeVariableName}.bilateralSoften = ${this.bilateralSoften};`);\r\n codes.push(`${this._codeVariableName}.bilateralTolerance = ${this.bilateralTolerance};`);\r\n return super._dumpPropertiesCode() + codes.join(\"\\n\");\r\n }\r\n\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n serializationObject.samples = this.samples;\r\n serializationObject.totalStrength = this.totalStrength;\r\n serializationObject.base = this.base;\r\n serializationObject.maxZ = this.maxZ;\r\n serializationObject.minZAspect = this.minZAspect;\r\n serializationObject.radius = this.radius;\r\n serializationObject.epsilon = this.epsilon;\r\n serializationObject.useViewportInCombineStage = this.useViewportInCombineStage;\r\n serializationObject.bypassBlur = this.bypassBlur;\r\n serializationObject.expensiveBlur = this.expensiveBlur;\r\n serializationObject.bilateralSoften = this.bilateralSoften;\r\n serializationObject.bilateralSamples = this.bilateralSamples;\r\n serializationObject.bilateralTolerance = this.bilateralTolerance;\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n this.samples = serializationObject.samples;\r\n this.totalStrength = serializationObject.totalStrength;\r\n this.base = serializationObject.base;\r\n this.maxZ = serializationObject.maxZ;\r\n this.minZAspect = serializationObject.minZAspect;\r\n this.radius = serializationObject.radius;\r\n this.epsilon = serializationObject.epsilon;\r\n this.useViewportInCombineStage = serializationObject.useViewportInCombineStage;\r\n this.bypassBlur = serializationObject.bypassBlur;\r\n this.expensiveBlur = serializationObject.expensiveBlur;\r\n this.bilateralSoften = serializationObject.bilateralSoften;\r\n this.bilateralSamples = serializationObject.bilateralSamples;\r\n this.bilateralTolerance = serializationObject.bilateralTolerance;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.NodeRenderGraphSSAO2PostProcessBlock\", NodeRenderGraphSSAO2PostProcessBlock);\r\n"]}