@babylonjs/core 7.39.1 → 7.39.3

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 (161) hide show
  1. package/Cameras/arcRotateCamera.d.ts +1 -1
  2. package/Cameras/arcRotateCamera.js.map +1 -1
  3. package/Debug/directionalLightFrustumViewer.d.ts +2 -1
  4. package/Debug/directionalLightFrustumViewer.js +4 -3
  5. package/Debug/directionalLightFrustumViewer.js.map +1 -1
  6. package/Engines/Extensions/engine.multiRender.js +1 -0
  7. package/Engines/Extensions/engine.multiRender.js.map +1 -1
  8. package/Engines/abstractEngine.js +2 -2
  9. package/Engines/abstractEngine.js.map +1 -1
  10. package/Engines/constants.d.ts +8 -0
  11. package/Engines/constants.js +8 -0
  12. package/Engines/constants.js.map +1 -1
  13. package/Engines/thinEngine.js +9 -3
  14. package/Engines/thinEngine.js.map +1 -1
  15. package/FrameGraph/Node/Blocks/PostProcesses/blackAndWhitePostProcessBlock.js +3 -9
  16. package/FrameGraph/Node/Blocks/PostProcesses/blackAndWhitePostProcessBlock.js.map +1 -1
  17. package/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.js +3 -9
  18. package/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.js.map +1 -1
  19. package/FrameGraph/Node/Blocks/PostProcesses/blurPostProcessBlock.js +3 -9
  20. package/FrameGraph/Node/Blocks/PostProcesses/blurPostProcessBlock.js.map +1 -1
  21. package/FrameGraph/Node/Blocks/PostProcesses/circleOfConfusionPostProcessBlock.js +5 -17
  22. package/FrameGraph/Node/Blocks/PostProcesses/circleOfConfusionPostProcessBlock.js.map +1 -1
  23. package/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.js +5 -17
  24. package/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.js.map +1 -1
  25. package/FrameGraph/Node/Blocks/PostProcesses/extractHighlightsPostProcessBlock.js +3 -9
  26. package/FrameGraph/Node/Blocks/PostProcesses/extractHighlightsPostProcessBlock.js.map +1 -1
  27. package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.d.ts +6 -1
  28. package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js +40 -20
  29. package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js.map +1 -1
  30. package/FrameGraph/Node/Blocks/Rendering/baseShadowGeneratorBlock.d.ts +77 -0
  31. package/FrameGraph/Node/Blocks/Rendering/baseShadowGeneratorBlock.js +250 -0
  32. package/FrameGraph/Node/Blocks/Rendering/baseShadowGeneratorBlock.js.map +1 -0
  33. package/FrameGraph/Node/Blocks/Rendering/csmShadowGeneratorBlock.d.ts +57 -0
  34. package/FrameGraph/Node/Blocks/Rendering/csmShadowGeneratorBlock.js +169 -0
  35. package/FrameGraph/Node/Blocks/Rendering/csmShadowGeneratorBlock.js.map +1 -0
  36. package/FrameGraph/Node/Blocks/Rendering/cullObjectsBlock.js +3 -9
  37. package/FrameGraph/Node/Blocks/Rendering/cullObjectsBlock.js.map +1 -1
  38. package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.js +4 -13
  39. package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.js.map +1 -1
  40. package/FrameGraph/Node/Blocks/Rendering/objectRendererBlock.d.ts +6 -0
  41. package/FrameGraph/Node/Blocks/Rendering/objectRendererBlock.js +27 -0
  42. package/FrameGraph/Node/Blocks/Rendering/objectRendererBlock.js.map +1 -1
  43. package/FrameGraph/Node/Blocks/Rendering/shadowGeneratorBlock.d.ts +19 -0
  44. package/FrameGraph/Node/Blocks/Rendering/shadowGeneratorBlock.js +28 -0
  45. package/FrameGraph/Node/Blocks/Rendering/shadowGeneratorBlock.js.map +1 -0
  46. package/FrameGraph/Node/Blocks/Textures/clearBlock.js +3 -9
  47. package/FrameGraph/Node/Blocks/Textures/clearBlock.js.map +1 -1
  48. package/FrameGraph/Node/Blocks/Textures/copyTextureBlock.js +3 -9
  49. package/FrameGraph/Node/Blocks/Textures/copyTextureBlock.js.map +1 -1
  50. package/FrameGraph/Node/Blocks/Textures/generateMipmapsBlock.js +2 -5
  51. package/FrameGraph/Node/Blocks/Textures/generateMipmapsBlock.js.map +1 -1
  52. package/FrameGraph/Node/Blocks/executeBlock.d.ts +29 -0
  53. package/FrameGraph/Node/Blocks/executeBlock.js +43 -0
  54. package/FrameGraph/Node/Blocks/executeBlock.js.map +1 -0
  55. package/FrameGraph/Node/Blocks/index.d.ts +4 -0
  56. package/FrameGraph/Node/Blocks/index.js +4 -0
  57. package/FrameGraph/Node/Blocks/index.js.map +1 -1
  58. package/FrameGraph/Node/Blocks/inputBlock.d.ts +7 -2
  59. package/FrameGraph/Node/Blocks/inputBlock.js +13 -0
  60. package/FrameGraph/Node/Blocks/inputBlock.js.map +1 -1
  61. package/FrameGraph/Node/Blocks/resourceContainerBlock.d.ts +55 -0
  62. package/FrameGraph/Node/Blocks/resourceContainerBlock.js +97 -0
  63. package/FrameGraph/Node/Blocks/resourceContainerBlock.js.map +1 -0
  64. package/FrameGraph/Node/Types/nodeRenderGraphTypes.d.ts +13 -10
  65. package/FrameGraph/Node/Types/nodeRenderGraphTypes.js +11 -4
  66. package/FrameGraph/Node/Types/nodeRenderGraphTypes.js.map +1 -1
  67. package/FrameGraph/Node/nodeRenderGraph.js +32 -4
  68. package/FrameGraph/Node/nodeRenderGraph.js.map +1 -1
  69. package/FrameGraph/Node/nodeRenderGraphBlock.d.ts +1 -0
  70. package/FrameGraph/Node/nodeRenderGraphBlock.js +11 -0
  71. package/FrameGraph/Node/nodeRenderGraphBlock.js.map +1 -1
  72. package/FrameGraph/Node/nodeRenderGraphBlockConnectionPoint.d.ts +18 -0
  73. package/FrameGraph/Node/nodeRenderGraphBlockConnectionPoint.js +24 -0
  74. package/FrameGraph/Node/nodeRenderGraphBlockConnectionPoint.js.map +1 -1
  75. package/FrameGraph/Passes/cullPass.d.ts +1 -1
  76. package/FrameGraph/Passes/cullPass.js.map +1 -1
  77. package/FrameGraph/Tasks/Misc/executeTask.d.ts +22 -0
  78. package/FrameGraph/Tasks/Misc/executeTask.js +28 -0
  79. package/FrameGraph/Tasks/Misc/executeTask.js.map +1 -0
  80. package/FrameGraph/Tasks/Rendering/csmShadowGeneratorTask.d.ts +72 -0
  81. package/FrameGraph/Tasks/Rendering/csmShadowGeneratorTask.js +183 -0
  82. package/FrameGraph/Tasks/Rendering/csmShadowGeneratorTask.js.map +1 -0
  83. package/FrameGraph/Tasks/Rendering/objectRendererTask.d.ts +16 -5
  84. package/FrameGraph/Tasks/Rendering/objectRendererTask.js +46 -0
  85. package/FrameGraph/Tasks/Rendering/objectRendererTask.js.map +1 -1
  86. package/FrameGraph/Tasks/Rendering/shadowGeneratorTask.d.ts +107 -0
  87. package/FrameGraph/Tasks/Rendering/shadowGeneratorTask.js +264 -0
  88. package/FrameGraph/Tasks/Rendering/shadowGeneratorTask.js.map +1 -0
  89. package/FrameGraph/Tasks/Texture/clearTextureTask.js +7 -0
  90. package/FrameGraph/Tasks/Texture/clearTextureTask.js.map +1 -1
  91. package/FrameGraph/frameGraph.d.ts +9 -0
  92. package/FrameGraph/frameGraph.js +12 -3
  93. package/FrameGraph/frameGraph.js.map +1 -1
  94. package/FrameGraph/frameGraphTextureManager.js +4 -1
  95. package/FrameGraph/frameGraphTextureManager.js.map +1 -1
  96. package/FrameGraph/index.d.ts +5 -0
  97. package/FrameGraph/index.js +5 -0
  98. package/FrameGraph/index.js.map +1 -1
  99. package/Inputs/scene.inputManager.d.ts +1 -1
  100. package/Inputs/scene.inputManager.js +8 -1
  101. package/Inputs/scene.inputManager.js.map +1 -1
  102. package/Lights/Shadows/shadowGenerator.d.ts +1 -1
  103. package/Lights/Shadows/shadowGenerator.js +2 -7
  104. package/Lights/Shadows/shadowGenerator.js.map +1 -1
  105. package/Lights/directionalLight.d.ts +5 -4
  106. package/Lights/directionalLight.js +7 -9
  107. package/Lights/directionalLight.js.map +1 -1
  108. package/Lights/shadowLight.d.ts +4 -4
  109. package/Lights/shadowLight.js +3 -2
  110. package/Lights/shadowLight.js.map +1 -1
  111. package/Lights/spotLight.d.ts +2 -2
  112. package/Lights/spotLight.js +3 -2
  113. package/Lights/spotLight.js.map +1 -1
  114. package/Loading/sceneLoader.d.ts +1 -1
  115. package/Loading/sceneLoader.js.map +1 -1
  116. package/Materials/GreasedLine/greasedLinePluginMaterial.js +1 -1
  117. package/Materials/GreasedLine/greasedLinePluginMaterial.js.map +1 -1
  118. package/Materials/PBR/pbrMetallicRoughnessMaterial.js +18 -6
  119. package/Materials/PBR/pbrMetallicRoughnessMaterial.js.map +1 -1
  120. package/Materials/PBR/pbrSpecularGlossinessMaterial.js +18 -6
  121. package/Materials/PBR/pbrSpecularGlossinessMaterial.js.map +1 -1
  122. package/Materials/Textures/renderTargetTexture.d.ts +2 -0
  123. package/Materials/Textures/renderTargetTexture.js +18 -8
  124. package/Materials/Textures/renderTargetTexture.js.map +1 -1
  125. package/Materials/material.js +3 -1
  126. package/Materials/material.js.map +1 -1
  127. package/Materials/materialPluginBase.d.ts +4 -0
  128. package/Materials/materialPluginBase.js +4 -0
  129. package/Materials/materialPluginBase.js.map +1 -1
  130. package/Maths/math.color.js.map +1 -1
  131. package/Maths/math.vector.js.map +1 -1
  132. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +1 -1
  133. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
  134. package/Meshes/lattice.material.d.ts +3 -8
  135. package/Meshes/lattice.material.js.map +1 -1
  136. package/Misc/copyTextureToTexture.js +1 -1
  137. package/Misc/copyTextureToTexture.js.map +1 -1
  138. package/Misc/filesInput.d.ts +3 -1
  139. package/Misc/filesInput.js +8 -4
  140. package/Misc/filesInput.js.map +1 -1
  141. package/PostProcesses/postProcess.d.ts +2 -2
  142. package/PostProcesses/postProcess.js +4 -4
  143. package/PostProcesses/postProcess.js.map +1 -1
  144. package/PostProcesses/postProcessManager.js +1 -1
  145. package/PostProcesses/postProcessManager.js.map +1 -1
  146. package/Shaders/ShadersInclude/lightsFragmentFunctions.js +1 -1
  147. package/Shaders/ShadersInclude/lightsFragmentFunctions.js.map +1 -1
  148. package/Shaders/default.fragment.js +2 -1
  149. package/Shaders/default.fragment.js.map +1 -1
  150. package/Shaders/default.vertex.js +2 -1
  151. package/Shaders/default.vertex.js.map +1 -1
  152. package/Shaders/pbr.fragment.js +2 -1
  153. package/Shaders/pbr.fragment.js.map +1 -1
  154. package/Shaders/pbr.vertex.js +2 -1
  155. package/Shaders/pbr.vertex.js.map +1 -1
  156. package/XR/webXRCamera.js +3 -0
  157. package/XR/webXRCamera.js.map +1 -1
  158. package/package.json +1 -1
  159. package/scene.d.ts +7 -0
  160. package/scene.js +10 -1
  161. package/scene.js.map +1 -1
