@babylonjs/core 8.15.0 → 8.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (173) hide show
  1. package/Animations/animatable.core.d.ts +6 -0
  2. package/Animations/animatable.core.js +7 -1
  3. package/Animations/animatable.core.js.map +1 -1
  4. package/Animations/animationGroup.d.ts +3 -1
  5. package/Animations/animationGroup.js +3 -2
  6. package/Animations/animationGroup.js.map +1 -1
  7. package/AudioV2/webAudio/components/webAudioParameterComponent.d.ts +8 -0
  8. package/AudioV2/webAudio/components/webAudioParameterComponent.js +36 -3
  9. package/AudioV2/webAudio/components/webAudioParameterComponent.js.map +1 -1
  10. package/AudioV2/webAudio/subNodes/spatialWebAudioSubNode.js +10 -0
  11. package/AudioV2/webAudio/subNodes/spatialWebAudioSubNode.js.map +1 -1
  12. package/AudioV2/webAudio/subProperties/spatialWebAudioListener.js +11 -0
  13. package/AudioV2/webAudio/subProperties/spatialWebAudioListener.js.map +1 -1
  14. package/AudioV2/webAudio/webAudioEngine.d.ts +7 -0
  15. package/AudioV2/webAudio/webAudioEngine.js +45 -0
  16. package/AudioV2/webAudio/webAudioEngine.js.map +1 -1
  17. package/AudioV2/webAudio/webAudioStaticSound.d.ts +1 -0
  18. package/AudioV2/webAudio/webAudioStaticSound.js +4 -1
  19. package/AudioV2/webAudio/webAudioStaticSound.js.map +1 -1
  20. package/Behaviors/Cameras/framingBehavior.js +3 -3
  21. package/Behaviors/Cameras/framingBehavior.js.map +1 -1
  22. package/Debug/directionalLightFrustumViewer.d.ts +6 -0
  23. package/Debug/directionalLightFrustumViewer.js +39 -1
  24. package/Debug/directionalLightFrustumViewer.js.map +1 -1
  25. package/Engines/AbstractEngine/abstractEngine.alpha.d.ts +2 -1
  26. package/Engines/AbstractEngine/abstractEngine.alpha.js +9 -9
  27. package/Engines/AbstractEngine/abstractEngine.alpha.js.map +1 -1
  28. package/Engines/AbstractEngine/abstractEngine.states.d.ts +4 -104
  29. package/Engines/AbstractEngine/abstractEngine.states.js +4 -70
  30. package/Engines/AbstractEngine/abstractEngine.states.js.map +1 -1
  31. package/Engines/AbstractEngine/abstractEngine.stencil.d.ts +147 -0
  32. package/Engines/AbstractEngine/abstractEngine.stencil.js +93 -0
  33. package/Engines/AbstractEngine/abstractEngine.stencil.js.map +1 -0
  34. package/Engines/AbstractEngine/index.d.ts +1 -0
  35. package/Engines/AbstractEngine/index.js +1 -0
  36. package/Engines/AbstractEngine/index.js.map +1 -1
  37. package/Engines/Extensions/engine.alpha.d.ts +2 -1
  38. package/Engines/Extensions/engine.alpha.js +7 -78
  39. package/Engines/Extensions/engine.alpha.js.map +1 -1
  40. package/Engines/WebGL/webGL2ShaderProcessors.js +8 -1
  41. package/Engines/WebGL/webGL2ShaderProcessors.js.map +1 -1
  42. package/Engines/WebGPU/Extensions/engine.alpha.d.ts +2 -1
  43. package/Engines/WebGPU/Extensions/engine.alpha.js +12 -82
  44. package/Engines/WebGPU/Extensions/engine.alpha.js.map +1 -1
  45. package/Engines/WebGPU/webgpuCacheRenderPipeline.d.ts +12 -5
  46. package/Engines/WebGPU/webgpuCacheRenderPipeline.js +139 -72
  47. package/Engines/WebGPU/webgpuCacheRenderPipeline.js.map +1 -1
  48. package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js +13 -1
  49. package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js.map +1 -1
  50. package/Engines/WebGPU/webgpuStencilStateComposer.d.ts +8 -0
  51. package/Engines/WebGPU/webgpuStencilStateComposer.js +40 -0
  52. package/Engines/WebGPU/webgpuStencilStateComposer.js.map +1 -1
  53. package/Engines/abstractEngine.d.ts +7 -3
  54. package/Engines/abstractEngine.js +12 -5
  55. package/Engines/abstractEngine.js.map +1 -1
  56. package/Engines/constants.d.ts +30 -28
  57. package/Engines/constants.js +30 -28
  58. package/Engines/constants.js.map +1 -1
  59. package/Engines/engine.d.ts +10 -0
  60. package/Engines/engine.js +1 -0
  61. package/Engines/engine.js.map +1 -1
  62. package/Engines/engineCapabilities.d.ts +4 -0
  63. package/Engines/engineCapabilities.js.map +1 -1
  64. package/Engines/nativeEngine.d.ts +2 -1
  65. package/Engines/nativeEngine.js +6 -3
  66. package/Engines/nativeEngine.js.map +1 -1
  67. package/Engines/nullEngine.d.ts +2 -1
  68. package/Engines/nullEngine.js +7 -4
  69. package/Engines/nullEngine.js.map +1 -1
  70. package/Engines/thinEngine.js +16 -3
  71. package/Engines/thinEngine.js.map +1 -1
  72. package/Engines/webgpuEngine.d.ts +1 -0
  73. package/Engines/webgpuEngine.js +6 -4
  74. package/Engines/webgpuEngine.js.map +1 -1
  75. package/FrameGraph/Tasks/PostProcesses/passTask.d.ts +1 -1
  76. package/FrameGraph/Tasks/PostProcesses/passTask.js.map +1 -1
  77. package/FrameGraph/Tasks/Rendering/objectRendererTask.d.ts +8 -1
  78. package/FrameGraph/Tasks/Rendering/objectRendererTask.js +14 -6
  79. package/FrameGraph/Tasks/Rendering/objectRendererTask.js.map +1 -1
  80. package/FrameGraph/Tasks/Rendering/shadowGeneratorTask.js +3 -0
  81. package/FrameGraph/Tasks/Rendering/shadowGeneratorTask.js.map +1 -1
  82. package/FrameGraph/Tasks/Rendering/taaObjectRendererTask.js +6 -5
  83. package/FrameGraph/Tasks/Rendering/taaObjectRendererTask.js.map +1 -1
  84. package/FrameGraph/Tasks/Texture/clearTextureTask.d.ts +1 -1
  85. package/FrameGraph/Tasks/Texture/clearTextureTask.js +7 -5
  86. package/FrameGraph/Tasks/Texture/clearTextureTask.js.map +1 -1
  87. package/FrameGraph/frameGraph.d.ts +6 -0
  88. package/FrameGraph/frameGraph.js +8 -0
  89. package/FrameGraph/frameGraph.js.map +1 -1
  90. package/FrameGraph/frameGraphContext.d.ts +16 -0
  91. package/FrameGraph/frameGraphContext.js +23 -0
  92. package/FrameGraph/frameGraphContext.js.map +1 -1
  93. package/FrameGraph/frameGraphRenderContext.d.ts +9 -16
  94. package/FrameGraph/frameGraphRenderContext.js +15 -23
  95. package/FrameGraph/frameGraphRenderContext.js.map +1 -1
  96. package/FrameGraph/frameGraphUtils.d.ts +52 -0
  97. package/FrameGraph/frameGraphUtils.js +99 -0
  98. package/FrameGraph/frameGraphUtils.js.map +1 -0
  99. package/FrameGraph/index.d.ts +1 -0
  100. package/FrameGraph/index.js +1 -0
  101. package/FrameGraph/index.js.map +1 -1
  102. package/Gizmos/boundingBoxGizmo.js +2 -0
  103. package/Gizmos/boundingBoxGizmo.js.map +1 -1
  104. package/Loading/Plugins/babylonFileLoader.js +35 -2
  105. package/Loading/Plugins/babylonFileLoader.js.map +1 -1
  106. package/Materials/material.d.ts +32 -12
  107. package/Materials/material.js +49 -17
  108. package/Materials/material.js.map +1 -1
  109. package/Materials/materialStencilState.d.ts +24 -0
  110. package/Materials/materialStencilState.js +53 -1
  111. package/Materials/materialStencilState.js.map +1 -1
  112. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +4 -4
  113. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
  114. package/Meshes/geometry.js +1 -1
  115. package/Meshes/geometry.js.map +1 -1
  116. package/Meshes/instancedMesh.d.ts +5 -0
  117. package/Meshes/instancedMesh.js +3 -3
  118. package/Meshes/instancedMesh.js.map +1 -1
  119. package/Meshes/mesh.d.ts +28 -5
  120. package/Meshes/mesh.js +127 -57
  121. package/Meshes/mesh.js.map +1 -1
  122. package/Meshes/thinInstanceMesh.js +4 -0
  123. package/Meshes/thinInstanceMesh.js.map +1 -1
  124. package/Misc/snapshotRenderingHelper.js +2 -1
  125. package/Misc/snapshotRenderingHelper.js.map +1 -1
  126. package/PostProcesses/RenderPipeline/Pipelines/taaMaterialManager.d.ts +71 -0
  127. package/PostProcesses/RenderPipeline/Pipelines/taaMaterialManager.js +156 -0
  128. package/PostProcesses/RenderPipeline/Pipelines/taaMaterialManager.js.map +1 -0
  129. package/PostProcesses/RenderPipeline/Pipelines/taaRenderingPipeline.d.ts +13 -0
  130. package/PostProcesses/RenderPipeline/Pipelines/taaRenderingPipeline.js +79 -3
  131. package/PostProcesses/RenderPipeline/Pipelines/taaRenderingPipeline.js.map +1 -1
  132. package/PostProcesses/RenderPipeline/postProcessRenderPipeline.d.ts +4 -0
  133. package/PostProcesses/RenderPipeline/postProcessRenderPipeline.js +5 -0
  134. package/PostProcesses/RenderPipeline/postProcessRenderPipeline.js.map +1 -1
  135. package/PostProcesses/RenderPipeline/postProcessRenderPipelineManager.d.ts +12 -3
  136. package/PostProcesses/RenderPipeline/postProcessRenderPipelineManager.js +22 -1
  137. package/PostProcesses/RenderPipeline/postProcessRenderPipelineManager.js.map +1 -1
  138. package/PostProcesses/thinPassPostProcess.js +7 -3
  139. package/PostProcesses/thinPassPostProcess.js.map +1 -1
  140. package/PostProcesses/thinTAAPostProcess.d.ts +17 -0
  141. package/PostProcesses/thinTAAPostProcess.js +51 -0
  142. package/PostProcesses/thinTAAPostProcess.js.map +1 -1
  143. package/Rendering/edgesRenderer.js +3 -2
  144. package/Rendering/edgesRenderer.js.map +1 -1
  145. package/Rendering/geometryBufferRenderer.js +1 -1
  146. package/Rendering/geometryBufferRenderer.js.map +1 -1
  147. package/Rendering/outlineRenderer.js +1 -1
  148. package/Rendering/outlineRenderer.js.map +1 -1
  149. package/Shaders/lod.fragment.js +2 -3
  150. package/Shaders/lod.fragment.js.map +1 -1
  151. package/Shaders/taa.fragment.js +15 -1
  152. package/Shaders/taa.fragment.js.map +1 -1
  153. package/ShadersWGSL/lod.fragment.js +2 -2
  154. package/ShadersWGSL/lod.fragment.js.map +1 -1
  155. package/ShadersWGSL/taa.fragment.js +16 -2
  156. package/ShadersWGSL/taa.fragment.js.map +1 -1
  157. package/States/IStencilState.d.ts +6 -2
  158. package/States/IStencilState.js.map +1 -1
  159. package/States/alphaCullingState.d.ts +7 -5
  160. package/States/alphaCullingState.js +144 -33
  161. package/States/alphaCullingState.js.map +1 -1
  162. package/States/stencilState.d.ts +12 -0
  163. package/States/stencilState.js +29 -1
  164. package/States/stencilState.js.map +1 -1
  165. package/States/stencilStateComposer.d.ts +12 -0
  166. package/States/stencilStateComposer.js +48 -2
  167. package/States/stencilStateComposer.js.map +1 -1
  168. package/assetContainer.js +29 -8
  169. package/assetContainer.js.map +1 -1
  170. package/package.json +1 -1
  171. package/scene.d.ts +2 -1
  172. package/scene.js +1 -0
  173. package/scene.js.map +1 -1
