@babylonjs/core 7.43.0 → 7.44.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (178) hide show
  1. package/Actions/actionEvent.d.ts +4 -4
  2. package/Buffers/bufferUtils.d.ts +8 -1
  3. package/Buffers/bufferUtils.js +15 -0
  4. package/Buffers/bufferUtils.js.map +1 -1
  5. package/Culling/Helper/boundingInfoHelper.d.ts +2 -9
  6. package/Culling/Helper/boundingInfoHelper.js +2 -9
  7. package/Culling/Helper/boundingInfoHelper.js.map +1 -1
  8. package/Engines/abstractEngine.js +2 -2
  9. package/Engines/abstractEngine.js.map +1 -1
  10. package/Engines/engine.d.ts +5 -2
  11. package/FlowGraph/flowGraphConnection.d.ts +1 -1
  12. package/FrameGraph/Node/Blocks/PostProcesses/basePostProcessBlock.d.ts +42 -0
  13. package/FrameGraph/Node/Blocks/PostProcesses/basePostProcessBlock.js +78 -0
  14. package/FrameGraph/Node/Blocks/PostProcesses/basePostProcessBlock.js.map +1 -0
  15. package/FrameGraph/Node/Blocks/PostProcesses/blackAndWhitePostProcessBlock.d.ts +3 -19
  16. package/FrameGraph/Node/Blocks/PostProcesses/blackAndWhitePostProcessBlock.js +3 -49
  17. package/FrameGraph/Node/Blocks/PostProcesses/blackAndWhitePostProcessBlock.js.map +1 -1
  18. package/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.d.ts +3 -19
  19. package/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.js +3 -49
  20. package/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.js.map +1 -1
  21. package/FrameGraph/Node/Blocks/PostProcesses/blurPostProcessBlock.d.ts +3 -19
  22. package/FrameGraph/Node/Blocks/PostProcesses/blurPostProcessBlock.js +3 -49
  23. package/FrameGraph/Node/Blocks/PostProcesses/blurPostProcessBlock.js.map +1 -1
  24. package/FrameGraph/Node/Blocks/PostProcesses/circleOfConfusionPostProcessBlock.d.ts +2 -17
  25. package/FrameGraph/Node/Blocks/PostProcesses/circleOfConfusionPostProcessBlock.js +3 -45
  26. package/FrameGraph/Node/Blocks/PostProcesses/circleOfConfusionPostProcessBlock.js.map +1 -1
  27. package/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.d.ts +2 -17
  28. package/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.js +3 -44
  29. package/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.js.map +1 -1
  30. package/FrameGraph/Node/Blocks/PostProcesses/extractHighlightsPostProcessBlock.d.ts +3 -19
  31. package/FrameGraph/Node/Blocks/PostProcesses/extractHighlightsPostProcessBlock.js +3 -49
  32. package/FrameGraph/Node/Blocks/PostProcesses/extractHighlightsPostProcessBlock.js.map +1 -1
  33. package/FrameGraph/Node/Blocks/PostProcesses/passPostProcessBlock.d.ts +47 -0
  34. package/FrameGraph/Node/Blocks/PostProcesses/passPostProcessBlock.js +65 -0
  35. package/FrameGraph/Node/Blocks/PostProcesses/passPostProcessBlock.js.map +1 -0
  36. package/FrameGraph/Node/Blocks/index.d.ts +1 -0
  37. package/FrameGraph/Node/Blocks/index.js +1 -0
  38. package/FrameGraph/Node/Blocks/index.js.map +1 -1
  39. package/FrameGraph/Tasks/PostProcesses/passTask.d.ts +29 -0
  40. package/FrameGraph/Tasks/PostProcesses/passTask.js +31 -0
  41. package/FrameGraph/Tasks/PostProcesses/passTask.js.map +1 -0
  42. package/FrameGraph/frameGraphTextureManager.d.ts +1 -1
  43. package/FrameGraph/index.d.ts +1 -0
  44. package/FrameGraph/index.js +1 -0
  45. package/FrameGraph/index.js.map +1 -1
  46. package/Gizmos/planeRotationGizmo.js +10 -0
  47. package/Gizmos/planeRotationGizmo.js.map +1 -1
  48. package/Inputs/scene.inputManager.js +2 -2
  49. package/Inputs/scene.inputManager.js.map +1 -1
  50. package/Materials/GreasedLine/greasedLinePluginMaterial.d.ts +6 -2
  51. package/Materials/GreasedLine/greasedLinePluginMaterial.js +8 -2
  52. package/Materials/GreasedLine/greasedLinePluginMaterial.js.map +1 -1
  53. package/Materials/GreasedLine/greasedLinePluginMaterialShadersWGSL.js +11 -3
  54. package/Materials/GreasedLine/greasedLinePluginMaterialShadersWGSL.js.map +1 -1
  55. package/Materials/GreasedLine/greasedLineSimpleMaterial.d.ts +1 -0
  56. package/Materials/GreasedLine/greasedLineSimpleMaterial.js +1 -0
  57. package/Materials/GreasedLine/greasedLineSimpleMaterial.js.map +1 -1
  58. package/Materials/Node/Blocks/PBR/reflectionBlock.js +1 -3
  59. package/Materials/Node/Blocks/PBR/reflectionBlock.js.map +1 -1
  60. package/Materials/Node/Blocks/PBR/subSurfaceBlock.js +3 -3
  61. package/Materials/Node/Blocks/PBR/subSurfaceBlock.js.map +1 -1
  62. package/Materials/Node/nodeMaterial.d.ts +4 -2
  63. package/Materials/Node/nodeMaterial.js +7 -5
  64. package/Materials/Node/nodeMaterial.js.map +1 -1
  65. package/Materials/PBR/pbrBaseMaterial.js +1 -0
  66. package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
  67. package/Materials/Textures/Filtering/hdrFiltering.js +1 -0
  68. package/Materials/Textures/Filtering/hdrFiltering.js.map +1 -1
  69. package/Materials/Textures/Filtering/hdrIrradianceFiltering.d.ts +69 -0
  70. package/Materials/Textures/Filtering/hdrIrradianceFiltering.js +187 -0
  71. package/Materials/Textures/Filtering/hdrIrradianceFiltering.js.map +1 -0
  72. package/Materials/Textures/hdrCubeTexture.d.ts +5 -1
  73. package/Materials/Textures/hdrCubeTexture.js +29 -3
  74. package/Materials/Textures/hdrCubeTexture.js.map +1 -1
  75. package/Materials/Textures/index.d.ts +4 -0
  76. package/Materials/Textures/index.js +4 -0
  77. package/Materials/Textures/index.js.map +1 -1
  78. package/Materials/standardMaterial.d.ts +1 -2
  79. package/Materials/standardMaterial.js +0 -2
  80. package/Materials/standardMaterial.js.map +1 -1
  81. package/Meshes/Builders/planeBuilder.js +2 -2
  82. package/Meshes/Builders/planeBuilder.js.map +1 -1
  83. package/Meshes/Compression/dracoCodec.d.ts +4 -4
  84. package/Meshes/Compression/dracoCodec.js.map +1 -1
  85. package/Meshes/Compression/dracoCompression.d.ts +1 -1
  86. package/Meshes/Compression/dracoCompression.js.map +1 -1
  87. package/Meshes/Compression/dracoCompressionWorker.d.ts +16 -30
  88. package/Meshes/Compression/dracoCompressionWorker.js +128 -22
  89. package/Meshes/Compression/dracoCompressionWorker.js.map +1 -1
  90. package/Meshes/Compression/dracoDecoder.d.ts +4 -9
  91. package/Meshes/Compression/dracoDecoder.js +5 -5
  92. package/Meshes/Compression/dracoDecoder.js.map +1 -1
  93. package/Meshes/Compression/dracoDecoder.types.d.ts +52 -0
  94. package/Meshes/Compression/dracoDecoder.types.js +2 -0
  95. package/Meshes/Compression/dracoDecoder.types.js.map +1 -0
  96. package/Meshes/Compression/dracoEncoder.d.ts +91 -0
  97. package/Meshes/Compression/dracoEncoder.js +239 -0
  98. package/Meshes/Compression/dracoEncoder.js.map +1 -0
  99. package/Meshes/Compression/dracoEncoder.types.d.ts +82 -0
  100. package/Meshes/Compression/dracoEncoder.types.js +2 -0
  101. package/Meshes/Compression/dracoEncoder.types.js.map +1 -0
  102. package/Meshes/Compression/index.d.ts +1 -0
  103. package/Meshes/Compression/index.js +1 -0
  104. package/Meshes/Compression/index.js.map +1 -1
  105. package/Meshes/GaussianSplatting/gaussianSplattingMesh.d.ts +92 -2
  106. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +286 -10
  107. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
  108. package/Meshes/GreasedLine/greasedLineBaseMesh.js +4 -2
  109. package/Meshes/GreasedLine/greasedLineBaseMesh.js.map +1 -1
  110. package/Meshes/GreasedLine/greasedLineRibbonMesh.js +1 -1
  111. package/Meshes/GreasedLine/greasedLineRibbonMesh.js.map +1 -1
  112. package/Meshes/Node/Blocks/Textures/geometryTextureBlock.d.ts +1 -1
  113. package/Meshes/mesh.d.ts +2 -2
  114. package/Meshes/transformNode.js +2 -0
  115. package/Meshes/transformNode.js.map +1 -1
  116. package/Misc/decorators.serialization.js +2 -0
  117. package/Misc/decorators.serialization.js.map +1 -1
  118. package/Misc/greasedLineTools.d.ts +1 -1
  119. package/Misc/logger.d.ts +2 -1
  120. package/Misc/logger.js +2 -1
  121. package/Misc/logger.js.map +1 -1
  122. package/Morph/morphTargetManager.d.ts +1 -0
  123. package/Morph/morphTargetManager.js +6 -1
  124. package/Morph/morphTargetManager.js.map +1 -1
  125. package/Particles/pointsCloudSystem.d.ts +3 -3
  126. package/Physics/v2/Plugins/havokPlugin.d.ts +2 -2
  127. package/PostProcesses/index.d.ts +1 -0
  128. package/PostProcesses/index.js +1 -0
  129. package/PostProcesses/index.js.map +1 -1
  130. package/PostProcesses/passPostProcess.d.ts +2 -3
  131. package/PostProcesses/passPostProcess.js +36 -48
  132. package/PostProcesses/passPostProcess.js.map +1 -1
  133. package/PostProcesses/thinPassPostProcess.d.ts +48 -0
  134. package/PostProcesses/thinPassPostProcess.js +113 -0
  135. package/PostProcesses/thinPassPostProcess.js.map +1 -0
  136. package/Rendering/IBLShadows/iblShadowsVoxelTracingPass.js +1 -1
  137. package/Rendering/IBLShadows/iblShadowsVoxelTracingPass.js.map +1 -1
  138. package/Rendering/iblCdfGenerator.d.ts +13 -5
  139. package/Rendering/iblCdfGenerator.js +67 -10
  140. package/Rendering/iblCdfGenerator.js.map +1 -1
  141. package/Shaders/ShadersInclude/gaussianSplatting.js +6 -6
  142. package/Shaders/ShadersInclude/gaussianSplatting.js.map +1 -1
  143. package/Shaders/ShadersInclude/pbrBlockReflection.js +13 -8
  144. package/Shaders/ShadersInclude/pbrBlockReflection.js.map +1 -1
  145. package/Shaders/gaussianSplatting.vertex.js +2 -1
  146. package/Shaders/gaussianSplatting.vertex.js.map +1 -1
  147. package/Shaders/hdrIrradianceFiltering.fragment.d.ts +9 -0
  148. package/Shaders/hdrIrradianceFiltering.fragment.js +25 -0
  149. package/Shaders/hdrIrradianceFiltering.fragment.js.map +1 -0
  150. package/Shaders/hdrIrradianceFiltering.vertex.d.ts +5 -0
  151. package/Shaders/hdrIrradianceFiltering.vertex.js +15 -0
  152. package/Shaders/hdrIrradianceFiltering.vertex.js.map +1 -0
  153. package/Shaders/pbr.fragment.js +1 -3
  154. package/Shaders/pbr.fragment.js.map +1 -1
  155. package/ShadersWGSL/ShadersInclude/pbrBlockReflection.js +13 -8
  156. package/ShadersWGSL/ShadersInclude/pbrBlockReflection.js.map +1 -1
  157. package/ShadersWGSL/greasedLine.fragment.js +9 -3
  158. package/ShadersWGSL/greasedLine.fragment.js.map +1 -1
  159. package/ShadersWGSL/greasedLine.vertex.js +12 -2
  160. package/ShadersWGSL/greasedLine.vertex.js.map +1 -1
  161. package/ShadersWGSL/hdrIrradianceFiltering.fragment.d.ts +9 -0
  162. package/ShadersWGSL/hdrIrradianceFiltering.fragment.js +26 -0
  163. package/ShadersWGSL/hdrIrradianceFiltering.fragment.js.map +1 -0
  164. package/ShadersWGSL/hdrIrradianceFiltering.vertex.d.ts +5 -0
  165. package/ShadersWGSL/hdrIrradianceFiltering.vertex.js +16 -0
  166. package/ShadersWGSL/hdrIrradianceFiltering.vertex.js.map +1 -0
  167. package/ShadersWGSL/outline.fragment.js +1 -1
  168. package/ShadersWGSL/outline.fragment.js.map +1 -1
  169. package/ShadersWGSL/passCube.fragment.js +1 -1
  170. package/ShadersWGSL/passCube.fragment.js.map +1 -1
  171. package/ShadersWGSL/pbr.fragment.js +1 -3
  172. package/ShadersWGSL/pbr.fragment.js.map +1 -1
  173. package/XR/features/WebXRDepthSensing.d.ts +24 -2
  174. package/XR/features/WebXRDepthSensing.js +320 -26
  175. package/XR/features/WebXRDepthSensing.js.map +1 -1
  176. package/package.json +1 -1
  177. package/scene.js +9 -5
  178. package/scene.js.map +1 -1
