@babylonjs/core 8.30.5 → 8.31.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (160) hide show
  1. package/Behaviors/Meshes/handConstraintBehavior.js.map +1 -1
  2. package/Buffers/bufferUtils.d.ts +1 -2
  3. package/Buffers/bufferUtils.js +3 -4
  4. package/Buffers/bufferUtils.js.map +1 -1
  5. package/Engines/abstractEngine.js +2 -2
  6. package/Engines/abstractEngine.js.map +1 -1
  7. package/FrameGraph/Node/Blocks/PostProcesses/screenSpaceCurvaturePostProcessBlock.d.ts +39 -0
  8. package/FrameGraph/Node/Blocks/PostProcesses/screenSpaceCurvaturePostProcessBlock.js +86 -0
  9. package/FrameGraph/Node/Blocks/PostProcesses/screenSpaceCurvaturePostProcessBlock.js.map +1 -0
  10. package/FrameGraph/Node/Blocks/PostProcesses/sharpenPostProcessBlock.d.ts +34 -0
  11. package/FrameGraph/Node/Blocks/PostProcesses/sharpenPostProcessBlock.js +74 -0
  12. package/FrameGraph/Node/Blocks/PostProcesses/sharpenPostProcessBlock.js.map +1 -0
  13. package/FrameGraph/Node/Blocks/index.d.ts +2 -0
  14. package/FrameGraph/Node/Blocks/index.js +2 -0
  15. package/FrameGraph/Node/Blocks/index.js.map +1 -1
  16. package/FrameGraph/Tasks/PostProcesses/customPostProcessTask.d.ts +21 -0
  17. package/FrameGraph/Tasks/PostProcesses/customPostProcessTask.js +18 -0
  18. package/FrameGraph/Tasks/PostProcesses/customPostProcessTask.js.map +1 -0
  19. package/FrameGraph/Tasks/PostProcesses/screenSpaceCurvatureTask.d.ts +22 -0
  20. package/FrameGraph/Tasks/PostProcesses/screenSpaceCurvatureTask.js +27 -0
  21. package/FrameGraph/Tasks/PostProcesses/screenSpaceCurvatureTask.js.map +1 -0
  22. package/FrameGraph/Tasks/PostProcesses/sharpenTask.d.ts +17 -0
  23. package/FrameGraph/Tasks/PostProcesses/sharpenTask.js +23 -0
  24. package/FrameGraph/Tasks/PostProcesses/sharpenTask.js.map +1 -0
  25. package/FrameGraph/frameGraphTextureManager.d.ts +6 -2
  26. package/FrameGraph/frameGraphTextureManager.js +22 -8
  27. package/FrameGraph/frameGraphTextureManager.js.map +1 -1
  28. package/FrameGraph/index.d.ts +3 -0
  29. package/FrameGraph/index.js +3 -0
  30. package/FrameGraph/index.js.map +1 -1
  31. package/Materials/PBR/openPbrMaterial.d.ts +39 -0
  32. package/Materials/PBR/openPbrMaterial.js +46 -0
  33. package/Materials/PBR/openPbrMaterial.js.map +1 -1
  34. package/Materials/Textures/texture.js +9 -2
  35. package/Materials/Textures/texture.js.map +1 -1
  36. package/Materials/materialHelper.functions.d.ts +1 -7
  37. package/Materials/materialHelper.functions.js +2 -15
  38. package/Materials/materialHelper.functions.js.map +1 -1
  39. package/Materials/materialHelper.functions.pure.d.ts +10 -0
  40. package/Materials/materialHelper.functions.pure.js +21 -0
  41. package/Materials/materialHelper.functions.pure.js.map +1 -0
  42. package/Meshes/Compression/dracoEncoder.js +1 -1
  43. package/Meshes/Compression/dracoEncoder.js.map +1 -1
  44. package/Meshes/geometry.js +6 -6
  45. package/Meshes/geometry.js.map +1 -1
  46. package/Meshes/mesh.js +2 -2
  47. package/Meshes/mesh.js.map +1 -1
  48. package/Particles/gpuParticleSystem.js +2 -1
  49. package/Particles/gpuParticleSystem.js.map +1 -1
  50. package/Particles/thinParticleSystem.js +4 -3
  51. package/Particles/thinParticleSystem.js.map +1 -1
  52. package/PostProcesses/index.d.ts +2 -0
  53. package/PostProcesses/index.js +2 -0
  54. package/PostProcesses/index.js.map +1 -1
  55. package/PostProcesses/screenSpaceCurvaturePostProcess.d.ts +6 -2
  56. package/PostProcesses/screenSpaceCurvaturePostProcess.js +37 -13
  57. package/PostProcesses/screenSpaceCurvaturePostProcess.js.map +1 -1
  58. package/PostProcesses/sharpenPostProcess.d.ts +6 -3
  59. package/PostProcesses/sharpenPostProcess.js +39 -24
  60. package/PostProcesses/sharpenPostProcess.js.map +1 -1
  61. package/PostProcesses/thinCustomPostProcess.d.ts +20 -0
  62. package/PostProcesses/thinCustomPostProcess.js +32 -0
  63. package/PostProcesses/thinCustomPostProcess.js.map +1 -0
  64. package/PostProcesses/thinScreenSpaceCurvaturePostProcess.d.ts +36 -0
  65. package/PostProcesses/thinScreenSpaceCurvaturePostProcess.js +61 -0
  66. package/PostProcesses/thinScreenSpaceCurvaturePostProcess.js.map +1 -0
  67. package/PostProcesses/thinSharpenPostProcess.d.ts +40 -0
  68. package/PostProcesses/thinSharpenPostProcess.js +64 -0
  69. package/PostProcesses/thinSharpenPostProcess.js.map +1 -0
  70. package/Rendering/geometryBufferRenderer.js +6 -1
  71. package/Rendering/geometryBufferRenderer.js.map +1 -1
  72. package/Rendering/objectRenderer.js +3 -1
  73. package/Rendering/objectRenderer.js.map +1 -1
  74. package/Shaders/ShadersInclude/openpbrDielectricReflectance.js +8 -9
  75. package/Shaders/ShadersInclude/openpbrDielectricReflectance.js.map +1 -1
  76. package/Shaders/ShadersInclude/openpbrDirectLighting.js +13 -6
  77. package/Shaders/ShadersInclude/openpbrDirectLighting.js.map +1 -1
  78. package/Shaders/ShadersInclude/openpbrEnvironmentLighting.js +10 -2
  79. package/Shaders/ShadersInclude/openpbrEnvironmentLighting.js.map +1 -1
  80. package/Shaders/ShadersInclude/openpbrFragmentDeclaration.js +7 -1
  81. package/Shaders/ShadersInclude/openpbrFragmentDeclaration.js.map +1 -1
  82. package/Shaders/ShadersInclude/openpbrFragmentSamplersDeclaration.js +2 -0
  83. package/Shaders/ShadersInclude/openpbrFragmentSamplersDeclaration.js.map +1 -1
  84. package/Shaders/ShadersInclude/openpbrThinFilmLayerData.d.ts +5 -0
  85. package/Shaders/ShadersInclude/openpbrThinFilmLayerData.js +27 -0
  86. package/Shaders/ShadersInclude/openpbrThinFilmLayerData.js.map +1 -0
  87. package/Shaders/ShadersInclude/openpbrUboDeclaration.js +1 -1
  88. package/Shaders/ShadersInclude/openpbrUboDeclaration.js.map +1 -1
  89. package/Shaders/ShadersInclude/openpbrVertexDeclaration.js +6 -0
  90. package/Shaders/ShadersInclude/openpbrVertexDeclaration.js.map +1 -1
  91. package/Shaders/geometry.vertex.js +10 -2
  92. package/Shaders/geometry.vertex.js.map +1 -1
  93. package/Shaders/openpbr.fragment.d.ts +1 -0
  94. package/Shaders/openpbr.fragment.js +7 -1
  95. package/Shaders/openpbr.fragment.js.map +1 -1
  96. package/Shaders/openpbr.vertex.js +4 -0
  97. package/Shaders/openpbr.vertex.js.map +1 -1
  98. package/ShadersWGSL/ShadersInclude/openpbrBaseLayerData.js +2 -2
  99. package/ShadersWGSL/ShadersInclude/openpbrBaseLayerData.js.map +1 -1
  100. package/ShadersWGSL/ShadersInclude/openpbrDirectLighting.js +13 -6
  101. package/ShadersWGSL/ShadersInclude/openpbrDirectLighting.js.map +1 -1
  102. package/ShadersWGSL/ShadersInclude/openpbrEnvironmentLighting.js +10 -2
  103. package/ShadersWGSL/ShadersInclude/openpbrEnvironmentLighting.js.map +1 -1
  104. package/ShadersWGSL/ShadersInclude/openpbrFragmentSamplersDeclaration.js +2 -0
  105. package/ShadersWGSL/ShadersInclude/openpbrFragmentSamplersDeclaration.js.map +1 -1
  106. package/ShadersWGSL/ShadersInclude/openpbrThinFilmLayerData.d.ts +5 -0
  107. package/ShadersWGSL/ShadersInclude/openpbrThinFilmLayerData.js +27 -0
  108. package/ShadersWGSL/ShadersInclude/openpbrThinFilmLayerData.js.map +1 -0
  109. package/ShadersWGSL/ShadersInclude/openpbrUboDeclaration.js +1 -1
  110. package/ShadersWGSL/ShadersInclude/openpbrUboDeclaration.js.map +1 -1
  111. package/ShadersWGSL/ShadersInclude/pbrDirectLightingFunctions.js +3 -3
  112. package/ShadersWGSL/ShadersInclude/pbrDirectLightingFunctions.js.map +1 -1
  113. package/ShadersWGSL/geometry.vertex.js +10 -2
  114. package/ShadersWGSL/geometry.vertex.js.map +1 -1
  115. package/ShadersWGSL/openpbr.fragment.d.ts +1 -0
  116. package/ShadersWGSL/openpbr.fragment.js +7 -1
  117. package/ShadersWGSL/openpbr.fragment.js.map +1 -1
  118. package/ShadersWGSL/openpbr.vertex.js +4 -0
  119. package/ShadersWGSL/openpbr.vertex.js.map +1 -1
  120. package/ShadersWGSL/pbr.fragment.js +1 -1
  121. package/ShadersWGSL/pbr.fragment.js.map +1 -1
  122. package/ShadersWGSL/screenSpaceCurvature.fragment.d.ts +5 -0
  123. package/ShadersWGSL/screenSpaceCurvature.fragment.js +25 -0
  124. package/ShadersWGSL/screenSpaceCurvature.fragment.js.map +1 -0
  125. package/Sprites/spriteRenderer.js +1 -1
  126. package/Sprites/spriteRenderer.js.map +1 -1
  127. package/XR/features/WebXRAnchorSystem.d.ts +1 -1
  128. package/XR/features/WebXRBackgroundRemover.d.ts +1 -1
  129. package/XR/features/WebXRControllerMovement.d.ts +1 -1
  130. package/XR/features/WebXRControllerPhysics.d.ts +1 -1
  131. package/XR/features/WebXRControllerPointerSelection.d.ts +1 -1
  132. package/XR/features/WebXRControllerTeleportation.d.ts +1 -1
  133. package/XR/features/WebXRDOMOverlay.d.ts +1 -1
  134. package/XR/features/WebXRDepthSensing.d.ts +1 -1
  135. package/XR/features/WebXREyeTracking.d.ts +1 -1
  136. package/XR/features/WebXRFeaturePointSystem.d.ts +1 -1
  137. package/XR/features/WebXRHandTracking.d.ts +1 -1
  138. package/XR/features/WebXRHitTest.d.ts +1 -1
  139. package/XR/features/WebXRHitTestLegacy.d.ts +1 -1
  140. package/XR/features/WebXRImageTracking.d.ts +1 -1
  141. package/XR/features/WebXRLayers.d.ts +1 -1
  142. package/XR/features/WebXRLightEstimation.d.ts +1 -1
  143. package/XR/features/WebXRMeshDetector.d.ts +1 -1
  144. package/XR/features/WebXRNearInteraction.d.ts +1 -1
  145. package/XR/features/WebXRPlaneDetector.d.ts +1 -1
  146. package/XR/features/WebXRRawCameraAccess.d.ts +1 -1
  147. package/XR/features/WebXRSpaceWarp.d.ts +1 -1
  148. package/XR/motionController/index.d.ts +1 -0
  149. package/XR/motionController/index.js +1 -0
  150. package/XR/motionController/index.js.map +1 -1
  151. package/XR/motionController/webXRMotionControllerManager.js +1 -0
  152. package/XR/motionController/webXRMotionControllerManager.js.map +1 -1
  153. package/XR/motionController/webXROculusHandController.d.ts +25 -0
  154. package/XR/motionController/webXROculusHandController.js +246 -0
  155. package/XR/motionController/webXROculusHandController.js.map +1 -0
  156. package/XR/webXRDefaultExperience.js +1 -1
  157. package/XR/webXRDefaultExperience.js.map +1 -1
  158. package/XR/webXRFeaturesManager.d.ts +116 -27
  159. package/XR/webXRFeaturesManager.js.map +1 -1
  160. package/package.json +1 -1
