@onerjs/core 8.26.4 → 8.26.6
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/Engines/abstractEngine.js +2 -2
- package/Engines/abstractEngine.js.map +1 -1
- package/FrameGraph/Tasks/Rendering/objectRendererTask.js +6 -0
- package/FrameGraph/Tasks/Rendering/objectRendererTask.js.map +1 -1
- package/FrameGraph/frameGraphContext.d.ts +2 -1
- package/FrameGraph/frameGraphContext.js +4 -1
- package/FrameGraph/frameGraphContext.js.map +1 -1
- package/Lights/Clustered/clusteredLightContainer.d.ts +1 -1
- package/Lights/Clustered/clusteredLightContainer.js +4 -5
- package/Lights/Clustered/clusteredLightContainer.js.map +1 -1
- package/Lights/pointLight.js +4 -4
- package/Lights/pointLight.js.map +1 -1
- package/Lights/rectAreaLight.js +4 -4
- package/Lights/rectAreaLight.js.map +1 -1
- package/Lights/spotLight.js +2 -2
- package/Lights/spotLight.js.map +1 -1
- package/Materials/Background/backgroundMaterial.d.ts +19 -91
- package/Materials/Background/backgroundMaterial.js +17 -245
- package/Materials/Background/backgroundMaterial.js.map +1 -1
- package/Materials/Node/Blocks/Dual/currentScreenBlock.d.ts +3 -1
- package/Materials/Node/Blocks/Dual/currentScreenBlock.js +15 -6
- package/Materials/Node/Blocks/Dual/currentScreenBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/imageSourceBlock.js +1 -1
- package/Materials/Node/Blocks/Dual/imageSourceBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/lightBlock.js +15 -4
- package/Materials/Node/Blocks/Dual/lightBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/smartFilterTextureBlock.d.ts +20 -0
- package/Materials/Node/Blocks/Dual/smartFilterTextureBlock.js +41 -3
- package/Materials/Node/Blocks/Dual/smartFilterTextureBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/smartFilterFragmentOutputBlock.js +0 -1
- package/Materials/Node/Blocks/Fragment/smartFilterFragmentOutputBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js +28 -5
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js.map +1 -1
- package/Materials/Node/nodeMaterial.d.ts +57 -69
- package/Materials/Node/nodeMaterial.js +9 -86
- package/Materials/Node/nodeMaterial.js.map +1 -1
- package/Materials/Node/nodeMaterialBuildState.d.ts +3 -1
- package/Materials/Node/nodeMaterialBuildState.js +35 -15
- package/Materials/Node/nodeMaterialBuildState.js.map +1 -1
- package/Materials/PBR/index.d.ts +5 -0
- package/Materials/PBR/index.js +5 -0
- package/Materials/PBR/index.js.map +1 -1
- package/Materials/PBR/openPbrMaterial.d.ts +998 -0
- package/Materials/PBR/openPbrMaterial.js +2069 -0
- package/Materials/PBR/openPbrMaterial.js.map +1 -0
- package/Materials/PBR/pbrBaseMaterial.d.ts +65 -43
- package/Materials/PBR/pbrBaseMaterial.js +37 -308
- package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
- package/Materials/PBR/pbrMaterial.d.ts +0 -78
- package/Materials/PBR/pbrMaterial.js +0 -110
- package/Materials/PBR/pbrMaterial.js.map +1 -1
- package/Materials/floatingOriginMatrixOverrides.d.ts +3 -0
- package/Materials/floatingOriginMatrixOverrides.js +91 -0
- package/Materials/floatingOriginMatrixOverrides.js.map +1 -0
- package/Materials/imageProcessing.d.ts +65 -0
- package/Materials/imageProcessing.js +162 -0
- package/Materials/imageProcessing.js.map +1 -0
- package/Materials/imageProcessingConfiguration.defines.d.ts +25 -0
- package/Materials/imageProcessingConfiguration.defines.js +27 -0
- package/Materials/imageProcessingConfiguration.defines.js.map +1 -1
- package/Materials/index.d.ts +2 -0
- package/Materials/index.js +2 -0
- package/Materials/index.js.map +1 -1
- package/Materials/material.d.ts +14 -0
- package/Materials/material.js +14 -0
- package/Materials/material.js.map +1 -1
- package/Materials/materialHelper.functions.d.ts +53 -0
- package/Materials/materialHelper.functions.js +297 -0
- package/Materials/materialHelper.functions.js.map +1 -1
- package/Materials/standardMaterial.d.ts +57 -121
- package/Materials/standardMaterial.js +21 -250
- package/Materials/standardMaterial.js.map +1 -1
- package/Materials/uv.defines.d.ts +22 -0
- package/Materials/uv.defines.js +24 -0
- package/Materials/uv.defines.js.map +1 -0
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +1 -0
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
- package/Misc/decorators.d.ts +7 -0
- package/Misc/decorators.js +34 -0
- package/Misc/decorators.js.map +1 -1
- package/Particles/Node/Blocks/Emitters/createParticleBlock.js +10 -1
- package/Particles/Node/Blocks/Emitters/createParticleBlock.js.map +1 -1
- package/Particles/Node/Blocks/index.d.ts +2 -0
- package/Particles/Node/Blocks/index.js +2 -0
- package/Particles/Node/Blocks/index.js.map +1 -1
- package/Particles/Node/Blocks/particleInputBlock.js +4 -1
- package/Particles/Node/Blocks/particleInputBlock.js.map +1 -1
- package/Particles/Node/Blocks/particleLocalVariableBlock.d.ts +38 -0
- package/Particles/Node/Blocks/particleLocalVariableBlock.js +108 -0
- package/Particles/Node/Blocks/particleLocalVariableBlock.js.map +1 -0
- package/Particles/Node/Blocks/particleVectorLengthBlock.d.ts +26 -0
- package/Particles/Node/Blocks/particleVectorLengthBlock.js +50 -0
- package/Particles/Node/Blocks/particleVectorLengthBlock.js.map +1 -0
- package/Rendering/IBLShadows/iblShadowsPluginMaterial.d.ts +2 -1
- package/Rendering/IBLShadows/iblShadowsPluginMaterial.js +45 -0
- package/Rendering/IBLShadows/iblShadowsPluginMaterial.js.map +1 -1
- package/Rendering/IBLShadows/iblShadowsRenderPipeline.js +2 -1
- package/Rendering/IBLShadows/iblShadowsRenderPipeline.js.map +1 -1
- package/Rendering/geometryBufferRenderer.js +6 -4
- package/Rendering/geometryBufferRenderer.js.map +1 -1
- package/Rendering/iblCdfGenerator.js +28 -20
- package/Rendering/iblCdfGenerator.js.map +1 -1
- package/Rendering/reflectiveShadowMap.d.ts +3 -3
- package/Shaders/ShadersInclude/backgroundUboDeclaration.js +1 -1
- package/Shaders/ShadersInclude/backgroundUboDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/clusteredLightingFunctions.js +3 -1
- package/Shaders/ShadersInclude/clusteredLightingFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/defaultUboDeclaration.js +1 -1
- package/Shaders/ShadersInclude/defaultUboDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/hdrFilteringFunctions.js +34 -0
- package/Shaders/ShadersInclude/hdrFilteringFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/helperFunctions.js +1 -1
- package/Shaders/ShadersInclude/helperFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/importanceSampling.js +4 -0
- package/Shaders/ShadersInclude/importanceSampling.js.map +1 -1
- package/Shaders/ShadersInclude/lightsFragmentFunctions.js +1 -0
- package/Shaders/ShadersInclude/lightsFragmentFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBRDFFunctions.js +1 -1
- package/Shaders/ShadersInclude/pbrBRDFFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/pbrClusteredLightingFunctions.js +1 -0
- package/Shaders/ShadersInclude/pbrClusteredLightingFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/pbrDirectLightingFunctions.js +3 -1
- package/Shaders/ShadersInclude/pbrDirectLightingFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/pbrHelperFunctions.js +2 -0
- package/Shaders/ShadersInclude/pbrHelperFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/pbrUboDeclaration.js +1 -1
- package/Shaders/ShadersInclude/pbrUboDeclaration.js.map +1 -1
- package/Shaders/openpbr.vertex.js +1 -1
- package/Shaders/openpbr.vertex.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/backgroundUboDeclaration.js +1 -1
- package/ShadersWGSL/ShadersInclude/backgroundUboDeclaration.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/defaultUboDeclaration.js +1 -1
- package/ShadersWGSL/ShadersInclude/defaultUboDeclaration.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/hdrFilteringFunctions.js +28 -0
- package/ShadersWGSL/ShadersInclude/hdrFilteringFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/importanceSampling.js +4 -0
- package/ShadersWGSL/ShadersInclude/importanceSampling.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrBRDFFunctions.js +1 -1
- package/ShadersWGSL/ShadersInclude/pbrBRDFFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrDirectLightingFunctions.js +3 -1
- package/ShadersWGSL/ShadersInclude/pbrDirectLightingFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrHelperFunctions.js +2 -0
- package/ShadersWGSL/ShadersInclude/pbrHelperFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrUboDeclaration.js +1 -1
- package/ShadersWGSL/ShadersInclude/pbrUboDeclaration.js.map +1 -1
- package/ShadersWGSL/openpbr.vertex.js +1 -1
- package/ShadersWGSL/openpbr.vertex.js.map +1 -1
- package/package.json +1 -1
- package/scene.d.ts +21 -0
- package/scene.js +29 -3
- package/scene.js.map +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __decorate } from "../../tslib.es6.js";
|
|
2
2
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
3
|
-
import {
|
|
3
|
+
import { expandToProperty } from "../../Misc/decorators.js";
|
|
4
4
|
import { Logger } from "../../Misc/logger.js";
|
|
5
5
|
import { SmartArray } from "../../Misc/smartArray.js";
|
|
6
6
|
import { GetEnvironmentBRDFTexture } from "../../Misc/brdfTextureTools.js";
|
|
@@ -10,11 +10,11 @@ import { VertexBuffer } from "../../Buffers/buffer.js";
|
|
|
10
10
|
import { PBRBRDFConfiguration } from "./pbrBRDFConfiguration.js";
|
|
11
11
|
import { PrePassConfiguration } from "../prePassConfiguration.js";
|
|
12
12
|
import { Color3, TmpColors } from "../../Maths/math.color.js";
|
|
13
|
+
import { ImageProcessingDefinesMixin } from "../../Materials/imageProcessingConfiguration.defines.js";
|
|
13
14
|
import { ImageProcessingConfiguration } from "../../Materials/imageProcessingConfiguration.js";
|
|
14
15
|
import { Material } from "../../Materials/material.js";
|
|
15
16
|
import { MaterialDefines } from "../../Materials/materialDefines.js";
|
|
16
17
|
import { PushMaterial } from "../../Materials/pushMaterial.js";
|
|
17
|
-
import { Texture } from "../../Materials/Textures/texture.js";
|
|
18
18
|
import { MaterialFlags } from "../materialFlags.js";
|
|
19
19
|
|
|
20
20
|
import "../../Materials/Textures/baseTexture.polynomial.js";
|
|
@@ -26,14 +26,18 @@ import { PBRSheenConfiguration } from "./pbrSheenConfiguration.js";
|
|
|
26
26
|
import { PBRSubSurfaceConfiguration } from "./pbrSubSurfaceConfiguration.js";
|
|
27
27
|
import { DetailMapConfiguration } from "../material.detailMapConfiguration.js";
|
|
28
28
|
import { AddClipPlaneUniforms, BindClipPlane } from "../clipPlaneMaterialHelper.js";
|
|
29
|
-
import { BindBonesParameters, BindFogParameters, BindLights, BindLogDepth, BindMorphTargetParameters, BindTextureMatrix, HandleFallbacksForShadows, PrepareAttributesForBakedVertexAnimation, PrepareAttributesForBones, PrepareAttributesForInstances, PrepareAttributesForMorphTargets, PrepareDefinesForAttributes, PrepareDefinesForFrameBoundValues, PrepareDefinesForLights, PrepareDefinesForMergedUV, PrepareDefinesForMisc, PrepareDefinesForMultiview, PrepareDefinesForOIT, PrepareDefinesForPrePass, PrepareUniformsAndSamplersList, } from "../materialHelper.functions.js";
|
|
29
|
+
import { BindBonesParameters, BindFogParameters, BindLights, BindLogDepth, BindMorphTargetParameters, BindTextureMatrix, BindIBLParameters, BindIBLSamplers, HandleFallbacksForShadows, PrepareAttributesForBakedVertexAnimation, PrepareAttributesForBones, PrepareAttributesForInstances, PrepareAttributesForMorphTargets, PrepareDefinesForAttributes, PrepareDefinesForFrameBoundValues, PrepareDefinesForLights, PrepareDefinesForIBL, PrepareDefinesForMergedUV, PrepareDefinesForMisc, PrepareDefinesForMultiview, PrepareDefinesForOIT, PrepareDefinesForPrePass, PrepareUniformsAndSamplersList, PrepareUniformsAndSamplersForIBL, PrepareUniformLayoutForIBL, } from "../materialHelper.functions.js";
|
|
30
30
|
import { MaterialHelperGeometryRendering } from "../materialHelper.geometryrendering.js";
|
|
31
|
+
import { UVDefinesMixin } from "../uv.defines.js";
|
|
32
|
+
import { ImageProcessingMixin } from "../imageProcessing.js";
|
|
31
33
|
const onCreatedEffectParameters = { effect: null, subMesh: null };
|
|
34
|
+
class PBRMaterialDefinesBase extends UVDefinesMixin(MaterialDefines) {
|
|
35
|
+
}
|
|
32
36
|
/**
|
|
33
37
|
* Manages the defines for the PBR Material.
|
|
34
38
|
* @internal
|
|
35
39
|
*/
|
|
36
|
-
export class PBRMaterialDefines extends
|
|
40
|
+
export class PBRMaterialDefines extends ImageProcessingDefinesMixin(PBRMaterialDefinesBase) {
|
|
37
41
|
/**
|
|
38
42
|
* Initializes the PBR Material defines.
|
|
39
43
|
* @param externalProperties The external properties
|
|
@@ -44,18 +48,6 @@ export class PBRMaterialDefines extends MaterialDefines {
|
|
|
44
48
|
this.NUM_SAMPLES = "0";
|
|
45
49
|
this.REALTIME_FILTERING = false;
|
|
46
50
|
this.IBL_CDF_FILTERING = false;
|
|
47
|
-
this.MAINUV1 = false;
|
|
48
|
-
this.MAINUV2 = false;
|
|
49
|
-
this.MAINUV3 = false;
|
|
50
|
-
this.MAINUV4 = false;
|
|
51
|
-
this.MAINUV5 = false;
|
|
52
|
-
this.MAINUV6 = false;
|
|
53
|
-
this.UV1 = false;
|
|
54
|
-
this.UV2 = false;
|
|
55
|
-
this.UV3 = false;
|
|
56
|
-
this.UV4 = false;
|
|
57
|
-
this.UV5 = false;
|
|
58
|
-
this.UV6 = false;
|
|
59
51
|
this.ALBEDO = false;
|
|
60
52
|
this.GAMMAALBEDO = false;
|
|
61
53
|
this.ALBEDODIRECTUV = 0;
|
|
@@ -200,21 +192,6 @@ export class PBRMaterialDefines extends MaterialDefines {
|
|
|
200
192
|
this.MORPHTARGETTEXTURE_HASCOLORS = false;
|
|
201
193
|
this.NUM_MORPH_INFLUENCERS = 0;
|
|
202
194
|
this.MORPHTARGETS_TEXTURE = false;
|
|
203
|
-
this.IMAGEPROCESSING = false;
|
|
204
|
-
this.VIGNETTE = false;
|
|
205
|
-
this.VIGNETTEBLENDMODEMULTIPLY = false;
|
|
206
|
-
this.VIGNETTEBLENDMODEOPAQUE = false;
|
|
207
|
-
this.TONEMAPPING = 0;
|
|
208
|
-
this.CONTRAST = false;
|
|
209
|
-
this.COLORCURVES = false;
|
|
210
|
-
this.COLORGRADING = false;
|
|
211
|
-
this.COLORGRADING3D = false;
|
|
212
|
-
this.SAMPLER3DGREENDEPTH = false;
|
|
213
|
-
this.SAMPLER3DBGRMAP = false;
|
|
214
|
-
this.DITHER = false;
|
|
215
|
-
this.IMAGEPROCESSINGPOSTPROCESS = false;
|
|
216
|
-
this.SKIPFINALCOLORCLAMP = false;
|
|
217
|
-
this.EXPOSURE = false;
|
|
218
195
|
this.MULTIVIEW = false;
|
|
219
196
|
this.ORDER_INDEPENDENT_TRANSPARENCY = false;
|
|
220
197
|
this.ORDER_INDEPENDENT_TRANSPARENCY_16BITS = false;
|
|
@@ -253,6 +230,8 @@ export class PBRMaterialDefines extends MaterialDefines {
|
|
|
253
230
|
this.NORMALXYSCALE = true;
|
|
254
231
|
}
|
|
255
232
|
}
|
|
233
|
+
class PBRBaseMaterialBase extends ImageProcessingMixin(PushMaterial) {
|
|
234
|
+
}
|
|
256
235
|
/**
|
|
257
236
|
* The Physically based material base class of BJS.
|
|
258
237
|
*
|
|
@@ -262,58 +241,44 @@ export class PBRMaterialDefines extends MaterialDefines {
|
|
|
262
241
|
* @see [WebGL](https://playground.babylonjs.com/#CGHTSM#1)
|
|
263
242
|
* @see [WebGPU](https://playground.babylonjs.com/#CGHTSM#2)
|
|
264
243
|
*/
|
|
265
|
-
export class PBRBaseMaterial extends
|
|
244
|
+
export class PBRBaseMaterial extends PBRBaseMaterialBase {
|
|
266
245
|
/**
|
|
267
246
|
* Enables realtime filtering on the texture.
|
|
268
247
|
*/
|
|
269
248
|
get realTimeFiltering() {
|
|
270
|
-
return this._realTimeFiltering;
|
|
249
|
+
return this._realTimeFiltering ?? false;
|
|
271
250
|
}
|
|
272
251
|
set realTimeFiltering(b) {
|
|
273
252
|
this._realTimeFiltering = b;
|
|
274
253
|
this.markAsDirty(1);
|
|
275
254
|
}
|
|
255
|
+
/**
|
|
256
|
+
* Checks if the real-time filtering setting is explicitly set by the user.
|
|
257
|
+
*/
|
|
258
|
+
get isUserSetRealTimeFiltering() {
|
|
259
|
+
return typeof this._realTimeFiltering === "boolean";
|
|
260
|
+
}
|
|
276
261
|
/**
|
|
277
262
|
* Quality switch for realtime filtering
|
|
278
263
|
*/
|
|
279
264
|
get realTimeFilteringQuality() {
|
|
280
|
-
return this._realTimeFilteringQuality;
|
|
265
|
+
return this._realTimeFilteringQuality ?? 8;
|
|
281
266
|
}
|
|
282
267
|
set realTimeFilteringQuality(n) {
|
|
283
268
|
this._realTimeFilteringQuality = n;
|
|
284
269
|
this.markAsDirty(1);
|
|
285
270
|
}
|
|
286
271
|
/**
|
|
287
|
-
*
|
|
272
|
+
* Checks if the real-time filtering quality has been set by the user.
|
|
288
273
|
*/
|
|
289
|
-
get
|
|
290
|
-
return
|
|
274
|
+
get isUserSetRealTimeFilteringQuality() {
|
|
275
|
+
return typeof this._realTimeFilteringQuality === "number";
|
|
291
276
|
}
|
|
292
277
|
/**
|
|
293
|
-
*
|
|
294
|
-
* @param configuration
|
|
278
|
+
* Can this material render to several textures at once
|
|
295
279
|
*/
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
return;
|
|
299
|
-
}
|
|
300
|
-
// Detaches observer.
|
|
301
|
-
if (this._imageProcessingConfiguration && this._imageProcessingObserver) {
|
|
302
|
-
this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver);
|
|
303
|
-
}
|
|
304
|
-
// Pick the scene configuration if needed.
|
|
305
|
-
if (!configuration) {
|
|
306
|
-
this._imageProcessingConfiguration = this.getScene().imageProcessingConfiguration;
|
|
307
|
-
}
|
|
308
|
-
else {
|
|
309
|
-
this._imageProcessingConfiguration = configuration;
|
|
310
|
-
}
|
|
311
|
-
// Attaches observer.
|
|
312
|
-
if (this._imageProcessingConfiguration) {
|
|
313
|
-
this._imageProcessingObserver = this._imageProcessingConfiguration.onUpdateParameters.add(() => {
|
|
314
|
-
this._markAllSubMeshesAsImageProcessingDirty();
|
|
315
|
-
});
|
|
316
|
-
}
|
|
280
|
+
get canRenderToMRT() {
|
|
281
|
+
return true;
|
|
317
282
|
}
|
|
318
283
|
/**
|
|
319
284
|
* Instantiates a new PBRMaterial instance.
|
|
@@ -675,8 +640,8 @@ export class PBRBaseMaterial extends PushMaterial {
|
|
|
675
640
|
* @internal
|
|
676
641
|
*/
|
|
677
642
|
this._forceIrradianceInFragment = false;
|
|
678
|
-
this._realTimeFiltering =
|
|
679
|
-
this._realTimeFilteringQuality =
|
|
643
|
+
this._realTimeFiltering = undefined;
|
|
644
|
+
this._realTimeFilteringQuality = undefined;
|
|
680
645
|
/**
|
|
681
646
|
* Force normal to face away from face.
|
|
682
647
|
* @internal
|
|
@@ -689,10 +654,6 @@ export class PBRBaseMaterial extends PushMaterial {
|
|
|
689
654
|
* @internal
|
|
690
655
|
*/
|
|
691
656
|
this._enableSpecularAntiAliasing = false;
|
|
692
|
-
/**
|
|
693
|
-
* Keep track of the image processing observer to allow dispose and replace.
|
|
694
|
-
*/
|
|
695
|
-
this._imageProcessingObserver = null;
|
|
696
657
|
/**
|
|
697
658
|
* Stores the available render targets.
|
|
698
659
|
*/
|
|
@@ -1132,7 +1093,6 @@ export class PBRBaseMaterial extends PushMaterial {
|
|
|
1132
1093
|
"vMetallicReflectanceFactors",
|
|
1133
1094
|
"vEmissiveColor",
|
|
1134
1095
|
"visibility",
|
|
1135
|
-
"vReflectionColor",
|
|
1136
1096
|
"vFogInfos",
|
|
1137
1097
|
"vFogColor",
|
|
1138
1098
|
"pointSize",
|
|
@@ -1141,12 +1101,8 @@ export class PBRBaseMaterial extends PushMaterial {
|
|
|
1141
1101
|
"vBaseDiffuseRoughnessInfos",
|
|
1142
1102
|
"vAmbientInfos",
|
|
1143
1103
|
"vOpacityInfos",
|
|
1144
|
-
"vReflectionInfos",
|
|
1145
|
-
"vReflectionPosition",
|
|
1146
|
-
"vReflectionSize",
|
|
1147
1104
|
"vEmissiveInfos",
|
|
1148
1105
|
"vReflectivityInfos",
|
|
1149
|
-
"vReflectionFilteringInfo",
|
|
1150
1106
|
"vMetallicReflectanceInfos",
|
|
1151
1107
|
"vReflectanceInfos",
|
|
1152
1108
|
"vMicroSurfaceSamplerInfos",
|
|
@@ -1158,7 +1114,6 @@ export class PBRBaseMaterial extends PushMaterial {
|
|
|
1158
1114
|
"baseDiffuseRoughnessMatrix",
|
|
1159
1115
|
"ambientMatrix",
|
|
1160
1116
|
"opacityMatrix",
|
|
1161
|
-
"reflectionMatrix",
|
|
1162
1117
|
"emissiveMatrix",
|
|
1163
1118
|
"reflectivityMatrix",
|
|
1164
1119
|
"normalMatrix",
|
|
@@ -1169,26 +1124,6 @@ export class PBRBaseMaterial extends PushMaterial {
|
|
|
1169
1124
|
"reflectanceMatrix",
|
|
1170
1125
|
"vLightingIntensity",
|
|
1171
1126
|
"logarithmicDepthConstant",
|
|
1172
|
-
"vSphericalX",
|
|
1173
|
-
"vSphericalY",
|
|
1174
|
-
"vSphericalZ",
|
|
1175
|
-
"vSphericalXX_ZZ",
|
|
1176
|
-
"vSphericalYY_ZZ",
|
|
1177
|
-
"vSphericalZZ",
|
|
1178
|
-
"vSphericalXY",
|
|
1179
|
-
"vSphericalYZ",
|
|
1180
|
-
"vSphericalZX",
|
|
1181
|
-
"vSphericalL00",
|
|
1182
|
-
"vSphericalL1_1",
|
|
1183
|
-
"vSphericalL10",
|
|
1184
|
-
"vSphericalL11",
|
|
1185
|
-
"vSphericalL2_2",
|
|
1186
|
-
"vSphericalL2_1",
|
|
1187
|
-
"vSphericalL20",
|
|
1188
|
-
"vSphericalL21",
|
|
1189
|
-
"vSphericalL22",
|
|
1190
|
-
"vReflectionMicrosurfaceInfos",
|
|
1191
|
-
"vReflectionDominantDirection",
|
|
1192
1127
|
"vTangentSpaceParams",
|
|
1193
1128
|
"boneTextureWidth",
|
|
1194
1129
|
"vDebugMode",
|
|
@@ -1206,10 +1141,6 @@ export class PBRBaseMaterial extends PushMaterial {
|
|
|
1206
1141
|
"bumpSampler",
|
|
1207
1142
|
"lightmapSampler",
|
|
1208
1143
|
"opacitySampler",
|
|
1209
|
-
"reflectionSampler",
|
|
1210
|
-
"reflectionSamplerLow",
|
|
1211
|
-
"reflectionSamplerHigh",
|
|
1212
|
-
"irradianceSampler",
|
|
1213
1144
|
"microSurfaceSampler",
|
|
1214
1145
|
"environmentBrdfSampler",
|
|
1215
1146
|
"boneSampler",
|
|
@@ -1218,10 +1149,10 @@ export class PBRBaseMaterial extends PushMaterial {
|
|
|
1218
1149
|
"morphTargets",
|
|
1219
1150
|
"oitDepthSampler",
|
|
1220
1151
|
"oitFrontColorSampler",
|
|
1221
|
-
"icdfSampler",
|
|
1222
1152
|
"areaLightsLTC1Sampler",
|
|
1223
1153
|
"areaLightsLTC2Sampler",
|
|
1224
1154
|
];
|
|
1155
|
+
PrepareUniformsAndSamplersForIBL(uniforms, samplers, true);
|
|
1225
1156
|
const uniformBuffers = ["Material", "Scene", "Mesh"];
|
|
1226
1157
|
const indexParameters = { maxSimultaneousLights: this._maxSimultaneousLights, maxSimultaneousMorphTargets: defines.NUM_MORPH_INFLUENCERS };
|
|
1227
1158
|
this._eventInfo.fallbacks = fallbacks;
|
|
@@ -1356,121 +1287,12 @@ export class PBRBaseMaterial extends PushMaterial {
|
|
|
1356
1287
|
defines.OPACITY = false;
|
|
1357
1288
|
}
|
|
1358
1289
|
const reflectionTexture = this._getReflectionTexture();
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
defines.USEIRRADIANCEMAP = false;
|
|
1366
|
-
if (this.realTimeFiltering && this.realTimeFilteringQuality > 0) {
|
|
1367
|
-
defines.NUM_SAMPLES = "" + this.realTimeFilteringQuality;
|
|
1368
|
-
if (engine._features.needTypeSuffixInShaderConstants) {
|
|
1369
|
-
defines.NUM_SAMPLES = defines.NUM_SAMPLES + "u";
|
|
1370
|
-
}
|
|
1371
|
-
defines.REALTIME_FILTERING = true;
|
|
1372
|
-
if (this.getScene().iblCdfGenerator) {
|
|
1373
|
-
defines.IBL_CDF_FILTERING = true;
|
|
1374
|
-
}
|
|
1375
|
-
}
|
|
1376
|
-
else {
|
|
1377
|
-
defines.REALTIME_FILTERING = false;
|
|
1378
|
-
}
|
|
1379
|
-
defines.INVERTCUBICMAP = reflectionTexture.coordinatesMode === Texture.INVCUBIC_MODE;
|
|
1380
|
-
defines.REFLECTIONMAP_3D = reflectionTexture.isCube;
|
|
1381
|
-
defines.REFLECTIONMAP_OPPOSITEZ = defines.REFLECTIONMAP_3D && this.getScene().useRightHandedSystem ? !reflectionTexture.invertZ : reflectionTexture.invertZ;
|
|
1382
|
-
defines.REFLECTIONMAP_CUBIC = false;
|
|
1383
|
-
defines.REFLECTIONMAP_EXPLICIT = false;
|
|
1384
|
-
defines.REFLECTIONMAP_PLANAR = false;
|
|
1385
|
-
defines.REFLECTIONMAP_PROJECTION = false;
|
|
1386
|
-
defines.REFLECTIONMAP_SKYBOX = false;
|
|
1387
|
-
defines.REFLECTIONMAP_SPHERICAL = false;
|
|
1388
|
-
defines.REFLECTIONMAP_EQUIRECTANGULAR = false;
|
|
1389
|
-
defines.REFLECTIONMAP_EQUIRECTANGULAR_FIXED = false;
|
|
1390
|
-
defines.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED = false;
|
|
1391
|
-
switch (reflectionTexture.coordinatesMode) {
|
|
1392
|
-
case Texture.EXPLICIT_MODE:
|
|
1393
|
-
defines.REFLECTIONMAP_EXPLICIT = true;
|
|
1394
|
-
break;
|
|
1395
|
-
case Texture.PLANAR_MODE:
|
|
1396
|
-
defines.REFLECTIONMAP_PLANAR = true;
|
|
1397
|
-
break;
|
|
1398
|
-
case Texture.PROJECTION_MODE:
|
|
1399
|
-
defines.REFLECTIONMAP_PROJECTION = true;
|
|
1400
|
-
break;
|
|
1401
|
-
case Texture.SKYBOX_MODE:
|
|
1402
|
-
defines.REFLECTIONMAP_SKYBOX = true;
|
|
1403
|
-
break;
|
|
1404
|
-
case Texture.SPHERICAL_MODE:
|
|
1405
|
-
defines.REFLECTIONMAP_SPHERICAL = true;
|
|
1406
|
-
break;
|
|
1407
|
-
case Texture.EQUIRECTANGULAR_MODE:
|
|
1408
|
-
defines.REFLECTIONMAP_EQUIRECTANGULAR = true;
|
|
1409
|
-
break;
|
|
1410
|
-
case Texture.FIXED_EQUIRECTANGULAR_MODE:
|
|
1411
|
-
defines.REFLECTIONMAP_EQUIRECTANGULAR_FIXED = true;
|
|
1412
|
-
break;
|
|
1413
|
-
case Texture.FIXED_EQUIRECTANGULAR_MIRRORED_MODE:
|
|
1414
|
-
defines.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED = true;
|
|
1415
|
-
break;
|
|
1416
|
-
case Texture.CUBIC_MODE:
|
|
1417
|
-
case Texture.INVCUBIC_MODE:
|
|
1418
|
-
default:
|
|
1419
|
-
defines.REFLECTIONMAP_CUBIC = true;
|
|
1420
|
-
defines.USE_LOCAL_REFLECTIONMAP_CUBIC = reflectionTexture.boundingBoxSize ? true : false;
|
|
1421
|
-
break;
|
|
1422
|
-
}
|
|
1423
|
-
if (reflectionTexture.coordinatesMode !== Texture.SKYBOX_MODE) {
|
|
1424
|
-
if (reflectionTexture.irradianceTexture) {
|
|
1425
|
-
defines.USEIRRADIANCEMAP = true;
|
|
1426
|
-
defines.USESPHERICALFROMREFLECTIONMAP = false;
|
|
1427
|
-
defines.USESPHERICALINVERTEX = false;
|
|
1428
|
-
if (reflectionTexture.irradianceTexture._dominantDirection) {
|
|
1429
|
-
defines.USE_IRRADIANCE_DOMINANT_DIRECTION = true;
|
|
1430
|
-
}
|
|
1431
|
-
}
|
|
1432
|
-
// Assume using spherical polynomial if the reflection texture is a cube map
|
|
1433
|
-
else if (reflectionTexture.isCube) {
|
|
1434
|
-
defines.USESPHERICALFROMREFLECTIONMAP = true;
|
|
1435
|
-
defines.USEIRRADIANCEMAP = false;
|
|
1436
|
-
defines.USE_IRRADIANCE_DOMINANT_DIRECTION = false;
|
|
1437
|
-
if (this._forceIrradianceInFragment ||
|
|
1438
|
-
this.realTimeFiltering ||
|
|
1439
|
-
this._twoSidedLighting ||
|
|
1440
|
-
engine.getCaps().maxVaryingVectors <= 8 ||
|
|
1441
|
-
this._baseDiffuseRoughnessTexture) {
|
|
1442
|
-
defines.USESPHERICALINVERTEX = false;
|
|
1443
|
-
}
|
|
1444
|
-
else {
|
|
1445
|
-
defines.USESPHERICALINVERTEX = true;
|
|
1446
|
-
}
|
|
1447
|
-
}
|
|
1448
|
-
}
|
|
1449
|
-
}
|
|
1450
|
-
else {
|
|
1451
|
-
defines.REFLECTION = false;
|
|
1452
|
-
defines.REFLECTIONMAP_3D = false;
|
|
1453
|
-
defines.REFLECTIONMAP_SPHERICAL = false;
|
|
1454
|
-
defines.REFLECTIONMAP_PLANAR = false;
|
|
1455
|
-
defines.REFLECTIONMAP_CUBIC = false;
|
|
1456
|
-
defines.USE_LOCAL_REFLECTIONMAP_CUBIC = false;
|
|
1457
|
-
defines.REFLECTIONMAP_PROJECTION = false;
|
|
1458
|
-
defines.REFLECTIONMAP_SKYBOX = false;
|
|
1459
|
-
defines.REFLECTIONMAP_EXPLICIT = false;
|
|
1460
|
-
defines.REFLECTIONMAP_EQUIRECTANGULAR = false;
|
|
1461
|
-
defines.REFLECTIONMAP_EQUIRECTANGULAR_FIXED = false;
|
|
1462
|
-
defines.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED = false;
|
|
1463
|
-
defines.INVERTCUBICMAP = false;
|
|
1464
|
-
defines.USESPHERICALFROMREFLECTIONMAP = false;
|
|
1465
|
-
defines.USEIRRADIANCEMAP = false;
|
|
1466
|
-
defines.USE_IRRADIANCE_DOMINANT_DIRECTION = false;
|
|
1467
|
-
defines.USESPHERICALINVERTEX = false;
|
|
1468
|
-
defines.REFLECTIONMAP_OPPOSITEZ = false;
|
|
1469
|
-
defines.LODINREFLECTIONALPHA = false;
|
|
1470
|
-
defines.GAMMAREFLECTION = false;
|
|
1471
|
-
defines.RGBDREFLECTION = false;
|
|
1472
|
-
defines.LINEARSPECULARREFLECTION = false;
|
|
1473
|
-
}
|
|
1290
|
+
const useSHInFragment = this._forceIrradianceInFragment ||
|
|
1291
|
+
this.realTimeFiltering ||
|
|
1292
|
+
this._twoSidedLighting ||
|
|
1293
|
+
engine.getCaps().maxVaryingVectors <= 8 ||
|
|
1294
|
+
this._baseDiffuseRoughnessTexture != null;
|
|
1295
|
+
PrepareDefinesForIBL(scene, reflectionTexture, defines, this.realTimeFiltering, this.realTimeFilteringQuality, !useSHInFragment);
|
|
1474
1296
|
if (this._lightmapTexture && MaterialFlags.LightmapTextureEnabled) {
|
|
1475
1297
|
PrepareDefinesForMergedUV(this._lightmapTexture, defines, "LIGHTMAP");
|
|
1476
1298
|
defines.USELIGHTMAPASSHADOWMAP = this._useLightmapAsShadowmap;
|
|
@@ -1683,10 +1505,6 @@ export class PBRBaseMaterial extends PushMaterial {
|
|
|
1683
1505
|
ubo.addUniform("vLightmapInfos", 2);
|
|
1684
1506
|
ubo.addUniform("vReflectivityInfos", 3);
|
|
1685
1507
|
ubo.addUniform("vMicroSurfaceSamplerInfos", 2);
|
|
1686
|
-
ubo.addUniform("vReflectionInfos", 2);
|
|
1687
|
-
ubo.addUniform("vReflectionFilteringInfo", 2);
|
|
1688
|
-
ubo.addUniform("vReflectionPosition", 3);
|
|
1689
|
-
ubo.addUniform("vReflectionSize", 3);
|
|
1690
1508
|
ubo.addUniform("vBumpInfos", 3);
|
|
1691
1509
|
ubo.addUniform("albedoMatrix", 16);
|
|
1692
1510
|
ubo.addUniform("baseWeightMatrix", 16);
|
|
@@ -1699,14 +1517,10 @@ export class PBRBaseMaterial extends PushMaterial {
|
|
|
1699
1517
|
ubo.addUniform("microSurfaceSamplerMatrix", 16);
|
|
1700
1518
|
ubo.addUniform("bumpMatrix", 16);
|
|
1701
1519
|
ubo.addUniform("vTangentSpaceParams", 2);
|
|
1702
|
-
ubo.addUniform("reflectionMatrix", 16);
|
|
1703
|
-
ubo.addUniform("vReflectionColor", 3);
|
|
1704
1520
|
ubo.addUniform("vAlbedoColor", 4);
|
|
1705
1521
|
ubo.addUniform("baseWeight", 1);
|
|
1706
1522
|
ubo.addUniform("baseDiffuseRoughness", 1);
|
|
1707
1523
|
ubo.addUniform("vLightingIntensity", 4);
|
|
1708
|
-
ubo.addUniform("vReflectionMicrosurfaceInfos", 3);
|
|
1709
|
-
ubo.addUniform("vReflectionDominantDirection", 3);
|
|
1710
1524
|
ubo.addUniform("pointSize", 1);
|
|
1711
1525
|
ubo.addUniform("vReflectivityColor", 4);
|
|
1712
1526
|
ubo.addUniform("vEmissiveColor", 3);
|
|
@@ -1717,25 +1531,8 @@ export class PBRBaseMaterial extends PushMaterial {
|
|
|
1717
1531
|
ubo.addUniform("metallicReflectanceMatrix", 16);
|
|
1718
1532
|
ubo.addUniform("vReflectanceInfos", 2);
|
|
1719
1533
|
ubo.addUniform("reflectanceMatrix", 16);
|
|
1720
|
-
ubo.addUniform("vSphericalL00", 3);
|
|
1721
|
-
ubo.addUniform("vSphericalL1_1", 3);
|
|
1722
|
-
ubo.addUniform("vSphericalL10", 3);
|
|
1723
|
-
ubo.addUniform("vSphericalL11", 3);
|
|
1724
|
-
ubo.addUniform("vSphericalL2_2", 3);
|
|
1725
|
-
ubo.addUniform("vSphericalL2_1", 3);
|
|
1726
|
-
ubo.addUniform("vSphericalL20", 3);
|
|
1727
|
-
ubo.addUniform("vSphericalL21", 3);
|
|
1728
|
-
ubo.addUniform("vSphericalL22", 3);
|
|
1729
|
-
ubo.addUniform("vSphericalX", 3);
|
|
1730
|
-
ubo.addUniform("vSphericalY", 3);
|
|
1731
|
-
ubo.addUniform("vSphericalZ", 3);
|
|
1732
|
-
ubo.addUniform("vSphericalXX_ZZ", 3);
|
|
1733
|
-
ubo.addUniform("vSphericalYY_ZZ", 3);
|
|
1734
|
-
ubo.addUniform("vSphericalZZ", 3);
|
|
1735
|
-
ubo.addUniform("vSphericalXY", 3);
|
|
1736
|
-
ubo.addUniform("vSphericalYZ", 3);
|
|
1737
|
-
ubo.addUniform("vSphericalZX", 3);
|
|
1738
1534
|
ubo.addUniform("cameraInfo", 4);
|
|
1535
|
+
PrepareUniformLayoutForIBL(ubo, true, true, true, true, true);
|
|
1739
1536
|
super.buildUniformLayout();
|
|
1740
1537
|
}
|
|
1741
1538
|
/**
|
|
@@ -1808,54 +1605,6 @@ export class PBRBaseMaterial extends PushMaterial {
|
|
|
1808
1605
|
ubo.updateFloat2("vOpacityInfos", this._opacityTexture.coordinatesIndex, this._opacityTexture.level);
|
|
1809
1606
|
BindTextureMatrix(this._opacityTexture, ubo, "opacity");
|
|
1810
1607
|
}
|
|
1811
|
-
if (reflectionTexture && MaterialFlags.ReflectionTextureEnabled) {
|
|
1812
|
-
ubo.updateMatrix("reflectionMatrix", reflectionTexture.getReflectionTextureMatrix());
|
|
1813
|
-
ubo.updateFloat2("vReflectionInfos", reflectionTexture.level * scene.iblIntensity, 0);
|
|
1814
|
-
if (reflectionTexture.boundingBoxSize) {
|
|
1815
|
-
const cubeTexture = reflectionTexture;
|
|
1816
|
-
ubo.updateVector3("vReflectionPosition", cubeTexture.boundingBoxPosition);
|
|
1817
|
-
ubo.updateVector3("vReflectionSize", cubeTexture.boundingBoxSize);
|
|
1818
|
-
}
|
|
1819
|
-
if (this.realTimeFiltering) {
|
|
1820
|
-
const width = reflectionTexture.getSize().width;
|
|
1821
|
-
ubo.updateFloat2("vReflectionFilteringInfo", width, Math.log2(width));
|
|
1822
|
-
}
|
|
1823
|
-
if (!defines.USEIRRADIANCEMAP) {
|
|
1824
|
-
const polynomials = reflectionTexture.sphericalPolynomial;
|
|
1825
|
-
if (defines.USESPHERICALFROMREFLECTIONMAP && polynomials) {
|
|
1826
|
-
if (defines.SPHERICAL_HARMONICS) {
|
|
1827
|
-
const preScaledHarmonics = polynomials.preScaledHarmonics;
|
|
1828
|
-
ubo.updateVector3("vSphericalL00", preScaledHarmonics.l00);
|
|
1829
|
-
ubo.updateVector3("vSphericalL1_1", preScaledHarmonics.l1_1);
|
|
1830
|
-
ubo.updateVector3("vSphericalL10", preScaledHarmonics.l10);
|
|
1831
|
-
ubo.updateVector3("vSphericalL11", preScaledHarmonics.l11);
|
|
1832
|
-
ubo.updateVector3("vSphericalL2_2", preScaledHarmonics.l2_2);
|
|
1833
|
-
ubo.updateVector3("vSphericalL2_1", preScaledHarmonics.l2_1);
|
|
1834
|
-
ubo.updateVector3("vSphericalL20", preScaledHarmonics.l20);
|
|
1835
|
-
ubo.updateVector3("vSphericalL21", preScaledHarmonics.l21);
|
|
1836
|
-
ubo.updateVector3("vSphericalL22", preScaledHarmonics.l22);
|
|
1837
|
-
}
|
|
1838
|
-
else {
|
|
1839
|
-
ubo.updateFloat3("vSphericalX", polynomials.x.x, polynomials.x.y, polynomials.x.z);
|
|
1840
|
-
ubo.updateFloat3("vSphericalY", polynomials.y.x, polynomials.y.y, polynomials.y.z);
|
|
1841
|
-
ubo.updateFloat3("vSphericalZ", polynomials.z.x, polynomials.z.y, polynomials.z.z);
|
|
1842
|
-
ubo.updateFloat3("vSphericalXX_ZZ", polynomials.xx.x - polynomials.zz.x, polynomials.xx.y - polynomials.zz.y, polynomials.xx.z - polynomials.zz.z);
|
|
1843
|
-
ubo.updateFloat3("vSphericalYY_ZZ", polynomials.yy.x - polynomials.zz.x, polynomials.yy.y - polynomials.zz.y, polynomials.yy.z - polynomials.zz.z);
|
|
1844
|
-
ubo.updateFloat3("vSphericalZZ", polynomials.zz.x, polynomials.zz.y, polynomials.zz.z);
|
|
1845
|
-
ubo.updateFloat3("vSphericalXY", polynomials.xy.x, polynomials.xy.y, polynomials.xy.z);
|
|
1846
|
-
ubo.updateFloat3("vSphericalYZ", polynomials.yz.x, polynomials.yz.y, polynomials.yz.z);
|
|
1847
|
-
ubo.updateFloat3("vSphericalZX", polynomials.zx.x, polynomials.zx.y, polynomials.zx.z);
|
|
1848
|
-
}
|
|
1849
|
-
}
|
|
1850
|
-
}
|
|
1851
|
-
else {
|
|
1852
|
-
// If we're using an irradiance map with a dominant direction assigned, set it.
|
|
1853
|
-
if (defines.USEIRRADIANCEMAP && defines.USE_IRRADIANCE_DOMINANT_DIRECTION) {
|
|
1854
|
-
ubo.updateVector3("vReflectionDominantDirection", reflectionTexture.irradianceTexture._dominantDirection);
|
|
1855
|
-
}
|
|
1856
|
-
}
|
|
1857
|
-
ubo.updateFloat3("vReflectionMicrosurfaceInfos", reflectionTexture.getSize().width, reflectionTexture.lodGenerationScale, reflectionTexture.lodGenerationOffset);
|
|
1858
|
-
}
|
|
1859
1608
|
if (this._emissiveTexture && MaterialFlags.EmissiveTextureEnabled) {
|
|
1860
1609
|
ubo.updateFloat2("vEmissiveInfos", this._emissiveTexture.coordinatesIndex, this._emissiveTexture.level);
|
|
1861
1610
|
BindTextureMatrix(this._emissiveTexture, ubo, "emissive");
|
|
@@ -1896,6 +1645,7 @@ export class PBRBaseMaterial extends PushMaterial {
|
|
|
1896
1645
|
ubo.updateFloat2("vTangentSpaceParams", this._invertNormalMapX ? -1.0 : 1.0, this._invertNormalMapY ? -1.0 : 1.0);
|
|
1897
1646
|
}
|
|
1898
1647
|
}
|
|
1648
|
+
BindIBLParameters(scene, defines, ubo, reflectionTexture, this.realTimeFiltering, true, true, true, true, true, this._reflectionColor);
|
|
1899
1649
|
}
|
|
1900
1650
|
// Point size
|
|
1901
1651
|
if (this.pointsCloud) {
|
|
@@ -1920,7 +1670,6 @@ export class PBRBaseMaterial extends PushMaterial {
|
|
|
1920
1670
|
ubo.updateColor4("vReflectivityColor", this._reflectivityColor, this._microSurface);
|
|
1921
1671
|
}
|
|
1922
1672
|
ubo.updateColor3("vEmissiveColor", MaterialFlags.EmissiveTextureEnabled ? this._emissiveColor : Color3.BlackReadOnly);
|
|
1923
|
-
ubo.updateColor3("vReflectionColor", this._reflectionColor);
|
|
1924
1673
|
if (!defines.SS_REFRACTION && this.subSurface?._linkRefractionWithTransparency) {
|
|
1925
1674
|
ubo.updateColor4("vAlbedoColor", this._albedoColor, 1);
|
|
1926
1675
|
}
|
|
@@ -1957,24 +1706,7 @@ export class PBRBaseMaterial extends PushMaterial {
|
|
|
1957
1706
|
if (this._opacityTexture && MaterialFlags.OpacityTextureEnabled) {
|
|
1958
1707
|
ubo.setTexture("opacitySampler", this._opacityTexture);
|
|
1959
1708
|
}
|
|
1960
|
-
|
|
1961
|
-
if (defines.LODBASEDMICROSFURACE) {
|
|
1962
|
-
ubo.setTexture("reflectionSampler", reflectionTexture);
|
|
1963
|
-
}
|
|
1964
|
-
else {
|
|
1965
|
-
ubo.setTexture("reflectionSampler", reflectionTexture._lodTextureMid || reflectionTexture);
|
|
1966
|
-
ubo.setTexture("reflectionSamplerLow", reflectionTexture._lodTextureLow || reflectionTexture);
|
|
1967
|
-
ubo.setTexture("reflectionSamplerHigh", reflectionTexture._lodTextureHigh || reflectionTexture);
|
|
1968
|
-
}
|
|
1969
|
-
if (defines.USEIRRADIANCEMAP) {
|
|
1970
|
-
ubo.setTexture("irradianceSampler", reflectionTexture.irradianceTexture);
|
|
1971
|
-
}
|
|
1972
|
-
//if realtime filtering and using CDF maps, set them.
|
|
1973
|
-
const cdfGenerator = this.getScene().iblCdfGenerator;
|
|
1974
|
-
if (this.realTimeFiltering && cdfGenerator) {
|
|
1975
|
-
ubo.setTexture("icdfSampler", cdfGenerator.getIcdfTexture());
|
|
1976
|
-
}
|
|
1977
|
-
}
|
|
1709
|
+
BindIBLSamplers(scene, defines, ubo, reflectionTexture, this.realTimeFiltering);
|
|
1978
1710
|
if (defines.ENVIRONMENTBRDF) {
|
|
1979
1711
|
ubo.setTexture("environmentBrdfSampler", this._environmentBRDFTexture);
|
|
1980
1712
|
}
|
|
@@ -2303,9 +2035,6 @@ PBRBaseMaterial.LIGHTFALLOFF_STANDARD = 2;
|
|
|
2303
2035
|
* False by default. This is mostly meant for backward compatibility.
|
|
2304
2036
|
*/
|
|
2305
2037
|
PBRBaseMaterial.ForceGLSL = false;
|
|
2306
|
-
__decorate([
|
|
2307
|
-
serializeAsImageProcessingConfiguration()
|
|
2308
|
-
], PBRBaseMaterial.prototype, "_imageProcessingConfiguration", void 0);
|
|
2309
2038
|
__decorate([
|
|
2310
2039
|
expandToProperty("_markAllSubMeshesAsMiscDirty")
|
|
2311
2040
|
], PBRBaseMaterial.prototype, "debugMode", void 0);
|