@babylonjs/core 6.45.0 → 6.46.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 (235) hide show
  1. package/Animations/animation.js +1 -1
  2. package/Animations/animation.js.map +1 -1
  3. package/BakedVertexAnimation/bakedVertexAnimationManager.js +2 -1
  4. package/BakedVertexAnimation/bakedVertexAnimationManager.js.map +1 -1
  5. package/Bones/skeleton.js +2 -2
  6. package/Bones/skeleton.js.map +1 -1
  7. package/Cameras/camera.d.ts +3 -3
  8. package/Cameras/camera.js +2 -1
  9. package/Cameras/camera.js.map +1 -1
  10. package/Cameras/cameraInputsManager.js +1 -1
  11. package/Cameras/cameraInputsManager.js.map +1 -1
  12. package/Cameras/targetCamera.js +4 -0
  13. package/Cameras/targetCamera.js.map +1 -1
  14. package/Compute/computeShader.d.ts +4 -2
  15. package/Compute/computeShader.js +7 -3
  16. package/Compute/computeShader.js.map +1 -1
  17. package/Debug/directionalLightFrustumViewer.js +6 -6
  18. package/Debug/directionalLightFrustumViewer.js.map +1 -1
  19. package/Engines/Extensions/engine.computeShader.d.ts +2 -1
  20. package/Engines/Extensions/engine.computeShader.js +1 -0
  21. package/Engines/Extensions/engine.computeShader.js.map +1 -1
  22. package/Engines/Extensions/engine.rawTexture.js +3 -3
  23. package/Engines/Extensions/engine.rawTexture.js.map +1 -1
  24. package/Engines/Native/nativePipelineContext.js +1 -1
  25. package/Engines/Native/nativePipelineContext.js.map +1 -1
  26. package/Engines/WebGL/webGLPipelineContext.js +1 -1
  27. package/Engines/WebGL/webGLPipelineContext.js.map +1 -1
  28. package/Engines/WebGPU/webgpuComputeContext.js +7 -3
  29. package/Engines/WebGPU/webgpuComputeContext.js.map +1 -1
  30. package/Engines/engine.d.ts +1 -1
  31. package/Engines/thinEngine.js +2 -2
  32. package/Engines/thinEngine.js.map +1 -1
  33. package/Engines/webgpuEngine.js +2 -15
  34. package/Engines/webgpuEngine.js.map +1 -1
  35. package/Layers/glowLayer.js +2 -1
  36. package/Layers/glowLayer.js.map +1 -1
  37. package/Layers/highlightLayer.js +2 -1
  38. package/Layers/highlightLayer.js.map +1 -1
  39. package/Lights/light.js +2 -1
  40. package/Lights/light.js.map +1 -1
  41. package/Loading/Plugins/babylonFileLoader.js +9 -0
  42. package/Loading/Plugins/babylonFileLoader.js.map +1 -1
  43. package/Loading/sceneLoader.d.ts +6 -1
  44. package/Loading/sceneLoader.js +6 -5
  45. package/Loading/sceneLoader.js.map +1 -1
  46. package/Materials/Background/backgroundMaterial.js +2 -1
  47. package/Materials/Background/backgroundMaterial.js.map +1 -1
  48. package/Materials/GaussianSplatting/gaussianSplattingMaterial.js +1 -1
  49. package/Materials/GaussianSplatting/gaussianSplattingMaterial.js.map +1 -1
  50. package/Materials/Node/nodeMaterial.d.ts +2 -1
  51. package/Materials/Node/nodeMaterial.js +5 -1
  52. package/Materials/Node/nodeMaterial.js.map +1 -1
  53. package/Materials/PBR/pbrBaseMaterial.d.ts +1 -1
  54. package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
  55. package/Materials/PBR/pbrMaterial.js +2 -1
  56. package/Materials/PBR/pbrMaterial.js.map +1 -1
  57. package/Materials/PBR/pbrMetallicRoughnessMaterial.js +2 -1
  58. package/Materials/PBR/pbrMetallicRoughnessMaterial.js.map +1 -1
  59. package/Materials/PBR/pbrSpecularGlossinessMaterial.js +2 -1
  60. package/Materials/PBR/pbrSpecularGlossinessMaterial.js.map +1 -1
  61. package/Materials/Textures/baseTexture.js +2 -1
  62. package/Materials/Textures/baseTexture.js.map +1 -1
  63. package/Materials/Textures/cubeTexture.js +2 -1
  64. package/Materials/Textures/cubeTexture.js.map +1 -1
  65. package/Materials/Textures/rawCubeTexture.js +1 -1
  66. package/Materials/Textures/rawCubeTexture.js.map +1 -1
  67. package/Materials/Textures/texture.js +2 -1
  68. package/Materials/Textures/texture.js.map +1 -1
  69. package/Materials/colorCurves.d.ts +1 -1
  70. package/Materials/colorCurves.functions.d.ts +5 -0
  71. package/Materials/colorCurves.functions.js +8 -0
  72. package/Materials/colorCurves.functions.js.map +1 -0
  73. package/Materials/colorCurves.js +8 -8
  74. package/Materials/colorCurves.js.map +1 -1
  75. package/Materials/fresnelParameters.js +1 -1
  76. package/Materials/fresnelParameters.js.map +1 -1
  77. package/Materials/imageProcessingConfiguration.d.ts +3 -48
  78. package/Materials/imageProcessingConfiguration.defines.d.ts +46 -0
  79. package/Materials/imageProcessingConfiguration.defines.js +27 -0
  80. package/Materials/imageProcessingConfiguration.defines.js.map +1 -0
  81. package/Materials/imageProcessingConfiguration.functions.d.ts +13 -0
  82. package/Materials/imageProcessingConfiguration.functions.js +41 -0
  83. package/Materials/imageProcessingConfiguration.functions.js.map +1 -0
  84. package/Materials/imageProcessingConfiguration.js +18 -69
  85. package/Materials/imageProcessingConfiguration.js.map +1 -1
  86. package/Materials/material.js +2 -1
  87. package/Materials/material.js.map +1 -1
  88. package/Materials/materialHelper.d.ts +33 -33
  89. package/Materials/materialHelper.js +244 -286
  90. package/Materials/materialHelper.js.map +1 -1
  91. package/Materials/materialPluginBase.js +2 -1
  92. package/Materials/materialPluginBase.js.map +1 -1
  93. package/Materials/materialStencilState.js +2 -1
  94. package/Materials/materialStencilState.js.map +1 -1
  95. package/Materials/shaderMaterial.js +1 -1
  96. package/Materials/shaderMaterial.js.map +1 -1
  97. package/Materials/standardMaterial.d.ts +1 -1
  98. package/Materials/standardMaterial.js +2 -1
  99. package/Materials/standardMaterial.js.map +1 -1
  100. package/Materials/uniformBuffer.js +2 -2
  101. package/Materials/uniformBuffer.js.map +1 -1
  102. package/Maths/math.color.d.ts +392 -66
  103. package/Maths/math.color.js +541 -65
  104. package/Maths/math.color.js.map +1 -1
  105. package/Maths/math.like.d.ts +17 -28
  106. package/Maths/math.like.js.map +1 -1
  107. package/Maths/math.plane.d.ts +2 -1
  108. package/Maths/math.plane.js.map +1 -1
  109. package/Maths/math.polar.d.ts +1 -1
  110. package/Maths/math.polar.js.map +1 -1
  111. package/Maths/math.scalar.d.ts +6 -6
  112. package/Maths/math.scalar.functions.d.ts +51 -0
  113. package/Maths/math.scalar.functions.js +80 -0
  114. package/Maths/math.scalar.functions.js.map +1 -0
  115. package/Maths/math.scalar.js +48 -73
  116. package/Maths/math.scalar.js.map +1 -1
  117. package/Maths/math.vector.d.ts +571 -72
  118. package/Maths/math.vector.js +917 -119
  119. package/Maths/math.vector.js.map +1 -1
  120. package/Maths/math.viewport.d.ts +2 -1
  121. package/Maths/math.viewport.js.map +1 -1
  122. package/Maths/tensor.d.ts +411 -0
  123. package/Maths/tensor.js +3 -0
  124. package/Maths/tensor.js.map +1 -0
  125. package/Meshes/Node/Blocks/Set/setColorsBlock.js +20 -4
  126. package/Meshes/Node/Blocks/Set/setColorsBlock.js.map +1 -1
  127. package/Meshes/Node/nodeGeometry.js +2 -1
  128. package/Meshes/Node/nodeGeometry.js.map +1 -1
  129. package/Meshes/mesh.js +2 -2
  130. package/Meshes/mesh.js.map +1 -1
  131. package/Meshes/mesh.vertexData.d.ts +4 -0
  132. package/Meshes/mesh.vertexData.js +10 -0
  133. package/Meshes/mesh.vertexData.js.map +1 -1
  134. package/Meshes/transformNode.js +2 -1
  135. package/Meshes/transformNode.js.map +1 -1
  136. package/Misc/arrayTools.d.ts +2 -19
  137. package/Misc/arrayTools.js.map +1 -1
  138. package/Misc/decorators.d.ts +0 -80
  139. package/Misc/decorators.functions.d.ts +7 -0
  140. package/Misc/decorators.functions.js +52 -0
  141. package/Misc/decorators.functions.js.map +1 -0
  142. package/Misc/decorators.js +2 -318
  143. package/Misc/decorators.js.map +1 -1
  144. package/Misc/decorators.serialization.d.ts +81 -0
  145. package/Misc/decorators.serialization.js +269 -0
  146. package/Misc/decorators.serialization.js.map +1 -0
  147. package/Misc/index.d.ts +1 -0
  148. package/Misc/index.js +1 -0
  149. package/Misc/index.js.map +1 -1
  150. package/Misc/sceneRecorder.js +1 -1
  151. package/Misc/sceneRecorder.js.map +1 -1
  152. package/Misc/sceneSerializer.js +8 -1
  153. package/Misc/sceneSerializer.js.map +1 -1
  154. package/Misc/tools.functions.d.ts +14 -0
  155. package/Misc/tools.functions.js +23 -0
  156. package/Misc/tools.functions.js.map +1 -0
  157. package/Misc/tools.js +5 -6
  158. package/Misc/tools.js.map +1 -1
  159. package/Morph/morphTarget.js +2 -1
  160. package/Morph/morphTarget.js.map +1 -1
  161. package/Particles/EmitterTypes/boxParticleEmitter.js +8 -8
  162. package/Particles/EmitterTypes/boxParticleEmitter.js.map +1 -1
  163. package/Particles/baseParticleSystem.d.ts +8 -11
  164. package/Particles/baseParticleSystem.js +9 -40
  165. package/Particles/baseParticleSystem.js.map +1 -1
  166. package/Particles/gpuParticleSystem.d.ts +71 -1
  167. package/Particles/gpuParticleSystem.js +102 -1
  168. package/Particles/gpuParticleSystem.js.map +1 -1
  169. package/Particles/particle.d.ts +3 -3
  170. package/Particles/particle.js +3 -3
  171. package/Particles/particle.js.map +1 -1
  172. package/Particles/particleSystem.d.ts +81 -455
  173. package/Particles/particleSystem.functions.d.ts +61 -0
  174. package/Particles/particleSystem.functions.js +79 -0
  175. package/Particles/particleSystem.functions.js.map +1 -0
  176. package/Particles/particleSystem.js +390 -1984
  177. package/Particles/particleSystem.js.map +1 -1
  178. package/Particles/thinParticleSystem.d.ts +485 -0
  179. package/Particles/thinParticleSystem.js +1768 -0
  180. package/Particles/thinParticleSystem.js.map +1 -0
  181. package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js +2 -1
  182. package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js.map +1 -1
  183. package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js +2 -1
  184. package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js.map +1 -1
  185. package/PostProcesses/RenderPipeline/Pipelines/ssrRenderingPipeline.js +2 -1
  186. package/PostProcesses/RenderPipeline/Pipelines/ssrRenderingPipeline.js.map +1 -1
  187. package/PostProcesses/RenderPipeline/Pipelines/standardRenderingPipeline.js +2 -1
  188. package/PostProcesses/RenderPipeline/Pipelines/standardRenderingPipeline.js.map +1 -1
  189. package/PostProcesses/RenderPipeline/Pipelines/taaRenderingPipeline.js +2 -1
  190. package/PostProcesses/RenderPipeline/Pipelines/taaRenderingPipeline.js.map +1 -1
  191. package/PostProcesses/blackAndWhitePostProcess.js +2 -1
  192. package/PostProcesses/blackAndWhitePostProcess.js.map +1 -1
  193. package/PostProcesses/blurPostProcess.js +2 -1
  194. package/PostProcesses/blurPostProcess.js.map +1 -1
  195. package/PostProcesses/chromaticAberrationPostProcess.js +2 -1
  196. package/PostProcesses/chromaticAberrationPostProcess.js.map +1 -1
  197. package/PostProcesses/colorCorrectionPostProcess.js +2 -1
  198. package/PostProcesses/colorCorrectionPostProcess.js.map +1 -1
  199. package/PostProcesses/convolutionPostProcess.js +2 -1
  200. package/PostProcesses/convolutionPostProcess.js.map +1 -1
  201. package/PostProcesses/displayPassPostProcess.js +1 -1
  202. package/PostProcesses/displayPassPostProcess.js.map +1 -1
  203. package/PostProcesses/filterPostProcess.js +2 -1
  204. package/PostProcesses/filterPostProcess.js.map +1 -1
  205. package/PostProcesses/fxaaPostProcess.js +1 -1
  206. package/PostProcesses/fxaaPostProcess.js.map +1 -1
  207. package/PostProcesses/grainPostProcess.js +2 -1
  208. package/PostProcesses/grainPostProcess.js.map +1 -1
  209. package/PostProcesses/imageProcessingPostProcess.js.map +1 -1
  210. package/PostProcesses/motionBlurPostProcess.js +2 -1
  211. package/PostProcesses/motionBlurPostProcess.js.map +1 -1
  212. package/PostProcesses/passPostProcess.js +1 -1
  213. package/PostProcesses/passPostProcess.js.map +1 -1
  214. package/PostProcesses/postProcess.js +2 -1
  215. package/PostProcesses/postProcess.js.map +1 -1
  216. package/PostProcesses/refractionPostProcess.js +2 -1
  217. package/PostProcesses/refractionPostProcess.js.map +1 -1
  218. package/PostProcesses/screenSpaceCurvaturePostProcess.js +2 -1
  219. package/PostProcesses/screenSpaceCurvaturePostProcess.js.map +1 -1
  220. package/PostProcesses/screenSpaceReflectionPostProcess.js +2 -1
  221. package/PostProcesses/screenSpaceReflectionPostProcess.js.map +1 -1
  222. package/PostProcesses/sharpenPostProcess.js +2 -1
  223. package/PostProcesses/sharpenPostProcess.js.map +1 -1
  224. package/Probes/reflectionProbe.js +2 -1
  225. package/Probes/reflectionProbe.js.map +1 -1
  226. package/Sprites/spriteManager.d.ts +4 -0
  227. package/Sprites/spriteManager.js.map +1 -1
  228. package/XR/features/WebXRControllerTeleportation.d.ts +9 -0
  229. package/XR/features/WebXRControllerTeleportation.js +75 -31
  230. package/XR/features/WebXRControllerTeleportation.js.map +1 -1
  231. package/node.js +2 -1
  232. package/node.js.map +1 -1
  233. package/package.json +1 -1
  234. package/types.d.ts +105 -0
  235. package/types.js.map +1 -1