@@ -2,6 +2,7 @@ import { __decorate } from "../../../../tslib.es6.js";
2
2
  import { NodeRenderGraphBlock } from "../../nodeRenderGraphBlock.js";
3
3
  import { NodeRenderGraphBlockConnectionPointTypes } from "../../Types/nodeRenderGraphTypes.js";
4
4
  import { editableInPropertyPage } from "../../../../Decorators/nodeDecorator.js";
5
+ import { NodeRenderGraphConnectionPoint } from "../../nodeRenderGraphBlockConnectionPoint.js";
5
6
  /**
6
7
  * @internal
7
8
  */
@@ -24,12 +25,13 @@ export class NodeRenderGraphBaseObjectRendererBlock extends NodeRenderGraphBlock
24
25
  this.registerInput("depth", NodeRenderGraphBlockConnectionPointTypes.TextureBackBufferDepthStencilAttachment, true);
25
26
  this.registerInput("camera", NodeRenderGraphBlockConnectionPointTypes.Camera);
26
27
  this.registerInput("objects", NodeRenderGraphBlockConnectionPointTypes.ObjectList);
27
- this.registerInput("dependencies", NodeRenderGraphBlockConnectionPointTypes.Texture, true);
28
+ this._addDependenciesInput();
29
+ this.registerInput("shadowGenerators", NodeRenderGraphBlockConnectionPointTypes.ShadowGenerator, true);
28
30
  this.registerOutput("output", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);
29
31
  this.registerOutput("outputDepth", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);
30
32
  this.destination.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBufferDepthStencil);
31
33
  this.depth.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureDepthStencilAttachment);
32
- this.dependencies.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);
34
+ this.shadowGenerators.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.ResourceContainer);
33
35
  this.output._typeConnectionSource = this.destination;
34
36
  this.outputDepth._typeConnectionSource = this.depth;
35
37
  }
@@ -84,6 +86,12 @@ export class NodeRenderGraphBaseObjectRendererBlock extends NodeRenderGraphBlock
84
86
  get dependencies() {
85
87
  return this._inputs[4];
86
88
  }
89
+ /**
90
+ * Gets the shadowGenerators input component
91
+ */
92
+ get shadowGenerators() {
93
+ return this._inputs[5];
94
+ }
87
95
  /**
88
96
  * Gets the output component
89
97
  */
@@ -98,29 +106,41 @@ export class NodeRenderGraphBaseObjectRendererBlock extends NodeRenderGraphBlock
98
106
  }
