@onerjs/core 8.28.3 → 8.28.4
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/Materials/PBR/openPbrMaterial.d.ts +60 -0
- package/Materials/PBR/openPbrMaterial.js +98 -7
- package/Materials/PBR/openPbrMaterial.js.map +1 -1
- package/Misc/brdfTextureTools.d.ts +12 -0
- package/Misc/brdfTextureTools.js +36 -6
- package/Misc/brdfTextureTools.js.map +1 -1
- package/Shaders/ShadersInclude/gaussianSplatting.js +9 -4
- package/Shaders/ShadersInclude/gaussianSplatting.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrBaseLayerData.js +1 -1
- package/Shaders/ShadersInclude/openpbrBaseLayerData.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrDirectLighting.js +10 -2
- package/Shaders/ShadersInclude/openpbrDirectLighting.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrEnvironmentLighting.js +24 -2
- package/Shaders/ShadersInclude/openpbrEnvironmentLighting.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrFragmentDeclaration.js +10 -1
- package/Shaders/ShadersInclude/openpbrFragmentDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrFragmentSamplersDeclaration.js +8 -2
- package/Shaders/ShadersInclude/openpbrFragmentSamplersDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrFuzzLayerData.d.ts +5 -0
- package/Shaders/ShadersInclude/openpbrFuzzLayerData.js +40 -0
- package/Shaders/ShadersInclude/openpbrFuzzLayerData.js.map +1 -0
- package/Shaders/ShadersInclude/openpbrGeometryInfo.js +2 -8
- package/Shaders/ShadersInclude/openpbrGeometryInfo.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrNormalMapFragment.js +1 -1
- package/Shaders/ShadersInclude/openpbrNormalMapFragment.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrNormalMapFragmentMainFunctions.js +1 -1
- package/Shaders/ShadersInclude/openpbrNormalMapFragmentMainFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrNormalMapVertex.js +1 -1
- package/Shaders/ShadersInclude/openpbrNormalMapVertex.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrNormalMapVertexDeclaration.js +1 -1
- package/Shaders/ShadersInclude/openpbrNormalMapVertexDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrUboDeclaration.js +1 -1
- package/Shaders/ShadersInclude/openpbrUboDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrVertexDeclaration.js +9 -0
- package/Shaders/ShadersInclude/openpbrVertexDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBRDFFunctions.js +3 -0
- package/Shaders/ShadersInclude/pbrBRDFFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/pbrDirectLightingFunctions.js +9 -0
- package/Shaders/ShadersInclude/pbrDirectLightingFunctions.js.map +1 -1
- package/Shaders/openpbr.fragment.d.ts +1 -0
- package/Shaders/openpbr.fragment.js +8 -1
- package/Shaders/openpbr.fragment.js.map +1 -1
- package/Shaders/openpbr.vertex.js +6 -0
- package/Shaders/openpbr.vertex.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/gaussianSplatting.js +10 -6
- package/ShadersWGSL/ShadersInclude/gaussianSplatting.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrDirectLighting.js +10 -2
- package/ShadersWGSL/ShadersInclude/openpbrDirectLighting.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrEnvironmentLighting.js +25 -2
- package/ShadersWGSL/ShadersInclude/openpbrEnvironmentLighting.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrFragmentSamplersDeclaration.js +6 -0
- package/ShadersWGSL/ShadersInclude/openpbrFragmentSamplersDeclaration.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrFuzzLayerData.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/openpbrFuzzLayerData.js +40 -0
- package/ShadersWGSL/ShadersInclude/openpbrFuzzLayerData.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/openpbrGeometryInfo.js +2 -8
- package/ShadersWGSL/ShadersInclude/openpbrGeometryInfo.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrNormalMapFragment.js +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrNormalMapFragment.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrNormalMapFragmentMainFunctions.js +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrNormalMapFragmentMainFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrNormalMapVertex.js +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrNormalMapVertex.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrNormalMapVertexDeclaration.js +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrNormalMapVertexDeclaration.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrUboDeclaration.js +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrUboDeclaration.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrBRDFFunctions.js +3 -0
- package/ShadersWGSL/ShadersInclude/pbrBRDFFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrDirectLightingFunctions.js +9 -0
- package/ShadersWGSL/ShadersInclude/pbrDirectLightingFunctions.js.map +1 -1
- package/ShadersWGSL/openpbr.fragment.d.ts +1 -0
- package/ShadersWGSL/openpbr.fragment.js +8 -1
- package/ShadersWGSL/openpbr.fragment.js.map +1 -1
- package/ShadersWGSL/openpbr.vertex.js +6 -0
- package/ShadersWGSL/openpbr.vertex.js.map +1 -1
- package/package.json +1 -1
- package/scene.d.ts +2 -0
- package/scene.js.map +1 -1
|
@@ -85,6 +85,7 @@ export declare class OpenPBRMaterialDefines extends OpenPBRMaterialDefines_base
|
|
|
85
85
|
THIN_FILM_THICKNESS_FROM_THIN_FILM_TEXTURE: boolean;
|
|
86
86
|
ENVIRONMENTBRDF: boolean;
|
|
87
87
|
ENVIRONMENTBRDF_RGBD: boolean;
|
|
88
|
+
FUZZENVIRONMENTBRDF: boolean;
|
|
88
89
|
NORMAL: boolean;
|
|
89
90
|
TANGENT: boolean;
|
|
90
91
|
OBJECTSPACE_NORMALMAP: boolean;
|
|
@@ -92,10 +93,26 @@ export declare class OpenPBRMaterialDefines extends OpenPBRMaterialDefines_base
|
|
|
92
93
|
PARALLAX_RHS: boolean;
|
|
93
94
|
PARALLAXOCCLUSION: boolean;
|
|
94
95
|
NORMALXYSCALE: boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Enables anisotropic logic. Still needed because it's used in pbrHelperFunctions
|
|
98
|
+
*/
|
|
95
99
|
ANISOTROPIC: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* Tells the shader to use OpenPBR's anisotropic roughness remapping
|
|
102
|
+
*/
|
|
96
103
|
ANISOTROPIC_OPENPBR: boolean;
|
|
104
|
+
/**
|
|
105
|
+
* Tells the shader to apply anisotropy to the base layer
|
|
106
|
+
*/
|
|
97
107
|
ANISOTROPIC_BASE: boolean;
|
|
108
|
+
/**
|
|
109
|
+
* Tells the shader to apply anisotropy to the coat layer
|
|
110
|
+
*/
|
|
98
111
|
ANISOTROPIC_COAT: boolean;
|
|
112
|
+
/**
|
|
113
|
+
* Tells the shader to enable the fuzz layer
|
|
114
|
+
*/
|
|
115
|
+
FUZZ: boolean;
|
|
99
116
|
THIN_FILM: boolean;
|
|
100
117
|
IRIDESCENCE: boolean;
|
|
101
118
|
REFLECTION: boolean;
|
|
@@ -424,6 +441,42 @@ export declare class OpenPBRMaterial extends OpenPBRMaterialBase {
|
|
|
424
441
|
* same texture as the coat_weight.
|
|
425
442
|
*/
|
|
426
443
|
useCoatRoughnessFromWeightTexture: boolean;
|
|
444
|
+
/**
|
|
445
|
+
* Defines the weight of the fuzz layer on the surface.
|
|
446
|
+
* See OpenPBR's specs for fuzz_weight
|
|
447
|
+
*/
|
|
448
|
+
fuzzWeight: number;
|
|
449
|
+
private _fuzzWeight;
|
|
450
|
+
/**
|
|
451
|
+
* Weight texture of the fuzz layer.
|
|
452
|
+
* See OpenPBR's specs for fuzz_weight
|
|
453
|
+
*/
|
|
454
|
+
fuzzWeightTexture: Nullable<BaseTexture>;
|
|
455
|
+
private _fuzzWeightTexture;
|
|
456
|
+
/**
|
|
457
|
+
* Defines the color of the fuzz layer on the surface.
|
|
458
|
+
* See OpenPBR's specs for fuzz_color
|
|
459
|
+
*/
|
|
460
|
+
fuzzColor: Color3;
|
|
461
|
+
private _fuzzColor;
|
|
462
|
+
/**
|
|
463
|
+
* Color texture of the fuzz layer.
|
|
464
|
+
* See OpenPBR's specs for fuzz_color
|
|
465
|
+
*/
|
|
466
|
+
fuzzColorTexture: Nullable<BaseTexture>;
|
|
467
|
+
private _fuzzColorTexture;
|
|
468
|
+
/**
|
|
469
|
+
* Defines the roughness of the fuzz layer on the surface.
|
|
470
|
+
* See OpenPBR's specs for fuzz_roughness
|
|
471
|
+
*/
|
|
472
|
+
fuzzRoughness: number;
|
|
473
|
+
private _fuzzRoughness;
|
|
474
|
+
/**
|
|
475
|
+
* Roughness texture of the fuzz layer.
|
|
476
|
+
* See OpenPBR's specs for fuzz_roughness
|
|
477
|
+
*/
|
|
478
|
+
fuzzRoughnessTexture: Nullable<BaseTexture>;
|
|
479
|
+
private _fuzzRoughnessTexture;
|
|
427
480
|
/**
|
|
428
481
|
* Defines the normal of the material's geometry.
|
|
429
482
|
* See OpenPBR's specs for geometry_normal
|
|
@@ -844,6 +897,13 @@ export declare class OpenPBRMaterial extends OpenPBRMaterialBase {
|
|
|
844
897
|
* @internal
|
|
845
898
|
*/
|
|
846
899
|
_environmentBRDFTexture: Nullable<BaseTexture>;
|
|
900
|
+
/**
|
|
901
|
+
* Specifies the environment BRDF texture used to compute the scale and offset roughness values
|
|
902
|
+
* from cos theta and roughness for the fuzz layer:
|
|
903
|
+
* https://github.com/tizian/ltc-sheen?tab=readme-ov-file
|
|
904
|
+
* @internal
|
|
905
|
+
*/
|
|
906
|
+
_environmentFuzzBRDFTexture: Nullable<BaseTexture>;
|
|
847
907
|
/**
|
|
848
908
|
* Force the shader to compute irradiance in the fragment shader in order to take normal mapping into account.
|
|
849
909
|
* @internal
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __decorate } from "../../tslib.es6.js";
|
|
2
2
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
3
3
|
import { serialize, expandToProperty, addAccessorsForMaterialProperty, serializeAsTexture, serializeAsColor3, serializeAsVector2 } from "../../Misc/decorators.js";
|
|
4
|
-
import { GetEnvironmentBRDFTexture } from "../../Misc/brdfTextureTools.js";
|
|
4
|
+
import { GetEnvironmentBRDFTexture, GetEnvironmentFuzzBRDFTexture } from "../../Misc/brdfTextureTools.js";
|
|
5
5
|
import { Scene } from "../../scene.js";
|
|
6
6
|
import { Color3 } from "../../Maths/math.color.js";
|
|
7
7
|
import { ImageProcessingConfiguration } from "../imageProcessingConfiguration.js";
|
|
@@ -181,6 +181,7 @@ export class OpenPBRMaterialDefines extends ImageProcessingDefinesMixin(OpenPBRM
|
|
|
181
181
|
this.THIN_FILM_THICKNESS_FROM_THIN_FILM_TEXTURE = false;
|
|
182
182
|
this.ENVIRONMENTBRDF = false;
|
|
183
183
|
this.ENVIRONMENTBRDF_RGBD = false;
|
|
184
|
+
this.FUZZENVIRONMENTBRDF = false;
|
|
184
185
|
this.NORMAL = false;
|
|
185
186
|
this.TANGENT = false;
|
|
186
187
|
this.OBJECTSPACE_NORMALMAP = false;
|
|
@@ -188,12 +189,28 @@ export class OpenPBRMaterialDefines extends ImageProcessingDefinesMixin(OpenPBRM
|
|
|
188
189
|
this.PARALLAX_RHS = false;
|
|
189
190
|
this.PARALLAXOCCLUSION = false;
|
|
190
191
|
this.NORMALXYSCALE = true;
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
this.
|
|
192
|
+
/**
|
|
193
|
+
* Enables anisotropic logic. Still needed because it's used in pbrHelperFunctions
|
|
194
|
+
*/
|
|
195
|
+
this.ANISOTROPIC = false;
|
|
196
|
+
/**
|
|
197
|
+
* Tells the shader to use OpenPBR's anisotropic roughness remapping
|
|
198
|
+
*/
|
|
199
|
+
this.ANISOTROPIC_OPENPBR = true;
|
|
200
|
+
/**
|
|
201
|
+
* Tells the shader to apply anisotropy to the base layer
|
|
202
|
+
*/
|
|
203
|
+
this.ANISOTROPIC_BASE = false;
|
|
204
|
+
/**
|
|
205
|
+
* Tells the shader to apply anisotropy to the coat layer
|
|
206
|
+
*/
|
|
207
|
+
this.ANISOTROPIC_COAT = false;
|
|
208
|
+
/**
|
|
209
|
+
* Tells the shader to enable the fuzz layer
|
|
210
|
+
*/
|
|
211
|
+
this.FUZZ = false;
|
|
195
212
|
this.THIN_FILM = false; // Enables thin film layer
|
|
196
|
-
this.IRIDESCENCE = false; // Enables iridescence
|
|
213
|
+
this.IRIDESCENCE = false; // Enables legacy iridescence code
|
|
197
214
|
this.REFLECTION = false;
|
|
198
215
|
this.REFLECTIONMAP_3D = false;
|
|
199
216
|
this.REFLECTIONMAP_SPHERICAL = false;
|
|
@@ -483,6 +500,12 @@ export class OpenPBRMaterial extends OpenPBRMaterialBase {
|
|
|
483
500
|
* same texture as the coat_weight.
|
|
484
501
|
*/
|
|
485
502
|
this.useCoatRoughnessFromWeightTexture = false;
|
|
503
|
+
this._fuzzWeight = new Property("fuzz_weight", 0.0, "vFuzzWeight", 1, 0);
|
|
504
|
+
this._fuzzWeightTexture = new Sampler("fuzz_weight", "fuzzWeight", "FUZZ_WEIGHT");
|
|
505
|
+
this._fuzzColor = new Property("fuzz_color", Color3.White(), "vFuzzColor", 3, 0);
|
|
506
|
+
this._fuzzColorTexture = new Sampler("fuzz_color", "fuzzColor", "FUZZ_COLOR");
|
|
507
|
+
this._fuzzRoughness = new Property("fuzz_roughness", 0.5, "vFuzzRoughness", 1, 0);
|
|
508
|
+
this._fuzzRoughnessTexture = new Sampler("fuzz_roughness", "fuzzRoughness", "FUZZ_ROUGHNESS");
|
|
486
509
|
this._geometryNormalTexture = new Sampler("geometry_normal", "geometryNormal", "GEOMETRY_NORMAL");
|
|
487
510
|
this._geometryTangent = new Property("geometry_tangent", new Vector2(1, 0), "vSpecularAnisotropy", 3, 0);
|
|
488
511
|
this._geometryTangentTexture = new Sampler("geometry_tangent", "geometryTangent", "GEOMETRY_TANGENT");
|
|
@@ -775,6 +798,13 @@ export class OpenPBRMaterial extends OpenPBRMaterialBase {
|
|
|
775
798
|
* @internal
|
|
776
799
|
*/
|
|
777
800
|
this._environmentBRDFTexture = null;
|
|
801
|
+
/**
|
|
802
|
+
* Specifies the environment BRDF texture used to compute the scale and offset roughness values
|
|
803
|
+
* from cos theta and roughness for the fuzz layer:
|
|
804
|
+
* https://github.com/tizian/ltc-sheen?tab=readme-ov-file
|
|
805
|
+
* @internal
|
|
806
|
+
*/
|
|
807
|
+
this._environmentFuzzBRDFTexture = null;
|
|
778
808
|
/**
|
|
779
809
|
* Force the shader to compute irradiance in the fragment shader in order to take normal mapping into account.
|
|
780
810
|
* @internal
|
|
@@ -858,6 +888,7 @@ export class OpenPBRMaterial extends OpenPBRMaterialBase {
|
|
|
858
888
|
return this._renderTargets;
|
|
859
889
|
};
|
|
860
890
|
this._environmentBRDFTexture = GetEnvironmentBRDFTexture(this.getScene());
|
|
891
|
+
this._environmentFuzzBRDFTexture = GetEnvironmentFuzzBRDFTexture(this.getScene());
|
|
861
892
|
this.prePassConfiguration = new PrePassConfiguration();
|
|
862
893
|
// Build the internal property list that can be used to generate and update the uniform buffer
|
|
863
894
|
this._propertyList = {};
|
|
@@ -927,6 +958,12 @@ export class OpenPBRMaterial extends OpenPBRMaterialBase {
|
|
|
927
958
|
this._coatIor;
|
|
928
959
|
this._coatDarkening;
|
|
929
960
|
this._coatDarkeningTexture;
|
|
961
|
+
this._fuzzWeight;
|
|
962
|
+
this._fuzzWeightTexture;
|
|
963
|
+
this._fuzzColor;
|
|
964
|
+
this._fuzzColorTexture;
|
|
965
|
+
this._fuzzRoughness;
|
|
966
|
+
this._fuzzRoughnessTexture;
|
|
930
967
|
this._geometryNormalTexture;
|
|
931
968
|
this._geometryTangent;
|
|
932
969
|
this._geometryTangentTexture;
|
|
@@ -1141,6 +1178,12 @@ export class OpenPBRMaterial extends OpenPBRMaterialBase {
|
|
|
1141
1178
|
return false;
|
|
1142
1179
|
}
|
|
1143
1180
|
}
|
|
1181
|
+
if (this._environmentFuzzBRDFTexture && MaterialFlags.ReflectionTextureEnabled) {
|
|
1182
|
+
// This is blocking.
|
|
1183
|
+
if (!this._environmentFuzzBRDFTexture.isReady()) {
|
|
1184
|
+
return false;
|
|
1185
|
+
}
|
|
1186
|
+
}
|
|
1144
1187
|
if (OpenPBRMaterial._noiseTextures[scene.uniqueId]) {
|
|
1145
1188
|
if (!OpenPBRMaterial._noiseTextures[scene.uniqueId].isReady()) {
|
|
1146
1189
|
return false;
|
|
@@ -1339,7 +1382,10 @@ export class OpenPBRMaterial extends OpenPBRMaterialBase {
|
|
|
1339
1382
|
if (defines.ENVIRONMENTBRDF) {
|
|
1340
1383
|
ubo.setTexture("environmentBrdfSampler", this._environmentBRDFTexture);
|
|
1341
1384
|
}
|
|
1342
|
-
if (defines.
|
|
1385
|
+
if (defines.FUZZENVIRONMENTBRDF) {
|
|
1386
|
+
ubo.setTexture("environmentFuzzBrdfSampler", this._environmentFuzzBRDFTexture);
|
|
1387
|
+
}
|
|
1388
|
+
if (defines.ANISOTROPIC || defines.FUZZ) {
|
|
1343
1389
|
ubo.setTexture("blueNoiseSampler", OpenPBRMaterial._noiseTextures[this.getScene().uniqueId]);
|
|
1344
1390
|
}
|
|
1345
1391
|
}
|
|
@@ -1460,6 +1506,9 @@ export class OpenPBRMaterial extends OpenPBRMaterialBase {
|
|
|
1460
1506
|
if (this._environmentBRDFTexture && this.getScene().environmentBRDFTexture !== this._environmentBRDFTexture) {
|
|
1461
1507
|
this._environmentBRDFTexture.dispose();
|
|
1462
1508
|
}
|
|
1509
|
+
if (this._environmentFuzzBRDFTexture && this.getScene().environmentFuzzBRDFTexture !== this._environmentFuzzBRDFTexture) {
|
|
1510
|
+
this._environmentFuzzBRDFTexture.dispose();
|
|
1511
|
+
}
|
|
1463
1512
|
// Loop through samplers and dispose the textures
|
|
1464
1513
|
for (const key in this._samplersList) {
|
|
1465
1514
|
const sampler = this._samplersList[key];
|
|
@@ -1484,6 +1533,9 @@ export class OpenPBRMaterial extends OpenPBRMaterialBase {
|
|
|
1484
1533
|
return this.getScene().environmentTexture;
|
|
1485
1534
|
}
|
|
1486
1535
|
_prepareEffect(mesh, renderingMesh, defines, onCompiled = null, onError = null, useInstances = null, useClipPlane = null) {
|
|
1536
|
+
if (this.fuzzWeight > 0) {
|
|
1537
|
+
this._environmentFuzzBRDFTexture = GetEnvironmentFuzzBRDFTexture(this.getScene());
|
|
1538
|
+
}
|
|
1487
1539
|
this._prepareDefines(mesh, renderingMesh, defines, useInstances, useClipPlane);
|
|
1488
1540
|
if (!defines.isDirty) {
|
|
1489
1541
|
return null;
|
|
@@ -1593,6 +1645,7 @@ export class OpenPBRMaterial extends OpenPBRMaterialBase {
|
|
|
1593
1645
|
}
|
|
1594
1646
|
const samplers = [
|
|
1595
1647
|
"environmentBrdfSampler",
|
|
1648
|
+
"environmentFuzzBrdfSampler",
|
|
1596
1649
|
"blueNoiseSampler",
|
|
1597
1650
|
"boneSampler",
|
|
1598
1651
|
"morphTargets",
|
|
@@ -1747,6 +1800,12 @@ export class OpenPBRMaterial extends OpenPBRMaterialBase {
|
|
|
1747
1800
|
defines.ENVIRONMENTBRDF = false;
|
|
1748
1801
|
defines.ENVIRONMENTBRDF_RGBD = false;
|
|
1749
1802
|
}
|
|
1803
|
+
if (this._environmentFuzzBRDFTexture) {
|
|
1804
|
+
defines.FUZZENVIRONMENTBRDF = true;
|
|
1805
|
+
}
|
|
1806
|
+
else {
|
|
1807
|
+
defines.FUZZENVIRONMENTBRDF = false;
|
|
1808
|
+
}
|
|
1750
1809
|
if (this._shouldUseAlphaFromBaseColorTexture()) {
|
|
1751
1810
|
defines.ALPHA_FROM_BASE_COLOR_TEXTURE = true;
|
|
1752
1811
|
}
|
|
@@ -1812,6 +1871,14 @@ export class OpenPBRMaterial extends OpenPBRMaterialBase {
|
|
|
1812
1871
|
}
|
|
1813
1872
|
defines.THIN_FILM = this.thinFilmWeight > 0.0;
|
|
1814
1873
|
defines.IRIDESCENCE = this.thinFilmWeight > 0.0;
|
|
1874
|
+
if (this.fuzzWeight > 0 && MaterialFlags.ReflectionTextureEnabled) {
|
|
1875
|
+
defines.FUZZ = true;
|
|
1876
|
+
if (!mesh.isVerticesDataPresent(VertexBuffer.TangentKind)) {
|
|
1877
|
+
defines._needUVs = true;
|
|
1878
|
+
defines.MAINUV1 = true;
|
|
1879
|
+
}
|
|
1880
|
+
this._environmentFuzzBRDFTexture = GetEnvironmentFuzzBRDFTexture(this.getScene());
|
|
1881
|
+
}
|
|
1815
1882
|
// Misc.
|
|
1816
1883
|
if (defines._areMiscDirty) {
|
|
1817
1884
|
PrepareDefinesForMisc(mesh, scene, this._useLogarithmicDepth, this.pointsCloud, this.fogEnabled, this.needAlphaTestingForMesh(mesh), defines, this._applyDecalMapAfterDetailMap, this._useVertexPulling, renderingMesh, this._setVertexOutputInvariant);
|
|
@@ -2035,6 +2102,30 @@ __decorate([
|
|
|
2035
2102
|
__decorate([
|
|
2036
2103
|
serialize()
|
|
2037
2104
|
], OpenPBRMaterial.prototype, "useCoatRoughnessFromWeightTexture", void 0);
|
|
2105
|
+
__decorate([
|
|
2106
|
+
addAccessorsForMaterialProperty("_markAllSubMeshesAsTexturesDirty", "fuzzWeight")
|
|
2107
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2108
|
+
], OpenPBRMaterial.prototype, "_fuzzWeight", void 0);
|
|
2109
|
+
__decorate([
|
|
2110
|
+
addAccessorsForMaterialProperty("_markAllSubMeshesAsTexturesDirty", "fuzzWeightTexture")
|
|
2111
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2112
|
+
], OpenPBRMaterial.prototype, "_fuzzWeightTexture", void 0);
|
|
2113
|
+
__decorate([
|
|
2114
|
+
addAccessorsForMaterialProperty("_markAllSubMeshesAsTexturesDirty", "fuzzColor")
|
|
2115
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2116
|
+
], OpenPBRMaterial.prototype, "_fuzzColor", void 0);
|
|
2117
|
+
__decorate([
|
|
2118
|
+
addAccessorsForMaterialProperty("_markAllSubMeshesAsTexturesDirty", "fuzzColorTexture")
|
|
2119
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2120
|
+
], OpenPBRMaterial.prototype, "_fuzzColorTexture", void 0);
|
|
2121
|
+
__decorate([
|
|
2122
|
+
addAccessorsForMaterialProperty("_markAllSubMeshesAsTexturesDirty", "fuzzRoughness")
|
|
2123
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2124
|
+
], OpenPBRMaterial.prototype, "_fuzzRoughness", void 0);
|
|
2125
|
+
__decorate([
|
|
2126
|
+
addAccessorsForMaterialProperty("_markAllSubMeshesAsTexturesDirty", "fuzzRoughnessTexture")
|
|
2127
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2128
|
+
], OpenPBRMaterial.prototype, "_fuzzRoughnessTexture", void 0);
|
|
2038
2129
|
__decorate([
|
|
2039
2130
|
serializeAsTexture()
|
|
2040
2131
|
], OpenPBRMaterial.prototype, "geometryNormalTexture", void 0);
|