@@ -7,304 +7,262 @@ import { BindBonesParameters, BindFogParameters, BindLight, BindLightProperties,
7
7
  * This works by convention in BabylonJS but is meant to be use only with shader following the in place naming rules and conventions.
8
8
  */
9
9
  export class MaterialHelper {
10
- /**
11
- * Binds the scene's uniform buffer to the effect.
12
- * @param effect defines the effect to bind to the scene uniform buffer
13
- * @param sceneUbo defines the uniform buffer storing scene data
14
- */
15
- static BindSceneUniformBuffer(effect, sceneUbo) { }
16
- /**
17
- * Helps preparing the defines values about the UVs in used in the effect.
18
- * UVs are shared as much as we can across channels in the shaders.
19
- * @param texture The texture we are preparing the UVs for
20
- * @param defines The defines to update
21
- * @param key The channel key "diffuse", "specular"... used in the shader
22
- */
23
- static PrepareDefinesForMergedUV(texture, defines, key) { }
24
- /**
25
- * Binds a texture matrix value to its corresponding uniform
26
- * @param texture The texture to bind the matrix for
27
- * @param uniformBuffer The uniform buffer receiving the data
28
- * @param key The channel key "diffuse", "specular"... used in the shader
29
- */
30
- static BindTextureMatrix(texture, uniformBuffer, key) { }
31
- /**
32
- * Gets the current status of the fog (should it be enabled?)
33
- * @param mesh defines the mesh to evaluate for fog support
34
- * @param scene defines the hosting scene
35
- * @returns true if fog must be enabled
36
- */
37
- static GetFogState(mesh, scene) {
38
- return true;
39
- }
40
- /**
41
- * Helper used to prepare the list of defines associated with misc. values for shader compilation
42
- * @param mesh defines the current mesh
43
- * @param scene defines the current scene
44
- * @param useLogarithmicDepth defines if logarithmic depth has to be turned on
45
- * @param pointsCloud defines if point cloud rendering has to be turned on
46
- * @param fogEnabled defines if fog has to be turned on
47
- * @param alphaTest defines if alpha testing has to be turned on
48
- * @param defines defines the current list of defines
49
- * @param applyDecalAfterDetail Defines if the decal is applied after or before the detail
50
- */
51
- static PrepareDefinesForMisc(mesh, scene, useLogarithmicDepth, pointsCloud, fogEnabled, alphaTest, defines, applyDecalAfterDetail = false) { }
52
- /**
53
- * Helper used to prepare the defines relative to the active camera
54
- * @param scene defines the current scene
55
- * @param defines specifies the list of active defines
56
- * @returns true if the defines have been updated, else false
57
- */
58
- static PrepareDefinesForCamera(scene, defines) {
59
- return true;
60
- }
61
- /**
62
- * Helper used to prepare the list of defines associated with frame values for shader compilation
63
- * @param scene defines the current scene
64
- * @param engine defines the current engine
65
- * @param material defines the material we are compiling the shader for
66
- * @param defines specifies the list of active defines
67
- * @param useInstances defines if instances have to be turned on
68
- * @param useClipPlane defines if clip plane have to be turned on
69
- * @param useThinInstances defines if thin instances have to be turned on
70
- */
71
- static PrepareDefinesForFrameBoundValues(scene, engine, material, defines, useInstances, useClipPlane = null, useThinInstances = false) { }
72
- /**
73
- * Prepares the defines for bones
74
- * @param mesh The mesh containing the geometry data we will draw
75
- * @param defines The defines to update
76
- */
77
- static PrepareDefinesForBones(mesh, defines) { }
78
- /**
79
- * Prepares the defines for morph targets
80
- * @param mesh The mesh containing the geometry data we will draw
81
- * @param defines The defines to update
82
- */
83
- static PrepareDefinesForMorphTargets(mesh, defines) { }
84
- /**
85
- * Prepares the defines for baked vertex animation
86
- * @param mesh The mesh containing the geometry data we will draw
87
- * @param defines The defines to update
88
- */
89
- static PrepareDefinesForBakedVertexAnimation(mesh, defines) { }
90
- /**
91
- * Prepares the defines used in the shader depending on the attributes data available in the mesh
92
- * @param mesh The mesh containing the geometry data we will draw
93
- * @param defines The defines to update
94
- * @param useVertexColor Precise whether vertex colors should be used or not (override mesh info)
95
- * @param useBones Precise whether bones should be used or not (override mesh info)
96
- * @param useMorphTargets Precise whether morph targets should be used or not (override mesh info)
97
- * @param useVertexAlpha Precise whether vertex alpha should be used or not (override mesh info)
98
- * @param useBakedVertexAnimation Precise whether baked vertex animation should be used or not (override mesh info)
99
- * @returns false if defines are considered not dirty and have not been checked
100
- */
101
- static PrepareDefinesForAttributes(mesh, defines, useVertexColor, useBones, useMorphTargets = false, useVertexAlpha = true, useBakedVertexAnimation = true) {
102
- return true;
103
- }
104
- /**
105
- * Prepares the defines related to multiview
106
- * @param scene The scene we are intending to draw
107
- * @param defines The defines to update
108
- */
109
- static PrepareDefinesForMultiview(scene, defines) { }
110
- /**
111
- * Prepares the defines related to order independant transparency
112
- * @param scene The scene we are intending to draw
113
- * @param defines The defines to update
114
- * @param needAlphaBlending Determines if the material needs alpha blending
115
- */
116
- static PrepareDefinesForOIT(scene, defines, needAlphaBlending) { }
117
- /**
118
- * Prepares the defines related to the prepass
119
- * @param scene The scene we are intending to draw
120
- * @param defines The defines to update
121
- * @param canRenderToMRT Indicates if this material renders to several textures in the prepass
122
- */
123
- static PrepareDefinesForPrePass(scene, defines, canRenderToMRT) { }
124
- /**
125
- * Prepares the defines related to the light information passed in parameter
126
- * @param scene The scene we are intending to draw
127
- * @param mesh The mesh the effect is compiling for
128
- * @param light The light the effect is compiling for
129
- * @param lightIndex The index of the light
130
- * @param defines The defines to update
131
- * @param specularSupported Specifies whether specular is supported or not (override lights data)
132
- * @param state Defines the current state regarding what is needed (normals, etc...)
133
- * @param state.needNormals
134
- * @param state.needRebuild
135
- * @param state.shadowEnabled
136
- * @param state.specularEnabled
137
- * @param state.lightmapMode
138
- */
139
- static PrepareDefinesForLight(scene, mesh, light, lightIndex, defines, specularSupported, state) { }
140
- /**
141
- * Prepares the defines related to the light information passed in parameter
142
- * @param scene The scene we are intending to draw
143
- * @param mesh The mesh the effect is compiling for
144
- * @param defines The defines to update
145
- * @param specularSupported Specifies whether specular is supported or not (override lights data)
146
- * @param maxSimultaneousLights Specifies how manuy lights can be added to the effect at max
147
- * @param disableLighting Specifies whether the lighting is disabled (override scene and light)
148
- * @returns true if normals will be required for the rest of the effect
149
- */
150
- static PrepareDefinesForLights(scene, mesh, defines, specularSupported, maxSimultaneousLights = 4, disableLighting = false) {
151
- return true;
152
- }
153
- /**
154
- * Prepares the uniforms and samplers list to be used in the effect (for a specific light)
155
- * @param lightIndex defines the light index
156
- * @param uniformsList The uniform list
157
- * @param samplersList The sampler list
158
- * @param projectedLightTexture defines if projected texture must be used
159
- * @param uniformBuffersList defines an optional list of uniform buffers
160
- * @param updateOnlyBuffersList True to only update the uniformBuffersList array
161
- */
162
- static PrepareUniformsAndSamplersForLight(lightIndex, uniformsList, samplersList, projectedLightTexture, uniformBuffersList = null, updateOnlyBuffersList = false) { }
163
- /**
164
- * Prepares the uniforms and samplers list to be used in the effect
165
- * @param uniformsListOrOptions The uniform names to prepare or an EffectCreationOptions containing the list and extra information
166
- * @param samplersList The sampler list
167
- * @param defines The defines helping in the list generation
168
- * @param maxSimultaneousLights The maximum number of simultaneous light allowed in the effect
169
- */
170
- static PrepareUniformsAndSamplersList(uniformsListOrOptions, samplersList, defines, maxSimultaneousLights = 4) { }
171
- /**
172
- * This helps decreasing rank by rank the shadow quality (0 being the highest rank and quality)
173
- * @param defines The defines to update while falling back
174
- * @param fallbacks The authorized effect fallbacks
175
- * @param maxSimultaneousLights The maximum number of lights allowed
176
- * @param rank the current rank of the Effect
177
- * @returns The newly affected rank
178
- */
179
- static HandleFallbacksForShadows(defines, fallbacks, maxSimultaneousLights = 4, rank = 0) {
180
- return 0;
181
- }
182
- /**
183
- * Prepares the list of attributes required for morph targets according to the effect defines.
184
- * @param attribs The current list of supported attribs
185
- * @param mesh The mesh to prepare the morph targets attributes for
186
- * @param influencers The number of influencers
187
- */
188
- static PrepareAttributesForMorphTargetsInfluencers(attribs, mesh, influencers) { }
189
- /**
190
- * Prepares the list of attributes required for morph targets according to the effect defines.
191
- * @param attribs The current list of supported attribs
192
- * @param mesh The mesh to prepare the morph targets attributes for
193
- * @param defines The current Defines of the effect
194
- */
195
- static PrepareAttributesForMorphTargets(attribs, mesh, defines) { }
196
- /**
197
- * Prepares the list of attributes required for baked vertex animations according to the effect defines.
198
- * @param attribs The current list of supported attribs
199
- * @param mesh The mesh to prepare for baked vertex animations
200
- * @param defines The current Defines of the effect
201
- */
202
- static PrepareAttributesForBakedVertexAnimation(attribs, mesh, defines) { }
203
- /**
204
- * Prepares the list of attributes required for bones according to the effect defines.
205
- * @param attribs The current list of supported attribs
206
- * @param mesh The mesh to prepare the bones attributes for
207
- * @param defines The current Defines of the effect
208
- * @param fallbacks The current effect fallback strategy
209
- */
210
- static PrepareAttributesForBones(attribs, mesh, defines, fallbacks) { }
211
- /**
212
- * Check and prepare the list of attributes required for instances according to the effect defines.
213
- * @param attribs The current list of supported attribs
214
- * @param defines The current MaterialDefines of the effect
215
- */
216
- static PrepareAttributesForInstances(attribs, defines) { }
217
- /**
218
- * Add the list of attributes required for instances to the attribs array.
219
- * @param attribs The current list of supported attribs
220
- * @param needsPreviousMatrices If the shader needs previous matrices
221
- */
222
- static PushAttributesForInstances(attribs, needsPreviousMatrices = false) { }
223
- /**
224
- * Binds the light information to the effect.
225
- * @param light The light containing the generator
226
- * @param effect The effect we are binding the data to
227
- * @param lightIndex The light index in the effect used to render
228
- */
229
- static BindLightProperties(light, effect, lightIndex) { }
230
- /**
231
- * Binds the lights information from the scene to the effect for the given mesh.
232
- * @param light Light to bind
233
- * @param lightIndex Light index
234
- * @param scene The scene where the light belongs to
235
- * @param effect The effect we are binding the data to
236
- * @param useSpecular Defines if specular is supported
237
- * @param receiveShadows Defines if the effect (mesh) we bind the light for receives shadows
238
- */
239
- static BindLight(light, lightIndex, scene, effect, useSpecular, receiveShadows = true) { }
240
- /**
241
- * Binds the lights information from the scene to the effect for the given mesh.
242
- * @param scene The scene the lights belongs to
243
- * @param mesh The mesh we are binding the information to render
244
- * @param effect The effect we are binding the data to
245
- * @param defines The generated defines for the effect
246
- * @param maxSimultaneousLights The maximum number of light that can be bound to the effect
247
- */
248
- static BindLights(scene, mesh, effect, defines, maxSimultaneousLights = 4) { }
249
- /**
250
- * Binds the fog information from the scene to the effect for the given mesh.
251
- * @param scene The scene the lights belongs to
252
- * @param mesh The mesh we are binding the information to render
253
- * @param effect The effect we are binding the data to
254
- * @param linearSpace Defines if the fog effect is applied in linear space
255
- */
256
- static BindFogParameters(scene, mesh, effect, linearSpace = false) { }
257
- /**
258
- * Binds the bones information from the mesh to the effect.
259
- * @param mesh The mesh we are binding the information to render
260
- * @param effect The effect we are binding the data to
261
- * @param prePassConfiguration Configuration for the prepass, in case prepass is activated
262
- */
263
- static BindBonesParameters(mesh, effect, prePassConfiguration) { }
264
- /**
265
- * Binds the morph targets information from the mesh to the effect.
266
- * @param abstractMesh The mesh we are binding the information to render
267
- * @param effect The effect we are binding the data to
268
- */
269
- static BindMorphTargetParameters(abstractMesh, effect) { }
270
- /**
271
- * Binds the logarithmic depth information from the scene to the effect for the given defines.
272
- * @param defines The generated defines used in the effect
273
- * @param effect The effect we are binding the data to
274
- * @param scene The scene we are willing to render with logarithmic scale for
275
- */
276
- static BindLogDepth(defines, effect, scene) { }
277
10
  }
278
- MaterialHelper.BindLogDepth = BindLogDepth;
279
- MaterialHelper.BindFogParameters = BindFogParameters;
280
- MaterialHelper.PrepareAttributesForMorphTargetsInfluencers = PrepareAttributesForMorphTargetsInfluencers;
281
- MaterialHelper.PrepareAttributesForMorphTargets = PrepareAttributesForMorphTargets;
282
- MaterialHelper.PushAttributesForInstances = PushAttributesForInstances;
283
- MaterialHelper.BindMorphTargetParameters = BindMorphTargetParameters;
11
+ /**
12
+ * Binds the scene's uniform buffer to the effect.
13
+ * @param effect defines the effect to bind to the scene uniform buffer
14
+ * @param sceneUbo defines the uniform buffer storing scene data
15
+ */
284
16
  MaterialHelper.BindSceneUniformBuffer = BindSceneUniformBuffer;
17
+ /**
18
+ * Helps preparing the defines values about the UVs in used in the effect.
19
+ * UVs are shared as much as we can across channels in the shaders.
20
+ * @param texture The texture we are preparing the UVs for
21
+ * @param defines The defines to update
22
+ * @param key The channel key "diffuse", "specular"... used in the shader
23
+ */
285
24
  MaterialHelper.PrepareDefinesForMergedUV = PrepareDefinesForMergedUV;
25
+ /**
26
+ * Binds a texture matrix value to its corresponding uniform
27
+ * @param texture The texture to bind the matrix for
28
+ * @param uniformBuffer The uniform buffer receiving the data
29
+ * @param key The channel key "diffuse", "specular"... used in the shader
30
+ */
286
31
  MaterialHelper.BindTextureMatrix = BindTextureMatrix;
287
- MaterialHelper.PrepareAttributesForBakedVertexAnimation = PrepareAttributesForBakedVertexAnimation;
288
- MaterialHelper.BindBonesParameters = BindBonesParameters;
289
- MaterialHelper.BindLightProperties = BindLightProperties;
290
- MaterialHelper.BindLights = BindLights;
291
- MaterialHelper.BindLight = BindLight;
292
- MaterialHelper.PrepareAttributesForBones = PrepareAttributesForBones;
293
- MaterialHelper.PrepareAttributesForInstances = PrepareAttributesForInstances;
294
- MaterialHelper.HandleFallbacksForShadows = HandleFallbacksForShadows;
295
- MaterialHelper.PrepareDefinesForMisc = PrepareDefinesForMisc;
32
+ /**
33
+ * Gets the current status of the fog (should it be enabled?)
34
+ * @param mesh defines the mesh to evaluate for fog support
35
+ * @param scene defines the hosting scene
36
+ * @returns true if fog must be enabled
37
+ */
296
38
  MaterialHelper.GetFogState = GetFogState;
297
- MaterialHelper.PrepareDefinesForLights = PrepareDefinesForLights;
298
- MaterialHelper.PrepareDefinesForLight = PrepareDefinesForLight;
39
+ /**
40
+ * Helper used to prepare the list of defines associated with misc. values for shader compilation
41
+ * @param mesh defines the current mesh
42
+ * @param scene defines the current scene
43
+ * @param useLogarithmicDepth defines if logarithmic depth has to be turned on
44
+ * @param pointsCloud defines if point cloud rendering has to be turned on
45
+ * @param fogEnabled defines if fog has to be turned on
46
+ * @param alphaTest defines if alpha testing has to be turned on
47
+ * @param defines defines the current list of defines
48
+ * @param applyDecalAfterDetail Defines if the decal is applied after or before the detail
49
+ */
50
+ MaterialHelper.PrepareDefinesForMisc = PrepareDefinesForMisc;
51
+ /**
52
+ * Helper used to prepare the defines relative to the active camera
53
+ * @param scene defines the current scene
54
+ * @param defines specifies the list of active defines
55
+ * @returns true if the defines have been updated, else false
56
+ */
57
+ MaterialHelper.PrepareDefinesForCamera = PrepareDefinesForCamera;
58
+ /**
59
+ * Helper used to prepare the list of defines associated with frame values for shader compilation
60
+ * @param scene defines the current scene
61
+ * @param engine defines the current engine
62
+ * @param material defines the material we are compiling the shader for
63
+ * @param defines specifies the list of active defines
64
+ * @param useInstances defines if instances have to be turned on
65
+ * @param useClipPlane defines if clip plane have to be turned on
66
+ * @param useThinInstances defines if thin instances have to be turned on
67
+ */
299
68
  MaterialHelper.PrepareDefinesForFrameBoundValues = PrepareDefinesForFrameBoundValues;
69
+ /**
70
+ * Prepares the defines for bones
71
+ * @param mesh The mesh containing the geometry data we will draw
72
+ * @param defines The defines to update
73
+ */
300
74
  MaterialHelper.PrepareDefinesForBones = PrepareDefinesForBones;
75
+ /**
76
+ * Prepares the defines for morph targets
77
+ * @param mesh The mesh containing the geometry data we will draw
78
+ * @param defines The defines to update
79
+ */
301
80
  MaterialHelper.PrepareDefinesForMorphTargets = PrepareDefinesForMorphTargets;
81
+ /**
82
+ * Prepares the defines for baked vertex animation
83
+ * @param mesh The mesh containing the geometry data we will draw
84
+ * @param defines The defines to update
85
+ */
302
86
  MaterialHelper.PrepareDefinesForBakedVertexAnimation = PrepareDefinesForBakedVertexAnimation;
87
+ /**
88
+ * Prepares the defines used in the shader depending on the attributes data available in the mesh
89
+ * @param mesh The mesh containing the geometry data we will draw
90
+ * @param defines The defines to update
91
+ * @param useVertexColor Precise whether vertex colors should be used or not (override mesh info)
92
+ * @param useBones Precise whether bones should be used or not (override mesh info)
93
+ * @param useMorphTargets Precise whether morph targets should be used or not (override mesh info)
94
+ * @param useVertexAlpha Precise whether vertex alpha should be used or not (override mesh info)
95
+ * @param useBakedVertexAnimation Precise whether baked vertex animation should be used or not (override mesh info)
96
+ * @returns false if defines are considered not dirty and have not been checked
97
+ */
303
98
  MaterialHelper.PrepareDefinesForAttributes = PrepareDefinesForAttributes;
99
+ /**
100
+ * Prepares the defines related to multiview
101
+ * @param scene The scene we are intending to draw
102
+ * @param defines The defines to update
103
+ */
304
104
  MaterialHelper.PrepareDefinesForMultiview = PrepareDefinesForMultiview;
105
+ /**
106
+ * Prepares the defines related to order independant transparency
107
+ * @param scene The scene we are intending to draw
108
+ * @param defines The defines to update
109
+ * @param needAlphaBlending Determines if the material needs alpha blending
110
+ */
305
111
  MaterialHelper.PrepareDefinesForOIT = PrepareDefinesForOIT;
112
+ /**
113
+ * Prepares the defines related to the prepass
114
+ * @param scene The scene we are intending to draw
115
+ * @param defines The defines to update
116
+ * @param canRenderToMRT Indicates if this material renders to several textures in the prepass
117
+ */
306
118
  MaterialHelper.PrepareDefinesForPrePass = PrepareDefinesForPrePass;
307
- MaterialHelper.PrepareDefinesForCamera = PrepareDefinesForCamera;
308
- MaterialHelper.PrepareUniformsAndSamplersList = PrepareUniformsAndSamplersList;
119
+ /**
120
+ * Prepares the defines related to the light information passed in parameter
121
+ * @param scene The scene we are intending to draw
122
+ * @param mesh The mesh the effect is compiling for
123
+ * @param light The light the effect is compiling for
124
+ * @param lightIndex The index of the light
125
+ * @param defines The defines to update
126
+ * @param specularSupported Specifies whether specular is supported or not (override lights data)
127
+ * @param state Defines the current state regarding what is needed (normals, etc...)
128
+ * @param state.needNormals
129
+ * @param state.needRebuild
130
+ * @param state.shadowEnabled
131
+ * @param state.specularEnabled
132
+ * @param state.lightmapMode
133
+ */
134
+ MaterialHelper.PrepareDefinesForLight = PrepareDefinesForLight;
135
+ /**
136
+ * Prepares the defines related to the light information passed in parameter
137
+ * @param scene The scene we are intending to draw
138
+ * @param mesh The mesh the effect is compiling for
139
+ * @param defines The defines to update
140
+ * @param specularSupported Specifies whether specular is supported or not (override lights data)
141
+ * @param maxSimultaneousLights Specifies how manuy lights can be added to the effect at max
142
+ * @param disableLighting Specifies whether the lighting is disabled (override scene and light)
143
+ * @returns true if normals will be required for the rest of the effect
144
+ */
145
+ MaterialHelper.PrepareDefinesForLights = PrepareDefinesForLights;
146
+ /**
147
+ * Prepares the uniforms and samplers list to be used in the effect (for a specific light)
148
+ * @param lightIndex defines the light index
149
+ * @param uniformsList The uniform list
150
+ * @param samplersList The sampler list
151
+ * @param projectedLightTexture defines if projected texture must be used
152
+ * @param uniformBuffersList defines an optional list of uniform buffers
153
+ * @param updateOnlyBuffersList True to only update the uniformBuffersList array
154
+ */
309
155
  MaterialHelper.PrepareUniformsAndSamplersForLight = PrepareUniformsAndSamplersForLight;
156
+ /**
157
+ * Prepares the uniforms and samplers list to be used in the effect
158
+ * @param uniformsListOrOptions The uniform names to prepare or an EffectCreationOptions containing the list and extra information
159
+ * @param samplersList The sampler list
160
+ * @param defines The defines helping in the list generation
161
+ * @param maxSimultaneousLights The maximum number of simultaneous light allowed in the effect
162
+ */
163
+ MaterialHelper.PrepareUniformsAndSamplersList = PrepareUniformsAndSamplersList;
164
+ /**
165
+ * This helps decreasing rank by rank the shadow quality (0 being the highest rank and quality)
166
+ * @param defines The defines to update while falling back
167
+ * @param fallbacks The authorized effect fallbacks
168
+ * @param maxSimultaneousLights The maximum number of lights allowed
169
+ * @param rank the current rank of the Effect
170
+ * @returns The newly affected rank
171
+ */
172
+ MaterialHelper.HandleFallbacksForShadows = HandleFallbacksForShadows;
173
+ /**
174
+ * Prepares the list of attributes required for morph targets according to the effect defines.
175
+ * @param attribs The current list of supported attribs
176
+ * @param mesh The mesh to prepare the morph targets attributes for
177
+ * @param influencers The number of influencers
178
+ */
179
+ MaterialHelper.PrepareAttributesForMorphTargetsInfluencers = PrepareAttributesForMorphTargetsInfluencers;
180
+ /**
181
+ * Prepares the list of attributes required for morph targets according to the effect defines.
182
+ * @param attribs The current list of supported attribs
183
+ * @param mesh The mesh to prepare the morph targets attributes for
184
+ * @param defines The current Defines of the effect
185
+ */
186
+ MaterialHelper.PrepareAttributesForMorphTargets = PrepareAttributesForMorphTargets;
187
+ /**
188
+ * Prepares the list of attributes required for baked vertex animations according to the effect defines.
189
+ * @param attribs The current list of supported attribs
190
+ * @param mesh The mesh to prepare for baked vertex animations
191
+ * @param defines The current Defines of the effect
192
+ */
193
+ MaterialHelper.PrepareAttributesForBakedVertexAnimation = PrepareAttributesForBakedVertexAnimation;
194
+ /**
195
+ * Prepares the list of attributes required for bones according to the effect defines.
196
+ * @param attribs The current list of supported attribs
197
+ * @param mesh The mesh to prepare the bones attributes for
198
+ * @param defines The current Defines of the effect
199
+ * @param fallbacks The current effect fallback strategy
200
+ */
201
+ MaterialHelper.PrepareAttributesForBones = PrepareAttributesForBones;
202
+ /**
203
+ * Check and prepare the list of attributes required for instances according to the effect defines.
204
+ * @param attribs The current list of supported attribs
205
+ * @param defines The current MaterialDefines of the effect
206
+ */
207
+ MaterialHelper.PrepareAttributesForInstances = PrepareAttributesForInstances;
208
+ /**
209
+ * Add the list of attributes required for instances to the attribs array.
210
+ * @param attribs The current list of supported attribs
211
+ * @param needsPreviousMatrices If the shader needs previous matrices
212
+ */
213
+ MaterialHelper.PushAttributesForInstances = PushAttributesForInstances;
214
+ /**
215
+ * Binds the light information to the effect.
216
+ * @param light The light containing the generator
217
+ * @param effect The effect we are binding the data to
218
+ * @param lightIndex The light index in the effect used to render
219
+ */
220
+ MaterialHelper.BindLightProperties = BindLightProperties;
221
+ /**
222
+ * Binds the lights information from the scene to the effect for the given mesh.
223
+ * @param light Light to bind
224
+ * @param lightIndex Light index
225
+ * @param scene The scene where the light belongs to
226
+ * @param effect The effect we are binding the data to
227
+ * @param useSpecular Defines if specular is supported
228
+ * @param receiveShadows Defines if the effect (mesh) we bind the light for receives shadows
229
+ */
230
+ MaterialHelper.BindLight = BindLight;
231
+ /**
232
+ * Binds the lights information from the scene to the effect for the given mesh.
233
+ * @param scene The scene the lights belongs to
234
+ * @param mesh The mesh we are binding the information to render
235
+ * @param effect The effect we are binding the data to
236
+ * @param defines The generated defines for the effect
237
+ * @param maxSimultaneousLights The maximum number of light that can be bound to the effect
238
+ */
239
+ MaterialHelper.BindLights = BindLights;
240
+ /**
241
+ * Binds the fog information from the scene to the effect for the given mesh.
242
+ * @param scene The scene the lights belongs to
243
+ * @param mesh The mesh we are binding the information to render
244
+ * @param effect The effect we are binding the data to
245
+ * @param linearSpace Defines if the fog effect is applied in linear space
246
+ */
247
+ MaterialHelper.BindFogParameters = BindFogParameters;
248
+ /**
249
+ * Binds the bones information from the mesh to the effect.
250
+ * @param mesh The mesh we are binding the information to render
251
+ * @param effect The effect we are binding the data to
252
+ * @param prePassConfiguration Configuration for the prepass, in case prepass is activated
253
+ */
254
+ MaterialHelper.BindBonesParameters = BindBonesParameters;
255
+ /**
256
+ * Binds the morph targets information from the mesh to the effect.
257
+ * @param abstractMesh The mesh we are binding the information to render
258
+ * @param effect The effect we are binding the data to
259
+ */
260
+ MaterialHelper.BindMorphTargetParameters = BindMorphTargetParameters;
261
+ /**
262
+ * Binds the logarithmic depth information from the scene to the effect for the given defines.
263
+ * @param defines The generated defines used in the effect
264
+ * @param effect The effect we are binding the data to
265
+ * @param scene The scene we are willing to render with logarithmic scale for
266
+ */
267
+ MaterialHelper.BindLogDepth = BindLogDepth;
310
268
  //# sourceMappingURL=materialHelper.js.map