@@ -470,7 +470,7 @@ export declare class Engine extends ThinEngine {
470
470
  /**
471
471
  * @internal
472
472
  */
473
- _readPixelsAsync(x: number, y: number, w: number, h: number, format: number, type: number, outputBuffer: ArrayBufferView): Promise<ArrayBufferView> | null;
473
+ _readPixelsAsync(x: number, y: number, w: number, h: number, format: number, type: number, outputBuffer: ArrayBufferView): Promise<ArrayBufferView<ArrayBufferLike>> | null;
474
474
  dispose(): void;
475
475
  }
476
476
 
@@ -1706,7 +1706,7 @@ interface XRLightProbe extends EventTarget {
1706
1706
  */
1707
1707
 
1708
1708
  type XRDepthUsage = "cpu-optimized" | "gpu-optimized";
1709
- type XRDepthDataFormat = "luminance-alpha" | "float32";
1709
+ type XRDepthDataFormat = "luminance-alpha" | "float32" | "unsigned-short";
1710
1710
 
1711
1711
  type XRDepthStateInit = {
1712
1712
  readonly usagePreference: XRDepthUsage[];
@@ -1742,6 +1742,9 @@ interface XRFrame {
1742
1742
 
1743
1743
  interface XRWebGLDepthInformation extends XRDepthInformation {
1744
1744
  readonly texture: WebGLTexture;
1745
+
1746
+ readonly textureType: XRTextureType;
1747
+ readonly imageIndex?: number | undefined;
1745
1748
  }
1746
1749
 
1747
1750
  interface XRWebGLBinding {
@@ -98,5 +98,5 @@ export declare class FlowGraphConnection<BlockT, ConnectedToT extends IConnectab
98
98
  * @param ownerBlock the block that owns the connection.
99
99
  * @returns the parsed connection.
100
100
  */
101
- static Parse(serializationObject: any, ownerBlock: FlowGraphBlock): any;
101
+ static Parse(serializationObject: any | undefined, ownerBlock: FlowGraphBlock): any;
102
102
  }
@@ -0,0 +1,42 @@
1
+ import type { NodeRenderGraphConnectionPoint, Scene, NodeRenderGraphBuildState, FrameGraphTextureHandle, FrameGraph, FrameGraphTask } from "../../../../index.js";
2
+ import { NodeRenderGraphBlock } from "../../nodeRenderGraphBlock";
3
+ interface IPostProcessLike {
4
+ sourceSamplingMode: number;
5
+ sourceTexture: FrameGraphTextureHandle;
6
+ destinationTexture?: FrameGraphTextureHandle;
7
+ outputTexture: FrameGraphTextureHandle;
8
+ }
9
+ /**
10
+ * @internal
11
+ */
12
+ export declare class NodeRenderGraphBasePostProcessBlock extends NodeRenderGraphBlock {
13
+ protected _frameGraphTask: IPostProcessLike & FrameGraphTask;
14
+ /**
15
+ * Create a new NodeRenderGraphBasePostProcessBlock
16
+ * @param name defines the block name
17
+ * @param frameGraph defines the hosting frame graph
18
+ * @param scene defines the hosting scene
19
+ */
20
+ constructor(name: string, frameGraph: FrameGraph, scene: Scene);
21
+ protected _finalizeInputOutputRegistering(): void;
22
+ /** Sampling mode used to sample from the source texture */
23
+ get sourceSamplingMode(): number;
24
+ set sourceSamplingMode(value: number);
25
+ /**
26
+ * Gets the source input component
27
+ */
28
+ get source(): NodeRenderGraphConnectionPoint;
29
+ /**
30
+ * Gets the destination input component
31
+ */
32
+ get destination(): NodeRenderGraphConnectionPoint;
33
+ /**
34
+ * Gets the output component
35
+ */
36
+ get output(): NodeRenderGraphConnectionPoint;
37
+ protected _buildBlock(state: NodeRenderGraphBuildState): void;
38
+ protected _dumpPropertiesCode(): string;
39
+ serialize(): any;
40
+ _deserialize(serializationObject: any): void;
41
+ }
42
+ export {};
@@ -0,0 +1,78 @@
1
+ import { __decorate } from "../../../../tslib.es6.js";
2
+ import { NodeRenderGraphBlock } from "../../nodeRenderGraphBlock.js";
3
+ import { NodeRenderGraphBlockConnectionPointTypes } from "../../Types/nodeRenderGraphTypes.js";
4
+ import { editableInPropertyPage } from "../../../../Decorators/nodeDecorator.js";
5
+ /**
6
+ * @internal
7
+ */
8
+ export class NodeRenderGraphBasePostProcessBlock extends NodeRenderGraphBlock {
9
+ /**
10
+ * Create a new NodeRenderGraphBasePostProcessBlock
11
+ * @param name defines the block name
12
+ * @param frameGraph defines the hosting frame graph
13
+ * @param scene defines the hosting scene
14
+ */
15
+ constructor(name, frameGraph, scene) {
16
+ super(name, frameGraph, scene);
17
+ this.registerInput("source", NodeRenderGraphBlockConnectionPointTypes.Texture);
18
+ this.registerInput("destination", NodeRenderGraphBlockConnectionPointTypes.Texture, true);
19
+ this.source.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);
20
+ this.destination.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAll);
21
+ }
22
+ _finalizeInputOutputRegistering() {
23
+ this._addDependenciesInput();
24
+ this.registerOutput("output", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);
25
+ this.output._typeConnectionSource = () => {
26
+ return this.destination.isConnected ? this.destination : this.source;
27
+ };
28
+ }
29
+ /** Sampling mode used to sample from the source texture */
30
+ get sourceSamplingMode() {
31
+ return this._frameGraphTask.sourceSamplingMode;
32
+ }
33
+ set sourceSamplingMode(value) {
34
+ this._frameGraphTask.sourceSamplingMode = value;
35
+ }
36
+ /**
37
+ * Gets the source input component
38
+ */
39
+ get source() {
40
+ return this._inputs[0];
41
+ }
42
+ /**
43
+ * Gets the destination input component
44
+ */
45
+ get destination() {
46
+ return this._inputs[1];
47
+ }
48
+ /**
49
+ * Gets the output component
50
+ */
51
+ get output() {
52
+ return this._outputs[0];
53
+ }
54
+ _buildBlock(state) {
55
+ super._buildBlock(state);
56
+ this.output.value = this._frameGraphTask.outputTexture;
57
+ this._frameGraphTask.sourceTexture = this.source.connectedPoint?.value;
58
+ this._frameGraphTask.destinationTexture = this.destination.connectedPoint?.value;
59
+ }
60
+ _dumpPropertiesCode() {
61
+ const codes = [];
62
+ codes.push(`${this._codeVariableName}.sourceSamplingMode = ${this.sourceSamplingMode};`);
63
+ return super._dumpPropertiesCode() + codes.join("\n");
64
+ }
65
+ serialize() {
66
+ const serializationObject = super.serialize();
67
+ serializationObject.sourceSamplingMode = this.sourceSamplingMode;
68
+ return serializationObject;
69
+ }
70
+ _deserialize(serializationObject) {
71
+ super._deserialize(serializationObject);
72
+ this.sourceSamplingMode = serializationObject.sourceSamplingMode;
73
+ }
74
+ }
75
+ __decorate([
76
+ editableInPropertyPage("Source sampling mode", 6 /* PropertyTypeForEdition.SamplingMode */, "PROPERTIES")
77
+ ], NodeRenderGraphBasePostProcessBlock.prototype, "sourceSamplingMode", null);
78
+ //# sourceMappingURL=basePostProcessBlock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"basePostProcessBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FrameGraph/Node/Blocks/PostProcesses/basePostProcessBlock.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,wCAAwC,EAAE,MAAM,kCAAkC,CAAC;AAC5F,OAAO,EAAE,sBAAsB,EAA0B,MAAM,sCAAsC,CAAC;AAStG;;GAEG;AACH,MAAM,OAAO,mCAAoC,SAAQ,oBAAoB;IAGzE;;;;;OAKG;IACH,YAAmB,IAAY,EAAE,UAAsB,EAAE,KAAY;QACjE,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;QAE/B,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,wCAAwC,CAAC,OAAO,CAAC,CAAC;QAC/E,IAAI,CAAC,aAAa,CAAC,aAAa,EAAE,wCAAwC,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAE1F,IAAI,CAAC,MAAM,CAAC,+BAA+B,CAAC,wCAAwC,CAAC,uBAAuB,CAAC,CAAC;QAC9G,IAAI,CAAC,WAAW,CAAC,+BAA+B,CAAC,wCAAwC,CAAC,UAAU,CAAC,CAAC;IAC1G,CAAC;IAES,+BAA+B;QACrC,IAAI,CAAC,qBAAqB,EAAE,CAAC;QAC7B,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,wCAAwC,CAAC,YAAY,CAAC,CAAC;QAErF,IAAI,CAAC,MAAM,CAAC,qBAAqB,GAAG,GAAG,EAAE;YACrC,OAAO,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC;QACzE,CAAC,CAAC;IACN,CAAC;IAED,2DAA2D;IAE3D,IAAW,kBAAkB;Q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Ee,YAAY,CAAC,mBAAwB;QACjD,KAAK,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;QACxC,IAAI,CAAC,kBAAkB,GAAG,mBAAmB,CAAC,kBAAkB,CAAC;IACrE,CAAC;CACJ;AAtDG;IADC,sBAAsB,CAAC,sBAAsB,+CAAuC,YAAY,CAAC;6EAGjG","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { NodeRenderGraphConnectionPoint, Scene, NodeRenderGraphBuildState, FrameGraphTextureHandle, FrameGraph, FrameGraphTask } from \"core/index\";\r\nimport { NodeRenderGraphBlock } from \"../../nodeRenderGraphBlock\";\r\nimport { NodeRenderGraphBlockConnectionPointTypes } from \"../../Types/nodeRenderGraphTypes\";\r\nimport { editableInPropertyPage, PropertyTypeForEdition } from \"../../../../Decorators/nodeDecorator\";\r\n\r\ninterface IPostProcessLike {\r\n sourceSamplingMode: number;\r\n sourceTexture: FrameGraphTextureHandle;\r\n destinationTexture?: FrameGraphTextureHandle;\r\n outputTexture: FrameGraphTextureHandle;\r\n}\r\n\r\n/**\r\n * @internal\r\n */\r\nexport class NodeRenderGraphBasePostProcessBlock extends NodeRenderGraphBlock {\r\n protected override _frameGraphTask: IPostProcessLike & FrameGraphTask;\r\n\r\n /**\r\n * Create a new NodeRenderGraphBasePostProcessBlock\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 */\r\n public constructor(name: string, frameGraph: FrameGraph, scene: Scene) {\r\n super(name, frameGraph, scene);\r\n\r\n this.registerInput(\"source\", NodeRenderGraphBlockConnectionPointTypes.Texture);\r\n this.registerInput(\"destination\", NodeRenderGraphBlockConnectionPointTypes.Texture, true);\r\n\r\n this.source.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);\r\n this.destination.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAll);\r\n }\r\n\r\n protected _finalizeInputOutputRegistering() {\r\n this._addDependenciesInput();\r\n this.registerOutput(\"output\", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this.output._typeConnectionSource = () => {\r\n return this.destination.isConnected ? this.destination : this.source;\r\n };\r\n }\r\n\r\n /** Sampling mode used to sample from the source texture */\r\n @editableInPropertyPage(\"Source sampling mode\", PropertyTypeForEdition.SamplingMode, \"PROPERTIES\")\r\n public get sourceSamplingMode() {\r\n return this._frameGraphTask.sourceSamplingMode;\r\n }\r\n\r\n public set sourceSamplingMode(value: number) {\r\n this._frameGraphTask.sourceSamplingMode = value;\r\n }\r\n\r\n /**\r\n * Gets the source input component\r\n */\r\n public get source(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the destination input component\r\n */\r\n public get destination(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[1];\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.sourceTexture = this.source.connectedPoint?.value as FrameGraphTextureHandle;\r\n this._frameGraphTask.destinationTexture = this.destination.connectedPoint?.value as FrameGraphTextureHandle;\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codes: string[] = [];\r\n codes.push(`${this._codeVariableName}.sourceSamplingMode = ${this.sourceSamplingMode};`);\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.sourceSamplingMode = this.sourceSamplingMode;\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n this.sourceSamplingMode = serializationObject.sourceSamplingMode;\r\n }\r\n}\r\n"]}
@@ -1,10 +1,10 @@
1
- import type { NodeRenderGraphConnectionPoint, Scene, NodeRenderGraphBuildState, FrameGraph } from "../../../../index.js";
2
- import { NodeRenderGraphBlock } from "../../nodeRenderGraphBlock";
1
+ import type { Scene, FrameGraph } from "../../../../index.js";
3
2
  import { FrameGraphBlackAndWhiteTask } from "../../../Tasks/PostProcesses/blackAndWhiteTask.js";
3
+ import { NodeRenderGraphBasePostProcessBlock } from "./basePostProcessBlock";
4
4
  /**
5
5
  * Block that implements the black and white post process
6
6
  */
7
- export declare class NodeRenderGraphBlackAndWhitePostProcessBlock extends NodeRenderGraphBlock {
7
+ export declare class NodeRenderGraphBlackAndWhitePostProcessBlock extends NodeRenderGraphBasePostProcessBlock {
8
8
  protected _frameGraphTask: FrameGraphBlackAndWhiteTask;
9
9
  /**
10
10
  * Gets the frame graph task associated with this block
@@ -17,9 +17,6 @@ export declare class NodeRenderGraphBlackAndWhitePostProcessBlock extends NodeRe
17
17
  * @param scene defines the hosting scene
18
18
  */
19
19
  constructor(name: string, frameGraph: FrameGraph, scene: Scene);
20
- /** Sampling mode used to sample from the source texture */
21
- get sourceSamplingMode(): number;
22
- set sourceSamplingMode(value: number);
23
20
  /** Degree of conversion to black and white (default: 1 - full b&w conversion) */
24
21
  get degree(): number;
25
22
  set degree(value: number);
@@ -28,19 +25,6 @@ export declare class NodeRenderGraphBlackAndWhitePostProcessBlock extends NodeRe
28
25
  * @returns the class name
29
26
  */
30
27
  getClassName(): string;
31
- /**
32
- * Gets the source input component
33
- */
34
- get source(): NodeRenderGraphConnectionPoint;
35
- /**
36
- * Gets the destination input component
37
- */
38
- get destination(): NodeRenderGraphConnectionPoint;
39
- /**
40
- * Gets the output component
41
- */
42
- get output(): NodeRenderGraphConnectionPoint;
43
- protected _buildBlock(state: NodeRenderGraphBuildState): void;
44
28
  protected _dumpPropertiesCode(): string;
45
29
  serialize(): any;
46
30
  _deserialize(serializationObject: any): void;
@@ -1,14 +1,13 @@
1
1
  import { __decorate } from "../../../../tslib.es6.js";
2
- import { NodeRenderGraphBlock } from "../../nodeRenderGraphBlock.js";
3
2
  import { RegisterClass } from "../../../../Misc/typeStore.js";
4
- import { NodeRenderGraphBlockConnectionPointTypes } from "../../Types/nodeRenderGraphTypes.js";
5
3
  import { editableInPropertyPage } from "../../../../Decorators/nodeDecorator.js";
6
4
  import { FrameGraphBlackAndWhiteTask } from "../../../Tasks/PostProcesses/blackAndWhiteTask.js";
7
5
  import { ThinBlackAndWhitePostProcess } from "../../../../PostProcesses/thinBlackAndWhitePostProcess.js";
6
+ import { NodeRenderGraphBasePostProcessBlock } from "./basePostProcessBlock.js";
8
7
  /**
9
8
  * Block that implements the black and white post process
10
9
  */
11
- export class NodeRenderGraphBlackAndWhitePostProcessBlock extends NodeRenderGraphBlock {
10
+ export class NodeRenderGraphBlackAndWhitePostProcessBlock extends NodeRenderGraphBasePostProcessBlock {
12
11
  /**
13
12
  * Gets the frame graph task associated with this block
14
13
  */
@@ -23,24 +22,9 @@ export class NodeRenderGraphBlackAndWhitePostProcessBlock extends NodeRenderGrap
23
22
  */
24
23
  constructor(name, frameGraph, scene) {
25
24
  super(name, frameGraph, scene);
26
- this.registerInput("source", NodeRenderGraphBlockConnectionPointTypes.Texture);
27
- this.registerInput("destination", NodeRenderGraphBlockConnectionPointTypes.Texture, true);
28
- this._addDependenciesInput();
29
- this.registerOutput("output", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);
30
- this.source.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);
31
- this.destination.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAll);
32
- this.output._typeConnectionSource = () => {
33
- return this.destination.isConnected ? this.destination : this.source;
34
- };
25
+ this._finalizeInputOutputRegistering();
35
26
  this._frameGraphTask = new FrameGraphBlackAndWhiteTask(this.name, frameGraph, new ThinBlackAndWhitePostProcess(name, scene.getEngine()));
36
27
  }
37
- /** Sampling mode used to sample from the source texture */
38
- get sourceSamplingMode() {
39
- return this._frameGraphTask.sourceSamplingMode;
40
- }
41
- set sourceSamplingMode(value) {
42
- this._frameGraphTask.sourceSamplingMode = value;
43
- }
44
28
  /** Degree of conversion to black and white (default: 1 - full b&w conversion) */
45
29
  get degree() {
46
30
  return this._frameGraphTask.postProcess.degree;
@@ -55,51 +39,21 @@ export class NodeRenderGraphBlackAndWhitePostProcessBlock extends NodeRenderGrap
55
39
  getClassName() {
56
40
  return "NodeRenderGraphBlackAndWhitePostProcessBlock";
57
41
  }
58
- /**
59
- * Gets the source input component
60
- */
61
- get source() {
62
- return this._inputs[0];
63
- }
64
- /**
65
- * Gets the destination input component
66
- */
67
- get destination() {
68
- return this._inputs[1];
69
- }
70
- /**
71
- * Gets the output component
72
- */
73
- get output() {
74
- return this._outputs[0];
75
- }
76
- _buildBlock(state) {
77
- super._buildBlock(state);
78
- this.output.value = this._frameGraphTask.outputTexture; // the value of the output connection point is the "output" texture of the task
79
- this._frameGraphTask.sourceTexture = this.source.connectedPoint?.value;
80
- this._frameGraphTask.destinationTexture = this.destination.connectedPoint?.value;
81
- }
82
42
  _dumpPropertiesCode() {
83
43
  const codes = [];
84
44
  codes.push(`${this._codeVariableName}.degree = ${this.degree};`);
85
- codes.push(`${this._codeVariableName}.sourceSamplingMode = ${this.sourceSamplingMode};`);
86
45
  return super._dumpPropertiesCode() + codes.join("\n");
87
46
  }
88
47
  serialize() {
89
48
  const serializationObject = super.serialize();
90
49
  serializationObject.degree = this.degree;
91
- serializationObject.sourceSamplingMode = this.sourceSamplingMode;
92
50
  return serializationObject;
93
51
  }
94
52
  _deserialize(serializationObject) {
95
53
  super._deserialize(serializationObject);
96
54
  this.degree = serializationObject.degree;
97
- this.sourceSamplingMode = serializationObject.sourceSamplingMode;
98
55
  }
99
56
  }
100
- __decorate([
101
- editableInPropertyPage("Source sampling mode", 6 /* PropertyTypeForEdition.SamplingMode */, "PROPERTIES")
102
- ], NodeRenderGraphBlackAndWhitePostProcessBlock.prototype, "sourceSamplingMode", null);
103
57
  __decorate([
104
58
  editableInPropertyPage("Degree", 1 /* PropertyTypeForEdition.Float */, "PROPERTIES", { min: 0, max: 1 })
105
59
  ], NodeRenderGraphBlackAndWhitePostProcessBlock.prototype, "degree", null);
@@ -1 +1 @@
1
- {"version":3,"file":"blackAndWhitePostProcessBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FrameGraph/Node/Blocks/PostProcesses/blackAndWhitePostProcessBlock.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,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,2BAA2B,EAAE,0DAA8D;AACpG,OAAO,EAAE,4BAA4B,EAAE,kEAAwD;AAE/F;;GAEG;AACH,MAAM,OAAO,4CAA6C,SAAQ,oBAAoB;IAGlF;;OAEG;IACH,IAAoB,IAAI;QACpB,OAAO,IAAI,CAAC,eAAe,CAAC;IAChC,CAAC;IAED;;;;;OAKG;IACH,YAAmB,IAAY,EAAE,UAAsB,EAAE,KAAY;QACjE,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;QAE/B,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,wCAAwC,CAAC,OAAO,CAAC,CAAC;QAC/E,IAAI,CAAC,aAAa,CAAC,aAAa,EAAE,wCAAwC,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAC1F,IAAI,CAAC,qBAAqB,EAAE,CAAC;QAC7B,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,wCAAwC,CAAC,YAAY,CAAC,CAAC;QAErF,IAAI,CAAC,MAAM,CAAC,+BAA+B,CAAC,wCAAwC,CAAC,uBAAuB,CAAC,CAAC;QAC9G,IAAI,CAAC,WAAW,CAAC,+BAA+B,CAA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AAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;0EAGhG;AAiEL,aAAa,CAAC,sDAAsD,EAAE,4CAA4C,CAAC,CAAC","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { NodeRenderGraphConnectionPoint, Scene, NodeRenderGraphBuildState, FrameGraphTextureHandle, FrameGraph } from \"core/index\";\r\nimport { NodeRenderGraphBlock } from \"../../nodeRenderGraphBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { NodeRenderGraphBlockConnectionPointTypes } from \"../../Types/nodeRenderGraphTypes\";\r\nimport { editableInPropertyPage, PropertyTypeForEdition } from \"../../../../Decorators/nodeDecorator\";\r\nimport { FrameGraphBlackAndWhiteTask } from \"core/FrameGraph/Tasks/PostProcesses/blackAndWhiteTask\";\r\nimport { ThinBlackAndWhitePostProcess } from \"core/PostProcesses/thinBlackAndWhitePostProcess\";\r\n\r\n/**\r\n * Block that implements the black and white post process\r\n */\r\nexport class NodeRenderGraphBlackAndWhitePostProcessBlock extends NodeRenderGraphBlock {\r\n protected override _frameGraphTask: FrameGraphBlackAndWhiteTask;\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 BlackAndWhitePostProcessBlock\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 */\r\n public constructor(name: string, frameGraph: FrameGraph, scene: Scene) {\r\n super(name, frameGraph, scene);\r\n\r\n this.registerInput(\"source\", NodeRenderGraphBlockConnectionPointTypes.Texture);\r\n this.registerInput(\"destination\", NodeRenderGraphBlockConnectionPointTypes.Texture, true);\r\n this._addDependenciesInput();\r\n this.registerOutput(\"output\", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this.source.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);\r\n this.destination.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAll);\r\n this.output._typeConnectionSource = () => {\r\n return this.destination.isConnected ? this.destination : this.source;\r\n };\r\n\r\n this._frameGraphTask = new FrameGraphBlackAndWhiteTask(this.name, frameGraph, new ThinBlackAndWhitePostProcess(name, scene.getEngine()));\r\n }\r\n\r\n /** Sampling mode used to sample from the source texture */\r\n @editableInPropertyPage(\"Source sampling mode\", PropertyTypeForEdition.SamplingMode, \"PROPERTIES\")\r\n public get sourceSamplingMode() {\r\n return this._frameGraphTask.sourceSamplingMode;\r\n }\r\n\r\n public set sourceSamplingMode(value: number) {\r\n this._frameGraphTask.sourceSamplingMode = value;\r\n }\r\n\r\n /** Degree of conversion to black and white (default: 1 - full b&w conversion) */\r\n @editableInPropertyPage(\"Degree\", PropertyTypeForEdition.Float, \"PROPERTIES\", { min: 0, max: 1 })\r\n public get degree(): number {\r\n return this._frameGraphTask.postProcess.degree;\r\n }\r\n\r\n public set degree(value: number) {\r\n this._frameGraphTask.postProcess.degree = 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 \"NodeRenderGraphBlackAndWhitePostProcessBlock\";\r\n }\r\n\r\n /**\r\n * Gets the source input component\r\n */\r\n public get source(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the destination input component\r\n */\r\n public get destination(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[1];\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; // the value of the output connection point is the \"output\" texture of the task\r\n\r\n this._frameGraphTask.sourceTexture = this.source.connectedPoint?.value as FrameGraphTextureHandle;\r\n this._frameGraphTask.destinationTexture = this.destination.connectedPoint?.value as FrameGraphTextureHandle;\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codes: string[] = [];\r\n codes.push(`${this._codeVariableName}.degree = ${this.degree};`);\r\n codes.push(`${this._codeVariableName}.sourceSamplingMode = ${this.sourceSamplingMode};`);\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.degree = this.degree;\r\n serializationObject.sourceSamplingMode = this.sourceSamplingMode;\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n this.degree = serializationObject.degree;\r\n this.sourceSamplingMode = serializationObject.sourceSamplingMode;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.NodeRenderGraphBlackAndWhitePostProcessBlock\", NodeRenderGraphBlackAndWhitePostProcessBlock);\r\n"]}
1
+ {"version":3,"file":"blackAndWhitePostProcessBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FrameGraph/Node/Blocks/PostProcesses/blackAndWhitePostProcessBlock.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAA0B,MAAM,sCAAsC,CAAC;AACtG,OAAO,EAAE,2BAA2B,EAAE,0DAA8D;AACpG,OAAO,EAAE,4BAA4B,EAAE,kEAAwD;AAC/F,OAAO,EAAE,mCAAmC,EAAE,MAAM,wBAAwB,CAAC;AAE7E;;GAEG;AACH,MAAM,OAAO,4CAA6C,SAAQ,mCAAmC;IAGjG;;OAEG;IACH,IAAoB,IAAI;QACpB,OAAO,IAAI,CAAC,eAAe,CAAC;IAChC,CAAC;IAED;;;;;OAKG;IACH,YAAmB,IAAY,EAAE,UAAsB,EAAE,KAAY;QACjE,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;QAE/B,IAAI,CAAC,+BAA+B,EAAE,CAAC;QAEvC,I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{ Scene, FrameGraph } from \"core/index\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { editableInPropertyPage, PropertyTypeForEdition } from \"../../../../Decorators/nodeDecorator\";\r\nimport { FrameGraphBlackAndWhiteTask } from \"core/FrameGraph/Tasks/PostProcesses/blackAndWhiteTask\";\r\nimport { ThinBlackAndWhitePostProcess } from \"core/PostProcesses/thinBlackAndWhitePostProcess\";\r\nimport { NodeRenderGraphBasePostProcessBlock } from \"./basePostProcessBlock\";\r\n\r\n/**\r\n * Block that implements the black and white post process\r\n */\r\nexport class NodeRenderGraphBlackAndWhitePostProcessBlock extends NodeRenderGraphBasePostProcessBlock {\r\n protected override _frameGraphTask: FrameGraphBlackAndWhiteTask;\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 BlackAndWhitePostProcessBlock\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 */\r\n public constructor(name: string, frameGraph: FrameGraph, scene: Scene) {\r\n super(name, frameGraph, scene);\r\n\r\n this._finalizeInputOutputRegistering();\r\n\r\n this._frameGraphTask = new FrameGraphBlackAndWhiteTask(this.name, frameGraph, new ThinBlackAndWhitePostProcess(name, scene.getEngine()));\r\n }\r\n\r\n /** Degree of conversion to black and white (default: 1 - full b&w conversion) */\r\n @editableInPropertyPage(\"Degree\", PropertyTypeForEdition.Float, \"PROPERTIES\", { min: 0, max: 1 })\r\n public get degree(): number {\r\n return this._frameGraphTask.postProcess.degree;\r\n }\r\n\r\n public set degree(value: number) {\r\n this._frameGraphTask.postProcess.degree = 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 \"NodeRenderGraphBlackAndWhitePostProcessBlock\";\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codes: string[] = [];\r\n codes.push(`${this._codeVariableName}.degree = ${this.degree};`);\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.degree = this.degree;\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n this.degree = serializationObject.degree;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.NodeRenderGraphBlackAndWhitePostProcessBlock\", NodeRenderGraphBlackAndWhitePostProcessBlock);\r\n"]}
@@ -1,10 +1,10 @@
1
- import type { NodeRenderGraphConnectionPoint, Scene, NodeRenderGraphBuildState, FrameGraph } from "../../../../index.js";
2
- import { NodeRenderGraphBlock } from "../../nodeRenderGraphBlock";
1
+ import type { Scene, FrameGraph } from "../../../../index.js";
3
2
  import { FrameGraphBloomTask } from "../../../Tasks/PostProcesses/bloomTask";
3
+ import { NodeRenderGraphBasePostProcessBlock } from "./basePostProcessBlock";
4
4
  /**
5
5
  * Block that implements the bloom post process
6
6
  */
7
- export declare class NodeRenderGraphBloomPostProcessBlock extends NodeRenderGraphBlock {
7
+ export declare class NodeRenderGraphBloomPostProcessBlock extends NodeRenderGraphBasePostProcessBlock {
8
8
  protected _frameGraphTask: FrameGraphBloomTask;
9
9
  /**
10
10
  * Gets the frame graph task associated with this block
@@ -26,9 +26,6 @@ export declare class NodeRenderGraphBloomPostProcessBlock extends NodeRenderGrap
26
26
  /** If high dynamic range textures should be used */
27
27
  get hdr(): boolean;
28
28
  set hdr(value: boolean);
29
- /** Sampling mode used to sample from the source texture */
30
- get sourceSamplingMode(): number;
31
- set sourceSamplingMode(value: number);
32
29
  /** The luminance threshold to find bright areas of the image to bloom. */
33
30
  get threshold(): number;
34
31
  set threshold(value: number);
@@ -43,19 +40,6 @@ export declare class NodeRenderGraphBloomPostProcessBlock extends NodeRenderGrap
43
40
  * @returns the class name
44
41
  */
45
42
  getClassName(): string;
46
- /**
47
- * Gets the source input component
48
- */
49
- get source(): NodeRenderGraphConnectionPoint;
50
- /**
51
- * Gets the destination input component
52
- */
53
- get destination(): NodeRenderGraphConnectionPoint;
54
- /**
55
- * Gets the output component
56
- */
57
- get output(): NodeRenderGraphConnectionPoint;
58
- protected _buildBlock(state: NodeRenderGraphBuildState): void;
59
43
  protected _dumpPropertiesCode(): string;
60
44
  serialize(): any;
61
45
  _deserialize(serializationObject: any): void;
@@ -1,13 +1,12 @@
1
1
  import { __decorate } from "../../../../tslib.es6.js";
2
- import { NodeRenderGraphBlock } from "../../nodeRenderGraphBlock.js";
3
2
  import { RegisterClass } from "../../../../Misc/typeStore.js";
4
- import { NodeRenderGraphBlockConnectionPointTypes } from "../../Types/nodeRenderGraphTypes.js";
5
3
  import { editableInPropertyPage } from "../../../../Decorators/nodeDecorator.js";
6
4
  import { FrameGraphBloomTask } from "../../../Tasks/PostProcesses/bloomTask.js";
5
+ import { NodeRenderGraphBasePostProcessBlock } from "./basePostProcessBlock.js";
7
6
  /**
8
7
  * Block that implements the bloom post process
9
8
  */
10
- export class NodeRenderGraphBloomPostProcessBlock extends NodeRenderGraphBlock {
9
+ export class NodeRenderGraphBloomPostProcessBlock extends NodeRenderGraphBasePostProcessBlock {
11
10
  /**
12
11
  * Gets the frame graph task associated with this block
13
12
  */
@@ -25,15 +24,7 @@ export class NodeRenderGraphBloomPostProcessBlock extends NodeRenderGraphBlock {
25
24
  constructor(name, frameGraph, scene, hdr = false, bloomScale = 0.5) {
26
25
  super(name, frameGraph, scene);
27
26
  this._additionalConstructionParameters = [hdr, bloomScale];
28
- this.registerInput("source", NodeRenderGraphBlockConnectionPointTypes.Texture);
29
- this.registerInput("destination", NodeRenderGraphBlockConnectionPointTypes.Texture, true);
30
- this._addDependenciesInput();
31
- this.registerOutput("output", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);
32
- this.source.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);
33
- this.destination.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAll);
34
- this.output._typeConnectionSource = () => {
35
- return this.destination.isConnected ? this.destination : this.source;
36
- };
27
+ this._finalizeInputOutputRegistering();
37
28
  this._frameGraphTask = new FrameGraphBloomTask(this.name, frameGraph, scene.getEngine(), 0.75, 64, 0.2, hdr, bloomScale);
38
29
  }
39
30
  _createTask(bloomScale, hdr) {
@@ -60,13 +51,6 @@ export class NodeRenderGraphBloomPostProcessBlock extends NodeRenderGraphBlock {
60
51
  set hdr(value) {
61
52
  this._createTask(this._frameGraphTask.bloom.scale, value);
62
53
  }
63
- /** Sampling mode used to sample from the source texture */
64
- get sourceSamplingMode() {
65
- return this._frameGraphTask.sourceSamplingMode;
66
- }
67
- set sourceSamplingMode(value) {
68
- this._frameGraphTask.sourceSamplingMode = value;
69
- }
70
54
  /** The luminance threshold to find bright areas of the image to bloom. */
71
55
  get threshold() {
72
56
  return this._frameGraphTask.bloom.threshold;
@@ -95,36 +79,11 @@ export class NodeRenderGraphBloomPostProcessBlock extends NodeRenderGraphBlock {
95
79
  getClassName() {
96
80
  return "NodeRenderGraphBloomPostProcessBlock";
97
81
  }
98
- /**
99
- * Gets the source input component
100
- */
101
- get source() {
102
- return this._inputs[0];
103
- }
104
- /**
105
- * Gets the destination input component
106
- */
107
- get destination() {
108
- return this._inputs[1];
109
- }
110
- /**
111
- * Gets the output component
112
- */
113
- get output() {
114
- return this._outputs[0];
115
- }
116
- _buildBlock(state) {
117
- super._buildBlock(state);
118
- this.output.value = this._frameGraphTask.outputTexture; // the value of the output connection point is the "output" texture of the task
119
- this._frameGraphTask.sourceTexture = this.source.connectedPoint?.value;
120
- this._frameGraphTask.destinationTexture = this.destination.connectedPoint?.value;
121
- }
122
82
  _dumpPropertiesCode() {
123
83
  const codes = [];
124
84
  codes.push(`${this._codeVariableName}.threshold = ${this.threshold};`);
125
85
  codes.push(`${this._codeVariableName}.weight = ${this.weight};`);
126
86
  codes.push(`${this._codeVariableName}.kernel = ${this.kernel};`);
127
- codes.push(`${this._codeVariableName}.sourceSamplingMode = ${this.sourceSamplingMode};`);
128
87
  return super._dumpPropertiesCode() + codes.join("\n");
129
88
  }
130
89
  serialize() {
@@ -132,7 +91,6 @@ export class NodeRenderGraphBloomPostProcessBlock extends NodeRenderGraphBlock {
132
91
  serializationObject.threshold = this.threshold;
133
92
  serializationObject.weight = this.weight;
134
93
  serializationObject.kernel = this.kernel;
135
- serializationObject.sourceSamplingMode = this.sourceSamplingMode;
136
94
  return serializationObject;
137
95
  }
138
96
  _deserialize(serializationObject) {
@@ -140,7 +98,6 @@ export class NodeRenderGraphBloomPostProcessBlock extends NodeRenderGraphBlock {
140
98
  this.threshold = serializationObject.threshold;
141
99
  this.weight = serializationObject.weight;
142
100
  this.kernel = serializationObject.kernel;
143
- this.sourceSamplingMode = serializationObject.sourceSamplingMode;
144
101
  }
145
102
  }
146
103
  __decorate([
@@ -149,9 +106,6 @@ __decorate([
149
106
  __decorate([
150
107
  editableInPropertyPage("HDR", 0 /* PropertyTypeForEdition.Boolean */, "PROPERTIES")
151
108
  ], NodeRenderGraphBloomPostProcessBlock.prototype, "hdr", null);
152
- __decorate([
153
- editableInPropertyPage("Source sampling mode", 6 /* PropertyTypeForEdition.SamplingMode */)
154
- ], NodeRenderGraphBloomPostProcessBlock.prototype, "sourceSamplingMode", null);
155
109
  __decorate([
156
110
  editableInPropertyPage("Threshold", 1 /* PropertyTypeForEdition.Float */, "PROPERTIES", { min: 0, max: 2 })
157
111
  ], NodeRenderGraphBloomPostProcessBlock.prototype, "threshold", null);
@@ -1 +1 @@
1
- {"version":3,"file":"bloomPostProcessBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,wCAAwC,EAAE,MAAM,kCAA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mBAAmB,CAAC;IAC/B,CAAC;IAEe,YAAY,CAAC,mBAAwB;QACjD,KAAK,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;QACxC,IAAI,CAAC,SAAS,GAAG,mBAAmB,CAAC,SAAS,CAAC;QAC/C,IAAI,CAAC,MAAM,GAAG,mBAAmB,CAAC,MAAM,CAAC;QACzC,IAAI,CAAC,MAAM,GAAG,mBAAmB,CAAC,MAAM,CAAC;QACzC,IAAI,CAAC,kBAAkB,GAAG,mBAAmB,CAAC,kBAAkB,CAAC;IACrE,CAAC;CACJ;AAzHG;IADC,sBAAsB,CAAC,aAAa,wCAAgC,YAAY,CAAC;sEAGjF;AAQD;IADC,sBAAsB,CAAC,KAAK,0CAAkC,YAAY,CAAC;+DAG3E;AAQD;IADC,sBAAsB,CAAC,sBAAsB,8CAAsC;8EAGnF;AAQD;IADC,sBAAsB,CAAC,WAAW,wCAAgC,YAAY,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;qEAGnG;AAQD;IADC,sBAAsB,CAAC,QAAQ,wCAAgC,YAAY,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;kEAGhG;AAQD;IADC,sBAAsB,CAAC,QAAQ,sCAA8B,YAAY,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;kEAGhG;AAuEL,aAAa,CAAC,8CAA8C,EAAE,oCAAoC,CAAC,CAAC","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { NodeRenderGraphConnectionPoint, Scene, NodeRenderGraphBuildState, FrameGraphTextureHandle, FrameGraph } from \"core/index\";\r\nimport { NodeRenderGraphBlock } from \"../../nodeRenderGraphBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { NodeRenderGraphBlockConnectionPointTypes } from \"../../Types/nodeRenderGraphTypes\";\r\nimport { editableInPropertyPage, PropertyTypeForEdition } from \"../../../../Decorators/nodeDecorator\";\r\nimport { FrameGraphBloomTask } from \"../../../Tasks/PostProcesses/bloomTask\";\r\n\r\n/**\r\n * Block that implements the bloom post process\r\n */\r\nexport class NodeRenderGraphBloomPostProcessBlock extends NodeRenderGraphBlock {\r\n protected override _frameGraphTask: FrameGraphBloomTask;\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 NodeRenderGraphBloomPostProcessBlock\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 hdr If high dynamic range textures should be used (default: false)\r\n * @param bloomScale The scale of the bloom effect (default: 0.5)\r\n */\r\n public constructor(name: string, frameGraph: FrameGraph, scene: Scene, hdr = false, bloomScale = 0.5) {\r\n super(name, frameGraph, scene);\r\n\r\n this._additionalConstructionParameters = [hdr, bloomScale];\r\n\r\n this.registerInput(\"source\", NodeRenderGraphBlockConnectionPointTypes.Texture);\r\n this.registerInput(\"destination\", NodeRenderGraphBlockConnectionPointTypes.Texture, true);\r\n this._addDependenciesInput();\r\n this.registerOutput(\"output\", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this.source.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);\r\n this.destination.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAll);\r\n this.output._typeConnectionSource = () => {\r\n return this.destination.isConnected ? this.destination : this.source;\r\n };\r\n\r\n this._frameGraphTask = new FrameGraphBloomTask(this.name, frameGraph, scene.getEngine(), 0.75, 64, 0.2, hdr, bloomScale);\r\n }\r\n\r\n private _createTask(bloomScale: number, hdr: boolean) {\r\n const sourceSamplingMode = this._frameGraphTask.sourceSamplingMode;\r\n const threshold = this._frameGraphTask.bloom.threshold;\r\n const weight = this._frameGraphTask.bloom.weight;\r\n const kernel = this._frameGraphTask.bloom.kernel;\r\n\r\n this._frameGraphTask.dispose();\r\n\r\n this._frameGraphTask = new FrameGraphBloomTask(this.name, this._frameGraph, this._scene.getEngine(), weight, kernel, threshold, hdr, bloomScale);\r\n this._frameGraphTask.sourceSamplingMode = sourceSamplingMode;\r\n\r\n this._additionalConstructionParameters = [hdr, bloomScale];\r\n }\r\n\r\n /** The quality of the blur effect */\r\n @editableInPropertyPage(\"Bloom scale\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get bloomScale() {\r\n return this._frameGraphTask.bloom.scale;\r\n }\r\n\r\n public set bloomScale(value: number) {\r\n this._createTask(value, this._frameGraphTask.hdr);\r\n }\r\n\r\n /** If high dynamic range textures should be used */\r\n @editableInPropertyPage(\"HDR\", PropertyTypeForEdition.Boolean, \"PROPERTIES\")\r\n public get hdr(): boolean {\r\n return this._frameGraphTask.hdr;\r\n }\r\n\r\n public set hdr(value: boolean) {\r\n this._createTask(this._frameGraphTask.bloom.scale, value);\r\n }\r\n\r\n /** Sampling mode used to sample from the source texture */\r\n @editableInPropertyPage(\"Source sampling mode\", PropertyTypeForEdition.SamplingMode)\r\n public get sourceSamplingMode() {\r\n return this._frameGraphTask.sourceSamplingMode;\r\n }\r\n\r\n public set sourceSamplingMode(value: number) {\r\n this._frameGraphTask.sourceSamplingMode = value;\r\n }\r\n\r\n /** The luminance threshold to find bright areas of the image to bloom. */\r\n @editableInPropertyPage(\"Threshold\", PropertyTypeForEdition.Float, \"PROPERTIES\", { min: 0, max: 2 })\r\n public get threshold(): number {\r\n return this._frameGraphTask.bloom.threshold;\r\n }\r\n\r\n public set threshold(value: number) {\r\n this._frameGraphTask.bloom.threshold = value;\r\n }\r\n\r\n /** The strength of the bloom. */\r\n @editableInPropertyPage(\"Weight\", PropertyTypeForEdition.Float, \"PROPERTIES\", { min: 0, max: 3 })\r\n public get weight(): number {\r\n return this._frameGraphTask.bloom.weight;\r\n }\r\n\r\n public set weight(value: number) {\r\n this._frameGraphTask.bloom.weight = value;\r\n }\r\n\r\n /** Specifies the size of the bloom blur kernel, relative to the final output size */\r\n @editableInPropertyPage(\"Kernel\", PropertyTypeForEdition.Int, \"PROPERTIES\", { min: 1, max: 128 })\r\n public get kernel(): number {\r\n return this._frameGraphTask.bloom.kernel;\r\n }\r\n\r\n public set kernel(value: number) {\r\n this._frameGraphTask.bloom.kernel = 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 \"NodeRenderGraphBloomPostProcessBlock\";\r\n }\r\n\r\n /**\r\n * Gets the source input component\r\n */\r\n public get source(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the destination input component\r\n */\r\n public get destination(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[1];\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; // the value of the output connection point is the \"output\" texture of the task\r\n\r\n this._frameGraphTask.sourceTexture = this.source.connectedPoint?.value as FrameGraphTextureHandle;\r\n this._frameGraphTask.destinationTexture = this.destination.connectedPoint?.value as FrameGraphTextureHandle;\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codes: string[] = [];\r\n codes.push(`${this._codeVariableName}.threshold = ${this.threshold};`);\r\n codes.push(`${this._codeVariableName}.weight = ${this.weight};`);\r\n codes.push(`${this._codeVariableName}.kernel = ${this.kernel};`);\r\n codes.push(`${this._codeVariableName}.sourceSamplingMode = ${this.sourceSamplingMode};`);\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.threshold = this.threshold;\r\n serializationObject.weight = this.weight;\r\n serializationObject.kernel = this.kernel;\r\n serializationObject.sourceSamplingMode = this.sourceSamplingMode;\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n this.threshold = serializationObject.threshold;\r\n this.weight = serializationObject.weight;\r\n this.kernel = serializationObject.kernel;\r\n this.sourceSamplingMode = serializationObject.sourceSamplingMode;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.NodeRenderGraphBloomPostProcessBlock\", NodeRenderGraphBloomPostProcessBlock);\r\n"]}
1
+ {"version":3,"file":"bloomPostProcessBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAA0B,MAAM,sCAAsC,CAAC;AACtG,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAAE,mCAAmC,EAAE,MAAM,wBAAwB,CAAC;AAE7E;;GAEG;AACH,MAAM,OAAO,oCAAqC,SAAQ,mCAAmC;IAGzF;;OAEG;IACH,IAAoB,IAAI;QACpB,OAAO,IAAI,CAAC,eAAe,CAAC;IAChC,CAAC;IAED;;;;;;;OAOG;IACH,YAAmB,IAAY,EAAE,UAAsB,EAAE,KAAY,EAAE,GAAG,GAAG,KAAK,EAAE,UAAU,GAAG,GAAG;QAChG,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;QAE/B,IAAI,CAAC,iCAAiC,GAAG,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;QAE3D,IAAI,CAAC,+BAA+B,EAAE,CAAC;QAEvC,IAAI,CAAC,eAAe,GAAG,IAAI,mBAAmB,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,CAAC,SAAS,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,UAAU,CAAC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AAC,SAAS,CAAC;QAC/C,mBAAmB,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QACzC,mBAAmB,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QACzC,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IAEe,YAAY,CAAC,mBAAwB;QACjD,KAAK,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;QACxC,IAAI,CAAC,SAAS,GAAG,mBAAmB,CAAC,SAAS,CAAC;QAC/C,IAAI,CAAC,MAAM,GAAG,mBAAmB,CAAC,MAAM,CAAC;QACzC,IAAI,CAAC,MAAM,GAAG,mBAAmB,CAAC,MAAM,CAAC;IAC7C,CAAC;CACJ;AA9EG;IADC,sBAAsB,CAAC,aAAa,wCAAgC,YAAY,CAAC;sEAGjF;AAQD;IADC,sBAAsB,CAAC,KAAK,0CAAkC,YAAY,CAAC;+DAG3E;AAQD;IADC,sBAAsB,CAAC,WAAW,wCAAgC,YAAY,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;qEAGnG;AAQD;IADC,sBAAsB,CAAC,QAAQ,wCAAgC,YAAY,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;kEAGhG;AAQD;IADC,sBAAsB,CAAC,QAAQ,sCAA8B,YAAY,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;kEAGhG;AAsCL,aAAa,CAAC,8CAA8C,EAAE,oCAAoC,CAAC,CAAC","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { Scene, FrameGraph } from \"core/index\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { editableInPropertyPage, PropertyTypeForEdition } from \"../../../../Decorators/nodeDecorator\";\r\nimport { FrameGraphBloomTask } from \"../../../Tasks/PostProcesses/bloomTask\";\r\nimport { NodeRenderGraphBasePostProcessBlock } from \"./basePostProcessBlock\";\r\n\r\n/**\r\n * Block that implements the bloom post process\r\n */\r\nexport class NodeRenderGraphBloomPostProcessBlock extends NodeRenderGraphBasePostProcessBlock {\r\n protected override _frameGraphTask: FrameGraphBloomTask;\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 NodeRenderGraphBloomPostProcessBlock\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 hdr If high dynamic range textures should be used (default: false)\r\n * @param bloomScale The scale of the bloom effect (default: 0.5)\r\n */\r\n public constructor(name: string, frameGraph: FrameGraph, scene: Scene, hdr = false, bloomScale = 0.5) {\r\n super(name, frameGraph, scene);\r\n\r\n this._additionalConstructionParameters = [hdr, bloomScale];\r\n\r\n this._finalizeInputOutputRegistering();\r\n\r\n this._frameGraphTask = new FrameGraphBloomTask(this.name, frameGraph, scene.getEngine(), 0.75, 64, 0.2, hdr, bloomScale);\r\n }\r\n\r\n private _createTask(bloomScale: number, hdr: boolean) {\r\n const sourceSamplingMode = this._frameGraphTask.sourceSamplingMode;\r\n const threshold = this._frameGraphTask.bloom.threshold;\r\n const weight = this._frameGraphTask.bloom.weight;\r\n const kernel = this._frameGraphTask.bloom.kernel;\r\n\r\n this._frameGraphTask.dispose();\r\n\r\n this._frameGraphTask = new FrameGraphBloomTask(this.name, this._frameGraph, this._scene.getEngine(), weight, kernel, threshold, hdr, bloomScale);\r\n this._frameGraphTask.sourceSamplingMode = sourceSamplingMode;\r\n\r\n this._additionalConstructionParameters = [hdr, bloomScale];\r\n }\r\n\r\n /** The quality of the blur effect */\r\n @editableInPropertyPage(\"Bloom scale\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get bloomScale() {\r\n return this._frameGraphTask.bloom.scale;\r\n }\r\n\r\n public set bloomScale(value: number) {\r\n this._createTask(value, this._frameGraphTask.hdr);\r\n }\r\n\r\n /** If high dynamic range textures should be used */\r\n @editableInPropertyPage(\"HDR\", PropertyTypeForEdition.Boolean, \"PROPERTIES\")\r\n public get hdr(): boolean {\r\n return this._frameGraphTask.hdr;\r\n }\r\n\r\n public set hdr(value: boolean) {\r\n this._createTask(this._frameGraphTask.bloom.scale, value);\r\n }\r\n\r\n /** The luminance threshold to find bright areas of the image to bloom. */\r\n @editableInPropertyPage(\"Threshold\", PropertyTypeForEdition.Float, \"PROPERTIES\", { min: 0, max: 2 })\r\n public get threshold(): number {\r\n return this._frameGraphTask.bloom.threshold;\r\n }\r\n\r\n public set threshold(value: number) {\r\n this._frameGraphTask.bloom.threshold = value;\r\n }\r\n\r\n /** The strength of the bloom. */\r\n @editableInPropertyPage(\"Weight\", PropertyTypeForEdition.Float, \"PROPERTIES\", { min: 0, max: 3 })\r\n public get weight(): number {\r\n return this._frameGraphTask.bloom.weight;\r\n }\r\n\r\n public set weight(value: number) {\r\n this._frameGraphTask.bloom.weight = value;\r\n }\r\n\r\n /** Specifies the size of the bloom blur kernel, relative to the final output size */\r\n @editableInPropertyPage(\"Kernel\", PropertyTypeForEdition.Int, \"PROPERTIES\", { min: 1, max: 128 })\r\n public get kernel(): number {\r\n return this._frameGraphTask.bloom.kernel;\r\n }\r\n\r\n public set kernel(value: number) {\r\n this._frameGraphTask.bloom.kernel = 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 \"NodeRenderGraphBloomPostProcessBlock\";\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codes: string[] = [];\r\n codes.push(`${this._codeVariableName}.threshold = ${this.threshold};`);\r\n codes.push(`${this._codeVariableName}.weight = ${this.weight};`);\r\n codes.push(`${this._codeVariableName}.kernel = ${this.kernel};`);\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.threshold = this.threshold;\r\n serializationObject.weight = this.weight;\r\n serializationObject.kernel = this.kernel;\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n this.threshold = serializationObject.threshold;\r\n this.weight = serializationObject.weight;\r\n this.kernel = serializationObject.kernel;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.NodeRenderGraphBloomPostProcessBlock\", NodeRenderGraphBloomPostProcessBlock);\r\n"]}
@@ -1,11 +1,11 @@
1
- import type { NodeRenderGraphConnectionPoint, Scene, NodeRenderGraphBuildState, FrameGraph } from "../../../../index.js";
2
- import { NodeRenderGraphBlock } from "../../nodeRenderGraphBlock";
1
+ import type { Scene, FrameGraph } from "../../../../index.js";
3
2
  import { FrameGraphBlurTask } from "../../../Tasks/PostProcesses/blurTask.js";
4
3
  import { Vector2 } from "../../../../Maths/math.vector.js";
4
+ import { NodeRenderGraphBasePostProcessBlock } from "./basePostProcessBlock";
5
5
  /**
6
6
  * Block that implements the blur post process
7
7
  */
8
- export declare class NodeRenderGraphBlurPostProcessBlock extends NodeRenderGraphBlock {
8
+ export declare class NodeRenderGraphBlurPostProcessBlock extends NodeRenderGraphBasePostProcessBlock {
9
9
  protected _frameGraphTask: FrameGraphBlurTask;
10
10
  /**
11
11
  * Gets the frame graph task associated with this block
@@ -18,9 +18,6 @@ export declare class NodeRenderGraphBlurPostProcessBlock extends NodeRenderGraph
18
18
  * @param scene defines the hosting scene
19
19
  */
20
20
  constructor(name: string, frameGraph: FrameGraph, scene: Scene);
21
- /** Sampling mode used to sample from the source texture */
22
- get sourceSamplingMode(): number;
23
- set sourceSamplingMode(value: number);
24
21
  /** The direction in which to blur the image */
25
22
  get direction(): Vector2;
26
23
  set direction(value: Vector2);
@@ -32,19 +29,6 @@ export declare class NodeRenderGraphBlurPostProcessBlock extends NodeRenderGraph
32
29
  * @returns the class name
33
30
  */
34
31
  getClassName(): string;
35
- /**
36
- * Gets the source input component
37
- */
38
- get source(): NodeRenderGraphConnectionPoint;
39
- /**
40
- * Gets the destination input component
41
- */
42
- get destination(): NodeRenderGraphConnectionPoint;
43
- /**
44
- * Gets the output component
45
- */
46
- get output(): NodeRenderGraphConnectionPoint;
47
- protected _buildBlock(state: NodeRenderGraphBuildState): void;
48
32
  protected _dumpPropertiesCode(): string;
49
33
  serialize(): any;
50
34
  _deserialize(serializationObject: any): void;