@@ -2,20 +2,6 @@ import type { Nullable } from "../../types.js";
2
2
  import "./abstractEngine.alpha.js";
3
3
  declare module "../../Engines/abstractEngine.js" {
4
4
  interface AbstractEngine {
5
- /** @internal */
6
- _cachedStencilBuffer: boolean;
7
- /** @internal */
8
- _cachedStencilFunction: number;
9
- /** @internal */
10
- _cachedStencilMask: number;
11
- /** @internal */
12
- _cachedStencilOperationPass: number;
13
- /** @internal */
14
- _cachedStencilOperationFail: number;
15
- /** @internal */
16
- _cachedStencilOperationDepthFail: number;
17
- /** @internal */
18
- _cachedStencilReference: number;
19
5
  /**
20
6
  * Gets the current depth function
21
7
  * @returns a number defining the depth function
@@ -52,94 +38,6 @@ declare module "../../Engines/abstractEngine.js" {
52
38
  * @param enable defines the state to set
53
39
  */
54
40
  setDepthWrite(enable: boolean): void;
55
- /**
56
- * Gets the current stencil operation when stencil passes
57
- * @returns a number defining stencil operation to use when stencil passes
58
- */
59
- getStencilOperationPass(): number;
60
- /**
61
- * Gets a boolean indicating if stencil buffer is enabled
62
- * @returns the current stencil buffer state
63
- */
64
- getStencilBuffer(): boolean;
65
- /**
66
- * Enable or disable the stencil buffer
67
- * @param enable defines if the stencil buffer must be enabled or disabled
68
- */
69
- setStencilBuffer(enable: boolean): void;
70
- /**
71
- * Gets the current stencil mask
72
- * @returns a number defining the new stencil mask to use
73
- */
74
- getStencilMask(): number;
75
- /**
76
- * Sets the current stencil mask
77
- * @param mask defines the new stencil mask to use
78
- */
79
- setStencilMask(mask: number): void;
80
- /**
81
- * Gets the current stencil function
82
- * @returns a number defining the stencil function to use
83
- */
84
- getStencilFunction(): number;
85
- /**
86
- * Gets the current stencil reference value
87
- * @returns a number defining the stencil reference value to use
88
- */
89
- getStencilFunctionReference(): number;
90
- /**
91
- * Gets the current stencil mask
92
- * @returns a number defining the stencil mask to use
93
- */
94
- getStencilFunctionMask(): number;
95
- /**
96
- * Sets the current stencil function
97
- * @param stencilFunc defines the new stencil function to use
98
- */
99
- setStencilFunction(stencilFunc: number): void;
100
- /**
101
- * Sets the current stencil reference
102
- * @param reference defines the new stencil reference to use
103
- */
104
- setStencilFunctionReference(reference: number): void;
105
- /**
106
- * Sets the current stencil mask
107
- * @param mask defines the new stencil mask to use
108
- */
109
- setStencilFunctionMask(mask: number): void;
110
- /**
111
- * Gets the current stencil operation when stencil fails
112
- * @returns a number defining stencil operation to use when stencil fails
113
- */
114
- getStencilOperationFail(): number;
115
- /**
116
- * Gets the current stencil operation when depth fails
117
- * @returns a number defining stencil operation to use when depth fails
118
- */
119
- getStencilOperationDepthFail(): number;
120
- /**
121
- * Sets the stencil operation to use when stencil fails
122
- * @param operation defines the stencil operation to use when stencil fails
123
- */
124
- setStencilOperationFail(operation: number): void;
125
- /**
126
- * Sets the stencil operation to use when depth fails
127
- * @param operation defines the stencil operation to use when depth fails
128
- */
129
- setStencilOperationDepthFail(operation: number): void;
130
- /**
131
- * Sets the stencil operation to use when stencil passes
132
- * @param operation defines the stencil operation to use when stencil passes
133
- */
134
- setStencilOperationPass(operation: number): void;
135
- /**
136
- * Caches the state of the stencil buffer
137
- */
138
- cacheStencilState(): void;
139
- /**
140
- * Restores the state of the stencil buffer
141
- */
142
- restoreStencilState(): void;
143
41
  /**
144
42
  * Sets alpha constants used by some alpha blending modes
145
43
  * @param r defines the red component
@@ -151,13 +49,15 @@ declare module "../../Engines/abstractEngine.js" {
151
49
  /**
152
50
  * Gets the current alpha mode
153
51
  * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/advanced/transparent_rendering
52
+ * @param targetIndex defines the index of the target to get the alpha mode for (default is 0)
154
53
  * @returns the current alpha mode
155
54
  */
156
- getAlphaMode(): number;
55
+ getAlphaMode(targetIndex?: number): number;
157
56
  /**
158
57
  * Gets the current alpha equation.
58
+ * @param targetIndex defines the index of the target to get the alpha equation for (default is 0)
159
59
  * @returns the current alpha equation
160
60
  */
161
- getAlphaEquation(): number;
61
+ getAlphaEquation(targetIndex?: number): number;
162
62
  }
163
63
  }
