@babylonjs/core 7.44.1 → 7.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.
- package/Buffers/bufferUtils.d.ts +28 -1
- package/Buffers/bufferUtils.js +104 -1
- package/Buffers/bufferUtils.js.map +1 -1
- package/Decorators/nodeDecorator.js +1 -1
- package/Decorators/nodeDecorator.js.map +1 -1
- package/Engines/Extensions/engine.renderTarget.js +2 -1
- package/Engines/Extensions/engine.renderTarget.js.map +1 -1
- package/Engines/WebGL/webGLRenderTargetWrapper.js +1 -1
- package/Engines/WebGL/webGLRenderTargetWrapper.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.renderTarget.js +2 -1
- package/Engines/WebGPU/Extensions/engine.renderTarget.js.map +1 -1
- package/Engines/abstractEngine.js +2 -2
- package/Engines/abstractEngine.js.map +1 -1
- package/Engines/renderTargetWrapper.js +1 -1
- package/Engines/renderTargetWrapper.js.map +1 -1
- package/Engines/thinEngine.js +2 -1
- package/Engines/thinEngine.js.map +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/basePostProcessBlock.d.ts +5 -0
- package/FrameGraph/Node/Blocks/PostProcesses/basePostProcessBlock.js +7 -0
- package/FrameGraph/Node/Blocks/PostProcesses/basePostProcessBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.d.ts +3 -0
- package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js +13 -0
- package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/Rendering/objectRendererBlock.d.ts +0 -3
- package/FrameGraph/Node/Blocks/Rendering/objectRendererBlock.js +0 -13
- package/FrameGraph/Node/Blocks/Rendering/objectRendererBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/Rendering/taaObjectRendererBlock.js +3 -0
- package/FrameGraph/Node/Blocks/Rendering/taaObjectRendererBlock.js.map +1 -1
- package/FrameGraph/Node/nodeRenderGraph.js +9 -5
- package/FrameGraph/Node/nodeRenderGraph.js.map +1 -1
- package/FrameGraph/Node/nodeRenderGraphBlock.js +1 -0
- package/FrameGraph/Node/nodeRenderGraphBlock.js.map +1 -1
- package/FrameGraph/Passes/renderPass.d.ts +11 -0
- package/FrameGraph/Passes/renderPass.js +40 -0
- package/FrameGraph/Passes/renderPass.js.map +1 -1
- package/FrameGraph/Tasks/Layers/baseLayerTask.js +3 -2
- package/FrameGraph/Tasks/Layers/baseLayerTask.js.map +1 -1
- package/FrameGraph/Tasks/Layers/highlightLayerTask.js +1 -1
- package/FrameGraph/Tasks/Layers/highlightLayerTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/bloomMergeTask.js +1 -1
- package/FrameGraph/Tasks/PostProcesses/bloomMergeTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/bloomTask.js +1 -1
- package/FrameGraph/Tasks/PostProcesses/bloomTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/circleOfConfusionTask.js +1 -1
- package/FrameGraph/Tasks/PostProcesses/circleOfConfusionTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldBlurTask.js +1 -1
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldBlurTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldMergeTask.js +2 -2
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldMergeTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.js +1 -0
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/postProcessTask.js +2 -1
- package/FrameGraph/Tasks/PostProcesses/postProcessTask.js.map +1 -1
- package/FrameGraph/Tasks/Texture/copyToBackbufferColorTask.js +1 -0
- package/FrameGraph/Tasks/Texture/copyToBackbufferColorTask.js.map +1 -1
- package/FrameGraph/Tasks/Texture/copyToTextureTask.js +1 -1
- package/FrameGraph/Tasks/Texture/copyToTextureTask.js.map +1 -1
- package/FrameGraph/frameGraph.d.ts +5 -5
- package/FrameGraph/frameGraph.js +31 -21
- package/FrameGraph/frameGraph.js.map +1 -1
- package/FrameGraph/frameGraphTask.d.ts +8 -2
- package/FrameGraph/frameGraphTask.js +12 -12
- package/FrameGraph/frameGraphTask.js.map +1 -1
- package/FrameGraph/frameGraphTextureManager.d.ts +33 -2
- package/FrameGraph/frameGraphTextureManager.js +368 -27
- package/FrameGraph/frameGraphTextureManager.js.map +1 -1
- package/Lights/LTC/ltcTextureTool.d.ts +20 -0
- package/Lights/LTC/ltcTextureTool.js +24 -0
- package/Lights/LTC/ltcTextureTool.js.map +1 -0
- package/Lights/Shadows/shadowGenerator.d.ts +10 -0
- package/Lights/Shadows/shadowGenerator.js +5 -0
- package/Lights/Shadows/shadowGenerator.js.map +1 -1
- package/Lights/Shadows/shadowGeneratorSceneComponent.js +6 -0
- package/Lights/Shadows/shadowGeneratorSceneComponent.js.map +1 -1
- package/Lights/areaLight.d.ts +39 -0
- package/Lights/areaLight.js +81 -0
- package/Lights/areaLight.js.map +1 -0
- package/Lights/index.d.ts +2 -0
- package/Lights/index.js +2 -0
- package/Lights/index.js.map +1 -1
- package/Lights/light.d.ts +8 -0
- package/Lights/light.js +10 -0
- package/Lights/light.js.map +1 -1
- package/Lights/lightConstants.d.ts +4 -0
- package/Lights/lightConstants.js +4 -0
- package/Lights/lightConstants.js.map +1 -1
- package/Lights/rectAreaLight.d.ts +61 -0
- package/Lights/rectAreaLight.js +127 -0
- package/Lights/rectAreaLight.js.map +1 -0
- package/Loading/loadingScreen.d.ts +21 -1
- package/Loading/loadingScreen.js +125 -52
- package/Loading/loadingScreen.js.map +1 -1
- package/Materials/Node/Blocks/Dual/lightBlock.js +2 -0
- package/Materials/Node/Blocks/Dual/lightBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js +1 -1
- package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js +2 -1
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js.map +1 -1
- package/Materials/Node/Blocks/debugBlock.d.ts +38 -0
- package/Materials/Node/Blocks/debugBlock.js +92 -0
- package/Materials/Node/Blocks/debugBlock.js.map +1 -0
- package/Materials/Node/Blocks/index.d.ts +1 -0
- package/Materials/Node/Blocks/index.js +1 -0
- package/Materials/Node/Blocks/index.js.map +1 -1
- package/Materials/Node/nodeMaterial.d.ts +2 -0
- package/Materials/Node/nodeMaterial.js +20 -2
- package/Materials/Node/nodeMaterial.js.map +1 -1
- package/Materials/Node/nodeMaterialBlock.d.ts +8 -1
- package/Materials/Node/nodeMaterialBlock.js +13 -1
- package/Materials/Node/nodeMaterialBlock.js.map +1 -1
- package/Materials/PBR/index.d.ts +1 -0
- package/Materials/PBR/index.js +1 -0
- package/Materials/PBR/index.js.map +1 -1
- package/Materials/PBR/pbrBRDFConfiguration.d.ts +14 -0
- package/Materials/PBR/pbrBRDFConfiguration.js +19 -0
- package/Materials/PBR/pbrBRDFConfiguration.js.map +1 -1
- package/Materials/PBR/pbrBaseMaterial.d.ts +13 -0
- package/Materials/PBR/pbrBaseMaterial.js +60 -0
- package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
- package/Materials/PBR/pbrMaterial.d.ts +8 -0
- package/Materials/PBR/pbrMaterial.js +12 -0
- package/Materials/PBR/pbrMaterial.js.map +1 -1
- package/Materials/Textures/internalTexture.d.ts +0 -18
- package/Materials/Textures/internalTexture.js +0 -46
- package/Materials/Textures/internalTexture.js.map +1 -1
- package/Materials/Textures/rawTexture.d.ts +6 -2
- package/Materials/Textures/rawTexture.js +10 -3
- package/Materials/Textures/rawTexture.js.map +1 -1
- package/Materials/Textures/textureHelper.functions.d.ts +18 -0
- package/Materials/Textures/textureHelper.functions.js +47 -0
- package/Materials/Textures/textureHelper.functions.js.map +1 -0
- package/Materials/materialFlags.d.ts +6 -0
- package/Materials/materialFlags.js +14 -0
- package/Materials/materialFlags.js.map +1 -1
- package/Materials/materialHelper.functions.js +3 -1
- package/Materials/materialHelper.functions.js.map +1 -1
- package/Materials/standardMaterial.d.ts +1 -0
- package/Materials/standardMaterial.js +14 -0
- package/Materials/standardMaterial.js.map +1 -1
- package/Meshes/Compression/dracoCompressionWorker.js +0 -1
- package/Meshes/Compression/dracoCompressionWorker.js.map +1 -1
- package/Misc/error.d.ts +6 -0
- package/Misc/error.js +10 -0
- package/Misc/error.js.map +1 -1
- package/Misc/timingTools.d.ts +2 -2
- package/Misc/timingTools.js +15 -10
- package/Misc/timingTools.js.map +1 -1
- package/Particles/gpuParticleSystem.js +8 -2
- package/Particles/gpuParticleSystem.js.map +1 -1
- package/Rendering/IBLShadows/iblShadowsPluginMaterial.d.ts +4 -0
- package/Rendering/IBLShadows/iblShadowsPluginMaterial.js +66 -16
- package/Rendering/IBLShadows/iblShadowsPluginMaterial.js.map +1 -1
- package/Rendering/IBLShadows/iblShadowsRenderPipeline.d.ts +8 -0
- package/Rendering/IBLShadows/iblShadowsRenderPipeline.js +16 -0
- package/Rendering/IBLShadows/iblShadowsRenderPipeline.js.map +1 -1
- package/Rendering/IBLShadows/iblShadowsVoxelTracingPass.d.ts +9 -0
- package/Rendering/IBLShadows/iblShadowsVoxelTracingPass.js +28 -11
- package/Rendering/IBLShadows/iblShadowsVoxelTracingPass.js.map +1 -1
- package/Shaders/ShadersInclude/defaultFragmentDeclaration.js +1 -1
- package/Shaders/ShadersInclude/defaultFragmentDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/gaussianSplatting.js +1 -1
- package/Shaders/ShadersInclude/gaussianSplatting.js.map +1 -1
- package/Shaders/ShadersInclude/lightFragment.js +19 -1
- package/Shaders/ShadersInclude/lightFragment.js.map +1 -1
- package/Shaders/ShadersInclude/lightFragmentDeclaration.js +3 -0
- package/Shaders/ShadersInclude/lightFragmentDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/lightUboDeclaration.js +3 -0
- package/Shaders/ShadersInclude/lightUboDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/lightVxFragmentDeclaration.js +3 -0
- package/Shaders/ShadersInclude/lightVxFragmentDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/lightVxUboDeclaration.js +3 -0
- package/Shaders/ShadersInclude/lightVxUboDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/lightsFragmentFunctions.d.ts +1 -0
- package/Shaders/ShadersInclude/lightsFragmentFunctions.js +14 -1
- package/Shaders/ShadersInclude/lightsFragmentFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/ltcHelperFunctions.d.ts +5 -0
- package/Shaders/ShadersInclude/ltcHelperFunctions.js +31 -0
- package/Shaders/ShadersInclude/ltcHelperFunctions.js.map +1 -0
- package/Shaders/ShadersInclude/pbrBlockAlbedoOpacity.js +11 -2
- package/Shaders/ShadersInclude/pbrBlockAlbedoOpacity.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBlockReflection.js +7 -1
- package/Shaders/ShadersInclude/pbrBlockReflection.js.map +1 -1
- package/Shaders/ShadersInclude/pbrDirectLightingFunctions.js +6 -0
- package/Shaders/ShadersInclude/pbrDirectLightingFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/pbrDirectLightingSetupFunctions.d.ts +1 -0
- package/Shaders/ShadersInclude/pbrDirectLightingSetupFunctions.js +18 -1
- package/Shaders/ShadersInclude/pbrDirectLightingSetupFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/pbrFragmentDeclaration.js +6 -3
- package/Shaders/ShadersInclude/pbrFragmentDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/pbrFragmentSamplersDeclaration.js +4 -0
- package/Shaders/ShadersInclude/pbrFragmentSamplersDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/pbrUboDeclaration.js +1 -1
- package/Shaders/ShadersInclude/pbrUboDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/pbrVertexDeclaration.js +5 -2
- package/Shaders/ShadersInclude/pbrVertexDeclaration.js.map +1 -1
- package/Shaders/gaussianSplatting.vertex.d.ts +1 -0
- package/Shaders/gaussianSplatting.vertex.js +3 -1
- package/Shaders/gaussianSplatting.vertex.js.map +1 -1
- package/Shaders/iblShadowAccumulation.fragment.js +6 -5
- package/Shaders/iblShadowAccumulation.fragment.js.map +1 -1
- package/Shaders/iblShadowSpatialBlur.fragment.js +3 -3
- package/Shaders/iblShadowSpatialBlur.fragment.js.map +1 -1
- package/Shaders/iblShadowVoxelTracing.fragment.js +26 -8
- package/Shaders/iblShadowVoxelTracing.fragment.js.map +1 -1
- package/Shaders/pbr.fragment.js +11 -3
- package/Shaders/pbr.fragment.js.map +1 -1
- package/Shaders/pbr.vertex.js +2 -0
- package/Shaders/pbr.vertex.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/lightFragment.js +19 -1
- package/ShadersWGSL/ShadersInclude/lightFragment.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/lightUboDeclaration.js +4 -0
- package/ShadersWGSL/ShadersInclude/lightUboDeclaration.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/lightVxFragmentDeclaration.js +3 -0
- package/ShadersWGSL/ShadersInclude/lightVxFragmentDeclaration.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/lightVxUboDeclaration.js +4 -0
- package/ShadersWGSL/ShadersInclude/lightVxUboDeclaration.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/lightsFragmentFunctions.d.ts +1 -0
- package/ShadersWGSL/ShadersInclude/lightsFragmentFunctions.js +12 -1
- package/ShadersWGSL/ShadersInclude/lightsFragmentFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/ltcHelperFunctions.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/ltcHelperFunctions.js +35 -0
- package/ShadersWGSL/ShadersInclude/ltcHelperFunctions.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockAlbedoOpacity.js +10 -1
- package/ShadersWGSL/ShadersInclude/pbrBlockAlbedoOpacity.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrBlockReflection.js +7 -1
- package/ShadersWGSL/ShadersInclude/pbrBlockReflection.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrDirectLightingFunctions.js +4 -0
- package/ShadersWGSL/ShadersInclude/pbrDirectLightingFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrDirectLightingSetupFunctions.d.ts +1 -0
- package/ShadersWGSL/ShadersInclude/pbrDirectLightingSetupFunctions.js +18 -1
- package/ShadersWGSL/ShadersInclude/pbrDirectLightingSetupFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrFragmentSamplersDeclaration.js +4 -0
- package/ShadersWGSL/ShadersInclude/pbrFragmentSamplersDeclaration.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrUboDeclaration.js +1 -1
- package/ShadersWGSL/ShadersInclude/pbrUboDeclaration.js.map +1 -1
- package/ShadersWGSL/glowMapGeneration.fragment.js +1 -2
- package/ShadersWGSL/glowMapGeneration.fragment.js.map +1 -1
- package/ShadersWGSL/iblShadowAccumulation.fragment.js +4 -3
- package/ShadersWGSL/iblShadowAccumulation.fragment.js.map +1 -1
- package/ShadersWGSL/iblShadowSpatialBlur.fragment.js +3 -3
- package/ShadersWGSL/iblShadowSpatialBlur.fragment.js.map +1 -1
- package/ShadersWGSL/iblShadowVoxelTracing.fragment.js +26 -8
- package/ShadersWGSL/iblShadowVoxelTracing.fragment.js.map +1 -1
- package/ShadersWGSL/layer.fragment.js +1 -2
- package/ShadersWGSL/layer.fragment.js.map +1 -1
- package/ShadersWGSL/pbr.fragment.js +10 -2
- package/ShadersWGSL/pbr.fragment.js.map +1 -1
- package/ShadersWGSL/pbr.vertex.js +2 -0
- package/ShadersWGSL/pbr.vertex.js.map +1 -1
- package/Sprites/spriteRenderer.js +1 -0
- package/Sprites/spriteRenderer.js.map +1 -1
- package/XR/features/WebXRHandTracking.js +2 -2
- package/XR/features/WebXRHandTracking.js.map +1 -1
- package/package.json +1 -1
|
@@ -60,6 +60,8 @@ export class PBRMaterialDefines extends MaterialDefines {
|
|
|
60
60
|
this.GAMMAALBEDO = false;
|
|
61
61
|
this.ALBEDODIRECTUV = 0;
|
|
62
62
|
this.VERTEXCOLOR = false;
|
|
63
|
+
this.BASEWEIGHT = false;
|
|
64
|
+
this.BASEWEIGHTDIRECTUV = 0;
|
|
63
65
|
this.BAKED_VERTEX_ANIMATION_TEXTURE = false;
|
|
64
66
|
this.AMBIENT = false;
|
|
65
67
|
this.AMBIENTDIRECTUV = 0;
|
|
@@ -224,6 +226,7 @@ export class PBRMaterialDefines extends MaterialDefines {
|
|
|
224
226
|
this.LOGARITHMICDEPTH = false;
|
|
225
227
|
this.CAMERA_ORTHOGRAPHIC = false;
|
|
226
228
|
this.CAMERA_PERSPECTIVE = false;
|
|
229
|
+
this.AREALIGHTSUPPORTED = true;
|
|
227
230
|
this.FORCENORMALFORWARD = false;
|
|
228
231
|
this.SPECULARAA = false;
|
|
229
232
|
this.UNLIT = false;
|
|
@@ -350,6 +353,11 @@ export class PBRBaseMaterial extends PushMaterial {
|
|
|
350
353
|
* @internal
|
|
351
354
|
*/
|
|
352
355
|
this._albedoTexture = null;
|
|
356
|
+
/**
|
|
357
|
+
* OpenPBR Base Weight (multiplier to the diffuse and metal lobes).
|
|
358
|
+
* @internal
|
|
359
|
+
*/
|
|
360
|
+
this._baseWeightTexture = null;
|
|
353
361
|
/**
|
|
354
362
|
* AKA Occlusion Texture in other nomenclature.
|
|
355
363
|
* @internal
|
|
@@ -472,6 +480,11 @@ export class PBRBaseMaterial extends PushMaterial {
|
|
|
472
480
|
* @internal
|
|
473
481
|
*/
|
|
474
482
|
this._albedoColor = new Color3(1, 1, 1);
|
|
483
|
+
/**
|
|
484
|
+
* OpenPBR Base Weight (multiplier to the diffuse and metal lobes).
|
|
485
|
+
* @internal
|
|
486
|
+
*/
|
|
487
|
+
this._baseWeight = 1;
|
|
475
488
|
/**
|
|
476
489
|
* AKA Specular Color in other nomenclature.
|
|
477
490
|
* @internal
|
|
@@ -834,6 +847,11 @@ export class PBRBaseMaterial extends PushMaterial {
|
|
|
834
847
|
return false;
|
|
835
848
|
}
|
|
836
849
|
}
|
|
850
|
+
if (this._baseWeightTexture && MaterialFlags.BaseWeightTextureEnabled) {
|
|
851
|
+
if (!this._baseWeightTexture.isReadyOrNotBlocking()) {
|
|
852
|
+
return false;
|
|
853
|
+
}
|
|
854
|
+
}
|
|
837
855
|
if (this._ambientTexture && MaterialFlags.AmbientTextureEnabled) {
|
|
838
856
|
if (!this._ambientTexture.isReadyOrNotBlocking()) {
|
|
839
857
|
return false;
|
|
@@ -924,6 +942,14 @@ export class PBRBaseMaterial extends PushMaterial {
|
|
|
924
942
|
return false;
|
|
925
943
|
}
|
|
926
944
|
}
|
|
945
|
+
// Check if Area Lights have LTC texture.
|
|
946
|
+
if (defines["AREALIGHTUSED"]) {
|
|
947
|
+
for (let index = 0; index < mesh.lightSources.length; index++) {
|
|
948
|
+
if (!mesh.lightSources[index]._isReady()) {
|
|
949
|
+
return false;
|
|
950
|
+
}
|
|
951
|
+
}
|
|
952
|
+
}
|
|
927
953
|
if (!engine.getCaps().standardDerivatives && !mesh.isVerticesDataPresent(VertexBuffer.NormalKind)) {
|
|
928
954
|
mesh.createNormals(true);
|
|
929
955
|
Logger.Warn("PBRMaterial: Normals have been created for the mesh: " + mesh.name);
|
|
@@ -1077,6 +1103,7 @@ export class PBRBaseMaterial extends PushMaterial {
|
|
|
1077
1103
|
"vLightsType",
|
|
1078
1104
|
"vAmbientColor",
|
|
1079
1105
|
"vAlbedoColor",
|
|
1106
|
+
"baseWeight",
|
|
1080
1107
|
"vReflectivityColor",
|
|
1081
1108
|
"vMetallicReflectanceFactors",
|
|
1082
1109
|
"vEmissiveColor",
|
|
@@ -1086,6 +1113,7 @@ export class PBRBaseMaterial extends PushMaterial {
|
|
|
1086
1113
|
"vFogColor",
|
|
1087
1114
|
"pointSize",
|
|
1088
1115
|
"vAlbedoInfos",
|
|
1116
|
+
"vBaseWeightInfos",
|
|
1089
1117
|
"vAmbientInfos",
|
|
1090
1118
|
"vOpacityInfos",
|
|
1091
1119
|
"vReflectionInfos",
|
|
@@ -1101,6 +1129,7 @@ export class PBRBaseMaterial extends PushMaterial {
|
|
|
1101
1129
|
"vLightmapInfos",
|
|
1102
1130
|
"mBones",
|
|
1103
1131
|
"albedoMatrix",
|
|
1132
|
+
"baseWeightMatrix",
|
|
1104
1133
|
"ambientMatrix",
|
|
1105
1134
|
"opacityMatrix",
|
|
1106
1135
|
"reflectionMatrix",
|
|
@@ -1141,6 +1170,7 @@ export class PBRBaseMaterial extends PushMaterial {
|
|
|
1141
1170
|
];
|
|
1142
1171
|
const samplers = [
|
|
1143
1172
|
"albedoSampler",
|
|
1173
|
+
"baseWeightSampler",
|
|
1144
1174
|
"reflectivitySampler",
|
|
1145
1175
|
"ambientSampler",
|
|
1146
1176
|
"emissiveSampler",
|
|
@@ -1160,6 +1190,8 @@ export class PBRBaseMaterial extends PushMaterial {
|
|
|
1160
1190
|
"oitDepthSampler",
|
|
1161
1191
|
"oitFrontColorSampler",
|
|
1162
1192
|
"icdfSampler",
|
|
1193
|
+
"areaLightsLTC1Sampler",
|
|
1194
|
+
"areaLightsLTC2Sampler",
|
|
1163
1195
|
];
|
|
1164
1196
|
const uniformBuffers = ["Material", "Scene", "Mesh"];
|
|
1165
1197
|
const indexParameters = { maxSimultaneousLights: this._maxSimultaneousLights, maxSimultaneousMorphTargets: defines.NUM_MORPH_INFLUENCERS };
|
|
@@ -1246,6 +1278,7 @@ export class PBRBaseMaterial extends PushMaterial {
|
|
|
1246
1278
|
}
|
|
1247
1279
|
if (scene.texturesEnabled) {
|
|
1248
1280
|
defines.ALBEDODIRECTUV = 0;
|
|
1281
|
+
defines.BASEWEIGHTDIRECTUV = 0;
|
|
1249
1282
|
defines.AMBIENTDIRECTUV = 0;
|
|
1250
1283
|
defines.OPACITYDIRECTUV = 0;
|
|
1251
1284
|
defines.EMISSIVEDIRECTUV = 0;
|
|
@@ -1265,6 +1298,12 @@ export class PBRBaseMaterial extends PushMaterial {
|
|
|
1265
1298
|
else {
|
|
1266
1299
|
defines.ALBEDO = false;
|
|
1267
1300
|
}
|
|
1301
|
+
if (this._baseWeightTexture && MaterialFlags.BaseWeightTextureEnabled) {
|
|
1302
|
+
PrepareDefinesForMergedUV(this._baseWeightTexture, defines, "BASEWEIGHT");
|
|
1303
|
+
}
|
|
1304
|
+
else {
|
|
1305
|
+
defines.BASEWEIGHT = false;
|
|
1306
|
+
}
|
|
1268
1307
|
if (this._ambientTexture && MaterialFlags.AmbientTextureEnabled) {
|
|
1269
1308
|
PrepareDefinesForMergedUV(this._ambientTexture, defines, "AMBIENT");
|
|
1270
1309
|
defines.AMBIENTINGRAYSCALE = this._useAmbientInGrayScale;
|
|
@@ -1587,6 +1626,7 @@ export class PBRBaseMaterial extends PushMaterial {
|
|
|
1587
1626
|
// Order is important !
|
|
1588
1627
|
const ubo = this._uniformBuffer;
|
|
1589
1628
|
ubo.addUniform("vAlbedoInfos", 2);
|
|
1629
|
+
ubo.addUniform("vBaseWeightInfos", 2);
|
|
1590
1630
|
ubo.addUniform("vAmbientInfos", 4);
|
|
1591
1631
|
ubo.addUniform("vOpacityInfos", 2);
|
|
1592
1632
|
ubo.addUniform("vEmissiveInfos", 2);
|
|
@@ -1599,6 +1639,7 @@ export class PBRBaseMaterial extends PushMaterial {
|
|
|
1599
1639
|
ubo.addUniform("vReflectionSize", 3);
|
|
1600
1640
|
ubo.addUniform("vBumpInfos", 3);
|
|
1601
1641
|
ubo.addUniform("albedoMatrix", 16);
|
|
1642
|
+
ubo.addUniform("baseWeightMatrix", 16);
|
|
1602
1643
|
ubo.addUniform("ambientMatrix", 16);
|
|
1603
1644
|
ubo.addUniform("opacityMatrix", 16);
|
|
1604
1645
|
ubo.addUniform("emissiveMatrix", 16);
|
|
@@ -1610,6 +1651,7 @@ export class PBRBaseMaterial extends PushMaterial {
|
|
|
1610
1651
|
ubo.addUniform("reflectionMatrix", 16);
|
|
1611
1652
|
ubo.addUniform("vReflectionColor", 3);
|
|
1612
1653
|
ubo.addUniform("vAlbedoColor", 4);
|
|
1654
|
+
ubo.addUniform("baseWeight", 1);
|
|
1613
1655
|
ubo.addUniform("vLightingIntensity", 4);
|
|
1614
1656
|
ubo.addUniform("vReflectionMicrosurfaceInfos", 3);
|
|
1615
1657
|
ubo.addUniform("pointSize", 1);
|
|
@@ -1689,6 +1731,10 @@ export class PBRBaseMaterial extends PushMaterial {
|
|
|
1689
1731
|
ubo.updateFloat2("vAlbedoInfos", this._albedoTexture.coordinatesIndex, this._albedoTexture.level);
|
|
1690
1732
|
BindTextureMatrix(this._albedoTexture, ubo, "albedo");
|
|
1691
1733
|
}
|
|
1734
|
+
if (this._baseWeightTexture && MaterialFlags.BaseWeightTextureEnabled) {
|
|
1735
|
+
ubo.updateFloat2("vBaseWeightInfos", this._baseWeightTexture.coordinatesIndex, this._baseWeightTexture.level);
|
|
1736
|
+
BindTextureMatrix(this._baseWeightTexture, ubo, "baseWeight");
|
|
1737
|
+
}
|
|
1692
1738
|
if (this._ambientTexture && MaterialFlags.AmbientTextureEnabled) {
|
|
1693
1739
|
ubo.updateFloat4("vAmbientInfos", this._ambientTexture.coordinatesIndex, this._ambientTexture.level, this._ambientTextureStrength, this._ambientTextureImpactOnAnalyticalLights);
|
|
1694
1740
|
BindTextureMatrix(this._ambientTexture, ubo, "ambient");
|
|
@@ -1811,6 +1857,7 @@ export class PBRBaseMaterial extends PushMaterial {
|
|
|
1811
1857
|
else {
|
|
1812
1858
|
ubo.updateColor4("vAlbedoColor", this._albedoColor, this.alpha);
|
|
1813
1859
|
}
|
|
1860
|
+
ubo.updateFloat("baseWeight", this._baseWeight);
|
|
1814
1861
|
// Misc
|
|
1815
1862
|
this._lightingInfos.x = this._directIntensity;
|
|
1816
1863
|
this._lightingInfos.y = this._emissiveIntensity;
|
|
@@ -1827,6 +1874,9 @@ export class PBRBaseMaterial extends PushMaterial {
|
|
|
1827
1874
|
if (this._albedoTexture && MaterialFlags.DiffuseTextureEnabled) {
|
|
1828
1875
|
ubo.setTexture("albedoSampler", this._albedoTexture);
|
|
1829
1876
|
}
|
|
1877
|
+
if (this._baseWeightTexture && MaterialFlags.BaseWeightTextureEnabled) {
|
|
1878
|
+
ubo.setTexture("baseWeightSampler", this._baseWeightTexture);
|
|
1879
|
+
}
|
|
1830
1880
|
if (this._ambientTexture && MaterialFlags.AmbientTextureEnabled) {
|
|
1831
1881
|
ubo.setTexture("ambientSampler", this._ambientTexture);
|
|
1832
1882
|
}
|
|
@@ -1934,6 +1984,9 @@ export class PBRBaseMaterial extends PushMaterial {
|
|
|
1934
1984
|
if (this._albedoTexture && this._albedoTexture.animations && this._albedoTexture.animations.length > 0) {
|
|
1935
1985
|
results.push(this._albedoTexture);
|
|
1936
1986
|
}
|
|
1987
|
+
if (this._baseWeightTexture && this._baseWeightTexture.animations && this._baseWeightTexture.animations.length > 0) {
|
|
1988
|
+
results.push(this._baseWeightTexture);
|
|
1989
|
+
}
|
|
1937
1990
|
if (this._ambientTexture && this._ambientTexture.animations && this._ambientTexture.animations.length > 0) {
|
|
1938
1991
|
results.push(this._ambientTexture);
|
|
1939
1992
|
}
|
|
@@ -1988,6 +2041,9 @@ export class PBRBaseMaterial extends PushMaterial {
|
|
|
1988
2041
|
if (this._albedoTexture) {
|
|
1989
2042
|
activeTextures.push(this._albedoTexture);
|
|
1990
2043
|
}
|
|
2044
|
+
if (this._baseWeightTexture) {
|
|
2045
|
+
activeTextures.push(this._baseWeightTexture);
|
|
2046
|
+
}
|
|
1991
2047
|
if (this._ambientTexture) {
|
|
1992
2048
|
activeTextures.push(this._ambientTexture);
|
|
1993
2049
|
}
|
|
@@ -2035,6 +2091,9 @@ export class PBRBaseMaterial extends PushMaterial {
|
|
|
2035
2091
|
if (this._albedoTexture === texture) {
|
|
2036
2092
|
return true;
|
|
2037
2093
|
}
|
|
2094
|
+
if (this._baseWeightTexture === texture) {
|
|
2095
|
+
return true;
|
|
2096
|
+
}
|
|
2038
2097
|
if (this._ambientTexture === texture) {
|
|
2039
2098
|
return true;
|
|
2040
2099
|
}
|
|
@@ -2098,6 +2157,7 @@ export class PBRBaseMaterial extends PushMaterial {
|
|
|
2098
2157
|
this._environmentBRDFTexture.dispose();
|
|
2099
2158
|
}
|
|
2100
2159
|
this._albedoTexture?.dispose();
|
|
2160
|
+
this._baseWeightTexture?.dispose();
|
|
2101
2161
|
this._ambientTexture?.dispose();
|
|
2102
2162
|
this._opacityTexture?.dispose();
|
|
2103
2163
|
this._reflectionTexture?.dispose();
|