@@ -178,6 +178,7 @@ export class OpenPBRMaterialDefines extends ImageProcessingDefinesMixin(OpenPBRM
178
178
  this.SPECULAR_ROUGHNESS_ANISOTROPY_FROM_TANGENT_TEXTURE = false;
179
179
  this.COAT_ROUGHNESS_ANISOTROPY_FROM_TANGENT_TEXTURE = false;
180
180
  this.USE_GLTF_STYLE_ANISOTROPY = false;
181
+ this.THIN_FILM_THICKNESS_FROM_THIN_FILM_TEXTURE = false;
181
182
  this.ENVIRONMENTBRDF = false;
182
183
  this.ENVIRONMENTBRDF_RGBD = false;
183
184
  this.NORMAL = false;
@@ -191,6 +192,8 @@ export class OpenPBRMaterialDefines extends ImageProcessingDefinesMixin(OpenPBRM
191
192
  this.ANISOTROPIC_OPENPBR = true; // Tells the shader to use OpenPBR's anisotropic roughness remapping
192
193
  this.ANISOTROPIC_BASE = false; // Tells the shader to apply anisotropy to the base layer
193
194
  this.ANISOTROPIC_COAT = false; // Tells the shader to apply anisotropy to the coat layer
195
+ this.THIN_FILM = false; // Enables thin film layer
196
+ this.IRIDESCENCE = false; // Enables iridescence layer
194
197
  this.REFLECTION = false;
195
198
  this.REFLECTIONMAP_3D = false;
196
199
  this.REFLECTIONMAP_SPHERICAL = false;
@@ -471,6 +474,12 @@ export class OpenPBRMaterial extends OpenPBRMaterialBase {
471
474
  this._emissionLuminance = new Property("emission_luminance", 1.0, "vLightingIntensity", 4, 1);
472
475
  this._emissionColor = new Property("emission_color", Color3.Black(), "vEmissionColor", 3);
473
476
  this._emissionColorTexture = new Sampler("emission_color", "emissionColor", "EMISSION_COLOR");
477
+ this._thinFilmWeight = new Property("thin_film_weight", 0.0, "vThinFilmWeight", 1, 0);
478
+ this._thinFilmWeightTexture = new Sampler("thin_film_weight", "thinFilmWeight", "THIN_FILM_WEIGHT");
479
+ this._thinFilmThickness = new Property("thin_film_thickness", 0.5, "vThinFilmThickness", 2, 0);
480
+ this._thinFilmThicknessMin = new Property("thin_film_thickness_min", 0.0, "vThinFilmThickness", 2, 1);
481
+ this._thinFilmThicknessTexture = new Sampler("thin_film_thickness", "thinFilmThickness", "THIN_FILM_THICKNESS");
482
+ this._thinFilmIor = new Property("thin_film_ior", 1.4, "vThinFilmIor", 1, 0);
474
483
  this._ambientOcclusionTexture = new Sampler("ambient_occlusion", "ambientOcclusion", "AMBIENT_OCCLUSION");
475
484
  this._uniformsList = {};
476
485
  this._samplersList = {};
@@ -667,6 +676,10 @@ export class OpenPBRMaterial extends OpenPBRMaterialBase {
667
676
  * @internal
668
677
  */
669
678
  this._useMetallicFromMetallicTextureBlue = false;
679
+ /**
680
+ * Specifies if the thin film thickness is stored in the green channel of the thin film thickness texture.
681
+ */
682
+ this._useThinFilmThicknessFromTextureGreen = false;
670
683
  /**
671
684
  * Defines the falloff type used in this material.
672
685
  * It by default is Physical.
@@ -901,6 +914,12 @@ export class OpenPBRMaterial extends OpenPBRMaterialBase {
901
914
  this._geometryCoatTangentTexture;
902
915
  this._geometryOpacity;
903
916
  this._geometryOpacityTexture;
917
+ this._thinFilmWeight;
918
+ this._thinFilmWeightTexture;
919
+ this._thinFilmThickness;
920
+ this._thinFilmThicknessMin;
921
+ this._thinFilmThicknessTexture;
922
+ this._thinFilmIor;
904
923
  this._emissionLuminance;
905
924
  this._emissionColor;
906
925
  this._emissionColorTexture;
@@ -1681,6 +1700,7 @@ export class OpenPBRMaterial extends OpenPBRMaterialBase {
1681
1700
  defines.COAT_ROUGHNESS_ANISOTROPY_FROM_TANGENT_TEXTURE = this._useCoatRoughnessAnisotropyFromTangentTexture;
1682
1701
  defines.ROUGHNESSSTOREINMETALMAPGREEN = this._useRoughnessFromMetallicTextureGreen;
1683
1702
  defines.METALLNESSSTOREINMETALMAPBLUE = this._useMetallicFromMetallicTextureBlue;
1703
+ defines.THIN_FILM_THICKNESS_FROM_THIN_FILM_TEXTURE = this._useThinFilmThicknessFromTextureGreen;
1684
1704
  if (this.geometryNormalTexture) {
1685
1705
  if (this._useParallax && this.baseColorTexture && MaterialFlags.DiffuseTextureEnabled) {
1686
1706
  defines.PARALLAX = true;
@@ -1769,6 +1789,8 @@ export class OpenPBRMaterial extends OpenPBRMaterialBase {
1769
1789
  defines.ANISOTROPIC_BASE = false;
1770
1790
  defines.ANISOTROPIC_COAT = false;
1771
1791
  }
1792
+ defines.THIN_FILM = this.thinFilmWeight > 0.0;
1793
+ defines.IRIDESCENCE = this.thinFilmWeight > 0.0;
1772
1794
  // Misc.
1773
1795
  if (defines._areMiscDirty) {
1774
1796
  PrepareDefinesForMisc(mesh, scene, this._useLogarithmicDepth, this.pointsCloud, this.fogEnabled, this.needAlphaTestingForMesh(mesh), defines, this._applyDecalMapAfterDetailMap, this._useVertexPulling, renderingMesh, this._setVertexOutputInvariant);
@@ -1949,6 +1971,30 @@ __decorate([
1949
1971
  addAccessorsForMaterialProperty("_markAllSubMeshesAsTexturesDirty", "emissionColorTexture")
1950
1972
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
1951
1973
  ], OpenPBRMaterial.prototype, "_emissionColorTexture", void 0);
1974
+ __decorate([
1975
+ addAccessorsForMaterialProperty("_markAllSubMeshesAsTexturesDirty", "thinFilmWeight")
1976
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
1977
+ ], OpenPBRMaterial.prototype, "_thinFilmWeight", void 0);
1978
+ __decorate([
1979
+ addAccessorsForMaterialProperty("_markAllSubMeshesAsTexturesDirty", "thinFilmWeightTexture")
1980
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
1981
+ ], OpenPBRMaterial.prototype, "_thinFilmWeightTexture", void 0);
1982
+ __decorate([
1983
+ addAccessorsForMaterialProperty("_markAllSubMeshesAsTexturesDirty", "thinFilmThickness")
1984
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
1985
+ ], OpenPBRMaterial.prototype, "_thinFilmThickness", void 0);
1986
+ __decorate([
1987
+ addAccessorsForMaterialProperty("_markAllSubMeshesAsTexturesDirty", "thinFilmThicknessMin")
1988
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
1989
+ ], OpenPBRMaterial.prototype, "_thinFilmThicknessMin", void 0);
1990
+ __decorate([
1991
+ addAccessorsForMaterialProperty("_markAllSubMeshesAsTexturesDirty", "thinFilmThicknessTexture")
1992
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
1993
+ ], OpenPBRMaterial.prototype, "_thinFilmThicknessTexture", void 0);
1994
+ __decorate([
1995
+ addAccessorsForMaterialProperty("_markAllSubMeshesAsTexturesDirty", "thinFilmIor")
1996
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
1997
+ ], OpenPBRMaterial.prototype, "_thinFilmIor", void 0);
1952
1998
  __decorate([
1953
1999
  addAccessorsForMaterialProperty("_markAllSubMeshesAsTexturesDirty", "ambientOcclusionTexture")
1954
2000
  // eslint-disable-next-line @typescript-eslint/no-unused-vars