99
107
  _buildBlock(state) {
100
108
  super._buildBlock(state);
101
- this._frameGraphTask.name = this.name;
102
109
  this.output.value = this._frameGraphTask.outputTexture; // the value of the output connection point is the "output" texture of the task
103
110
  this.outputDepth.value = this._frameGraphTask.outputDepthTexture; // the value of the outputDepth connection point is the "outputDepth" texture of the task
104
- const destinationConnectedPoint = this.destination.connectedPoint;
105
- if (destinationConnectedPoint) {
106
- this._frameGraphTask.destinationTexture = destinationConnectedPoint.value;
107
- }
108
- const depthConnectedPoint = this.depth.connectedPoint;
109
- if (depthConnectedPoint) {
110
- this._frameGraphTask.depthTexture = depthConnectedPoint.value;
111
- }
112
- const cameraConnectedPoint = this.camera.connectedPoint;
113
- if (cameraConnectedPoint) {
114
- this._frameGraphTask.camera = cameraConnectedPoint.value;
115
- }
116
- const objectsConnectedPoint = this.objects.connectedPoint;
117
- if (objectsConnectedPoint) {
118
- this._frameGraphTask.objectList = objectsConnectedPoint.value;
119
- }
111
+ this._frameGraphTask.destinationTexture = this.destination.connectedPoint?.value;
112
+ this._frameGraphTask.depthTexture = this.depth.connectedPoint?.value;
113
+ this._frameGraphTask.camera = this.camera.connectedPoint?.value;
114
+ this._frameGraphTask.objectList = this.objects.connectedPoint?.value;
120
115
  this._frameGraphTask.dependencies = [];
121
116
  const dependenciesConnectedPoint = this.dependencies.connectedPoint;
122
117
  if (dependenciesConnectedPoint) {
123
- this._frameGraphTask.dependencies[0] = dependenciesConnectedPoint.value;
118
+ if (dependenciesConnectedPoint.type === NodeRenderGraphBlockConnectionPointTypes.ResourceContainer) {
119
+ const container = dependenciesConnectedPoint.ownerBlock;
120
+ container.inputs.forEach((input) => {
121
+ if (input.connectedPoint && input.connectedPoint.value !== undefined && NodeRenderGraphConnectionPoint.IsTextureHandle(input.connectedPoint.value)) {
122
+ this._frameGraphTask.dependencies.push(input.connectedPoint.value);
123
+ }
124
+ });
125
+ }
126
+ else if (NodeRenderGraphConnectionPoint.IsTextureHandle(dependenciesConnectedPoint.value)) {
127
+ this._frameGraphTask.dependencies[0] = dependenciesConnectedPoint.value;
128
+ }
129
+ }
130
+ this._frameGraphTask.shadowGenerators = [];
131
+ const shadowGeneratorsConnectedPoint = this.shadowGenerators.connectedPoint;
132
+ if (shadowGeneratorsConnectedPoint) {
133
+ if (shadowGeneratorsConnectedPoint.type === NodeRenderGraphBlockConnectionPointTypes.ResourceContainer) {
134
+ const container = shadowGeneratorsConnectedPoint.ownerBlock;
135
+ container.inputs.forEach((input) => {
136
+ if (input.connectedPoint && input.connectedPoint.value !== undefined && NodeRenderGraphConnectionPoint.IsShadowGenerator(input.connectedPoint.value)) {
137
+ this._frameGraphTask.shadowGenerators.push(input.connectedPoint.value);
138
+ }
139
+ });
140
+ }
141
+ else if (NodeRenderGraphConnectionPoint.IsShadowGenerator(shadowGeneratorsConnectedPoint.value)) {
142
+ this._frameGraphTask.shadowGenerators[0] = shadowGeneratorsConnectedPoint.value;
143
+ }
124
144
  }
125
145
  }
