@babylonjs/core 6.37.1 → 6.38.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Behaviors/Meshes/baseSixDofDragBehavior.js +1 -1
- package/Behaviors/Meshes/baseSixDofDragBehavior.js.map +1 -1
- package/Behaviors/Meshes/sixDofDragBehavior.js +26 -6
- package/Behaviors/Meshes/sixDofDragBehavior.js.map +1 -1
- package/Bones/skeleton.js +2 -2
- package/Bones/skeleton.js.map +1 -1
- package/Buffers/buffer.align.js +4 -1
- package/Buffers/buffer.align.js.map +1 -1
- package/Buffers/buffer.d.ts +10 -3
- package/Buffers/buffer.js +34 -5
- package/Buffers/buffer.js.map +1 -1
- package/Engines/Extensions/engine.cubeTexture.d.ts +1 -3
- package/Engines/Extensions/engine.cubeTexture.js +1 -3
- package/Engines/Extensions/engine.cubeTexture.js.map +1 -1
- package/Engines/Extensions/engine.renderTarget.js +6 -17
- package/Engines/Extensions/engine.renderTarget.js.map +1 -1
- package/Engines/ICanvas.d.ts +60 -0
- package/Engines/ICanvas.js.map +1 -1
- package/Engines/IPipelineContext.d.ts +3 -3
- package/Engines/IPipelineContext.js.map +1 -1
- package/Engines/Native/nativePipelineContext.d.ts +4 -5
- package/Engines/Native/nativePipelineContext.js +2 -9
- package/Engines/Native/nativePipelineContext.js.map +1 -1
- package/Engines/Native/validatedNativeDataStream.d.ts +3 -0
- package/Engines/Native/validatedNativeDataStream.js +3 -0
- package/Engines/Native/validatedNativeDataStream.js.map +1 -1
- package/Engines/WebGL/webGLRenderTargetWrapper.d.ts +11 -0
- package/Engines/WebGL/webGLRenderTargetWrapper.js +27 -0
- package/Engines/WebGL/webGLRenderTargetWrapper.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.cubeTexture.js +8 -4
- package/Engines/WebGPU/Extensions/engine.cubeTexture.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.renderTarget.js +1 -1
- package/Engines/WebGPU/Extensions/engine.renderTarget.js.map +1 -1
- package/Engines/WebGPU/webgpuCacheRenderPipeline.js.map +1 -1
- package/Engines/WebGPU/webgpuConstants.d.ts +3 -1
- package/Engines/WebGPU/webgpuConstants.js +2 -0
- package/Engines/WebGPU/webgpuConstants.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureManager.js +3 -0
- package/Engines/WebGPU/webgpuTextureManager.js.map +1 -1
- package/Engines/engine.d.ts +10 -45
- package/Engines/nativeEngine.d.ts +3 -1
- package/Engines/nativeEngine.js +29 -30
- package/Engines/nativeEngine.js.map +1 -1
- package/Engines/renderTargetWrapper.js +7 -1
- package/Engines/renderTargetWrapper.js.map +1 -1
- package/Engines/thinEngine.d.ts +3 -3
- package/Engines/thinEngine.js +16 -8
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.d.ts +2 -2
- package/Engines/webgpuEngine.js +7 -13
- package/Engines/webgpuEngine.js.map +1 -1
- package/FlowGraph/Blocks/Data/Logic/index.d.ts +0 -1
- package/FlowGraph/Blocks/Data/Logic/index.js +0 -1
- package/FlowGraph/Blocks/Data/Logic/index.js.map +1 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.d.ts +327 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.js +465 -74
- package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.d.ts +3 -0
- package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphUnaryOperationBlock.d.ts +1 -1
- package/FlowGraph/Blocks/Data/flowGraphUnaryOperationBlock.js +2 -2
- package/FlowGraph/Blocks/Data/flowGraphUnaryOperationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.d.ts +7 -3
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.js +7 -6
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSequenceBlock.d.ts +14 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSequenceBlock.js +4 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSequenceBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.d.ts +3 -0
- package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.js.map +1 -1
- package/FlowGraph/flowGraphConnection.d.ts +16 -0
- package/FlowGraph/flowGraphConnection.js.map +1 -1
- package/FlowGraph/flowGraphContext.d.ts +14 -0
- package/FlowGraph/flowGraphContext.js.map +1 -1
- package/FlowGraph/flowGraphInteger.d.ts +62 -0
- package/FlowGraph/flowGraphInteger.js +76 -0
- package/FlowGraph/flowGraphInteger.js.map +1 -0
- package/FlowGraph/flowGraphPathConverterComponent.d.ts +2 -1
- package/FlowGraph/flowGraphPathConverterComponent.js +3 -3
- package/FlowGraph/flowGraphPathConverterComponent.js.map +1 -1
- package/FlowGraph/flowGraphRichTypes.d.ts +2 -0
- package/FlowGraph/flowGraphRichTypes.js +5 -0
- package/FlowGraph/flowGraphRichTypes.js.map +1 -1
- package/FlowGraph/serialization.js +8 -1
- package/FlowGraph/serialization.js.map +1 -1
- package/Gizmos/boundingBoxGizmo.js +1 -1
- package/Gizmos/boundingBoxGizmo.js.map +1 -1
- package/Gizmos/cameraGizmo.d.ts +9 -2
- package/Gizmos/cameraGizmo.js +29 -10
- package/Gizmos/cameraGizmo.js.map +1 -1
- package/Inputs/scene.inputManager.js +1 -1
- package/Inputs/scene.inputManager.js.map +1 -1
- package/Lights/shadowLight.d.ts +2 -2
- package/Lights/shadowLight.js +1 -1
- package/Lights/shadowLight.js.map +1 -1
- package/Lights/spotLight.js +1 -1
- package/Lights/spotLight.js.map +1 -1
- package/Materials/Node/Blocks/addBlock.js +1 -1
- package/Materials/Node/Blocks/addBlock.js.map +1 -1
- package/Materials/Node/Blocks/divideBlock.js +1 -1
- package/Materials/Node/Blocks/divideBlock.js.map +1 -1
- package/Materials/Node/Blocks/multiplyBlock.js +1 -1
- package/Materials/Node/Blocks/multiplyBlock.js.map +1 -1
- package/Materials/Node/Blocks/subtractBlock.js +1 -1
- package/Materials/Node/Blocks/subtractBlock.js.map +1 -1
- package/Materials/PBR/pbrMaterial.d.ts +1 -0
- package/Materials/PBR/pbrMaterial.js +1 -0
- package/Materials/PBR/pbrMaterial.js.map +1 -1
- package/Materials/Textures/baseTexture.d.ts +1 -1
- package/Materials/Textures/baseTexture.js +1 -1
- package/Materials/Textures/baseTexture.js.map +1 -1
- package/Materials/Textures/internalTexture.js +5 -0
- package/Materials/Textures/internalTexture.js.map +1 -1
- package/Materials/Textures/multiRenderTarget.d.ts +1 -1
- package/Materials/Textures/multiRenderTarget.js +4 -4
- package/Materials/Textures/multiRenderTarget.js.map +1 -1
- package/Materials/Textures/videoTexture.js +2 -0
- package/Materials/Textures/videoTexture.js.map +1 -1
- package/Materials/effect.js +2 -1
- package/Materials/effect.js.map +1 -1
- package/Materials/materialPluginManager.d.ts +1 -1
- package/Materials/materialPluginManager.js.map +1 -1
- package/Meshes/Node/Blocks/geometryArcTan2Block.d.ts +30 -0
- package/Meshes/Node/Blocks/geometryArcTan2Block.js +81 -0
- package/Meshes/Node/Blocks/geometryArcTan2Block.js.map +1 -0
- package/Meshes/Node/Blocks/geometryClampBlock.d.ts +33 -0
- package/Meshes/Node/Blocks/geometryClampBlock.js +101 -0
- package/Meshes/Node/Blocks/geometryClampBlock.js.map +1 -0
- package/Meshes/Node/Blocks/geometryCrossBlock.d.ts +30 -0
- package/Meshes/Node/Blocks/geometryCrossBlock.js +76 -0
- package/Meshes/Node/Blocks/geometryCrossBlock.js.map +1 -0
- package/Meshes/Node/Blocks/geometryLerpBlock.d.ts +34 -0
- package/Meshes/Node/Blocks/geometryLerpBlock.js +90 -0
- package/Meshes/Node/Blocks/geometryLerpBlock.js.map +1 -0
- package/Meshes/Node/Blocks/geometryModBlock.d.ts +30 -0
- package/Meshes/Node/Blocks/geometryModBlock.js +82 -0
- package/Meshes/Node/Blocks/geometryModBlock.js.map +1 -0
- package/Meshes/Node/Blocks/geometryNLerpBlock.d.ts +34 -0
- package/Meshes/Node/Blocks/geometryNLerpBlock.js +96 -0
- package/Meshes/Node/Blocks/geometryNLerpBlock.js.map +1 -0
- package/Meshes/Node/Blocks/geometryPowBlock.d.ts +30 -0
- package/Meshes/Node/Blocks/geometryPowBlock.js +82 -0
- package/Meshes/Node/Blocks/geometryPowBlock.js.map +1 -0
- package/Meshes/Node/Blocks/geometrySmoothStepBlock.d.ts +34 -0
- package/Meshes/Node/Blocks/geometrySmoothStepBlock.js +91 -0
- package/Meshes/Node/Blocks/geometrySmoothStepBlock.js.map +1 -0
- package/Meshes/Node/Blocks/geometryStepBlock.d.ts +30 -0
- package/Meshes/Node/Blocks/geometryStepBlock.js +84 -0
- package/Meshes/Node/Blocks/geometryStepBlock.js.map +1 -0
- package/Meshes/Node/Blocks/geometryTrigonometryBlock.d.ts +19 -15
- package/Meshes/Node/Blocks/geometryTrigonometryBlock.js +37 -17
- package/Meshes/Node/Blocks/geometryTrigonometryBlock.js.map +1 -1
- package/Meshes/Node/index.d.ts +9 -0
- package/Meshes/Node/index.js +9 -0
- package/Meshes/Node/index.js.map +1 -1
- package/Meshes/geometry.js +8 -5
- package/Meshes/geometry.js.map +1 -1
- package/Meshes/thinInstanceMesh.d.ts +1 -1
- package/Meshes/thinInstanceMesh.js +2 -2
- package/Meshes/thinInstanceMesh.js.map +1 -1
- package/Navigation/INavigationEngine.d.ts +10 -1
- package/Navigation/INavigationEngine.js.map +1 -1
- package/Navigation/Plugins/recastJSPlugin.d.ts +20 -0
- package/Navigation/Plugins/recastJSPlugin.js +43 -8
- package/Navigation/Plugins/recastJSPlugin.js.map +1 -1
- package/ObjectModel/objectModelInterfaces.d.ts +5 -0
- package/ObjectModel/objectModelInterfaces.js.map +1 -1
- package/Particles/gpuParticleSystem.d.ts +1 -0
- package/Particles/gpuParticleSystem.js +10 -3
- package/Particles/gpuParticleSystem.js.map +1 -1
- package/Physics/v2/ragdoll.js +4 -0
- package/Physics/v2/ragdoll.js.map +1 -1
- package/Rendering/GaussianSplatting/gaussianSplatting.d.ts +6 -0
- package/Rendering/GaussianSplatting/gaussianSplatting.js +124 -39
- package/Rendering/GaussianSplatting/gaussianSplatting.js.map +1 -1
- package/Rendering/GlobalIllumination/giRSM.d.ts +54 -0
- package/Rendering/GlobalIllumination/giRSM.js +54 -0
- package/Rendering/GlobalIllumination/giRSM.js.map +1 -0
- package/Rendering/GlobalIllumination/giRSMManager.d.ts +256 -0
- package/Rendering/GlobalIllumination/giRSMManager.js +715 -0
- package/Rendering/GlobalIllumination/giRSMManager.js.map +1 -0
- package/Rendering/GlobalIllumination/index.d.ts +2 -0
- package/Rendering/GlobalIllumination/index.js +3 -0
- package/Rendering/GlobalIllumination/index.js.map +1 -0
- package/Rendering/fluidRenderer/fluidRenderer.js +20 -1
- package/Rendering/fluidRenderer/fluidRenderer.js.map +1 -1
- package/Rendering/index.d.ts +2 -0
- package/Rendering/index.js +2 -0
- package/Rendering/index.js.map +1 -1
- package/Rendering/prePassRendererSceneComponent.js +1 -4
- package/Rendering/prePassRendererSceneComponent.js.map +1 -1
- package/Rendering/reflectiveShadowMap.d.ts +152 -0
- package/Rendering/reflectiveShadowMap.js +389 -0
- package/Rendering/reflectiveShadowMap.js.map +1 -0
- package/Shaders/bilateralBlur.fragment.d.ts +5 -0
- package/Shaders/bilateralBlur.fragment.js +20 -0
- package/Shaders/bilateralBlur.fragment.js.map +1 -0
- package/Shaders/bilateralBlurQuality.fragment.d.ts +5 -0
- package/Shaders/bilateralBlurQuality.fragment.js +20 -0
- package/Shaders/bilateralBlurQuality.fragment.js.map +1 -0
- package/Shaders/rsmFullGlobalIllumination.fragment.d.ts +5 -0
- package/Shaders/rsmFullGlobalIllumination.fragment.js +28 -0
- package/Shaders/rsmFullGlobalIllumination.fragment.js.map +1 -0
- package/Shaders/rsmGlobalIllumination.fragment.d.ts +5 -0
- package/Shaders/rsmGlobalIllumination.fragment.js +33 -0
- package/Shaders/rsmGlobalIllumination.fragment.js.map +1 -0
- package/XR/features/WebXRControllerPointerSelection.js +1 -0
- package/XR/features/WebXRControllerPointerSelection.js.map +1 -1
- package/XR/features/WebXRControllerTeleportation.d.ts +9 -1
- package/XR/features/WebXRControllerTeleportation.js +3 -0
- package/XR/features/WebXRControllerTeleportation.js.map +1 -1
- package/XR/webXRCamera.d.ts +2 -0
- package/XR/webXRCamera.js +2 -0
- package/XR/webXRCamera.js.map +1 -1
- package/node.d.ts +3 -0
- package/node.js +3 -0
- package/node.js.map +1 -1
- package/package.json +1 -1
- package/scene.js +1 -1
- package/scene.js.map +1 -1
- package/FlowGraph/Blocks/Data/Logic/flowGraphBitwiseBlocks.d.ts +0 -60
- package/FlowGraph/Blocks/Data/Logic/flowGraphBitwiseBlocks.js +0 -104
- package/FlowGraph/Blocks/Data/Logic/flowGraphBitwiseBlocks.js.map +0 -1
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Class used to store the global illumination parameters for a reflective shadow map.
|
|
3
|
+
* Instances of this class are used by the GIRSMManager class to generate global illumination for a scene.
|
|
4
|
+
*/
|
|
5
|
+
export class GIRSM {
|
|
6
|
+
/**
|
|
7
|
+
* Creates a new GIRSM instance
|
|
8
|
+
* @param rsm The reflective shadow map
|
|
9
|
+
*/
|
|
10
|
+
constructor(rsm) {
|
|
11
|
+
/**
|
|
12
|
+
* The number of samples to use to generate the global illumination. Default value is 400.
|
|
13
|
+
*/
|
|
14
|
+
this.numSamples = 400;
|
|
15
|
+
/**
|
|
16
|
+
* Radius of the circle in the RSM flux texture to read samples from. Default value is 0.1.
|
|
17
|
+
* Valid values are between 0 and 1.
|
|
18
|
+
*/
|
|
19
|
+
this.radius = 0.1;
|
|
20
|
+
/**
|
|
21
|
+
* Intensity of the global illumination effect. Default value is 0.1.
|
|
22
|
+
*/
|
|
23
|
+
this.intensity = 0.1;
|
|
24
|
+
/**
|
|
25
|
+
* value used to correct for edge artifacts when calculating the global illumination effect. Default value is 0.1.
|
|
26
|
+
* Will depend on your scene.
|
|
27
|
+
*/
|
|
28
|
+
this.edgeArtifactCorrection = 0.1;
|
|
29
|
+
/**
|
|
30
|
+
* Defines if samples should be rotated when generating the global illumination effect. Default value is true.
|
|
31
|
+
* Rotating samples will improve the quality of the global illumination effect by trading banding for noise, at the cost of a bit of performance.
|
|
32
|
+
*/
|
|
33
|
+
this.rotateSample = true;
|
|
34
|
+
/**
|
|
35
|
+
* Noise scale factor, only used if rotateSample is true. Default value is 100.
|
|
36
|
+
* Will depend on your scene.
|
|
37
|
+
*/
|
|
38
|
+
this.noiseFactor = 100;
|
|
39
|
+
/**
|
|
40
|
+
* Defines if the full texture should be used when generating the global illumination effect. Default value is false.
|
|
41
|
+
* If true, values for numSamples, radius, rotateSample and noiseFactor will be ignored and the full texture will be used to generate the global illumination effect.
|
|
42
|
+
* Be careful to use a RSM texture size small enough to limit the number of samples! For eg. a 32x32 texture will generate 1024 samples per pixel!
|
|
43
|
+
*/
|
|
44
|
+
this.useFullTexture = false;
|
|
45
|
+
this.rsm = rsm;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Disposes the GIRSM
|
|
49
|
+
*/
|
|
50
|
+
dispose() {
|
|
51
|
+
this.rsm.dispose();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=giRSM.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"giRSM.js","sourceRoot":"","sources":["../../../../../dev/core/src/Rendering/GlobalIllumination/giRSM.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,OAAO,KAAK;IA+Cd;;;OAGG;IACH,YAAY,GAAwB;QA7CpC;;WAEG;QACI,eAAU,GAAG,GAAG,CAAC;QAExB;;;WAGG;QACI,WAAM,GAAG,GAAG,CAAC;QAEpB;;WAEG;QACI,cAAS,GAAG,GAAG,CAAC;QAEvB;;;WAGG;QACI,2BAAsB,GAAG,GAAG,CAAC;QAEpC;;;WAGG;QACI,iBAAY,GAAG,IAAI,CAAC;QAE3B;;;WAGG;QACI,gBAAW,GAAG,GAAG,CAAC;QAEzB;;;;WAIG;QACI,mBAAc,GAAG,KAAK,CAAC;QAO1B,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACnB,CAAC;IAED;;OAEG;IACI,OAAO;QACV,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;IACvB,CAAC;CACJ","sourcesContent":["import type { ReflectiveShadowMap } from \"../reflectiveShadowMap\";\r\n\r\n/**\r\n * Class used to store the global illumination parameters for a reflective shadow map.\r\n * Instances of this class are used by the GIRSMManager class to generate global illumination for a scene.\r\n */\r\nexport class GIRSM {\r\n /**\r\n * The reflective shadow map used to generate the global illumination for the corresponding light.\r\n */\r\n public rsm: ReflectiveShadowMap;\r\n\r\n /**\r\n * The number of samples to use to generate the global illumination. Default value is 400.\r\n */\r\n public numSamples = 400;\r\n\r\n /**\r\n * Radius of the circle in the RSM flux texture to read samples from. Default value is 0.1.\r\n * Valid values are between 0 and 1.\r\n */\r\n public radius = 0.1;\r\n\r\n /**\r\n * Intensity of the global illumination effect. Default value is 0.1.\r\n */\r\n public intensity = 0.1;\r\n\r\n /**\r\n * value used to correct for edge artifacts when calculating the global illumination effect. Default value is 0.1.\r\n * Will depend on your scene.\r\n */\r\n public edgeArtifactCorrection = 0.1;\r\n\r\n /**\r\n * Defines if samples should be rotated when generating the global illumination effect. Default value is true.\r\n * Rotating samples will improve the quality of the global illumination effect by trading banding for noise, at the cost of a bit of performance.\r\n */\r\n public rotateSample = true;\r\n\r\n /**\r\n * Noise scale factor, only used if rotateSample is true. Default value is 100.\r\n * Will depend on your scene.\r\n */\r\n public noiseFactor = 100;\r\n\r\n /**\r\n * Defines if the full texture should be used when generating the global illumination effect. Default value is false.\r\n * If true, values for numSamples, radius, rotateSample and noiseFactor will be ignored and the full texture will be used to generate the global illumination effect.\r\n * Be careful to use a RSM texture size small enough to limit the number of samples! For eg. a 32x32 texture will generate 1024 samples per pixel!\r\n */\r\n public useFullTexture = false;\r\n\r\n /**\r\n * Creates a new GIRSM instance\r\n * @param rsm The reflective shadow map\r\n */\r\n constructor(rsm: ReflectiveShadowMap) {\r\n this.rsm = rsm;\r\n }\r\n\r\n /**\r\n * Disposes the GIRSM\r\n */\r\n public dispose() {\r\n this.rsm.dispose();\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reflective Shadow Maps were first described in http://www.klayge.org/material/3_12/GI/rsm.pdf by Carsten Dachsbacher and Marc Stamminger
|
|
3
|
+
* Further explanations and implementations can be found in:
|
|
4
|
+
* - Jaker video explaining RSM and its implementation: https://www.youtube.com/watch?v=LJQQdBsOYPM
|
|
5
|
+
* - C++ implementation by Luis Angel: https://github.com/imyoungmin/RSM
|
|
6
|
+
* - Javascript implementation by Erkaman: https://github.com/Erkaman/webgl-rsm
|
|
7
|
+
*/
|
|
8
|
+
import type { Scene } from "../../scene.js";
|
|
9
|
+
import type { GIRSM } from "./giRSM";
|
|
10
|
+
import type { Material } from "../../Materials/material.js";
|
|
11
|
+
import { MaterialPluginBase } from "../../Materials/materialPluginBase.js";
|
|
12
|
+
import type { InternalTexture } from "../../Materials/Textures/internalTexture.js";
|
|
13
|
+
import type { StandardMaterial } from "../../Materials/standardMaterial.js";
|
|
14
|
+
import { PBRBaseMaterial } from "../../Materials/PBR/pbrBaseMaterial.js";
|
|
15
|
+
import type { UniformBuffer } from "../../Materials/uniformBuffer.js";
|
|
16
|
+
import { MaterialDefines } from "../../Materials/materialDefines.js";
|
|
17
|
+
import "../../Shaders/bilateralBlur.fragment";
|
|
18
|
+
import "../../Shaders/bilateralBlurQuality.fragment";
|
|
19
|
+
import "../../Shaders/rsmGlobalIllumination.fragment";
|
|
20
|
+
import "../../Shaders/rsmFullGlobalIllumination.fragment";
|
|
21
|
+
/**
|
|
22
|
+
* Class used to manage the global illumination contribution calculated from reflective shadow maps (RSM).
|
|
23
|
+
*/
|
|
24
|
+
export declare class GIRSMManager {
|
|
25
|
+
private _scene;
|
|
26
|
+
private _engine;
|
|
27
|
+
private _giRSM;
|
|
28
|
+
private _materialsWithRenderPlugin;
|
|
29
|
+
private _sampleTexture;
|
|
30
|
+
private _maxSamples;
|
|
31
|
+
private _blurRTT;
|
|
32
|
+
private _blurPostProcesses;
|
|
33
|
+
private _blurXPostprocess;
|
|
34
|
+
private _blurYPostprocess;
|
|
35
|
+
private _upsamplingXPostprocess;
|
|
36
|
+
private _upsamplingYPostprocess;
|
|
37
|
+
private _ppGlobalIllumination;
|
|
38
|
+
private _drawPhaseObserver;
|
|
39
|
+
private _debugLayer;
|
|
40
|
+
private _counters;
|
|
41
|
+
private _countersRTW;
|
|
42
|
+
private _firstActivation;
|
|
43
|
+
private _geomBufferEnabled;
|
|
44
|
+
private _geomBufferEnablePosition;
|
|
45
|
+
private _tempMatrix;
|
|
46
|
+
private _enable;
|
|
47
|
+
/**
|
|
48
|
+
* Defines the default texture types and formats used by the geometry buffer renderer.
|
|
49
|
+
*/
|
|
50
|
+
static GeometryBufferTextureTypesAndFormats: {
|
|
51
|
+
[key: number]: {
|
|
52
|
+
textureType: number;
|
|
53
|
+
textureFormat: number;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Enables or disables the manager. Default is false.
|
|
58
|
+
* If disabled, the global illumination won't be calculated and the scene will be rendered normally, without any global illumination contribution.
|
|
59
|
+
*/
|
|
60
|
+
get enable(): boolean;
|
|
61
|
+
set enable(enable: boolean);
|
|
62
|
+
/**
|
|
63
|
+
* Defines if the global illumination calculation is paused or not.
|
|
64
|
+
* Use this setting to pause the global illumination calculation when you know that the scene (camera/mesh/light positions) is not changing anymore to save some GPU power.
|
|
65
|
+
* The scene will still be rendered with the latest global illumination contribution.
|
|
66
|
+
*/
|
|
67
|
+
pause: boolean;
|
|
68
|
+
private _enableBlur;
|
|
69
|
+
/**
|
|
70
|
+
* Defines if the global illumination contribution should be blurred or not (using a bilateral blur). Default is true.
|
|
71
|
+
*/
|
|
72
|
+
get enableBlur(): boolean;
|
|
73
|
+
set enableBlur(enable: boolean);
|
|
74
|
+
private _useQualityBlur;
|
|
75
|
+
/**
|
|
76
|
+
* Defines if the blur should be done with a better quality but slower or not. Default is false.
|
|
77
|
+
*/
|
|
78
|
+
get useQualityBlur(): boolean;
|
|
79
|
+
set useQualityBlur(enable: boolean);
|
|
80
|
+
/**
|
|
81
|
+
* Defines the depth threshold used by the bilateral blur post-processes (also used by the upsampling, if enabled).
|
|
82
|
+
* You may have to change this value, depending on your scene.
|
|
83
|
+
*/
|
|
84
|
+
blurDepthThreshold: number;
|
|
85
|
+
/**
|
|
86
|
+
* Defines the normal threshold used by the bilateral blur post-processes (also used by the upsampling, if enabled).
|
|
87
|
+
* You may have to change this value, depending on your scene.
|
|
88
|
+
*/
|
|
89
|
+
blurNormalThreshold: number;
|
|
90
|
+
/**
|
|
91
|
+
* Defines the kernel size used by the bilateral blur post-processes. Default is 12.
|
|
92
|
+
*/
|
|
93
|
+
blurKernel: number;
|
|
94
|
+
private _forceFullSizeBlur;
|
|
95
|
+
/**
|
|
96
|
+
* Defines if the blur should be done at full resolution or not. Default is false.
|
|
97
|
+
* If this setting is eabled, upampling will be disabled (ignored) as it is not needed anymore.
|
|
98
|
+
*/
|
|
99
|
+
get fullSizeBlur(): boolean;
|
|
100
|
+
set fullSizeBlur(mode: boolean);
|
|
101
|
+
private _useQualityUpsampling;
|
|
102
|
+
/**
|
|
103
|
+
* Defines if the upsampling should be done with a better quality but slower or not. Default is false.
|
|
104
|
+
*/
|
|
105
|
+
get useQualityUpsampling(): boolean;
|
|
106
|
+
set useQualityUpsampling(enable: boolean);
|
|
107
|
+
/**
|
|
108
|
+
* Defines the kernel size used by the bilateral upsampling post-processes. Default is 6.
|
|
109
|
+
*/
|
|
110
|
+
upsamplerKernel: number;
|
|
111
|
+
private _showOnlyGI;
|
|
112
|
+
/**
|
|
113
|
+
* Defines if the debug layer should be enabled or not. Default is false.
|
|
114
|
+
* Use this setting for debugging purpose, to show the global illumination contribution only.
|
|
115
|
+
*/
|
|
116
|
+
get showOnlyGI(): boolean;
|
|
117
|
+
set showOnlyGI(show: boolean);
|
|
118
|
+
private _outputDimensions;
|
|
119
|
+
/**
|
|
120
|
+
* Sets the output dimensions of the final process. It should normally be the same as the output dimensions of the screen.
|
|
121
|
+
* @param dimensions The dimensions of the output texture (width and height)
|
|
122
|
+
*/
|
|
123
|
+
setOutputDimensions(dimensions: {
|
|
124
|
+
width: number;
|
|
125
|
+
height: number;
|
|
126
|
+
}): void;
|
|
127
|
+
private _giTextureDimensions;
|
|
128
|
+
/**
|
|
129
|
+
* Sets the dimensions of the GI texture. Try to use the smallest size possible for better performance.
|
|
130
|
+
* @param dimensions The dimensions of the GI texture (width and height)
|
|
131
|
+
*/
|
|
132
|
+
setGITextureDimensions(dimensions: {
|
|
133
|
+
width: number;
|
|
134
|
+
height: number;
|
|
135
|
+
}): void;
|
|
136
|
+
private _giTextureType;
|
|
137
|
+
/**
|
|
138
|
+
* Gets or sets the texture type used by the GI texture. Default is Constants.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV.
|
|
139
|
+
*/
|
|
140
|
+
get giTextureType(): number;
|
|
141
|
+
set giTextureType(textureType: number);
|
|
142
|
+
/**
|
|
143
|
+
* Gets the list of GIRSM used by the manager.
|
|
144
|
+
*/
|
|
145
|
+
get giRSM(): GIRSM[];
|
|
146
|
+
/**
|
|
147
|
+
* Adds a (list of) GIRSM to the manager.
|
|
148
|
+
* @param rsm The GIRSM (or array of GIRSM) to add to the manager
|
|
149
|
+
*/
|
|
150
|
+
addGIRSM(rsm: GIRSM | GIRSM[]): void;
|
|
151
|
+
/**
|
|
152
|
+
* Removes a (list of) GIRSM from the manager.
|
|
153
|
+
* @param rsm The GIRSM (or array of GIRSM) to remove from the manager
|
|
154
|
+
*/
|
|
155
|
+
removeGIRSM(rsm: GIRSM | GIRSM[]): void;
|
|
156
|
+
/**
|
|
157
|
+
* Add a material to the manager. This will enable the global illumination contribution for the material.
|
|
158
|
+
* @param material Material that will be affected by the global illumination contribution. If not provided, all materials of the scene will be affected.
|
|
159
|
+
*/
|
|
160
|
+
addMaterial(material?: Material): void;
|
|
161
|
+
/**
|
|
162
|
+
* Gets the list of GPU counters used by the manager.
|
|
163
|
+
* GPU timing measurements must be enabled for the counters to be filled (engine.enableGPUTimingMeasurements = true).
|
|
164
|
+
* Only available with WebGPU. You will still get the list of counters with other engines but the values will always be 0.
|
|
165
|
+
*/
|
|
166
|
+
get countersGPU(): Array<{
|
|
167
|
+
name: string;
|
|
168
|
+
value: number;
|
|
169
|
+
}>;
|
|
170
|
+
/**
|
|
171
|
+
* Recreates the resources used by the manager.
|
|
172
|
+
* You should normally not have to call this method manually, except if you change the useFullTexture property of a GIRSM, because the manager won't track this change.
|
|
173
|
+
*/
|
|
174
|
+
recreateResources(_disposeGeometryBufferRenderer?: boolean): void;
|
|
175
|
+
/**
|
|
176
|
+
* Generates the sample texture used by the the global illumination calculation process.
|
|
177
|
+
* @param maxSamples The maximum number of samples to generate in the texture. Default value is 2048. The numSamples property of the GIRSM should be less than or equal to this value!
|
|
178
|
+
*/
|
|
179
|
+
generateSampleTexture(maxSamples: number): void;
|
|
180
|
+
/**
|
|
181
|
+
* Disposes the manager.
|
|
182
|
+
*/
|
|
183
|
+
dispose(): void;
|
|
184
|
+
/**
|
|
185
|
+
* Creates a new GIRSMManager
|
|
186
|
+
* @param scene The scene
|
|
187
|
+
* @param outputDimensions The dimensions of the output texture (width and height). Should normally be the same as the output dimensions of the screen.
|
|
188
|
+
* @param giTextureDimensions The dimensions of the GI texture (width and height). Try to use the smallest size possible for better performance.
|
|
189
|
+
* @param maxSamples The maximum number of samples to generate in the sample texture. Default value is 2048. The numSamples property of the GIRSM should be less than or equal to this value!
|
|
190
|
+
* @param giTextureType The texture type used by the GI texture. Default is Constants.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV.
|
|
191
|
+
*/
|
|
192
|
+
constructor(scene: Scene, outputDimensions: {
|
|
193
|
+
width: number;
|
|
194
|
+
height: number;
|
|
195
|
+
}, giTextureDimensions?: {
|
|
196
|
+
width: number;
|
|
197
|
+
height: number;
|
|
198
|
+
}, maxSamples?: number, giTextureType?: number);
|
|
199
|
+
protected _disposePostProcesses(disposeGeometryBufferRenderer?: boolean): void;
|
|
200
|
+
protected _setPluginParameters(): void;
|
|
201
|
+
protected _createPostProcesses(): void;
|
|
202
|
+
protected _addGISupportToMaterial(material: Material): void;
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* @internal
|
|
206
|
+
*/
|
|
207
|
+
declare class MaterialGIRSMRenderDefines extends MaterialDefines {
|
|
208
|
+
RENDER_WITH_GIRSM: boolean;
|
|
209
|
+
RSMCREATE_PROJTEXTURE: boolean;
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Plugin used to render the global illumination contribution.
|
|
213
|
+
*/
|
|
214
|
+
export declare class GIRSMRenderPluginMaterial extends MaterialPluginBase {
|
|
215
|
+
private _isPBR;
|
|
216
|
+
/**
|
|
217
|
+
* Defines the name of the plugin.
|
|
218
|
+
*/
|
|
219
|
+
static readonly Name = "GIRSMRender";
|
|
220
|
+
/**
|
|
221
|
+
* The texture containing the global illumination contribution.
|
|
222
|
+
*/
|
|
223
|
+
textureGIContrib: InternalTexture;
|
|
224
|
+
/**
|
|
225
|
+
* The width of the output texture.
|
|
226
|
+
*/
|
|
227
|
+
outputTextureWidth: number;
|
|
228
|
+
/**
|
|
229
|
+
* The height of the output texture.
|
|
230
|
+
*/
|
|
231
|
+
outputTextureHeight: number;
|
|
232
|
+
private _isEnabled;
|
|
233
|
+
/**
|
|
234
|
+
* Defines if the plugin is enabled in the material.
|
|
235
|
+
*/
|
|
236
|
+
isEnabled: boolean;
|
|
237
|
+
protected _markAllSubMeshesAsTexturesDirty(): void;
|
|
238
|
+
private _internalMarkAllSubMeshesAsTexturesDirty;
|
|
239
|
+
constructor(material: Material | StandardMaterial | PBRBaseMaterial);
|
|
240
|
+
prepareDefines(defines: MaterialGIRSMRenderDefines): void;
|
|
241
|
+
getClassName(): string;
|
|
242
|
+
getUniforms(): {
|
|
243
|
+
ubo: {
|
|
244
|
+
name: string;
|
|
245
|
+
size: number;
|
|
246
|
+
type: string;
|
|
247
|
+
}[];
|
|
248
|
+
fragment: string;
|
|
249
|
+
};
|
|
250
|
+
getSamplers(samplers: string[]): void;
|
|
251
|
+
bindForSubMesh(uniformBuffer: UniformBuffer): void;
|
|
252
|
+
getCustomCode(shaderType: string): {
|
|
253
|
+
[name: string]: string;
|
|
254
|
+
} | null;
|
|
255
|
+
}
|
|
256
|
+
export {};
|