@@ -28,79 +28,13 @@ AbstractEngine.prototype.getDepthWrite = function () {
28
28
  AbstractEngine.prototype.setDepthWrite = function (enable) {
29
29
  this._depthCullingState.depthMask = enable;
30
30
  };
31
- AbstractEngine.prototype.getStencilBuffer = function () {
32
- return this._stencilState.stencilTest;
33
- };
34
- AbstractEngine.prototype.setStencilBuffer = function (enable) {
35
- this._stencilState.stencilTest = enable;
36
- };
37
- AbstractEngine.prototype.getStencilMask = function () {
38
- return this._stencilState.stencilMask;
39
- };
40
- AbstractEngine.prototype.setStencilMask = function (mask) {
41
- this._stencilState.stencilMask = mask;
42
- };
43
- AbstractEngine.prototype.getStencilFunction = function () {
44
- return this._stencilState.stencilFunc;
45
- };
46
- AbstractEngine.prototype.getStencilFunctionReference = function () {
47
- return this._stencilState.stencilFuncRef;
48
- };
49
- AbstractEngine.prototype.getStencilFunctionMask = function () {
50
- return this._stencilState.stencilFuncMask;
51
- };
52
- AbstractEngine.prototype.setStencilFunction = function (stencilFunc) {
53
- this._stencilState.stencilFunc = stencilFunc;
54
- };
55
- AbstractEngine.prototype.setStencilFunctionReference = function (reference) {
56
- this._stencilState.stencilFuncRef = reference;
57
- };
58
- AbstractEngine.prototype.setStencilFunctionMask = function (mask) {
59
- this._stencilState.stencilFuncMask = mask;
60
- };
61
- AbstractEngine.prototype.getStencilOperationFail = function () {
62
- return this._stencilState.stencilOpStencilFail;
63
- };
64
- AbstractEngine.prototype.getStencilOperationDepthFail = function () {
65
- return this._stencilState.stencilOpDepthFail;
66
- };
67
- AbstractEngine.prototype.getStencilOperationPass = function () {
68
- return this._stencilState.stencilOpStencilDepthPass;
69
- };
70
- AbstractEngine.prototype.setStencilOperationFail = function (operation) {
71
- this._stencilState.stencilOpStencilFail = operation;
72
- };
73
- AbstractEngine.prototype.setStencilOperationDepthFail = function (operation) {
74
- this._stencilState.stencilOpDepthFail = operation;
75
- };
76
- AbstractEngine.prototype.setStencilOperationPass = function (operation) {
77
- this._stencilState.stencilOpStencilDepthPass = operation;
78
- };
79
- AbstractEngine.prototype.cacheStencilState = function () {
80
- this._cachedStencilBuffer = this.getStencilBuffer();
81
- this._cachedStencilFunction = this.getStencilFunction();
82
- this._cachedStencilMask = this.getStencilMask();
83
- this._cachedStencilOperationPass = this.getStencilOperationPass();
84
- this._cachedStencilOperationFail = this.getStencilOperationFail();
85
- this._cachedStencilOperationDepthFail = this.getStencilOperationDepthFail();
86
- this._cachedStencilReference = this.getStencilFunctionReference();
87
- };
88
- AbstractEngine.prototype.restoreStencilState = function () {
89
- this.setStencilFunction(this._cachedStencilFunction);
90
- this.setStencilMask(this._cachedStencilMask);
91
- this.setStencilBuffer(this._cachedStencilBuffer);
92
- this.setStencilOperationPass(this._cachedStencilOperationPass);
93
- this.setStencilOperationFail(this._cachedStencilOperationFail);
94
- this.setStencilOperationDepthFail(this._cachedStencilOperationDepthFail);
95
- this.setStencilFunctionReference(this._cachedStencilReference);
96
- };
97
31
  AbstractEngine.prototype.setAlphaConstants = function (r, g, b, a) {
98
32
  this._alphaState.setAlphaBlendConstants(r, g, b, a);
99
33
  };
100
- AbstractEngine.prototype.getAlphaMode = function () {
101
- return this._alphaMode;
34
+ AbstractEngine.prototype.getAlphaMode = function (targetIndex = 0) {
35
+ return this._alphaMode[targetIndex];
102
36
  };
103
- AbstractEngine.prototype.getAlphaEquation = function () {
104
- return this._alphaEquation;
37
+ AbstractEngine.prototype.getAlphaEquation = function (targetIndex = 0) {
38
+ return this._alphaEquation[targetIndex];
105
39
  };
106
40
  //# sourceMappingURL=abstractEngine.states.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"abstractEngine.states.js","sourceRoot":"","sources":["../../../../../dev/core/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,2BAA2B,EAAE,CAAC;AACtE,CAAC,CAAC;AAEF,cAAc,CAAC,SAAS,CAAC,mBAAmB,GAAG;IAC3C,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;IACrD,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;IAC7C,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;IACjD,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC;IAC/D,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC;IAC/D,IAAI,CAAC,4BAA4B,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC;IACzE,IAAI,CAAC,2BAA2B,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;AACnE,CAAC,CAAC;AAEF,cAAc,CAAC,SAAS,CAAC,iBAAiB,GAAG,UAAU,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS;IAC7F,IAAI,CAAC,WAAW,CAAC,sBAAsB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AACxD,CAAC,CAAC;AAEF,cAAc,CAAC,SAAS,CAAC,YAAY,GAAG;IACpC,OAAO,IAAI,CAAC,UAAU,CAAC;AAC3B,CAAC,CAAC;AAEF,cAAc,CAAC,SAAS,CAAC,gBAAgB,GAAG;IACxC,OAAO,IAAI,CAAC,cAAc,CAAC;AAC/B,CAAC,CAAC","sourcesContent":["import type { Nullable } from \"../../types\";\r\nimport { AbstractEngine } from \"../abstractEngine\";\r\nimport { Constants } from \"../constants\";\r\n\r\nimport \"./abstractEngine.alpha\";\r\n\r\ndeclare module \"../../Engines/abstractEngine\" {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n export interface AbstractEngine {\r\n /** @internal */\r\n _cachedStencilBuffer: boolean;\r\n /** @internal */\r\n _cachedStencilFunction: number;\r\n /** @internal */\r\n _cachedStencilMask: number;\r\n /** @internal */\r\n _cachedStencilOperationPass: number;\r\n /** @internal */\r\n _cachedStencilOperationFail: number;\r\n /** @internal */\r\n _cachedStencilOperationDepthFail: number;\r\n /** @internal */\r\n _cachedStencilReference: number;\r\n\r\n /**\r\n * Gets the current depth function\r\n * @returns a number defining the depth function\r\n */\r\n getDepthFunction(): Nullable<number>;\r\n\r\n /**\r\n * Sets the current depth function\r\n * @param depthFunc defines the function to use\r\n */\r\n setDepthFunction(depthFunc: number): void;\r\n\r\n /**\r\n * Sets the current depth function to GREATER\r\n */\r\n setDepthFunctionToGreater(): void;\r\n\r\n /**\r\n * Sets the current depth function to GEQUAL\r\n */\r\n setDepthFunctionToGreaterOrEqual(): void;\r\n\r\n /**\r\n * Sets the current depth function to LESS\r\n */\r\n setDepthFunctionToLess(): void;\r\n\r\n /**\r\n * Sets the current depth function to LEQUAL\r\n */\r\n setDepthFunctionToLessOrEqual(): void;\r\n\r\n /**\r\n * Gets a boolean indicating if depth writing is enabled\r\n * @returns the current depth writing state\r\n */\r\n getDepthWrite(): boolean;\r\n\r\n /**\r\n * Enable or disable depth writing\r\n * @param enable defines the state to set\r\n */\r\n setDepthWrite(enable: boolean): void;\r\n\r\n /**\r\n * Gets the current stencil operation when stencil passes\r\n * @returns a number defining stencil operation to use when stencil passes\r\n */\r\n getStencilOperationPass(): number;\r\n\r\n /**\r\n * Gets a boolean indicating if stencil buffer is enabled\r\n * @returns the current stencil buffer state\r\n */\r\n getStencilBuffer(): boolean;\r\n\r\n /**\r\n * Enable or disable the stencil buffer\r\n * @param enable defines if the stencil buffer must be enabled or disabled\r\n */\r\n setStencilBuffer(enable: boolean): void;\r\n\r\n /**\r\n * Gets the current stencil mask\r\n * @returns a number defining the new stencil mask to use\r\n */\r\n getStencilMask(): number;\r\n /**\r\n * Sets the current stencil mask\r\n * @param mask defines the new stencil mask to use\r\n */\r\n setStencilMask(mask: number): void;\r\n\r\n /**\r\n * Gets the current stencil function\r\n * @returns a number defining the stencil function to use\r\n */\r\n getStencilFunction(): number;\r\n\r\n /**\r\n * Gets the current stencil reference value\r\n * @returns a number defining the stencil reference value to use\r\n */\r\n getStencilFunctionReference(): number;\r\n\r\n /**\r\n * Gets the current stencil mask\r\n * @returns a number defining the stencil mask to use\r\n */\r\n getStencilFunctionMask(): number;\r\n\r\n /**\r\n * Sets the current stencil function\r\n * @param stencilFunc defines the new stencil function to use\r\n */\r\n setStencilFunction(stencilFunc: number): void;\r\n\r\n /**\r\n * Sets the current stencil reference\r\n * @param reference defines the new stencil reference to use\r\n */\r\n setStencilFunctionReference(reference: number): void;\r\n\r\n /**\r\n * Sets the current stencil mask\r\n * @param mask defines the new stencil mask to use\r\n */\r\n setStencilFunctionMask(mask: number): void;\r\n\r\n /**\r\n * Gets the current stencil operation when stencil fails\r\n * @returns a number defining stencil operation to use when stencil fails\r\n */\r\n getStencilOperationFail(): number;\r\n\r\n /**\r\n * Gets the current stencil operation when depth fails\r\n * @returns a number defining stencil operation to use when depth fails\r\n */\r\n getStencilOperationDepthFail(): number;\r\n\r\n /**\r\n * Sets the stencil operation to use when stencil fails\r\n * @param operation defines the stencil operation to use when stencil fails\r\n */\r\n setStencilOperationFail(operation: number): void;\r\n\r\n /**\r\n * Sets the stencil operation to use when depth fails\r\n * @param operation defines the stencil operation to use when depth fails\r\n */\r\n setStencilOperationDepthFail(operation: number): void;\r\n\r\n /**\r\n * Sets the stencil operation to use when stencil passes\r\n * @param operation defines the stencil operation to use when stencil passes\r\n */\r\n setStencilOperationPass(operation: number): void;\r\n\r\n /**\r\n * Caches the state of the stencil buffer\r\n */\r\n cacheStencilState(): void;\r\n\r\n /**\r\n * Restores the state of the stencil buffer\r\n */\r\n restoreStencilState(): void;\r\n\r\n /**\r\n * Sets alpha constants used by some alpha blending modes\r\n * @param r defines the red component\r\n * @param g defines the green component\r\n * @param b defines the blue component\r\n * @param a defines the alpha component\r\n */\r\n setAlphaConstants(r: number, g: number, b: number, a: number): void;\r\n\r\n /**\r\n * Gets the current alpha mode\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/advanced/transparent_rendering\r\n * @returns the current alpha mode\r\n */\r\n getAlphaMode(): number;\r\n\r\n /**\r\n * Gets the current alpha equation.\r\n * @returns the current alpha equation\r\n */\r\n getAlphaEquation(): number;\r\n }\r\n}\r\n\r\nAbstractEngine.prototype.getInputElement = function (): Nullable<HTMLElement> {\r\n return this._renderingCanvas;\r\n};\r\n\r\nAbstractEngine.prototype.getDepthFunction = function (): Nullable<number> {\r\n return this._depthCullingState.depthFunc;\r\n};\r\n\r\nAbstractEngine.prototype.setDepthFunction = function (depthFunc: number) {\r\n this._depthCullingState.depthFunc = depthFunc;\r\n};\r\n\r\nAbstractEngine.prototype.setDepthFunctionToGreater = function (): void {\r\n this.setDepthFunction(Constants.GREATER);\r\n};\r\n\r\nAbstractEngine.prototype.setDepthFunctionToGreaterOrEqual = function (): void {\r\n this.setDepthFunction(Constants.GEQUAL);\r\n};\r\n\r\nAbstractEngine.prototype.setDepthFunctionToLess = function (): void {\r\n this.setDepthFunction(Constants.LESS);\r\n};\r\nAbstractEngine.prototype.setDepthFunctionToLessOrEqual = function (): void {\r\n this.setDepthFunction(Constants.LEQUAL);\r\n};\r\n\r\nAbstractEngine.prototype.getDepthWrite = function (): boolean {\r\n return this._depthCullingState.depthMask;\r\n};\r\n\r\nAbstractEngine.prototype.setDepthWrite = function (enable: boolean): void {\r\n this._depthCullingState.depthMask = enable;\r\n};\r\n\r\nAbstractEngine.prototype.getStencilBuffer = function (): boolean {\r\n return this._stencilState.stencilTest;\r\n};\r\n\r\nAbstractEngine.prototype.setStencilBuffer = function (enable: boolean): void {\r\n this._stencilState.stencilTest = enable;\r\n};\r\n\r\nAbstractEngine.prototype.getStencilMask = function (): number {\r\n return this._stencilState.stencilMask;\r\n};\r\n\r\nAbstractEngine.prototype.setStencilMask = function (mask: number): void {\r\n this._stencilState.stencilMask = mask;\r\n};\r\n\r\nAbstractEngine.prototype.getStencilFunction = function (): number {\r\n return this._stencilState.stencilFunc;\r\n};\r\n\r\nAbstractEngine.prototype.getStencilFunctionReference = function (): number {\r\n return this._stencilState.stencilFuncRef;\r\n};\r\n\r\nAbstractEngine.prototype.getStencilFunctionMask = function (): number {\r\n return this._stencilState.stencilFuncMask;\r\n};\r\n\r\nAbstractEngine.prototype.setStencilFunction = function (stencilFunc: number) {\r\n this._stencilState.stencilFunc = stencilFunc;\r\n};\r\n\r\nAbstractEngine.prototype.setStencilFunctionReference = function (reference: number): void {\r\n this._stencilState.stencilFuncRef = reference;\r\n};\r\n\r\nAbstractEngine.prototype.setStencilFunctionMask = function (mask: number): void {\r\n this._stencilState.stencilFuncMask = mask;\r\n};\r\n\r\nAbstractEngine.prototype.getStencilOperationFail = function (): number {\r\n return this._stencilState.stencilOpStencilFail;\r\n};\r\n\r\nAbstractEngine.prototype.getStencilOperationDepthFail = function (): number {\r\n return this._stencilState.stencilOpDepthFail;\r\n};\r\n\r\nAbstractEngine.prototype.getStencilOperationPass = function (): number {\r\n return this._stencilState.stencilOpStencilDepthPass;\r\n};\r\n\r\nAbstractEngine.prototype.setStencilOperationFail = function (operation: number): void {\r\n this._stencilState.stencilOpStencilFail = operation;\r\n};\r\n\r\nAbstractEngine.prototype.setStencilOperationDepthFail = function (operation: number): void {\r\n this._stencilState.stencilOpDepthFail = operation;\r\n};\r\n\r\nAbstractEngine.prototype.setStencilOperationPass = function (operation: number): void {\r\n this._stencilState.stencilOpStencilDepthPass = operation;\r\n};\r\n\r\nAbstractEngine.prototype.cacheStencilState = function (): void {\r\n this._cachedStencilBuffer = this.getStencilBuffer();\r\n this._cachedStencilFunction = this.getStencilFunction();\r\n this._cachedStencilMask = this.getStencilMask();\r\n this._cachedStencilOperationPass = this.getStencilOperationPass();\r\n this._cachedStencilOperationFail = this.getStencilOperationFail();\r\n this._cachedStencilOperationDepthFail = this.getStencilOperationDepthFail();\r\n this._cachedStencilReference = this.getStencilFunctionReference();\r\n};\r\n\r\nAbstractEngine.prototype.restoreStencilState = function (): void {\r\n this.setStencilFunction(this._cachedStencilFunction);\r\n this.setStencilMask(this._cachedStencilMask);\r\n this.setStencilBuffer(this._cachedStencilBuffer);\r\n this.setStencilOperationPass(this._cachedStencilOperationPass);\r\n this.setStencilOperationFail(this._cachedStencilOperationFail);\r\n this.setStencilOperationDepthFail(this._cachedStencilOperationDepthFail);\r\n this.setStencilFunctionReference(this._cachedStencilReference);\r\n};\r\n\r\nAbstractEngine.prototype.setAlphaConstants = function (r: number, g: number, b: number, a: number): void {\r\n this._alphaState.setAlphaBlendConstants(r, g, b, a);\r\n};\r\n\r\nAbstractEngine.prototype.getAlphaMode = function (): number {\r\n return this._alphaMode;\r\n};\r\n\r\nAbstractEngine.prototype.getAlphaEquation = function (): number {\r\n return this._alphaEquation;\r\n};\r\n"]}
1
+ {"version":3,"file":"abstractEngine.states.js","sourceRoot":"","sources":["../../../../../dev/core/src/Engines/AbstractEngine/abstractEngine.states.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,wBAAwB,CAAC;AA2EhC,cAAc,CAAC,SAAS,CAAC,eAAe,GAAG;IACvC,OAAO,IAAI,CAAC,gBAAgB,CAAC;AACjC,CAAC,CAAC;AAEF,cAAc,CAAC,SAAS,CAAC,gBAAgB,GAAG;IACxC,OAAO,IAAI,CAAC,kBAAkB,CAAC,SAAS,CAAC;AAC7C,CAAC,CAAC;AAEF,cAAc,CAAC,SAAS,CAAC,gBAAgB,GAAG,UAAU,SAAiB;IACnE,IAAI,CAAC,kBAAkB,CAAC,SAAS,GAAG,SAAS,CAAC;AAClD,CAAC,CAAC;AAEF,cAAc,CAAC,SAAS,CAAC,yBAAyB,GAAG;IACjD,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;AAC7C,CAAC,CAAC;AAEF,cAAc,CAAC,SAAS,CAAC,gCAAgC,GAAG;IACxD,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;AAC5C,CAAC,CAAC;AAEF,cAAc,CAAC,SAAS,CAAC,sBAAsB,GAAG;IAC9C,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;AAC1C,CAAC,CAAC;AACF,cAAc,CAAC,SAAS,CAAC,6BAA6B,GAAG;IACrD,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;AAC5C,CAAC,CAAC;AAEF,cAAc,CAAC,SAAS,CAAC,aAAa,GAAG;IACrC,OAAO,IAAI,CAAC,kBAAkB,CAAC,SAAS,CAAC;AAC7C,CAAC,CAAC;AAEF,cAAc,CAAC,SAAS,CAAC,aAAa,GAAG,UAAU,MAAe;IAC9D,IAAI,CAAC,kBAAkB,CAAC,SAAS,GAAG,MAAM,CAAC;AAC/C,CAAC,CAAC;AAEF,cAAc,CAAC,SAAS,CAAC,iBAAiB,GAAG,UAAU,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS;IAC7F,IAAI,CAAC,WAAW,CAAC,sBAAsB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AACxD,CAAC,CAAC;AAEF,cAAc,CAAC,SAAS,CAAC,YAAY,GAAG,UAAU,WAAW,GAAG,CAAC;IAC7D,OAAO,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;AACxC,CAAC,CAAC;AAEF,cAAc,CAAC,SAAS,CAAC,gBAAgB,GAAG,UAAU,WAAW,GAAG,CAAC;IACjE,OAAO,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;AAC5C,CAAC,CAAC","sourcesContent":["import type { Nullable } from \"../../types\";\r\nimport { AbstractEngine } from \"../abstractEngine\";\r\nimport { Constants } from \"../constants\";\r\n\r\nimport \"./abstractEngine.alpha\";\r\n\r\ndeclare module \"../../Engines/abstractEngine\" {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n export interface AbstractEngine {\r\n /**\r\n * Gets the current depth function\r\n * @returns a number defining the depth function\r\n */\r\n getDepthFunction(): Nullable<number>;\r\n\r\n /**\r\n * Sets the current depth function\r\n * @param depthFunc defines the function to use\r\n */\r\n setDepthFunction(depthFunc: number): void;\r\n\r\n /**\r\n * Sets the current depth function to GREATER\r\n */\r\n setDepthFunctionToGreater(): void;\r\n\r\n /**\r\n * Sets the current depth function to GEQUAL\r\n */\r\n setDepthFunctionToGreaterOrEqual(): void;\r\n\r\n /**\r\n * Sets the current depth function to LESS\r\n */\r\n setDepthFunctionToLess(): void;\r\n\r\n /**\r\n * Sets the current depth function to LEQUAL\r\n */\r\n setDepthFunctionToLessOrEqual(): void;\r\n\r\n /**\r\n * Gets a boolean indicating if depth writing is enabled\r\n * @returns the current depth writing state\r\n */\r\n getDepthWrite(): boolean;\r\n\r\n /**\r\n * Enable or disable depth writing\r\n * @param enable defines the state to set\r\n */\r\n setDepthWrite(enable: boolean): void;\r\n\r\n /**\r\n * Sets alpha constants used by some alpha blending modes\r\n * @param r defines the red component\r\n * @param g defines the green component\r\n * @param b defines the blue component\r\n * @param a defines the alpha component\r\n */\r\n setAlphaConstants(r: number, g: number, b: number, a: number): void;\r\n\r\n /**\r\n * Gets the current alpha mode\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/advanced/transparent_rendering\r\n * @param targetIndex defines the index of the target to get the alpha mode for (default is 0)\r\n * @returns the current alpha mode\r\n */\r\n getAlphaMode(targetIndex?: number): number;\r\n\r\n /**\r\n * Gets the current alpha equation.\r\n * @param targetIndex defines the index of the target to get the alpha equation for (default is 0)\r\n * @returns the current alpha equation\r\n */\r\n getAlphaEquation(targetIndex?: number): number;\r\n }\r\n}\r\n\r\nAbstractEngine.prototype.getInputElement = function (): Nullable<HTMLElement> {\r\n return this._renderingCanvas;\r\n};\r\n\r\nAbstractEngine.prototype.getDepthFunction = function (): Nullable<number> {\r\n return this._depthCullingState.depthFunc;\r\n};\r\n\r\nAbstractEngine.prototype.setDepthFunction = function (depthFunc: number) {\r\n this._depthCullingState.depthFunc = depthFunc;\r\n};\r\n\r\nAbstractEngine.prototype.setDepthFunctionToGreater = function (): void {\r\n this.setDepthFunction(Constants.GREATER);\r\n};\r\n\r\nAbstractEngine.prototype.setDepthFunctionToGreaterOrEqual = function (): void {\r\n this.setDepthFunction(Constants.GEQUAL);\r\n};\r\n\r\nAbstractEngine.prototype.setDepthFunctionToLess = function (): void {\r\n this.setDepthFunction(Constants.LESS);\r\n};\r\nAbstractEngine.prototype.setDepthFunctionToLessOrEqual = function (): void {\r\n this.setDepthFunction(Constants.LEQUAL);\r\n};\r\n\r\nAbstractEngine.prototype.getDepthWrite = function (): boolean {\r\n return this._depthCullingState.depthMask;\r\n};\r\n\r\nAbstractEngine.prototype.setDepthWrite = function (enable: boolean): void {\r\n this._depthCullingState.depthMask = enable;\r\n};\r\n\r\nAbstractEngine.prototype.setAlphaConstants = function (r: number, g: number, b: number, a: number): void {\r\n this._alphaState.setAlphaBlendConstants(r, g, b, a);\r\n};\r\n\r\nAbstractEngine.prototype.getAlphaMode = function (targetIndex = 0): number {\r\n return this._alphaMode[targetIndex];\r\n};\r\n\r\nAbstractEngine.prototype.getAlphaEquation = function (targetIndex = 0): number {\r\n return this._alphaEquation[targetIndex];\r\n};\r\n"]}
@@ -0,0 +1,147 @@
1
+ import "./abstractEngine.alpha.js";
2
+ declare module "../../Engines/abstractEngine.js" {
3
+ interface AbstractEngine {
4
+ /** @internal */
5
+ _cachedStencilBuffer: boolean;
6
+ /** @internal */
7
+ _cachedStencilFunction: number;
8
+ /** @internal */
9
+ _cachedStencilMask: number;
10
+ /** @internal */
11
+ _cachedStencilOperationPass: number;
12
+ /** @internal */
13
+ _cachedStencilOperationFail: number;
14
+ /** @internal */
15
+ _cachedStencilOperationDepthFail: number;
16
+ /** @internal */
17
+ _cachedStencilReference: number;
18
+ /**
19
+ * Gets the current stencil operation when stencil passes
20
+ * @returns a number defining stencil operation to use when stencil passes
21
+ */
22
+ getStencilOperationPass(): number;
23
+ /**
24
+ * Gets the current back stencil operation when stencil passes
25
+ * @returns a number defining back stencil operation to use when stencil passes
26
+ */
27
+ getStencilBackOperationPass(): number;
28
+ /**
29
+ * Gets a boolean indicating if stencil buffer is enabled
30
+ * @returns the current stencil buffer state
31
+ */
32
+ getStencilBuffer(): boolean;
33
+ /**
34
+ * Enable or disable the stencil buffer
35
+ * @param enable defines if the stencil buffer must be enabled or disabled
36
+ */
37
+ setStencilBuffer(enable: boolean): void;
38
+ /**
39
+ * Gets the current stencil mask
40
+ * @returns a number defining the new stencil mask to use
41
+ */
42
+ getStencilMask(): number;
43
+ /**
44
+ * Sets the current stencil mask
45
+ * @param mask defines the new stencil mask to use
46
+ */
47
+ setStencilMask(mask: number): void;
48
+ /**
49
+ * Gets the current stencil function
50
+ * @returns a number defining the stencil function to use
51
+ */
52
+ getStencilFunction(): number;
53
+ /**
54
+ * Gets the current back stencil function
55
+ * @returns a number defining the back stencil function to use
56
+ */
57
+ getStencilBackFunction(): number;
58
+ /**
59
+ * Gets the current stencil reference value
60
+ * @returns a number defining the stencil reference value to use
61
+ */
62
+ getStencilFunctionReference(): number;
63
+ /**
64
+ * Gets the current stencil mask
65
+ * @returns a number defining the stencil mask to use
66
+ */
67
+ getStencilFunctionMask(): number;
68
+ /**
69
+ * Sets the current stencil function
70
+ * @param stencilFunc defines the new stencil function to use
71
+ */
72
+ setStencilFunction(stencilFunc: number): void;
73
+ /**
74
+ * Sets the current back stencil function
75
+ * @param stencilFunc defines the new back stencil function to use
76
+ */
77
+ setStencilBackFunction(stencilFunc: number): void;
78
+ /**
79
+ * Sets the current stencil reference
80
+ * @param reference defines the new stencil reference to use
81
+ */
82
+ setStencilFunctionReference(reference: number): void;
83
+ /**
84
+ * Sets the current stencil mask
85
+ * @param mask defines the new stencil mask to use
86
+ */
87
+ setStencilFunctionMask(mask: number): void;
88
+ /**
89
+ * Gets the current stencil operation when stencil fails
90
+ * @returns a number defining stencil operation to use when stencil fails
91
+ */
92
+ getStencilOperationFail(): number;
93
+ /**
94
+ * Gets the current back stencil operation when stencil fails
95
+ * @returns a number defining back stencil operation to use when stencil fails
96
+ */
97
+ getStencilBackOperationFail(): number;
98
+ /**
99
+ * Gets the current stencil operation when depth fails
100
+ * @returns a number defining stencil operation to use when depth fails
101
+ */
102
+ getStencilOperationDepthFail(): number;
103
+ /**
104
+ * Gets the current back stencil operation when depth fails
105
+ * @returns a number defining back stencil operation to use when depth fails
106
+ */
107
+ getStencilBackOperationDepthFail(): number;
108
+ /**
109
+ * Sets the stencil operation to use when stencil fails
110
+ * @param operation defines the stencil operation to use when stencil fails
111
+ */
112
+ setStencilOperationFail(operation: number): void;
113
+ /**
114
+ * Sets the back stencil operation to use when stencil fails
115
+ * @param operation defines the back stencil operation to use when stencil fails
116
+ */
117
+ setStencilBackOperationFail(operation: number): void;
118
+ /**
119
+ * Sets the stencil operation to use when depth fails
120
+ * @param operation defines the stencil operation to use when depth fails
121
+ */
122
+ setStencilOperationDepthFail(operation: number): void;
123
+ /**
124
+ * Sets the back stencil operation to use when depth fails
125
+ * @param operation defines the back stencil operation to use when depth fails
126
+ */
127
+ setStencilBackOperationDepthFail(operation: number): void;
128
+ /**
129
+ * Sets the stencil operation to use when stencil passes
130
+ * @param operation defines the stencil operation to use when stencil passes
131
+ */
132
+ setStencilOperationPass(operation: number): void;
133
+ /**
134
+ * Sets the back stencil operation to use when stencil passes
135
+ * @param operation defines the back stencil operation to use when stencil passes
136
+ */
137
+ setStencilBackOperationPass(operation: number): void;
138
+ /**
139
+ * Caches the state of the stencil buffer
140
+ */
141
+ cacheStencilState(): void;
142
+ /**
143
+ * Restores the state of the stencil buffer
144
+ */
145
+ restoreStencilState(): void;
146
+ }
147
+ }
@@ -0,0 +1,93 @@
1
+ import { AbstractEngine } from "../abstractEngine.js";
2
+ import "./abstractEngine.alpha.js";
3
+ AbstractEngine.prototype.getStencilBuffer = function () {
4
+ return this._stencilState.stencilTest;
5
+ };
6
+ AbstractEngine.prototype.setStencilBuffer = function (enable) {
7
+ this._stencilState.stencilTest = enable;
8
+ };
9
+ AbstractEngine.prototype.getStencilMask = function () {
10
+ return this._stencilState.stencilMask;
11
+ };
12
+ AbstractEngine.prototype.setStencilMask = function (mask) {
13
+ this._stencilState.stencilMask = mask;
14
+ };
15
+ AbstractEngine.prototype.getStencilFunction = function () {
16
+ return this._stencilState.stencilFunc;
17
+ };
18
+ AbstractEngine.prototype.getStencilBackFunction = function () {
19
+ return this._stencilState.stencilBackFunc;
20
+ };
21
+ AbstractEngine.prototype.getStencilFunctionReference = function () {
22
+ return this._stencilState.stencilFuncRef;
23
+ };
24
+ AbstractEngine.prototype.getStencilFunctionMask = function () {
25
+ return this._stencilState.stencilFuncMask;
26
+ };
27
+ AbstractEngine.prototype.setStencilFunction = function (stencilFunc) {
28
+ this._stencilState.stencilFunc = stencilFunc;
29
+ };
30
+ AbstractEngine.prototype.setStencilBackFunction = function (stencilFunc) {
31
+ this._stencilState.stencilBackFunc = stencilFunc;
32
+ };
33
+ AbstractEngine.prototype.setStencilFunctionReference = function (reference) {
34
+ this._stencilState.stencilFuncRef = reference;
35
+ };
36
+ AbstractEngine.prototype.setStencilFunctionMask = function (mask) {
37
+ this._stencilState.stencilFuncMask = mask;
38
+ };
39
+ AbstractEngine.prototype.getStencilOperationFail = function () {
40
+ return this._stencilState.stencilOpStencilFail;
41
+ };
42
+ AbstractEngine.prototype.getStencilBackOperationFail = function () {
43
+ return this._stencilState.stencilBackOpStencilFail;
44
+ };
45
+ AbstractEngine.prototype.getStencilOperationDepthFail = function () {
46
+ return this._stencilState.stencilOpDepthFail;
47
+ };
48
+ AbstractEngine.prototype.getStencilBackOperationDepthFail = function () {
49
+ return this._stencilState.stencilBackOpDepthFail;
50
+ };
51
+ AbstractEngine.prototype.getStencilOperationPass = function () {
52
+ return this._stencilState.stencilOpStencilDepthPass;
53
+ };
54
+ AbstractEngine.prototype.getStencilBackOperationPass = function () {
55
+ return this._stencilState.stencilBackOpStencilDepthPass;
56
+ };
57
+ AbstractEngine.prototype.setStencilOperationFail = function (operation) {
58
+ this._stencilState.stencilOpStencilFail = operation;
59
+ };
60
+ AbstractEngine.prototype.setStencilBackOperationFail = function (operation) {
61
+ this._stencilState.stencilBackOpStencilFail = operation;
62
+ };
63
+ AbstractEngine.prototype.setStencilOperationDepthFail = function (operation) {
64
+ this._stencilState.stencilOpDepthFail = operation;
65
+ };
66
+ AbstractEngine.prototype.setStencilBackOperationDepthFail = function (operation) {
67
+ this._stencilState.stencilBackOpDepthFail = operation;
68
+ };
69
+ AbstractEngine.prototype.setStencilOperationPass = function (operation) {
70
+ this._stencilState.stencilOpStencilDepthPass = operation;
71
+ };
72
+ AbstractEngine.prototype.setStencilBackOperationPass = function (operation) {
73
+ this._stencilState.stencilBackOpStencilDepthPass = operation;
74
+ };
75
+ AbstractEngine.prototype.cacheStencilState = function () {
76
+ this._cachedStencilBuffer = this.getStencilBuffer();
77
+ this._cachedStencilFunction = this.getStencilFunction();
78
+ this._cachedStencilMask = this.getStencilMask();
79
+ this._cachedStencilOperationPass = this.getStencilOperationPass();
80
+ this._cachedStencilOperationFail = this.getStencilOperationFail();
81
+ this._cachedStencilOperationDepthFail = this.getStencilOperationDepthFail();
82
+ this._cachedStencilReference = this.getStencilFunctionReference();
83
+ };
84
+ AbstractEngine.prototype.restoreStencilState = function () {
85
+ this.setStencilFunction(this._cachedStencilFunction);
86
+ this.setStencilMask(this._cachedStencilMask);
87
+ this.setStencilBuffer(this._cachedStencilBuffer);
88
+ this.setStencilOperationPass(this._cachedStencilOperationPass);
89
+ this.setStencilOperationFail(this._cachedStencilOperationFail);
90
+ this.setStencilOperationDepthFail(this._cachedStencilOperationDepthFail);
91
+ this.setStencilFunctionReference(this._cachedStencilReference);
92
+ };
93
+ //# sourceMappingURL=abstractEngine.stencil.js.map
@@ -0,0 +1 @@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,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;IACrD,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;IAC7C,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;IACjD,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC;IAC/D,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC;IAC/D,IAAI,CAAC,4BAA4B,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC;IACzE,IAAI,CAAC,2BAA2B,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;AACnE,CAAC,CAAC","sourcesContent":["import { AbstractEngine } from \"../abstractEngine\";\r\n\r\nimport \"./abstractEngine.alpha\";\r\n\r\ndeclare module \"../../Engines/abstractEngine\" {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n export interface AbstractEngine {\r\n /** @internal */\r\n _cachedStencilBuffer: boolean;\r\n /** @internal */\r\n _cachedStencilFunction: number;\r\n /** @internal */\r\n _cachedStencilMask: number;\r\n /** @internal */\r\n _cachedStencilOperationPass: number;\r\n /** @internal */\r\n _cachedStencilOperationFail: number;\r\n /** @internal */\r\n _cachedStencilOperationDepthFail: number;\r\n /** @internal */\r\n _cachedStencilReference: number;\r\n\r\n /**\r\n * Gets the current stencil operation when stencil passes\r\n * @returns a number defining stencil operation to use when stencil passes\r\n */\r\n getStencilOperationPass(): number;\r\n\r\n /**\r\n * Gets the current back stencil operation when stencil passes\r\n * @returns a number defining back stencil operation to use when stencil passes\r\n */\r\n getStencilBackOperationPass(): number;\r\n\r\n /**\r\n * Gets a boolean indicating if stencil buffer is enabled\r\n * @returns the current stencil buffer state\r\n */\r\n getStencilBuffer(): boolean;\r\n\r\n /**\r\n * Enable or disable the stencil buffer\r\n * @param enable defines if the stencil buffer must be enabled or disabled\r\n */\r\n setStencilBuffer(enable: boolean): void;\r\n\r\n /**\r\n * Gets the current stencil mask\r\n * @returns a number defining the new stencil mask to use\r\n */\r\n getStencilMask(): number;\r\n /**\r\n * Sets the current stencil mask\r\n * @param mask defines the new stencil mask to use\r\n */\r\n setStencilMask(mask: number): void;\r\n\r\n /**\r\n * Gets the current stencil function\r\n * @returns a number defining the stencil function to use\r\n */\r\n getStencilFunction(): number;\r\n\r\n /**\r\n * Gets the current back stencil function\r\n * @returns a number defining the back stencil function to use\r\n */\r\n getStencilBackFunction(): number;\r\n\r\n /**\r\n * Gets the current stencil reference value\r\n * @returns a number defining the stencil reference value to use\r\n */\r\n getStencilFunctionReference(): number;\r\n\r\n /**\r\n * Gets the current stencil mask\r\n * @returns a number defining the stencil mask to use\r\n */\r\n getStencilFunctionMask(): number;\r\n\r\n /**\r\n * Sets the current stencil function\r\n * @param stencilFunc defines the new stencil function to use\r\n */\r\n setStencilFunction(stencilFunc: number): void;\r\n\r\n /**\r\n * Sets the current back stencil function\r\n * @param stencilFunc defines the new back stencil function to use\r\n */\r\n setStencilBackFunction(stencilFunc: number): void;\r\n\r\n /**\r\n * Sets the current stencil reference\r\n * @param reference defines the new stencil reference to use\r\n */\r\n setStencilFunctionReference(reference: number): void;\r\n\r\n /**\r\n * Sets the current stencil mask\r\n * @param mask defines the new stencil mask to use\r\n */\r\n setStencilFunctionMask(mask: number): void;\r\n\r\n /**\r\n * Gets the current stencil operation when stencil fails\r\n * @returns a number defining stencil operation to use when stencil fails\r\n */\r\n getStencilOperationFail(): number;\r\n\r\n /**\r\n * Gets the current back stencil operation when stencil fails\r\n * @returns a number defining back stencil operation to use when stencil fails\r\n */\r\n getStencilBackOperationFail(): number;\r\n\r\n /**\r\n * Gets the current stencil operation when depth fails\r\n * @returns a number defining stencil operation to use when depth fails\r\n */\r\n getStencilOperationDepthFail(): number;\r\n\r\n /**\r\n * Gets the current back stencil operation when depth fails\r\n * @returns a number defining back stencil operation to use when depth fails\r\n */\r\n getStencilBackOperationDepthFail(): number;\r\n\r\n /**\r\n * Sets the stencil operation to use when stencil fails\r\n * @param operation defines the stencil operation to use when stencil fails\r\n */\r\n setStencilOperationFail(operation: number): void;\r\n\r\n /**\r\n * Sets the back stencil operation to use when stencil fails\r\n * @param operation defines the back stencil operation to use when stencil fails\r\n */\r\n setStencilBackOperationFail(operation: number): void;\r\n\r\n /**\r\n * Sets the stencil operation to use when depth fails\r\n * @param operation defines the stencil operation to use when depth fails\r\n */\r\n setStencilOperationDepthFail(operation: number): void;\r\n\r\n /**\r\n * Sets the back stencil operation to use when depth fails\r\n * @param operation defines the back stencil operation to use when depth fails\r\n */\r\n setStencilBackOperationDepthFail(operation: number): void;\r\n\r\n /**\r\n * Sets the stencil operation to use when stencil passes\r\n * @param operation defines the stencil operation to use when stencil passes\r\n */\r\n setStencilOperationPass(operation: number): void;\r\n\r\n /**\r\n * Sets the back stencil operation to use when stencil passes\r\n * @param operation defines the back stencil operation to use when stencil passes\r\n */\r\n setStencilBackOperationPass(operation: number): void;\r\n\r\n /**\r\n * Caches the state of the stencil buffer\r\n */\r\n cacheStencilState(): void;\r\n\r\n /**\r\n * Restores the state of the stencil buffer\r\n */\r\n restoreStencilState(): void;\r\n }\r\n}\r\n\r\nAbstractEngine.prototype.getStencilBuffer = function (): boolean {\r\n return this._stencilState.stencilTest;\r\n};\r\n\r\nAbstractEngine.prototype.setStencilBuffer = function (enable: boolean): void {\r\n this._stencilState.stencilTest = enable;\r\n};\r\n\r\nAbstractEngine.prototype.getStencilMask = function (): number {\r\n return this._stencilState.stencilMask;\r\n};\r\n\r\nAbstractEngine.prototype.setStencilMask = function (mask: number): void {\r\n this._stencilState.stencilMask = mask;\r\n};\r\n\r\nAbstractEngine.prototype.getStencilFunction = function (): number {\r\n return this._stencilState.stencilFunc;\r\n};\r\n\r\nAbstractEngine.prototype.getStencilBackFunction = function (): number {\r\n return this._stencilState.stencilBackFunc;\r\n};\r\n\r\nAbstractEngine.prototype.getStencilFunctionReference = function (): number {\r\n return this._stencilState.stencilFuncRef;\r\n};\r\n\r\nAbstractEngine.prototype.getStencilFunctionMask = function (): number {\r\n return this._stencilState.stencilFuncMask;\r\n};\r\n\r\nAbstractEngine.prototype.setStencilFunction = function (stencilFunc: number) {\r\n this._stencilState.stencilFunc = stencilFunc;\r\n};\r\n\r\nAbstractEngine.prototype.setStencilBackFunction = function (stencilFunc: number) {\r\n this._stencilState.stencilBackFunc = stencilFunc;\r\n};\r\n\r\nAbstractEngine.prototype.setStencilFunctionReference = function (reference: number): void {\r\n this._stencilState.stencilFuncRef = reference;\r\n};\r\n\r\nAbstractEngine.prototype.setStencilFunctionMask = function (mask: number): void {\r\n this._stencilState.stencilFuncMask = mask;\r\n};\r\n\r\nAbstractEngine.prototype.getStencilOperationFail = function (): number {\r\n return this._stencilState.stencilOpStencilFail;\r\n};\r\n\r\nAbstractEngine.prototype.getStencilBackOperationFail = function (): number {\r\n return this._stencilState.stencilBackOpStencilFail;\r\n};\r\n\r\nAbstractEngine.prototype.getStencilOperationDepthFail = function (): number {\r\n return this._stencilState.stencilOpDepthFail;\r\n};\r\n\r\nAbstractEngine.prototype.getStencilBackOperationDepthFail = function (): number {\r\n return this._stencilState.stencilBackOpDepthFail;\r\n};\r\n\r\nAbstractEngine.prototype.getStencilOperationPass = function (): number {\r\n return this._stencilState.stencilOpStencilDepthPass;\r\n};\r\n\r\nAbstractEngine.prototype.getStencilBackOperationPass = function (): number {\r\n return this._stencilState.stencilBackOpStencilDepthPass;\r\n};\r\n\r\nAbstractEngine.prototype.setStencilOperationFail = function (operation: number): void {\r\n this._stencilState.stencilOpStencilFail = operation;\r\n};\r\n\r\nAbstractEngine.prototype.setStencilBackOperationFail = function (operation: number): void {\r\n this._stencilState.stencilBackOpStencilFail = operation;\r\n};\r\n\r\nAbstractEngine.prototype.setStencilOperationDepthFail = function (operation: number): void {\r\n this._stencilState.stencilOpDepthFail = operation;\r\n};\r\n\r\nAbstractEngine.prototype.setStencilBackOperationDepthFail = function (operation: number): void {\r\n this._stencilState.stencilBackOpDepthFail = operation;\r\n};\r\n\r\nAbstractEngine.prototype.setStencilOperationPass = function (operation: number): void {\r\n this._stencilState.stencilOpStencilDepthPass = operation;\r\n};\r\n\r\nAbstractEngine.prototype.setStencilBackOperationPass = function (operation: number): void {\r\n this._stencilState.stencilBackOpStencilDepthPass = operation;\r\n};\r\n\r\nAbstractEngine.prototype.cacheStencilState = function (): void {\r\n this._cachedStencilBuffer = this.getStencilBuffer();\r\n this._cachedStencilFunction = this.getStencilFunction();\r\n this._cachedStencilMask = this.getStencilMask();\r\n this._cachedStencilOperationPass = this.getStencilOperationPass();\r\n this._cachedStencilOperationFail = this.getStencilOperationFail();\r\n this._cachedStencilOperationDepthFail = this.getStencilOperationDepthFail();\r\n this._cachedStencilReference = this.getStencilFunctionReference();\r\n};\r\n\r\nAbstractEngine.prototype.restoreStencilState = function (): void {\r\n this.setStencilFunction(this._cachedStencilFunction);\r\n this.setStencilMask(this._cachedStencilMask);\r\n this.setStencilBuffer(this._cachedStencilBuffer);\r\n this.setStencilOperationPass(this._cachedStencilOperationPass);\r\n this.setStencilOperationFail(this._cachedStencilOperationFail);\r\n this.setStencilOperationDepthFail(this._cachedStencilOperationDepthFail);\r\n this.setStencilFunctionReference(this._cachedStencilReference);\r\n};\r\n"]}
@@ -2,6 +2,7 @@ export * from "./abstractEngine.cubeTexture.js";
2
2
  export * from "./abstractEngine.loadingScreen.js";
3
3
  export * from "./abstractEngine.dom.js";
4
4
  export * from "./abstractEngine.states.js";
5
+ export * from "./abstractEngine.stencil.js";
5
6
  export * from "./abstractEngine.timeQuery.js";
6
7
  export * from "./abstractEngine.query.js";
7
8
  export * from "./abstractEngine.renderPass.js";
@@ -3,6 +3,7 @@ export * from "./abstractEngine.cubeTexture.js";
3
3
  export * from "./abstractEngine.loadingScreen.js";
4
4
  export * from "./abstractEngine.dom.js";
5
5
  export * from "./abstractEngine.states.js";
6
+ export * from "./abstractEngine.stencil.js";
6
7
  export * from "./abstractEngine.timeQuery.js";
7
8
  export * from "./abstractEngine.query.js";
8
9
  export * from "./abstractEngine.renderPass.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../dev/core/src/Engines/AbstractEngine/index.ts"],"names":[],"mappings":"AAAA,kCAAkC;AAClC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC","sourcesContent":["/* eslint-disable import/export */\r\nexport * from \"./abstractEngine.cubeTexture\";\r\nexport * from \"./abstractEngine.loadingScreen\";\r\nexport * from \"./abstractEngine.dom\";\r\nexport * from \"./abstractEngine.states\";\r\nexport * from \"./abstractEngine.timeQuery\";\r\nexport * from \"./abstractEngine.query\";\r\nexport * from \"./abstractEngine.renderPass\";\r\nexport * from \"./abstractEngine.texture\";\r\nexport * from \"./abstractEngine.alpha\";\r\nexport * from \"./abstractEngine.views\";\r\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../dev/core/src/Engines/AbstractEngine/index.ts"],"names":[],"mappings":"AAAA,kCAAkC;AAClC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC","sourcesContent":["/* eslint-disable import/export */\r\nexport * from \"./abstractEngine.cubeTexture\";\r\nexport * from \"./abstractEngine.loadingScreen\";\r\nexport * from \"./abstractEngine.dom\";\r\nexport * from \"./abstractEngine.states\";\r\nexport * from \"./abstractEngine.stencil\";\r\nexport * from \"./abstractEngine.timeQuery\";\r\nexport * from \"./abstractEngine.query\";\r\nexport * from \"./abstractEngine.renderPass\";\r\nexport * from \"./abstractEngine.texture\";\r\nexport * from \"./abstractEngine.alpha\";\r\nexport * from \"./abstractEngine.views\";\r\n"]}
@@ -4,9 +4,10 @@ declare module "../abstractEngine.js" {
4
4
  * Sets the current alpha mode
5
5
  * @param mode defines the mode to use (one of the Engine.ALPHA_XXX)
6
6
  * @param noDepthWriteChange defines if depth writing state should remains unchanged (false by default)
7
+ * @param targetIndex defines the index of the target to set the alpha mode for (default is 0)
7
8
  * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/advanced/transparent_rendering
8
9
  */
9
- setAlphaMode(mode: number, noDepthWriteChange?: boolean): void;
10
+ setAlphaMode(mode: number, noDepthWriteChange?: boolean, targetIndex?: number): void;
10
11
  }
11
12
  }
12
13
  export {};