126
146
  _dumpPropertiesCode() {
@@ -1 +1 @@
1
- {"version":3,"file":"baseObjectRendererBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.ts"],"names":[],"mappings":";AAWA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,wCAAwC,EAAE,MAAM,kCAAkC,CAAC;AAC5F,OAAO,EAAE,sBAAsB,EAA0B,MAAM,sCAAsC,CAAC;AAEtG;;GAEG;AACH,MAAM,OAAO,sCAAuC,SAAQ,oBAAoB;IAG5E;;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,aAAa,EAAE,wCAAwC,CAAC,OAAO,CAAC,CAAC;QACpF,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,wCAAwC,CAAC,uCAAuC,EAAE,IAAI,CAAC,CAAC;QACpH,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,wCAAwC,CAAC,MAAM,CAAC,CAAC;QAC9E,IAAI,CAAC,aAAa,CAAC,SAAS,EAAE,wCAAwC,CAAC,UAAU,CAAC,CAAC;QACnF,IAAI,CAAC,aAAa,CAAC,cAAc,EAAE,wCAAwC,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAE3F,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,wCAAwC,CAAC,YAAY,CAAC,CAAC;QACrF,IAAI,CAAC,cAAc,CAAC,aAAa,EAAE,wCAAwC,CAAC,YAAY,CAAC,CAAC;QAE1F,IAAI,CAAC,WAAW,CAAC,+BAA+B,CAAC,wCAAw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GraphConnectionPoint,\r\n Scene,\r\n NodeRenderGraphBuildState,\r\n FrameGraph,\r\n FrameGraphTextureHandle,\r\n FrameGraphObjectList,\r\n Camera,\r\n FrameGraphObjectRendererTask,\r\n // eslint-disable-next-line import/no-internal-modules\r\n} from \"core/index\";\r\nimport { NodeRenderGraphBlock } from \"../../nodeRenderGraphBlock\";\r\nimport { NodeRenderGraphBlockConnectionPointTypes } from \"../../Types/nodeRenderGraphTypes\";\r\nimport { editableInPropertyPage, PropertyTypeForEdition } from \"../../../../Decorators/nodeDecorator\";\r\n\r\n/**\r\n * @internal\r\n */\r\nexport class NodeRenderGraphBaseObjectRendererBlock extends NodeRenderGraphBlock {\r\n protected override _frameGraphTask: FrameGraphObjectRendererTask;\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 NodeRenderGraphBaseObjectRendererBlock\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(\"destination\", NodeRenderGraphBlockConnectionPointTypes.Texture);\r\n this.registerInput(\"depth\", NodeRenderGraphBlockConnectionPointTypes.TextureBackBufferDepthStencilAttachment, true);\r\n this.registerInput(\"camera\", NodeRenderGraphBlockConnectionPointTypes.Camera);\r\n this.registerInput(\"objects\", NodeRenderGraphBlockConnectionPointTypes.ObjectList);\r\n this.registerInput(\"dependencies\", NodeRenderGraphBlockConnectionPointTypes.Texture, true);\r\n\r\n this.registerOutput(\"output\", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);\r\n this.registerOutput(\"outputDepth\", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this.destination.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBufferDepthStencil);\r\n this.depth.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureDepthStencilAttachment);\r\n this.dependencies.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);\r\n\r\n this.output._typeConnectionSource = this.destination;\r\n this.outputDepth._typeConnectionSource = this.depth;\r\n }\r\n\r\n /** Indicates if depth testing must be enabled or disabled */\r\n @editableInPropertyPage(\"Depth test\", PropertyTypeForEdition.Boolean, \"PROPERTIES\")\r\n public get depthTest() {\r\n return this._frameGraphTask.depthTest;\r\n }\r\n\r\n public set depthTest(value: boolean) {\r\n this._frameGraphTask.depthTest = value;\r\n }\r\n\r\n /** Indicates if depth writing must be enabled or disabled */\r\n @editableInPropertyPage(\"Depth write\", PropertyTypeForEdition.Boolean, \"PROPERTIES\")\r\n public get depthWrite() {\r\n return this._frameGraphTask.depthWrite;\r\n }\r\n\r\n public set depthWrite(value: boolean) {\r\n this._frameGraphTask.depthWrite = 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 \"NodeRenderGraphBaseObjectRendererBlock\";\r\n }\r\n\r\n /**\r\n * Gets the destination texture input component\r\n */\r\n public get destination(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the depth texture input component\r\n */\r\n public get depth(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[1];\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 objects input component\r\n */\r\n public get objects(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[3];\r\n }\r\n\r\n /**\r\n * Gets the dependencies input component\r\n */\r\n public get dependencies(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[4];\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 /**\r\n * Gets the output depth component\r\n */\r\n public get outputDepth(): NodeRenderGraphConnectionPoint {\r\n return this._outputs[1];\r\n }\r\n\r\n protected override _buildBlock(state: NodeRenderGraphBuildState) {\r\n super._buildBlock(state);\r\n\r\n this._frameGraphTask.name = this.name;\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.outputDepth.value = this._frameGraphTask.outputDepthTexture; // the value of the outputDepth connection point is the \"outputDepth\" texture of the task\r\n\r\n const destinationConnectedPoint = this.destination.connectedPoint;\r\n if (destinationConnectedPoint) {\r\n this._frameGraphTask.destinationTexture = destinationConnectedPoint.value as FrameGraphTextureHandle;\r\n }\r\n\r\n const depthConnectedPoint = this.depth.connectedPoint;\r\n if (depthConnectedPoint) {\r\n this._frameGraphTask.depthTexture = depthConnectedPoint.value as FrameGraphTextureHandle;\r\n }\r\n\r\n const cameraConnectedPoint = this.camera.connectedPoint;\r\n if (cameraConnectedPoint) {\r\n this._frameGraphTask.camera = cameraConnectedPoint.value as Camera;\r\n }\r\n\r\n const objectsConnectedPoint = this.objects.connectedPoint;\r\n if (objectsConnectedPoint) {\r\n this._frameGraphTask.objectList = objectsConnectedPoint.value as FrameGraphObjectList;\r\n }\r\n\r\n this._frameGraphTask.dependencies = [];\r\n\r\n const dependenciesConnectedPoint = this.dependencies.connectedPoint;\r\n if (dependenciesConnectedPoint) {\r\n this._frameGraphTask.dependencies[0] = dependenciesConnectedPoint.value as FrameGraphTextureHandle;\r\n }\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codes: string[] = [];\r\n codes.push(`${this._codeVariableName}.depthTest = ${this.depthTest};`);\r\n codes.push(`${this._codeVariableName}.depthWrite = ${this.depthWrite};`);\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.depthTest = this.depthTest;\r\n serializationObject.depthWrite = this.depthWrite;\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n this.depthTest = serializationObject.depthTest;\r\n this.depthWrite = serializationObject.depthWrite;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"baseObjectRendererBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.ts"],"names":[],"mappings":";AAYA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,wCAAwC,EAAE,MAAM,kCAAkC,CAAC;AAC5F,OAAO,EAAE,sBAAsB,EAA0B,MAAM,sCAAsC,CAAC;AACtG,OAAO,EAAE,8BAA8B,EAAE,MAAM,2CAA2C,CAAC;AAE3F;;GAEG;AACH,MAAM,OAAO,sCAAuC,SAAQ,oBAAoB;IAG5E;;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,aAAa,EAAE,wCAAwC,CAAC,OAAO,CAAC,CAAC;QACpF,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,wCAAwC,CAAC,uCAAuC,EAAE,IAAI,CAAC,CAAC;QACpH,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,wCAAwC,CAAC,MAAM,CAAC,CAAC;QAC9E,IAAI,CAAC,aAAa,CAAC,SAAS,EAAE,wCAAwC,CAAC,UAAU,CAAC,CAAC;QACnF,IAAI,CAAC,qBAAqB,EAAE,CAAC;QAC7B,IAAI,CAAC,aAAa,CAAC,kBAAkB,EAAE,wCAAwC,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC;QAEvG,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,wCAA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sB,CAAC,aAAa,0CAAkC,YAAY,CAAC;wEAGnF","sourcesContent":["import type {\r\n Scene,\r\n NodeRenderGraphBuildState,\r\n FrameGraph,\r\n FrameGraphTextureHandle,\r\n FrameGraphObjectList,\r\n Camera,\r\n FrameGraphObjectRendererTask,\r\n NodeRenderGraphResourceContainerBlock,\r\n FrameGraphShadowGeneratorTask,\r\n // eslint-disable-next-line import/no-internal-modules\r\n} from \"core/index\";\r\nimport { NodeRenderGraphBlock } from \"../../nodeRenderGraphBlock\";\r\nimport { NodeRenderGraphBlockConnectionPointTypes } from \"../../Types/nodeRenderGraphTypes\";\r\nimport { editableInPropertyPage, PropertyTypeForEdition } from \"../../../../Decorators/nodeDecorator\";\r\nimport { NodeRenderGraphConnectionPoint } from \"../../nodeRenderGraphBlockConnectionPoint\";\r\n\r\n/**\r\n * @internal\r\n */\r\nexport class NodeRenderGraphBaseObjectRendererBlock extends NodeRenderGraphBlock {\r\n protected override _frameGraphTask: FrameGraphObjectRendererTask;\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 NodeRenderGraphBaseObjectRendererBlock\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(\"destination\", NodeRenderGraphBlockConnectionPointTypes.Texture);\r\n this.registerInput(\"depth\", NodeRenderGraphBlockConnectionPointTypes.TextureBackBufferDepthStencilAttachment, true);\r\n this.registerInput(\"camera\", NodeRenderGraphBlockConnectionPointTypes.Camera);\r\n this.registerInput(\"objects\", NodeRenderGraphBlockConnectionPointTypes.ObjectList);\r\n this._addDependenciesInput();\r\n this.registerInput(\"shadowGenerators\", NodeRenderGraphBlockConnectionPointTypes.ShadowGenerator, true);\r\n\r\n this.registerOutput(\"output\", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);\r\n this.registerOutput(\"outputDepth\", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this.destination.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBufferDepthStencil);\r\n this.depth.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureDepthStencilAttachment);\r\n this.shadowGenerators.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.ResourceContainer);\r\n\r\n this.output._typeConnectionSource = this.destination;\r\n this.outputDepth._typeConnectionSource = this.depth;\r\n }\r\n\r\n /** Indicates if depth testing must be enabled or disabled */\r\n @editableInPropertyPage(\"Depth test\", PropertyTypeForEdition.Boolean, \"PROPERTIES\")\r\n public get depthTest() {\r\n return this._frameGraphTask.depthTest;\r\n }\r\n\r\n public set depthTest(value: boolean) {\r\n this._frameGraphTask.depthTest = value;\r\n }\r\n\r\n /** Indicates if depth writing must be enabled or disabled */\r\n @editableInPropertyPage(\"Depth write\", PropertyTypeForEdition.Boolean, \"PROPERTIES\")\r\n public get depthWrite() {\r\n return this._frameGraphTask.depthWrite;\r\n }\r\n\r\n public set depthWrite(value: boolean) {\r\n this._frameGraphTask.depthWrite = 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 \"NodeRenderGraphBaseObjectRendererBlock\";\r\n }\r\n\r\n /**\r\n * Gets the destination texture input component\r\n */\r\n public get destination(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the depth texture input component\r\n */\r\n public get depth(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[1];\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 objects input component\r\n */\r\n public get objects(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[3];\r\n }\r\n\r\n /**\r\n * Gets the dependencies input component\r\n */\r\n public get dependencies(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[4];\r\n }\r\n\r\n /**\r\n * Gets the shadowGenerators input component\r\n */\r\n public get shadowGenerators(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[5];\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 /**\r\n * Gets the output depth component\r\n */\r\n public get outputDepth(): NodeRenderGraphConnectionPoint {\r\n return this._outputs[1];\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.outputDepth.value = this._frameGraphTask.outputDepthTexture; // the value of the outputDepth connection point is the \"outputDepth\" texture of the task\r\n\r\n this._frameGraphTask.destinationTexture = this.destination.connectedPoint?.value as FrameGraphTextureHandle;\r\n this._frameGraphTask.depthTexture = this.depth.connectedPoint?.value as FrameGraphTextureHandle;\r\n this._frameGraphTask.camera = this.camera.connectedPoint?.value as Camera;\r\n this._frameGraphTask.objectList = this.objects.connectedPoint?.value as FrameGraphObjectList;\r\n\r\n this._frameGraphTask.dependencies = [];\r\n\r\n const dependenciesConnectedPoint = this.dependencies.connectedPoint;\r\n if (dependenciesConnectedPoint) {\r\n if (dependenciesConnectedPoint.type === NodeRenderGraphBlockConnectionPointTypes.ResourceContainer) {\r\n const container = dependenciesConnectedPoint.ownerBlock as NodeRenderGraphResourceContainerBlock;\r\n container.inputs.forEach((input) => {\r\n if (input.connectedPoint && input.connectedPoint.value !== undefined && NodeRenderGraphConnectionPoint.IsTextureHandle(input.connectedPoint.value)) {\r\n this._frameGraphTask.dependencies!.push(input.connectedPoint.value as FrameGraphTextureHandle);\r\n }\r\n });\r\n } else if (NodeRenderGraphConnectionPoint.IsTextureHandle(dependenciesConnectedPoint.value)) {\r\n this._frameGraphTask.dependencies[0] = dependenciesConnectedPoint.value as FrameGraphTextureHandle;\r\n }\r\n }\r\n\r\n this._frameGraphTask.shadowGenerators = [];\r\n\r\n const shadowGeneratorsConnectedPoint = this.shadowGenerators.connectedPoint;\r\n if (shadowGeneratorsConnectedPoint) {\r\n if (shadowGeneratorsConnectedPoint.type === NodeRenderGraphBlockConnectionPointTypes.ResourceContainer) {\r\n const container = shadowGeneratorsConnectedPoint.ownerBlock as NodeRenderGraphResourceContainerBlock;\r\n container.inputs.forEach((input) => {\r\n if (input.connectedPoint && input.connectedPoint.value !== undefined && NodeRenderGraphConnectionPoint.IsShadowGenerator(input.connectedPoint.value)) {\r\n this._frameGraphTask.shadowGenerators!.push(input.connectedPoint.value as FrameGraphShadowGeneratorTask);\r\n }\r\n });\r\n } else if (NodeRenderGraphConnectionPoint.IsShadowGenerator(shadowGeneratorsConnectedPoint.value)) {\r\n this._frameGraphTask.shadowGenerators[0] = shadowGeneratorsConnectedPoint.value as FrameGraphShadowGeneratorTask;\r\n }\r\n }\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codes: string[] = [];\r\n codes.push(`${this._codeVariableName}.depthTest = ${this.depthTest};`);\r\n codes.push(`${this._codeVariableName}.depthWrite = ${this.depthWrite};`);\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.depthTest = this.depthTest;\r\n serializationObject.depthWrite = this.depthWrite;\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n this.depthTest = serializationObject.depthTest;\r\n this.depthWrite = serializationObject.depthWrite;\r\n }\r\n}\r\n"]}
@@ -0,0 +1,77 @@
1
+ import type { NodeRenderGraphConnectionPoint, Scene, NodeRenderGraphBuildState, FrameGraph, FrameGraphShadowGeneratorTask } from "../../../../index.js";
2
+ import { NodeRenderGraphBlock } from "../../nodeRenderGraphBlock";
3
+ /**
4
+ * @internal
5
+ */
6
+ export declare class NodeRenderGraphBaseShadowGeneratorBlock extends NodeRenderGraphBlock {
7
+ protected _frameGraphTask: FrameGraphShadowGeneratorTask;
8
+ /**
9
+ * Gets the frame graph task associated with this block
10
+ */
11
+ get task(): FrameGraphShadowGeneratorTask;
12
+ /**
13
+ * Create a new NodeRenderGraphBaseShadowGeneratorBlock
14
+ * @param name defines the block name
15
+ * @param frameGraph defines the hosting frame graph
16
+ * @param scene defines the hosting scene
17
+ */
18
+ constructor(name: string, frameGraph: FrameGraph, scene: Scene);
19
+ /** Sets the size of the shadow texture */
20
+ get mapSize(): number;
21
+ set mapSize(value: number);
22
+ /** Sets the texture type to float (by default, half float is used if supported) */
23
+ get useFloat32TextureType(): boolean;
24
+ set useFloat32TextureType(value: boolean);
25
+ /** Sets the texture type to Red */
26
+ get useRedTextureFormat(): boolean;
27
+ set useRedTextureFormat(value: boolean);
28
+ /** Sets the bias */
29
+ get bias(): number;
30
+ set bias(value: number);
31
+ /** Sets the normal bias */
32
+ get normalBias(): number;
33
+ set normalBias(value: number);
34
+ /** Sets the darkness of the shadows */
35
+ get darkness(): number;
36
+ set darkness(value: number);
37
+ /** Sets the filter method */
38
+ get filter(): number;
39
+ set filter(value: number);
40
+ /** Sets the filter quality (for PCF and PCSS) */
41
+ get filteringQuality(): number;
42
+ set filteringQuality(value: number);
43
+ /** Gets or sets the ability to have transparent shadow */
44
+ get transparencyShadow(): boolean;
45
+ set transparencyShadow(value: boolean);
46
+ /** Enables or disables shadows with varying strength based on the transparency */
47
+ get enableSoftTransparentShadow(): boolean;
48
+ set enableSoftTransparentShadow(value: boolean);
49
+ /** If this is true, use the opacity texture's alpha channel for transparent shadows instead of the diffuse one */
50
+ get useOpacityTextureForTransparentShadow(): boolean;
51
+ set useOpacityTextureForTransparentShadow(value: boolean);
52
+ /**
53
+ * Gets the current class name
54
+ * @returns the class name
55
+ */
56
+ getClassName(): string;
57
+ /**
58
+ * Gets the light input component
59
+ */
60
+ get light(): NodeRenderGraphConnectionPoint;
61
+ /**
62
+ * Gets the objects input component
63
+ */
64
+ get objects(): NodeRenderGraphConnectionPoint;
65
+ /**
66
+ * Gets the shadow generator component
67
+ */
68
+ get generator(): NodeRenderGraphConnectionPoint;
69
+ /**
70
+ * Gets the output texture component
71
+ */
72
+ get output(): NodeRenderGraphConnectionPoint;
73
+ protected _buildBlock(state: NodeRenderGraphBuildState): void;
74
+ protected _dumpPropertiesCode(): string;
75
+ serialize(): any;
76
+ _deserialize(serializationObject: any): void;
77
+ }
@@ -0,0 +1,250 @@
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
+ import { ShadowGenerator } from "../../../../Lights/Shadows/shadowGenerator.js";
6
+ /**
7
+ * @internal
8
+ */
9
+ export class NodeRenderGraphBaseShadowGeneratorBlock extends NodeRenderGraphBlock {
10
+ /**
11
+ * Gets the frame graph task associated with this block
12
+ */
13
+ get task() {
14
+ return this._frameGraphTask;
15
+ }
16
+ /**
17
+ * Create a new NodeRenderGraphBaseShadowGeneratorBlock
18
+ * @param name defines the block name
19
+ * @param frameGraph defines the hosting frame graph
20
+ * @param scene defines the hosting scene
21
+ */
22
+ constructor(name, frameGraph, scene) {
23
+ super(name, frameGraph, scene);
24
+ this.registerInput("light", NodeRenderGraphBlockConnectionPointTypes.ShadowLight);
25
+ this.registerInput("objects", NodeRenderGraphBlockConnectionPointTypes.ObjectList);
26
+ this.registerOutput("generator", NodeRenderGraphBlockConnectionPointTypes.ShadowGenerator);
27
+ this.registerOutput("output", NodeRenderGraphBlockConnectionPointTypes.Texture);
28
+ }
29
+ /** Sets the size of the shadow texture */
30
+ get mapSize() {
31
+ return this._frameGraphTask.mapSize;
32
+ }
33
+ set mapSize(value) {
34
+ this._frameGraphTask.mapSize = value;
35
+ }
36
+ /** Sets the texture type to float (by default, half float is used if supported) */
37
+ get useFloat32TextureType() {
38
+ return this._frameGraphTask.useFloat32TextureType;
39
+ }
40
+ set useFloat32TextureType(value) {
41
+ this._frameGraphTask.useFloat32TextureType = value;
42
+ }
43
+ /** Sets the texture type to Red */
44
+ get useRedTextureFormat() {
45
+ return this._frameGraphTask.useRedTextureFormat;
46
+ }
47
+ set useRedTextureFormat(value) {
48
+ this._frameGraphTask.useRedTextureFormat = value;
49
+ }
50
+ /** Sets the bias */
51
+ get bias() {
52
+ return this._frameGraphTask.bias;
53
+ }
54
+ set bias(value) {
55
+ this._frameGraphTask.bias = value;
56
+ }
57
+ /** Sets the normal bias */
58
+ get normalBias() {
59
+ return this._frameGraphTask.normalBias;
60
+ }
61
+ set normalBias(value) {
62
+ this._frameGraphTask.normalBias = value;
63
+ }
64
+ /** Sets the darkness of the shadows */
65
+ get darkness() {
66
+ return this._frameGraphTask.darkness;
67
+ }
68
+ set darkness(value) {
69
+ this._frameGraphTask.darkness = value;
70
+ }
71
+ /** Sets the filter method */
72
+ get filter() {
73
+ return this._frameGraphTask.filter;
74
+ }
75
+ set filter(value) {
76
+ this._frameGraphTask.filter = value;
77
+ }
78
+ /** Sets the filter quality (for PCF and PCSS) */
79
+ get filteringQuality() {
80
+ return this._frameGraphTask.filteringQuality;
81
+ }
82
+ set filteringQuality(value) {
83
+ this._frameGraphTask.filteringQuality = value;
84
+ }
85
+ /** Gets or sets the ability to have transparent shadow */
86
+ get transparencyShadow() {
87
+ return this._frameGraphTask.transparencyShadow;
88
+ }
89
+ set transparencyShadow(value) {
90
+ this._frameGraphTask.transparencyShadow = value;
91
+ }
92
+ /** Enables or disables shadows with varying strength based on the transparency */
93
+ get enableSoftTransparentShadow() {
94
+ return this._frameGraphTask.enableSoftTransparentShadow;
95
+ }
96
+ set enableSoftTransparentShadow(value) {
97
+ this._frameGraphTask.enableSoftTransparentShadow = value;
98
+ }
99
+ /** If this is true, use the opacity texture's alpha channel for transparent shadows instead of the diffuse one */
100
+ get useOpacityTextureForTransparentShadow() {
101
+ return this._frameGraphTask.useOpacityTextureForTransparentShadow;
102
+ }
103
+ set useOpacityTextureForTransparentShadow(value) {
104
+ this._frameGraphTask.useOpacityTextureForTransparentShadow = value;
105
+ }
106
+ /**
107
+ * Gets the current class name
108
+ * @returns the class name
109
+ */
110
+ getClassName() {
111
+ return "NodeRenderGraphBaseShadowGeneratorBlock";
112
+ }
113
+ /**
114
+ * Gets the light input component
115
+ */
116
+ get light() {
117
+ return this._inputs[0];
118
+ }
119
+ /**
120
+ * Gets the objects input component
121
+ */
122
+ get objects() {
123
+ return this._inputs[1];
124
+ }
125
+ /**
126
+ * Gets the shadow generator component
127
+ */
128
+ get generator() {
129
+ return this._outputs[0];
130
+ }
131
+ /**
132
+ * Gets the output texture component
133
+ */
134
+ get output() {
135
+ return this._outputs[1];
136
+ }
137
+ _buildBlock(state) {
138
+ super._buildBlock(state);
139
+ this._frameGraphTask.light = this.light.connectedPoint?.value;
140
+ this._frameGraphTask.objectList = this.objects.connectedPoint?.value;
141
+ // Important: the shadow generator object is created by the task when we set the light, that's why we must set generator.value after setting the light!
142
+ this.generator.value = this._frameGraphTask;
143
+ this.output.value = this._frameGraphTask.outputTexture;
144
+ }
145
+ _dumpPropertiesCode() {
146
+ const codes = [];
147
+ codes.push(`${this._codeVariableName}.mapSize = ${this.mapSize};`);
148
+ codes.push(`${this._codeVariableName}.useFloat32TextureType = ${this.useFloat32TextureType};`);
149
+ codes.push(`${this._codeVariableName}.useRedTextureFormat = ${this.useRedTextureFormat};`);
150
+ codes.push(`${this._codeVariableName}.bias = ${this.bias};`);
151
+ codes.push(`${this._codeVariableName}.normalBias = ${this.normalBias};`);
152
+ codes.push(`${this._codeVariableName}.darkness = ${this.darkness};`);
153
+ codes.push(`${this._codeVariableName}.filter = ${this.filter};`);
154
+ codes.push(`${this._codeVariableName}.filteringQuality = ${this.filteringQuality};`);
155
+ codes.push(`${this._codeVariableName}.transparencyShadow = ${this.transparencyShadow};`);
156
+ codes.push(`${this._codeVariableName}.enableSoftTransparentShadow = ${this.enableSoftTransparentShadow};`);
157
+ codes.push(`${this._codeVariableName}.useOpacityTextureForTransparentShadow = ${this.useOpacityTextureForTransparentShadow};`);
158
+ return super._dumpPropertiesCode() + codes.join("\n");
159
+ }
160
+ serialize() {
161
+ const serializationObject = super.serialize();
162
+ serializationObject.mapSize = this.mapSize;
163
+ serializationObject.useFloat32TextureType = this.useFloat32TextureType;
164
+ serializationObject.useRedTextureFormat = this.useRedTextureFormat;
165
+ serializationObject.bias = this.bias;
166
+ serializationObject.normalBias = this.normalBias;
167
+ serializationObject.darkness = this.darkness;
168
+ serializationObject.filter = this.filter;
169
+ serializationObject.filteringQuality = this.filteringQuality;
170
+ serializationObject.transparencyShadow = this.transparencyShadow;
171
+ serializationObject.enableSoftTransparentShadow = this.enableSoftTransparentShadow;
172
+ serializationObject.useOpacityTextureForTransparentShadow = this.useOpacityTextureForTransparentShadow;
173
+ return serializationObject;
174
+ }
175
+ _deserialize(serializationObject) {
176
+ super._deserialize(serializationObject);
177
+ this.mapSize = serializationObject.mapSize;
178
+ this.useFloat32TextureType = serializationObject.useFloat32TextureType;
179
+ this.useRedTextureFormat = serializationObject.useRedTextureFormat;
180
+ this.bias = serializationObject.bias;
181
+ this.normalBias = serializationObject.normalBias;
182
+ this.darkness = serializationObject.darkness;
183
+ this.filter = serializationObject.filter;
184
+ this.filteringQuality = serializationObject.filteringQuality;
185
+ this.transparencyShadow = serializationObject.transparencyShadow;
186
+ this.enableSoftTransparentShadow = serializationObject.enableSoftTransparentShadow;
187
+ this.useOpacityTextureForTransparentShadow = serializationObject.useOpacityTextureForTransparentShadow;
188
+ }
189
+ }
190
+ __decorate([
191
+ editableInPropertyPage("Map size", 4 /* PropertyTypeForEdition.List */, "PROPERTIES", {
192
+ options: [
193
+ { label: "128", value: 128 },
194
+ { label: "256", value: 256 },
195
+ { label: "512", value: 512 },
196
+ { label: "1024", value: 1024 },
197
+ { label: "2048", value: 2048 },
198
+ { label: "4096", value: 4096 },
199
+ { label: "8192", value: 8192 },
200
+ ],
201
+ })
202
+ ], NodeRenderGraphBaseShadowGeneratorBlock.prototype, "mapSize", null);
203
+ __decorate([
204
+ editableInPropertyPage("Use 32 bits float texture type", 0 /* PropertyTypeForEdition.Boolean */, "PROPERTIES")
205
+ ], NodeRenderGraphBaseShadowGeneratorBlock.prototype, "useFloat32TextureType", null);
206
+ __decorate([
207
+ editableInPropertyPage("Use red texture format", 0 /* PropertyTypeForEdition.Boolean */, "PROPERTIES")
208
+ ], NodeRenderGraphBaseShadowGeneratorBlock.prototype, "useRedTextureFormat", null);
209
+ __decorate([
210
+ editableInPropertyPage("Bias", 1 /* PropertyTypeForEdition.Float */, "PROPERTIES", { min: 0, max: 1 })
211
+ ], NodeRenderGraphBaseShadowGeneratorBlock.prototype, "bias", null);
212
+ __decorate([
213
+ editableInPropertyPage("Normal bias", 1 /* PropertyTypeForEdition.Float */, "PROPERTIES", { min: 0, max: 1 })
214
+ ], NodeRenderGraphBaseShadowGeneratorBlock.prototype, "normalBias", null);
215
+ __decorate([
216
+ editableInPropertyPage("Darkness", 1 /* PropertyTypeForEdition.Float */, "PROPERTIES", { min: 0, max: 1 })
217
+ ], NodeRenderGraphBaseShadowGeneratorBlock.prototype, "darkness", null);
218
+ __decorate([
219
+ editableInPropertyPage("Filter", 4 /* PropertyTypeForEdition.List */, "PROPERTIES", {
220
+ options: [
221
+ { label: "None", value: ShadowGenerator.FILTER_NONE },
222
+ { label: "Exponential", value: ShadowGenerator.FILTER_EXPONENTIALSHADOWMAP },
223
+ { label: "Poisson Sampling", value: ShadowGenerator.FILTER_POISSONSAMPLING },
224
+ { label: "Blur exponential", value: ShadowGenerator.FILTER_BLUREXPONENTIALSHADOWMAP },
225
+ { label: "Close exponential", value: ShadowGenerator.FILTER_CLOSEEXPONENTIALSHADOWMAP },
226
+ { label: "Blur close exponential", value: ShadowGenerator.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP },
227
+ { label: "PCF", value: ShadowGenerator.FILTER_PCF },
228
+ { label: "PCSS", value: ShadowGenerator.FILTER_PCSS },
229
+ ],
230
+ })
231
+ ], NodeRenderGraphBaseShadowGeneratorBlock.prototype, "filter", null);
232
+ __decorate([
233
+ editableInPropertyPage("Filter quality", 4 /* PropertyTypeForEdition.List */, "PROPERTIES", {
234
+ options: [
235
+ { label: "Low", value: ShadowGenerator.QUALITY_LOW },
236
+ { label: "Medium", value: ShadowGenerator.QUALITY_MEDIUM },
237
+ { label: "High", value: ShadowGenerator.QUALITY_HIGH },
238
+ ],
239
+ })
240
+ ], NodeRenderGraphBaseShadowGeneratorBlock.prototype, "filteringQuality", null);
241
+ __decorate([
242
+ editableInPropertyPage("Transparency shadow", 0 /* PropertyTypeForEdition.Boolean */, "PROPERTIES")
243
+ ], NodeRenderGraphBaseShadowGeneratorBlock.prototype, "transparencyShadow", null);
244
+ __decorate([
245
+ editableInPropertyPage("Enable soft transparent shadows", 0 /* PropertyTypeForEdition.Boolean */, "PROPERTIES")
246
+ ], NodeRenderGraphBaseShadowGeneratorBlock.prototype, "enableSoftTransparentShadow", null);
247
+ __decorate([
248
+ editableInPropertyPage("Use opacity texture for transparent shadows", 0 /* PropertyTypeForEdition.Boolean */, "PROPERTIES")
249
+ ], NodeRenderGraphBaseShadowGeneratorBlock.prototype, "useOpacityTextureForTransparentShadow", null);
250
+ //# sourceMappingURL=baseShadowGeneratorBlock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"baseShadowGeneratorBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FrameGraph/Node/Blocks/Rendering/baseShadowGeneratorBlock.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,wCAAwC,EAAE,MAAM,kCAAkC,CAAC;AAC5F,OAAO,EAAE,sBAAsB,EAA0B,M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AAsB,CAAC,6CAA6C,0CAAkC,YAAY,CAAC;oGAGnH","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { NodeRenderGraphConnectionPoint, Scene, NodeRenderGraphBuildState, FrameGraph, IShadowLight, FrameGraphObjectList, FrameGraphShadowGeneratorTask } from \"core/index\";\r\nimport { NodeRenderGraphBlock } from \"../../nodeRenderGraphBlock\";\r\nimport { NodeRenderGraphBlockConnectionPointTypes } from \"../../Types/nodeRenderGraphTypes\";\r\nimport { editableInPropertyPage, PropertyTypeForEdition } from \"../../../../Decorators/nodeDecorator\";\r\nimport { ShadowGenerator } from \"../../../../Lights/Shadows/shadowGenerator\";\r\n\r\n/**\r\n * @internal\r\n */\r\nexport class NodeRenderGraphBaseShadowGeneratorBlock extends NodeRenderGraphBlock {\r\n protected override _frameGraphTask: FrameGraphShadowGeneratorTask;\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 NodeRenderGraphBaseShadowGeneratorBlock\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(\"light\", NodeRenderGraphBlockConnectionPointTypes.ShadowLight);\r\n this.registerInput(\"objects\", NodeRenderGraphBlockConnectionPointTypes.ObjectList);\r\n\r\n this.registerOutput(\"generator\", NodeRenderGraphBlockConnectionPointTypes.ShadowGenerator);\r\n this.registerOutput(\"output\", NodeRenderGraphBlockConnectionPointTypes.Texture);\r\n }\r\n\r\n /** Sets the size of the shadow texture */\r\n @editableInPropertyPage(\"Map size\", PropertyTypeForEdition.List, \"PROPERTIES\", {\r\n options: [\r\n { label: \"128\", value: 128 },\r\n { label: \"256\", value: 256 },\r\n { label: \"512\", value: 512 },\r\n { label: \"1024\", value: 1024 },\r\n { label: \"2048\", value: 2048 },\r\n { label: \"4096\", value: 4096 },\r\n { label: \"8192\", value: 8192 },\r\n ],\r\n })\r\n public get mapSize() {\r\n return this._frameGraphTask.mapSize;\r\n }\r\n\r\n public set mapSize(value: number) {\r\n this._frameGraphTask.mapSize = value;\r\n }\r\n\r\n /** Sets the texture type to float (by default, half float is used if supported) */\r\n @editableInPropertyPage(\"Use 32 bits float texture type\", PropertyTypeForEdition.Boolean, \"PROPERTIES\")\r\n public get useFloat32TextureType() {\r\n return this._frameGraphTask.useFloat32TextureType;\r\n }\r\n\r\n public set useFloat32TextureType(value: boolean) {\r\n this._frameGraphTask.useFloat32TextureType = value;\r\n }\r\n\r\n /** Sets the texture type to Red */\r\n @editableInPropertyPage(\"Use red texture format\", PropertyTypeForEdition.Boolean, \"PROPERTIES\")\r\n public get useRedTextureFormat() {\r\n return this._frameGraphTask.useRedTextureFormat;\r\n }\r\n\r\n public set useRedTextureFormat(value: boolean) {\r\n this._frameGraphTask.useRedTextureFormat = value;\r\n }\r\n\r\n /** Sets the bias */\r\n @editableInPropertyPage(\"Bias\", PropertyTypeForEdition.Float, \"PROPERTIES\", { min: 0, max: 1 })\r\n public get bias() {\r\n return this._frameGraphTask.bias;\r\n }\r\n\r\n public set bias(value: number) {\r\n this._frameGraphTask.bias = value;\r\n }\r\n\r\n /** Sets the normal bias */\r\n @editableInPropertyPage(\"Normal bias\", PropertyTypeForEdition.Float, \"PROPERTIES\", { min: 0, max: 1 })\r\n public get normalBias() {\r\n return this._frameGraphTask.normalBias;\r\n }\r\n\r\n public set normalBias(value: number) {\r\n this._frameGraphTask.normalBias = value;\r\n }\r\n\r\n /** Sets the darkness of the shadows */\r\n @editableInPropertyPage(\"Darkness\", PropertyTypeForEdition.Float, \"PROPERTIES\", { min: 0, max: 1 })\r\n public get darkness() {\r\n return this._frameGraphTask.darkness;\r\n }\r\n\r\n public set darkness(value: number) {\r\n this._frameGraphTask.darkness = value;\r\n }\r\n\r\n /** Sets the filter method */\r\n @editableInPropertyPage(\"Filter\", PropertyTypeForEdition.List, \"PROPERTIES\", {\r\n options: [\r\n { label: \"None\", value: ShadowGenerator.FILTER_NONE },\r\n { label: \"Exponential\", value: ShadowGenerator.FILTER_EXPONENTIALSHADOWMAP },\r\n { label: \"Poisson Sampling\", value: ShadowGenerator.FILTER_POISSONSAMPLING },\r\n { label: \"Blur exponential\", value: ShadowGenerator.FILTER_BLUREXPONENTIALSHADOWMAP },\r\n { label: \"Close exponential\", value: ShadowGenerator.FILTER_CLOSEEXPONENTIALSHADOWMAP },\r\n { label: \"Blur close exponential\", value: ShadowGenerator.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP },\r\n { label: \"PCF\", value: ShadowGenerator.FILTER_PCF },\r\n { label: \"PCSS\", value: ShadowGenerator.FILTER_PCSS },\r\n ],\r\n })\r\n public get filter() {\r\n return this._frameGraphTask.filter;\r\n }\r\n\r\n public set filter(value: number) {\r\n this._frameGraphTask.filter = value;\r\n }\r\n\r\n /** Sets the filter quality (for PCF and PCSS) */\r\n @editableInPropertyPage(\"Filter quality\", PropertyTypeForEdition.List, \"PROPERTIES\", {\r\n options: [\r\n { label: \"Low\", value: ShadowGenerator.QUALITY_LOW },\r\n { label: \"Medium\", value: ShadowGenerator.QUALITY_MEDIUM },\r\n { label: \"High\", value: ShadowGenerator.QUALITY_HIGH },\r\n ],\r\n })\r\n public get filteringQuality() {\r\n return this._frameGraphTask.filteringQuality;\r\n }\r\n\r\n public set filteringQuality(value: number) {\r\n this._frameGraphTask.filteringQuality = value;\r\n }\r\n\r\n /** Gets or sets the ability to have transparent shadow */\r\n @editableInPropertyPage(\"Transparency shadow\", PropertyTypeForEdition.Boolean, \"PROPERTIES\")\r\n public get transparencyShadow() {\r\n return this._frameGraphTask.transparencyShadow;\r\n }\r\n\r\n public set transparencyShadow(value: boolean) {\r\n this._frameGraphTask.transparencyShadow = value;\r\n }\r\n\r\n /** Enables or disables shadows with varying strength based on the transparency */\r\n @editableInPropertyPage(\"Enable soft transparent shadows\", PropertyTypeForEdition.Boolean, \"PROPERTIES\")\r\n public get enableSoftTransparentShadow() {\r\n return this._frameGraphTask.enableSoftTransparentShadow;\r\n }\r\n\r\n public set enableSoftTransparentShadow(value: boolean) {\r\n this._frameGraphTask.enableSoftTransparentShadow = value;\r\n }\r\n\r\n /** If this is true, use the opacity texture's alpha channel for transparent shadows instead of the diffuse one */\r\n @editableInPropertyPage(\"Use opacity texture for transparent shadows\", PropertyTypeForEdition.Boolean, \"PROPERTIES\")\r\n public get useOpacityTextureForTransparentShadow() {\r\n return this._frameGraphTask.useOpacityTextureForTransparentShadow;\r\n }\r\n\r\n public set useOpacityTextureForTransparentShadow(value: boolean) {\r\n this._frameGraphTask.useOpacityTextureForTransparentShadow = 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 \"NodeRenderGraphBaseShadowGeneratorBlock\";\r\n }\r\n\r\n /**\r\n * Gets the light input component\r\n */\r\n public get light(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the objects input component\r\n */\r\n public get objects(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the shadow generator component\r\n */\r\n public get generator(): NodeRenderGraphConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n /**\r\n * Gets the output texture component\r\n */\r\n public get output(): NodeRenderGraphConnectionPoint {\r\n return this._outputs[1];\r\n }\r\n\r\n protected override _buildBlock(state: NodeRenderGraphBuildState) {\r\n super._buildBlock(state);\r\n\r\n this._frameGraphTask.light = this.light.connectedPoint?.value as IShadowLight;\r\n this._frameGraphTask.objectList = this.objects.connectedPoint?.value as FrameGraphObjectList;\r\n\r\n // Important: the shadow generator object is created by the task when we set the light, that's why we must set generator.value after setting the light!\r\n this.generator.value = this._frameGraphTask;\r\n this.output.value = this._frameGraphTask.outputTexture;\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codes: string[] = [];\r\n codes.push(`${this._codeVariableName}.mapSize = ${this.mapSize};`);\r\n codes.push(`${this._codeVariableName}.useFloat32TextureType = ${this.useFloat32TextureType};`);\r\n codes.push(`${this._codeVariableName}.useRedTextureFormat = ${this.useRedTextureFormat};`);\r\n codes.push(`${this._codeVariableName}.bias = ${this.bias};`);\r\n codes.push(`${this._codeVariableName}.normalBias = ${this.normalBias};`);\r\n codes.push(`${this._codeVariableName}.darkness = ${this.darkness};`);\r\n codes.push(`${this._codeVariableName}.filter = ${this.filter};`);\r\n codes.push(`${this._codeVariableName}.filteringQuality = ${this.filteringQuality};`);\r\n codes.push(`${this._codeVariableName}.transparencyShadow = ${this.transparencyShadow};`);\r\n codes.push(`${this._codeVariableName}.enableSoftTransparentShadow = ${this.enableSoftTransparentShadow};`);\r\n codes.push(`${this._codeVariableName}.useOpacityTextureForTransparentShadow = ${this.useOpacityTextureForTransparentShadow};`);\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.mapSize = this.mapSize;\r\n serializationObject.useFloat32TextureType = this.useFloat32TextureType;\r\n serializationObject.useRedTextureFormat = this.useRedTextureFormat;\r\n serializationObject.bias = this.bias;\r\n serializationObject.normalBias = this.normalBias;\r\n serializationObject.darkness = this.darkness;\r\n serializationObject.filter = this.filter;\r\n serializationObject.filteringQuality = this.filteringQuality;\r\n serializationObject.transparencyShadow = this.transparencyShadow;\r\n serializationObject.enableSoftTransparentShadow = this.enableSoftTransparentShadow;\r\n serializationObject.useOpacityTextureForTransparentShadow = this.useOpacityTextureForTransparentShadow;\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n this.mapSize = serializationObject.mapSize;\r\n this.useFloat32TextureType = serializationObject.useFloat32TextureType;\r\n this.useRedTextureFormat = serializationObject.useRedTextureFormat;\r\n this.bias = serializationObject.bias;\r\n this.normalBias = serializationObject.normalBias;\r\n this.darkness = serializationObject.darkness;\r\n this.filter = serializationObject.filter;\r\n this.filteringQuality = serializationObject.filteringQuality;\r\n this.transparencyShadow = serializationObject.transparencyShadow;\r\n this.enableSoftTransparentShadow = serializationObject.enableSoftTransparentShadow;\r\n this.useOpacityTextureForTransparentShadow = serializationObject.useOpacityTextureForTransparentShadow;\r\n }\r\n}\r\n"]}
@@ -0,0 +1,57 @@
1
+ import type { Scene, FrameGraph, NodeRenderGraphConnectionPoint, NodeRenderGraphBuildState } from "../../../../index.js";
2
+ import { NodeRenderGraphBaseShadowGeneratorBlock } from "./baseShadowGeneratorBlock";
3
+ import { FrameGraphCascadedShadowGeneratorTask } from "../../../Tasks/Rendering/csmShadowGeneratorTask";
4
+ /**
5
+ * Block that generates shadows through a shadow generator
6
+ */
7
+ export declare class NodeRenderGraphCascadedShadowGeneratorBlock extends NodeRenderGraphBaseShadowGeneratorBlock {
8
+ protected _frameGraphTask: FrameGraphCascadedShadowGeneratorTask;
9
+ /**
10
+ * Gets the frame graph task associated with this block
11
+ */
12
+ get task(): FrameGraphCascadedShadowGeneratorTask;
13
+ /**
14
+ * Create a new NodeRenderGraphCascadedShadowGeneratorBlock
15
+ * @param name defines the block name
16
+ * @param frameGraph defines the hosting frame graph
17
+ * @param scene defines the hosting scene
18
+ */
19
+ constructor(name: string, frameGraph: FrameGraph, scene: Scene);
20
+ /** Sets the number of cascades */
21
+ get numCascades(): number;
22
+ set numCascades(value: number);
23
+ /** Gets or sets a value indicating whether the shadow generator should display the cascades. */
24
+ get debug(): boolean;
25
+ set debug(value: boolean);
26
+ /** Gets or sets a value indicating whether the shadow generator should stabilize the cascades. */
27
+ get stabilizeCascades(): boolean;
28
+ set stabilizeCascades(value: boolean);
29
+ /** Gets or sets the lambda parameter of the shadow generator. */
30
+ get lambda(): number;
31
+ set lambda(value: number);
32
+ /** Gets or sets the cascade blend percentage. */
33
+ get cascadeBlendPercentage(): number;
34
+ set cascadeBlendPercentage(value: number);
35
+ /** Gets or sets a value indicating whether the shadow generator should use depth clamping. */
36
+ get depthClamp(): boolean;
37
+ set depthClamp(value: boolean);
38
+ /** Gets or sets a value indicating whether the shadow generator should automatically calculate the depth bounds. */
39
+ get autoCalcDepthBounds(): boolean;
40
+ set autoCalcDepthBounds(value: boolean);
41
+ /** Gets or sets the maximum shadow Z value. */
42
+ get shadowMaxZ(): number;
43
+ set shadowMaxZ(value: number);
44
+ /**
45
+ * Gets the current class name
46
+ * @returns the class name
47
+ */
48
+ getClassName(): string;
49
+ /**
50
+ * Gets the camera input component
51
+ */
52
+ get camera(): NodeRenderGraphConnectionPoint;
53
+ protected _buildBlock(state: NodeRenderGraphBuildState): void;
54
+ protected _dumpPropertiesCode(): string;
55
+ serialize(): any;
56
+ _deserialize(serializationObject: any): void;
57
+ }