@babylonjs/core 7.44.1 → 7.45.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/Engines/abstractEngine.js +2 -2
- package/Engines/abstractEngine.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/Misc/error.d.ts +6 -0
- package/Misc/error.js +10 -0
- package/Misc/error.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBlockReflection.js +7 -1
- package/Shaders/ShadersInclude/pbrBlockReflection.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/ShadersWGSL/ShadersInclude/pbrBlockReflection.js +7 -1
- package/ShadersWGSL/ShadersInclude/pbrBlockReflection.js.map +1 -1
- package/ShadersWGSL/glowMapGeneration.fragment.js +1 -2
- package/ShadersWGSL/glowMapGeneration.fragment.js.map +1 -1
- package/ShadersWGSL/layer.fragment.js +1 -2
- package/ShadersWGSL/layer.fragment.js.map +1 -1
- package/XR/features/WebXRHandTracking.js +2 -2
- package/XR/features/WebXRHandTracking.js.map +1 -1
- package/package.json +1 -1
|
@@ -9,6 +9,7 @@ export declare class MaterialBRDFDefines extends MaterialDefines {
|
|
|
9
9
|
MS_BRDF_ENERGY_CONSERVATION: boolean;
|
|
10
10
|
SPHERICAL_HARMONICS: boolean;
|
|
11
11
|
SPECULAR_GLOSSINESS_ENERGY_CONSERVATION: boolean;
|
|
12
|
+
MIX_IBL_RADIANCE_WITH_IRRADIANCE: boolean;
|
|
12
13
|
}
|
|
13
14
|
/**
|
|
14
15
|
* Plugin that implements the BRDF component of the PBR material
|
|
@@ -36,6 +37,12 @@ export declare class PBRBRDFConfiguration extends MaterialPluginBase {
|
|
|
36
37
|
* If deactivated, a material is only physically plausible, when (albedo color + specular color) < 1.
|
|
37
38
|
*/
|
|
38
39
|
static DEFAULT_USE_SPECULAR_GLOSSINESS_INPUT_ENERGY_CONSERVATION: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Default value for whether IBL irradiance is used to augment rough radiance.
|
|
42
|
+
* If activated, irradiance is blended into the radiance contribution when the material is rough.
|
|
43
|
+
* This better approximates raytracing results for rough surfaces.
|
|
44
|
+
*/
|
|
45
|
+
static DEFAULT_MIX_IBL_RADIANCE_WITH_IRRADIANCE: boolean;
|
|
39
46
|
private _useEnergyConservation;
|
|
40
47
|
/**
|
|
41
48
|
* Defines if the material uses energy conservation.
|
|
@@ -68,6 +75,13 @@ export declare class PBRBRDFConfiguration extends MaterialPluginBase {
|
|
|
68
75
|
* In the deactivated case, the material author has to ensure energy conservation, for a physically plausible rendering.
|
|
69
76
|
*/
|
|
70
77
|
useSpecularGlossinessInputEnergyConservation: boolean;
|
|
78
|
+
private _mixIblRadianceWithIrradiance;
|
|
79
|
+
/**
|
|
80
|
+
* Defines if IBL irradiance is used to augment rough radiance.
|
|
81
|
+
* If activated, irradiance is blended into the radiance contribution when the material is rough.
|
|
82
|
+
* This better approximates raytracing results for rough surfaces.
|
|
83
|
+
*/
|
|
84
|
+
mixIblRadianceWithIrradiance: boolean;
|
|
71
85
|
/** @internal */
|
|
72
86
|
private _internalMarkAllSubMeshesAsMiscDirty;
|
|
73
87
|
/** @internal */
|
|
@@ -14,6 +14,7 @@ export class MaterialBRDFDefines extends MaterialDefines {
|
|
|
14
14
|
this.MS_BRDF_ENERGY_CONSERVATION = false;
|
|
15
15
|
this.SPHERICAL_HARMONICS = false;
|
|
16
16
|
this.SPECULAR_GLOSSINESS_ENERGY_CONSERVATION = false;
|
|
17
|
+
this.MIX_IBL_RADIANCE_WITH_IRRADIANCE = true;
|
|
17
18
|
}
|
|
18
19
|
}
|
|
19
20
|
/**
|
|
@@ -65,6 +66,13 @@ export class PBRBRDFConfiguration extends MaterialPluginBase {
|
|
|
65
66
|
* In the deactivated case, the material author has to ensure energy conservation, for a physically plausible rendering.
|
|
66
67
|
*/
|
|
67
68
|
this.useSpecularGlossinessInputEnergyConservation = PBRBRDFConfiguration.DEFAULT_USE_SPECULAR_GLOSSINESS_INPUT_ENERGY_CONSERVATION;
|
|
69
|
+
this._mixIblRadianceWithIrradiance = PBRBRDFConfiguration.DEFAULT_MIX_IBL_RADIANCE_WITH_IRRADIANCE;
|
|
70
|
+
/**
|
|
71
|
+
* Defines if IBL irradiance is used to augment rough radiance.
|
|
72
|
+
* If activated, irradiance is blended into the radiance contribution when the material is rough.
|
|
73
|
+
* This better approximates raytracing results for rough surfaces.
|
|
74
|
+
*/
|
|
75
|
+
this.mixIblRadianceWithIrradiance = PBRBRDFConfiguration.DEFAULT_MIX_IBL_RADIANCE_WITH_IRRADIANCE;
|
|
68
76
|
this._internalMarkAllSubMeshesAsMiscDirty = material._dirtyCallbacks[16];
|
|
69
77
|
this._enable(true);
|
|
70
78
|
}
|
|
@@ -73,6 +81,7 @@ export class PBRBRDFConfiguration extends MaterialPluginBase {
|
|
|
73
81
|
defines.MS_BRDF_ENERGY_CONSERVATION = this._useEnergyConservation && this._useSmithVisibilityHeightCorrelated;
|
|
74
82
|
defines.SPHERICAL_HARMONICS = this._useSphericalHarmonics;
|
|
75
83
|
defines.SPECULAR_GLOSSINESS_ENERGY_CONSERVATION = this._useSpecularGlossinessInputEnergyConservation;
|
|
84
|
+
defines.MIX_IBL_RADIANCE_WITH_IRRADIANCE = this._mixIblRadianceWithIrradiance;
|
|
76
85
|
}
|
|
77
86
|
getClassName() {
|
|
78
87
|
return "PBRBRDFConfiguration";
|
|
@@ -100,6 +109,12 @@ PBRBRDFConfiguration.DEFAULT_USE_SPHERICAL_HARMONICS = true;
|
|
|
100
109
|
* If deactivated, a material is only physically plausible, when (albedo color + specular color) < 1.
|
|
101
110
|
*/
|
|
102
111
|
PBRBRDFConfiguration.DEFAULT_USE_SPECULAR_GLOSSINESS_INPUT_ENERGY_CONSERVATION = true;
|
|
112
|
+
/**
|
|
113
|
+
* Default value for whether IBL irradiance is used to augment rough radiance.
|
|
114
|
+
* If activated, irradiance is blended into the radiance contribution when the material is rough.
|
|
115
|
+
* This better approximates raytracing results for rough surfaces.
|
|
116
|
+
*/
|
|
117
|
+
PBRBRDFConfiguration.DEFAULT_MIX_IBL_RADIANCE_WITH_IRRADIANCE = true;
|
|
103
118
|
__decorate([
|
|
104
119
|
serialize(),
|
|
105
120
|
expandToProperty("_markAllSubMeshesAsMiscDirty")
|
|
@@ -116,4 +131,8 @@ __decorate([
|
|
|
116
131
|
serialize(),
|
|
117
132
|
expandToProperty("_markAllSubMeshesAsMiscDirty")
|
|
118
133
|
], PBRBRDFConfiguration.prototype, "useSpecularGlossinessInputEnergyConservation", void 0);
|
|
134
|
+
__decorate([
|
|
135
|
+
serialize(),
|
|
136
|
+
expandToProperty("_markAllSubMeshesAsMiscDirty")
|
|
137
|
+
], PBRBRDFConfiguration.prototype, "mixIblRadianceWithIrradiance", void 0);
|
|
119
138
|
//# sourceMappingURL=pbrBRDFConfiguration.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pbrBRDFConfiguration.js","sourceRoot":"","sources":["../../../../../dev/core/src/Materials/PBR/pbrBRDFConfiguration.ts"],"names":[],"mappings":";AAAA,yDAAyD;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAG3D;;GAEG;AACH,MAAM,OAAO,mBAAoB,SAAQ,eAAe;IAAxD;;QACI,6BAAwB,GAAG,KAAK,CAAC;QACjC,gCAA2B,GAAG,KAAK,CAAC;QACpC,wBAAmB,GAAG,KAAK,CAAC;QAC5B,4CAAuC,GAAG,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"pbrBRDFConfiguration.js","sourceRoot":"","sources":["../../../../../dev/core/src/Materials/PBR/pbrBRDFConfiguration.ts"],"names":[],"mappings":";AAAA,yDAAyD;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAG3D;;GAEG;AACH,MAAM,OAAO,mBAAoB,SAAQ,eAAe;IAAxD;;QACI,6BAAwB,GAAG,KAAK,CAAC;QACjC,gCAA2B,GAAG,KAAK,CAAC;QACpC,wBAAmB,GAAG,KAAK,CAAC;QAC5B,4CAAuC,GAAG,KAAK,CAAC;QAChD,qCAAgC,GAAG,IAAI,CAAC;IAC5C,CAAC;CAAA;AAED;;GAEG;AACH,MAAM,OAAO,oBAAqB,SAAQ,kBAAkB;IA2FxD,gBAAgB;IACT,4BAA4B;QAC/B,IAAI,CAAC,oCAAoC,EAAE,CAAC;IAChD,CAAC;IAED;;;OAGG;IACa,YAAY;QACxB,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,YAAY,QAAyB,EAAE,eAAe,GAAG,IAAI;QACzD,KAAK,CAAC,QAAQ,EAAE,SAAS,EAAE,EAAE,EAAE,IAAI,mBAAmB,EAAE,EAAE,eAAe,CAAC,CAAC;QAvEvE,2BAAsB,GAAG,oBAAoB,CAAC,+BAA+B,CAAC;QACtF;;WAEG;QAGI,0BAAqB,GAAG,oBAAoB,CAAC,+BAA+B,CAAC;QAE5E,wCAAmC,GAAG,oBAAoB,CAAC,8CAA8C,CAAC;QAClH;;;;;;;WAOG;QAGI,uCAAkC,GAAG,oBAAoB,CAAC,8CAA8C,CAAC;QAExG,2BAAsB,GAAG,oBAAoB,CAAC,+BAA+B,CAAC;QACtF;;;;;;WAMG;QAGI,0BAAqB,GAAG,oBAAoB,CAAC,+BAA+B,CAAC;QAE5E,kDAA6C,GAAG,oBAAoB,CAAC,yDAAyD,CAAC;QACvI;;;;;WAKG;QAGI,iDAA4C,GAAG,oBAAoB,CAAC,yDAAyD,CAAC;QAE7H,kCAA6B,GAAG,oBAAoB,CAAC,wCAAwC,CAAC;QACtG;;;;WAIG;QAGI,iCAA4B,GAAG,oBAAoB,CAAC,wCAAwC,CAAC;QAqBhG,IAAI,CAAC,oCAAoC,GAAG,QAAQ,CAAC,eAAe,CAAC,SAAS,CAAC,sBAAsB,CAAC,CAAC;QACvG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,CAAC;IAEe,cAAc,CAAC,OAA4B;QACvD,OAAO,CAAC,wBAAwB,GAAG,IAAI,CAAC,mCAAmC,CAAC;QAC5E,OAAO,CAAC,2BAA2B,GAAG,IAAI,CAAC,sBAAsB,IAAI,IAAI,CAAC,mCAAmC,CAAC;QAC9G,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC,sBAAsB,CAAC;QAC1D,OAAO,CAAC,uCAAuC,GAAG,IAAI,CAAC,6CAA6C,CAAC;QACrG,OAAO,CAAC,gCAAgC,GAAG,IAAI,CAAC,6BAA6B,CAAC;IAClF,CAAC;IAEe,YAAY;QACxB,OAAO,sBAAsB,CAAC;IAClC,CAAC;;AAxHD;;;GAGG;AACW,oDAA+B,GAAG,IAAI,AAAP,CAAQ;AAErD;;;GAGG;AACW,mEAA8C,GAAG,IAAI,AAAP,CAAQ;AAEpE;;;;GAIG;AACW,oDAA+B,GAAG,IAAI,AAAP,CAAQ;AAErD;;;;GAIG;AACW,8EAAyD,GAAG,IAAI,AAAP,CAAQ;AAE/E;;;;GAIG;AACW,6DAAwC,GAAG,IAAI,AAAP,CAAQ;AAQvD;IAFN,SAAS,EAAE;IACX,gBAAgB,CAAC,8BAA8B,CAAC;mEACmC;AAa7E;IAFN,SAAS,EAAE;IACX,gBAAgB,CAAC,8BAA8B,CAAC;gFAC+D;AAYzG;IAFN,SAAS,EAAE;IACX,gBAAgB,CAAC,8BAA8B,CAAC;mEACmC;AAW7E;IAFN,SAAS,EAAE;IACX,gBAAgB,CAAC,8BAA8B,CAAC;0FACoF;AAU9H;IAFN,SAAS,EAAE;IACX,gBAAgB,CAAC,8BAA8B,CAAC;0EACmD","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\r\nimport { Constants } from \"../../Engines/constants\";\r\nimport { serialize, expandToProperty } from \"../../Misc/decorators\";\r\nimport { MaterialDefines } from \"../materialDefines\";\r\nimport { MaterialPluginBase } from \"../materialPluginBase\";\r\nimport type { PBRBaseMaterial } from \"./pbrBaseMaterial\";\r\n\r\n/**\r\n * @internal\r\n */\r\nexport class MaterialBRDFDefines extends MaterialDefines {\r\n BRDF_V_HEIGHT_CORRELATED = false;\r\n MS_BRDF_ENERGY_CONSERVATION = false;\r\n SPHERICAL_HARMONICS = false;\r\n SPECULAR_GLOSSINESS_ENERGY_CONSERVATION = false;\r\n MIX_IBL_RADIANCE_WITH_IRRADIANCE = true;\r\n}\r\n\r\n/**\r\n * Plugin that implements the BRDF component of the PBR material\r\n */\r\nexport class PBRBRDFConfiguration extends MaterialPluginBase {\r\n /**\r\n * Default value used for the energy conservation.\r\n * This should only be changed to adapt to the type of texture in scene.environmentBRDFTexture.\r\n */\r\n public static DEFAULT_USE_ENERGY_CONSERVATION = true;\r\n\r\n /**\r\n * Default value used for the Smith Visibility Height Correlated mode.\r\n * This should only be changed to adapt to the type of texture in scene.environmentBRDFTexture.\r\n */\r\n public static DEFAULT_USE_SMITH_VISIBILITY_HEIGHT_CORRELATED = true;\r\n\r\n /**\r\n * Default value used for the IBL diffuse part.\r\n * This can help switching back to the polynomials mode globally which is a tiny bit\r\n * less GPU intensive at the drawback of a lower quality.\r\n */\r\n public static DEFAULT_USE_SPHERICAL_HARMONICS = true;\r\n\r\n /**\r\n * Default value used for activating energy conservation for the specular workflow.\r\n * If activated, the albedo color is multiplied with (1. - maxChannel(specular color)).\r\n * If deactivated, a material is only physically plausible, when (albedo color + specular color) < 1.\r\n */\r\n public static DEFAULT_USE_SPECULAR_GLOSSINESS_INPUT_ENERGY_CONSERVATION = true;\r\n\r\n /**\r\n * Default value for whether IBL irradiance is used to augment rough radiance.\r\n * If activated, irradiance is blended into the radiance contribution when the material is rough.\r\n * This better approximates raytracing results for rough surfaces.\r\n */\r\n public static DEFAULT_MIX_IBL_RADIANCE_WITH_IRRADIANCE = true;\r\n\r\n private _useEnergyConservation = PBRBRDFConfiguration.DEFAULT_USE_ENERGY_CONSERVATION;\r\n /**\r\n * Defines if the material uses energy conservation.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsMiscDirty\")\r\n public useEnergyConservation = PBRBRDFConfiguration.DEFAULT_USE_ENERGY_CONSERVATION;\r\n\r\n private _useSmithVisibilityHeightCorrelated = PBRBRDFConfiguration.DEFAULT_USE_SMITH_VISIBILITY_HEIGHT_CORRELATED;\r\n /**\r\n * LEGACY Mode set to false\r\n * Defines if the material uses height smith correlated visibility term.\r\n * If you intent to not use our default BRDF, you need to load a separate BRDF Texture for the PBR\r\n * You can either load https://assets.babylonjs.com/environments/uncorrelatedBRDF.png\r\n * or https://assets.babylonjs.com/environments/uncorrelatedBRDF.dds to have more precision\r\n * Not relying on height correlated will also disable energy conservation.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsMiscDirty\")\r\n public useSmithVisibilityHeightCorrelated = PBRBRDFConfiguration.DEFAULT_USE_SMITH_VISIBILITY_HEIGHT_CORRELATED;\r\n\r\n private _useSphericalHarmonics = PBRBRDFConfiguration.DEFAULT_USE_SPHERICAL_HARMONICS;\r\n /**\r\n * LEGACY Mode set to false\r\n * Defines if the material uses spherical harmonics vs spherical polynomials for the\r\n * diffuse part of the IBL.\r\n * The harmonics despite a tiny bigger cost has been proven to provide closer results\r\n * to the ground truth.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsMiscDirty\")\r\n public useSphericalHarmonics = PBRBRDFConfiguration.DEFAULT_USE_SPHERICAL_HARMONICS;\r\n\r\n private _useSpecularGlossinessInputEnergyConservation = PBRBRDFConfiguration.DEFAULT_USE_SPECULAR_GLOSSINESS_INPUT_ENERGY_CONSERVATION;\r\n /**\r\n * Defines if the material uses energy conservation, when the specular workflow is active.\r\n * If activated, the albedo color is multiplied with (1. - maxChannel(specular color)).\r\n * If deactivated, a material is only physically plausible, when (albedo color + specular color) < 1.\r\n * In the deactivated case, the material author has to ensure energy conservation, for a physically plausible rendering.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsMiscDirty\")\r\n public useSpecularGlossinessInputEnergyConservation = PBRBRDFConfiguration.DEFAULT_USE_SPECULAR_GLOSSINESS_INPUT_ENERGY_CONSERVATION;\r\n\r\n private _mixIblRadianceWithIrradiance = PBRBRDFConfiguration.DEFAULT_MIX_IBL_RADIANCE_WITH_IRRADIANCE;\r\n /**\r\n * Defines if IBL irradiance is used to augment rough radiance.\r\n * If activated, irradiance is blended into the radiance contribution when the material is rough.\r\n * This better approximates raytracing results for rough surfaces.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsMiscDirty\")\r\n public mixIblRadianceWithIrradiance = PBRBRDFConfiguration.DEFAULT_MIX_IBL_RADIANCE_WITH_IRRADIANCE;\r\n\r\n /** @internal */\r\n private _internalMarkAllSubMeshesAsMiscDirty: () => void;\r\n\r\n /** @internal */\r\n public _markAllSubMeshesAsMiscDirty(): void {\r\n this._internalMarkAllSubMeshesAsMiscDirty();\r\n }\r\n\r\n /**\r\n * Gets a boolean indicating that the plugin is compatible with a given shader language.\r\n * @returns true if the plugin is compatible with the shader language\r\n */\r\n public override isCompatible(): boolean {\r\n return true;\r\n }\r\n\r\n constructor(material: PBRBaseMaterial, addToPluginList = true) {\r\n super(material, \"PBRBRDF\", 90, new MaterialBRDFDefines(), addToPluginList);\r\n\r\n this._internalMarkAllSubMeshesAsMiscDirty = material._dirtyCallbacks[Constants.MATERIAL_MiscDirtyFlag];\r\n this._enable(true);\r\n }\r\n\r\n public override prepareDefines(defines: MaterialBRDFDefines): void {\r\n defines.BRDF_V_HEIGHT_CORRELATED = this._useSmithVisibilityHeightCorrelated;\r\n defines.MS_BRDF_ENERGY_CONSERVATION = this._useEnergyConservation && this._useSmithVisibilityHeightCorrelated;\r\n defines.SPHERICAL_HARMONICS = this._useSphericalHarmonics;\r\n defines.SPECULAR_GLOSSINESS_ENERGY_CONSERVATION = this._useSpecularGlossinessInputEnergyConservation;\r\n defines.MIX_IBL_RADIANCE_WITH_IRRADIANCE = this._mixIblRadianceWithIrradiance;\r\n }\r\n\r\n public override getClassName(): string {\r\n return \"PBRBRDFConfiguration\";\r\n }\r\n}\r\n"]}
|
package/Misc/error.d.ts
CHANGED
|
@@ -49,3 +49,9 @@ export declare class RuntimeError extends BaseError {
|
|
|
49
49
|
*/
|
|
50
50
|
constructor(message: string, errorCode: ErrorCodesType, innerError?: Error);
|
|
51
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* Used for flow control when an operation is aborted, such as with AbortController.
|
|
54
|
+
*/
|
|
55
|
+
export declare class AbortError extends BaseError {
|
|
56
|
+
constructor(message?: string);
|
|
57
|
+
}
|
package/Misc/error.js
CHANGED
|
@@ -57,4 +57,14 @@ export class RuntimeError extends BaseError {
|
|
|
57
57
|
BaseError._setPrototypeOf(this, RuntimeError.prototype);
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
+
/**
|
|
61
|
+
* Used for flow control when an operation is aborted, such as with AbortController.
|
|
62
|
+
*/
|
|
63
|
+
export class AbortError extends BaseError {
|
|
64
|
+
constructor(message = "Operation aborted") {
|
|
65
|
+
super(message);
|
|
66
|
+
this.name = "AbortError";
|
|
67
|
+
BaseError._setPrototypeOf(this, AbortError.prototype);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
60
70
|
//# sourceMappingURL=error.js.map
|
package/Misc/error.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.js","sourceRoot":"","sources":["../../../../dev/core/src/Misc/error.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD;;;;GAIG;AACH,MAAM,OAAgB,SAAU,SAAQ,KAAK;;AACzC,yGAAyG;AACzG,oIAAoI;AAEpI,mDAAmD;AAClC,yBAAe,GAC3B,MAAc,CAAC,cAAc;IAC9B,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE;QACV,CAAC,CAAC,SAAS,GAAG,KAAK,CAAC;QACpB,OAAO,CAAC,CAAC;IACb,CAAC,CAAC,CAAC;AAGX,8DAA8D;AAC9D;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACtB,oBAAoB;IACpB,8CAA8C;IAC9C,yBAAyB,EAAE,CAAC;IAE5B,2BAA2B;IAC3B,iCAAiC;IACjC,uBAAuB,EAAE,IAAI;IAE7B,8BAA8B;IAC9B,yDAAyD;IACzD,8BAA8B,EAAE,IAAI;IAEpC,+BAA+B;IAC/B,yEAAyE;IACzE,gBAAgB,EAAE,IAAI;IAEtB,gCAAgC;IAChC,sBAAsB;IACtB,aAAa,EAAE,IAAI;IACnB,yBAAyB;IACzB,gBAAgB,EAAE,IAAI;IACtB,sBAAsB;IACtB,aAAa,EAAE,IAAI;CACb,CAAC;AAOX;;GAEG;AACH,MAAM,OAAO,YAAa,SAAQ,SAAS;IAWvC;;;;;OAKG;IACH,YAAmB,OAAe,EAAE,SAAyB,EAAE,UAAkB;QAC7E,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAE7B,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC;QAC3B,SAAS,CAAC,eAAe,CAAC,IAAI,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;IAC5D,CAAC;CACJ","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\r\n/**\r\n * Base error. Due to limitations of typedoc-check and missing documentation\r\n * in lib.es5.d.ts, cannot extend Error directly for RuntimeError.\r\n * @ignore\r\n */\r\nexport abstract class BaseError extends Error {\r\n // See https://stackoverflow.com/questions/12915412/how-do-i-extend-a-host-object-e-g-error-in-typescript\r\n // and https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#extending-built-ins-like-error-array-and-map-may-no-longer-work\r\n\r\n // Polyfill for Object.setPrototypeOf if necessary.\r\n protected static _setPrototypeOf: (o: any, proto: object | null) => any =\r\n (Object as any).setPrototypeOf ||\r\n ((o, proto) => {\r\n o.__proto__ = proto;\r\n return o;\r\n });\r\n}\r\n\r\n/* IMP! DO NOT CHANGE THE NUMBERING OF EXISTING ERROR CODES */\r\n/**\r\n * Error codes for BaseError\r\n */\r\nexport const ErrorCodes = {\r\n // Mesh errors 0-999\r\n /** Invalid or empty mesh vertex positions. */\r\n MeshInvalidPositionsError: 0,\r\n\r\n // Texture errors 1000-1999\r\n /** Unsupported texture found. */\r\n UnsupportedTextureError: 1000,\r\n\r\n // GLTFLoader errors 2000-2999\r\n /** Unexpected magic number found in GLTF file header. */\r\n GLTFLoaderUnexpectedMagicError: 2000,\r\n\r\n // SceneLoader errors 3000-3999\r\n /** SceneLoader generic error code. Ideally wraps the inner exception. */\r\n SceneLoaderError: 3000,\r\n\r\n // File related errors 4000-4999\r\n /** Load file error */\r\n LoadFileError: 4000,\r\n /** Request file error */\r\n RequestFileError: 4001,\r\n /** Read file error */\r\n ReadFileError: 4002,\r\n} as const;\r\n\r\n/**\r\n * Error code type\r\n */\r\nexport type ErrorCodesType = (typeof ErrorCodes)[keyof typeof ErrorCodes];\r\n\r\n/**\r\n * Application runtime error\r\n */\r\nexport class RuntimeError extends BaseError {\r\n /**\r\n * The error code\r\n */\r\n public errorCode: ErrorCodesType;\r\n\r\n /**\r\n * The error that caused this outer error\r\n */\r\n public innerError?: Error;\r\n\r\n /**\r\n * Creates a new RuntimeError\r\n * @param message defines the message of the error\r\n * @param errorCode the error code\r\n * @param innerError the error that caused the outer error\r\n */\r\n public constructor(message: string, errorCode: ErrorCodesType, innerError?: Error) {\r\n super(message);\r\n\r\n this.errorCode = errorCode;\r\n this.innerError = innerError;\r\n\r\n this.name = \"RuntimeError\";\r\n BaseError._setPrototypeOf(this, RuntimeError.prototype);\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"error.js","sourceRoot":"","sources":["../../../../dev/core/src/Misc/error.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD;;;;GAIG;AACH,MAAM,OAAgB,SAAU,SAAQ,KAAK;;AACzC,yGAAyG;AACzG,oIAAoI;AAEpI,mDAAmD;AAClC,yBAAe,GAC3B,MAAc,CAAC,cAAc;IAC9B,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE;QACV,CAAC,CAAC,SAAS,GAAG,KAAK,CAAC;QACpB,OAAO,CAAC,CAAC;IACb,CAAC,CAAC,CAAC;AAGX,8DAA8D;AAC9D;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACtB,oBAAoB;IACpB,8CAA8C;IAC9C,yBAAyB,EAAE,CAAC;IAE5B,2BAA2B;IAC3B,iCAAiC;IACjC,uBAAuB,EAAE,IAAI;IAE7B,8BAA8B;IAC9B,yDAAyD;IACzD,8BAA8B,EAAE,IAAI;IAEpC,+BAA+B;IAC/B,yEAAyE;IACzE,gBAAgB,EAAE,IAAI;IAEtB,gCAAgC;IAChC,sBAAsB;IACtB,aAAa,EAAE,IAAI;IACnB,yBAAyB;IACzB,gBAAgB,EAAE,IAAI;IACtB,sBAAsB;IACtB,aAAa,EAAE,IAAI;CACb,CAAC;AAOX;;GAEG;AACH,MAAM,OAAO,YAAa,SAAQ,SAAS;IAWvC;;;;;OAKG;IACH,YAAmB,OAAe,EAAE,SAAyB,EAAE,UAAkB;QAC7E,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAE7B,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC;QAC3B,SAAS,CAAC,eAAe,CAAC,IAAI,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;IAC5D,CAAC;CACJ;AAED;;GAEG;AACH,MAAM,OAAO,UAAW,SAAQ,SAAS;IACrC,YAAmB,OAAO,GAAG,mBAAmB;QAC5C,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC;QACzB,SAAS,CAAC,eAAe,CAAC,IAAI,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;IAC1D,CAAC;CACJ","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\r\n/**\r\n * Base error. Due to limitations of typedoc-check and missing documentation\r\n * in lib.es5.d.ts, cannot extend Error directly for RuntimeError.\r\n * @ignore\r\n */\r\nexport abstract class BaseError extends Error {\r\n // See https://stackoverflow.com/questions/12915412/how-do-i-extend-a-host-object-e-g-error-in-typescript\r\n // and https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#extending-built-ins-like-error-array-and-map-may-no-longer-work\r\n\r\n // Polyfill for Object.setPrototypeOf if necessary.\r\n protected static _setPrototypeOf: (o: any, proto: object | null) => any =\r\n (Object as any).setPrototypeOf ||\r\n ((o, proto) => {\r\n o.__proto__ = proto;\r\n return o;\r\n });\r\n}\r\n\r\n/* IMP! DO NOT CHANGE THE NUMBERING OF EXISTING ERROR CODES */\r\n/**\r\n * Error codes for BaseError\r\n */\r\nexport const ErrorCodes = {\r\n // Mesh errors 0-999\r\n /** Invalid or empty mesh vertex positions. */\r\n MeshInvalidPositionsError: 0,\r\n\r\n // Texture errors 1000-1999\r\n /** Unsupported texture found. */\r\n UnsupportedTextureError: 1000,\r\n\r\n // GLTFLoader errors 2000-2999\r\n /** Unexpected magic number found in GLTF file header. */\r\n GLTFLoaderUnexpectedMagicError: 2000,\r\n\r\n // SceneLoader errors 3000-3999\r\n /** SceneLoader generic error code. Ideally wraps the inner exception. */\r\n SceneLoaderError: 3000,\r\n\r\n // File related errors 4000-4999\r\n /** Load file error */\r\n LoadFileError: 4000,\r\n /** Request file error */\r\n RequestFileError: 4001,\r\n /** Read file error */\r\n ReadFileError: 4002,\r\n} as const;\r\n\r\n/**\r\n * Error code type\r\n */\r\nexport type ErrorCodesType = (typeof ErrorCodes)[keyof typeof ErrorCodes];\r\n\r\n/**\r\n * Application runtime error\r\n */\r\nexport class RuntimeError extends BaseError {\r\n /**\r\n * The error code\r\n */\r\n public errorCode: ErrorCodesType;\r\n\r\n /**\r\n * The error that caused this outer error\r\n */\r\n public innerError?: Error;\r\n\r\n /**\r\n * Creates a new RuntimeError\r\n * @param message defines the message of the error\r\n * @param errorCode the error code\r\n * @param innerError the error that caused the outer error\r\n */\r\n public constructor(message: string, errorCode: ErrorCodesType, innerError?: Error) {\r\n super(message);\r\n\r\n this.errorCode = errorCode;\r\n this.innerError = innerError;\r\n\r\n this.name = \"RuntimeError\";\r\n BaseError._setPrototypeOf(this, RuntimeError.prototype);\r\n }\r\n}\r\n\r\n/**\r\n * Used for flow control when an operation is aborted, such as with AbortController.\r\n */\r\nexport class AbortError extends BaseError {\r\n public constructor(message = \"Operation aborted\") {\r\n super(message);\r\n this.name = \"AbortError\";\r\n BaseError._setPrototypeOf(this, AbortError.prototype);\r\n }\r\n}\r\n"]}
|
|
@@ -257,7 +257,13 @@ environmentIrradiance.rgb=fromRGBD(environmentIrradiance4);
|
|
|
257
257
|
environmentIrradiance.rgb=toLinearSpace(environmentIrradiance.rgb);
|
|
258
258
|
#endif
|
|
259
259
|
#endif
|
|
260
|
-
environmentIrradiance*=vReflectionColor.rgb;
|
|
260
|
+
environmentIrradiance*=vReflectionColor.rgb;
|
|
261
|
+
#ifdef MIX_IBL_RADIANCE_WITH_IRRADIANCE
|
|
262
|
+
outParams.environmentRadiance=vec4(mix(environmentRadiance.rgb,environmentIrradiance,alphaG),environmentRadiance.a);
|
|
263
|
+
#else
|
|
264
|
+
outParams.environmentRadiance=environmentRadiance;
|
|
265
|
+
#endif
|
|
266
|
+
outParams.environmentIrradiance=environmentIrradiance;outParams.reflectionCoords=reflectionCoords;return outParams;}
|
|
261
267
|
#endif
|
|
262
268
|
`;
|
|
263
269
|
// Sideeffect
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pbrBlockReflection.js","sourceRoot":"","sources":["../../../../../dev/core/src/Shaders/ShadersInclude/pbrBlockReflection.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,IAAI,GAAG,oBAAoB,CAAC;AAClC,MAAM,MAAM,GAAG
|
|
1
|
+
{"version":3,"file":"pbrBlockReflection.js","sourceRoot":"","sources":["../../../../../dev/core/src/Shaders/ShadersInclude/pbrBlockReflection.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,IAAI,GAAG,oBAAoB,CAAC;AAClC,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwQd,CAAC;AACF,aAAa;AACb,WAAW,CAAC,oBAAoB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAChD,gBAAgB;AAChB,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore\";\n\nconst name = \"pbrBlockReflection\";\nconst shader = `#ifdef REFLECTION\nstruct reflectionOutParams\n{vec4 environmentRadiance;vec3 environmentIrradiance;\n#ifdef REFLECTIONMAP_3D\nvec3 reflectionCoords;\n#else\nvec2 reflectionCoords;\n#endif\n#ifdef SS_TRANSLUCENCY\n#ifdef USESPHERICALFROMREFLECTIONMAP\n#if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)\nvec3 irradianceVector;\n#endif\n#endif\n#endif\n};\n#define pbr_inline\nvoid createReflectionCoords(\nin vec3 vPositionW,\nin vec3 normalW,\n#ifdef ANISOTROPIC\nin anisotropicOutParams anisotropicOut,\n#endif\n#ifdef REFLECTIONMAP_3D\nout vec3 reflectionCoords\n#else\nout vec2 reflectionCoords\n#endif\n)\n{\n#ifdef ANISOTROPIC\nvec3 reflectionVector=computeReflectionCoords(vec4(vPositionW,1.0),anisotropicOut.anisotropicNormal);\n#else\nvec3 reflectionVector=computeReflectionCoords(vec4(vPositionW,1.0),normalW);\n#endif\n#ifdef REFLECTIONMAP_OPPOSITEZ\nreflectionVector.z*=-1.0;\n#endif\n#ifdef REFLECTIONMAP_3D\nreflectionCoords=reflectionVector;\n#else\nreflectionCoords=reflectionVector.xy;\n#ifdef REFLECTIONMAP_PROJECTION\nreflectionCoords/=reflectionVector.z;\n#endif\nreflectionCoords.y=1.0-reflectionCoords.y;\n#endif\n}\n#define pbr_inline\n#define inline\nvoid sampleReflectionTexture(\nin float alphaG,\nin vec3 vReflectionMicrosurfaceInfos,\nin vec2 vReflectionInfos,\nin vec3 vReflectionColor,\n#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\nin float NdotVUnclamped,\n#endif\n#ifdef LINEARSPECULARREFLECTION\nin float roughness,\n#endif\n#ifdef REFLECTIONMAP_3D\nin samplerCube reflectionSampler,\nconst vec3 reflectionCoords,\n#else\nin sampler2D reflectionSampler,\nconst vec2 reflectionCoords,\n#endif\n#ifndef LODBASEDMICROSFURACE\n#ifdef REFLECTIONMAP_3D\nin samplerCube reflectionSamplerLow,\nin samplerCube reflectionSamplerHigh,\n#else\nin sampler2D reflectionSamplerLow,\nin sampler2D reflectionSamplerHigh,\n#endif\n#endif\n#ifdef REALTIME_FILTERING\nin vec2 vReflectionFilteringInfo,\n#endif\nout vec4 environmentRadiance\n)\n{\n#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\nfloat reflectionLOD=getLodFromAlphaG(vReflectionMicrosurfaceInfos.x,alphaG,NdotVUnclamped);\n#elif defined(LINEARSPECULARREFLECTION)\nfloat reflectionLOD=getLinearLodFromRoughness(vReflectionMicrosurfaceInfos.x,roughness);\n#else\nfloat reflectionLOD=getLodFromAlphaG(vReflectionMicrosurfaceInfos.x,alphaG);\n#endif\n#ifdef LODBASEDMICROSFURACE\nreflectionLOD=reflectionLOD*vReflectionMicrosurfaceInfos.y+vReflectionMicrosurfaceInfos.z;\n#ifdef LODINREFLECTIONALPHA\nfloat automaticReflectionLOD=UNPACK_LOD(sampleReflection(reflectionSampler,reflectionCoords).a);float requestedReflectionLOD=max(automaticReflectionLOD,reflectionLOD);\n#else\nfloat requestedReflectionLOD=reflectionLOD;\n#endif\n#ifdef REALTIME_FILTERING\nenvironmentRadiance=vec4(radiance(alphaG,reflectionSampler,reflectionCoords,vReflectionFilteringInfo),1.0);\n#else\nenvironmentRadiance=sampleReflectionLod(reflectionSampler,reflectionCoords,reflectionLOD);\n#endif\n#else\nfloat lodReflectionNormalized=saturate(reflectionLOD/log2(vReflectionMicrosurfaceInfos.x));float lodReflectionNormalizedDoubled=lodReflectionNormalized*2.0;vec4 environmentMid=sampleReflection(reflectionSampler,reflectionCoords);if (lodReflectionNormalizedDoubled<1.0){environmentRadiance=mix(\nsampleReflection(reflectionSamplerHigh,reflectionCoords),\nenvironmentMid,\nlodReflectionNormalizedDoubled\n);} else {environmentRadiance=mix(\nenvironmentMid,\nsampleReflection(reflectionSamplerLow,reflectionCoords),\nlodReflectionNormalizedDoubled-1.0\n);}\n#endif\n#ifdef RGBDREFLECTION\nenvironmentRadiance.rgb=fromRGBD(environmentRadiance);\n#endif\n#ifdef GAMMAREFLECTION\nenvironmentRadiance.rgb=toLinearSpace(environmentRadiance.rgb);\n#endif\nenvironmentRadiance.rgb*=vReflectionInfos.x;environmentRadiance.rgb*=vReflectionColor.rgb;}\n#define pbr_inline\n#define inline\nreflectionOutParams reflectionBlock(\nin vec3 vPositionW\n,in vec3 normalW\n,in float alphaG\n,in vec3 vReflectionMicrosurfaceInfos\n,in vec2 vReflectionInfos\n,in vec3 vReflectionColor\n#ifdef ANISOTROPIC\n,in anisotropicOutParams anisotropicOut\n#endif\n#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\n,in float NdotVUnclamped\n#endif\n#ifdef LINEARSPECULARREFLECTION\n,in float roughness\n#endif\n#ifdef REFLECTIONMAP_3D\n,in samplerCube reflectionSampler\n#else\n,in sampler2D reflectionSampler\n#endif\n#if defined(NORMAL) && defined(USESPHERICALINVERTEX)\n,in vec3 vEnvironmentIrradiance\n#endif\n#if (defined(USESPHERICALFROMREFLECTIONMAP) && (!defined(NORMAL) || !defined(USESPHERICALINVERTEX))) || (defined(USEIRRADIANCEMAP) && defined(REFLECTIONMAP_3D))\n,in mat4 reflectionMatrix\n#endif\n#ifdef USEIRRADIANCEMAP\n#ifdef REFLECTIONMAP_3D\n,in samplerCube irradianceSampler\n#else\n,in sampler2D irradianceSampler\n#endif\n#endif\n#ifndef LODBASEDMICROSFURACE\n#ifdef REFLECTIONMAP_3D\n,in samplerCube reflectionSamplerLow\n,in samplerCube reflectionSamplerHigh\n#else\n,in sampler2D reflectionSamplerLow\n,in sampler2D reflectionSamplerHigh\n#endif\n#endif\n#ifdef REALTIME_FILTERING\n,in vec2 vReflectionFilteringInfo\n#ifdef IBL_CDF_FILTERING\n,in sampler2D icdfSampler\n#endif\n#endif\n)\n{reflectionOutParams outParams;vec4 environmentRadiance=vec4(0.,0.,0.,0.);\n#ifdef REFLECTIONMAP_3D\nvec3 reflectionCoords=vec3(0.);\n#else\nvec2 reflectionCoords=vec2(0.);\n#endif\ncreateReflectionCoords(\nvPositionW,\nnormalW,\n#ifdef ANISOTROPIC\nanisotropicOut,\n#endif\nreflectionCoords\n);sampleReflectionTexture(\nalphaG,\nvReflectionMicrosurfaceInfos,\nvReflectionInfos,\nvReflectionColor,\n#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\nNdotVUnclamped,\n#endif\n#ifdef LINEARSPECULARREFLECTION\nroughness,\n#endif\n#ifdef REFLECTIONMAP_3D\nreflectionSampler,\nreflectionCoords,\n#else\nreflectionSampler,\nreflectionCoords,\n#endif\n#ifndef LODBASEDMICROSFURACE\nreflectionSamplerLow,\nreflectionSamplerHigh,\n#endif\n#ifdef REALTIME_FILTERING\nvReflectionFilteringInfo,\n#endif\nenvironmentRadiance\n);vec3 environmentIrradiance=vec3(0.,0.,0.);\n#if (defined(USESPHERICALFROMREFLECTIONMAP) && (!defined(NORMAL) || !defined(USESPHERICALINVERTEX))) || (defined(USEIRRADIANCEMAP) && defined(REFLECTIONMAP_3D))\n#ifdef ANISOTROPIC\nvec3 irradianceVector=vec3(reflectionMatrix*vec4(anisotropicOut.anisotropicNormal,0)).xyz;\n#else\nvec3 irradianceVector=vec3(reflectionMatrix*vec4(normalW,0)).xyz;\n#endif\n#ifdef REFLECTIONMAP_OPPOSITEZ\nirradianceVector.z*=-1.0;\n#endif\n#ifdef INVERTCUBICMAP\nirradianceVector.y*=-1.0;\n#endif\n#endif\n#ifdef USESPHERICALFROMREFLECTIONMAP\n#if defined(NORMAL) && defined(USESPHERICALINVERTEX)\nenvironmentIrradiance=vEnvironmentIrradiance;\n#else\n#if defined(REALTIME_FILTERING)\nenvironmentIrradiance=irradiance(reflectionSampler,irradianceVector,vReflectionFilteringInfo\n#ifdef IBL_CDF_FILTERING\n,icdfSampler\n#endif\n);\n#else\nenvironmentIrradiance=computeEnvironmentIrradiance(irradianceVector);\n#endif\n#ifdef SS_TRANSLUCENCY\noutParams.irradianceVector=irradianceVector;\n#endif\n#endif\n#elif defined(USEIRRADIANCEMAP)\n#ifdef REFLECTIONMAP_3D\nvec4 environmentIrradiance4=sampleReflection(irradianceSampler,irradianceVector);\n#else\nvec4 environmentIrradiance4=sampleReflection(irradianceSampler,reflectionCoords);\n#endif\nenvironmentIrradiance=environmentIrradiance4.rgb;\n#ifdef RGBDREFLECTION\nenvironmentIrradiance.rgb=fromRGBD(environmentIrradiance4);\n#endif\n#ifdef GAMMAREFLECTION\nenvironmentIrradiance.rgb=toLinearSpace(environmentIrradiance.rgb);\n#endif\n#endif\nenvironmentIrradiance*=vReflectionColor.rgb;\n#ifdef MIX_IBL_RADIANCE_WITH_IRRADIANCE\noutParams.environmentRadiance=vec4(mix(environmentRadiance.rgb,environmentIrradiance,alphaG),environmentRadiance.a);\n#else\noutParams.environmentRadiance=environmentRadiance;\n#endif\noutParams.environmentIrradiance=environmentIrradiance;outParams.reflectionCoords=reflectionCoords;return outParams;}\n#endif\n`;\n// Sideeffect\nShaderStore.IncludesShadersStore[name] = shader;\n/** @internal */\nexport const pbrBlockReflection = { name, shader };\n"]}
|
|
@@ -3,6 +3,7 @@ import "./ShadersInclude/gaussianSplattingUboDeclaration";
|
|
|
3
3
|
import "./ShadersInclude/clipPlaneVertexDeclaration";
|
|
4
4
|
import "./ShadersInclude/fogVertexDeclaration";
|
|
5
5
|
import "./ShadersInclude/logDepthDeclaration";
|
|
6
|
+
import "./ShadersInclude/helperFunctions";
|
|
6
7
|
import "./ShadersInclude/gaussianSplatting";
|
|
7
8
|
import "./ShadersInclude/clipPlaneVertex";
|
|
8
9
|
import "./ShadersInclude/fogVertex";
|
|
@@ -5,6 +5,7 @@ import "./ShadersInclude/gaussianSplattingUboDeclaration.js";
|
|
|
5
5
|
import "./ShadersInclude/clipPlaneVertexDeclaration.js";
|
|
6
6
|
import "./ShadersInclude/fogVertexDeclaration.js";
|
|
7
7
|
import "./ShadersInclude/logDepthDeclaration.js";
|
|
8
|
+
import "./ShadersInclude/helperFunctions.js";
|
|
8
9
|
import "./ShadersInclude/gaussianSplatting.js";
|
|
9
10
|
import "./ShadersInclude/clipPlaneVertex.js";
|
|
10
11
|
import "./ShadersInclude/fogVertex.js";
|
|
@@ -17,6 +18,7 @@ const shader = `#include<__decl__gaussianSplattingVertex>
|
|
|
17
18
|
#include<clipPlaneVertexDeclaration>
|
|
18
19
|
#include<fogVertexDeclaration>
|
|
19
20
|
#include<logDepthDeclaration>
|
|
21
|
+
#include<helperFunctions>
|
|
20
22
|
attribute float splatIndex;uniform vec2 invViewport;uniform vec2 dataTextureSize;uniform vec2 focal;uniform sampler2D covariancesATexture;uniform sampler2D covariancesBTexture;uniform sampler2D centersTexture;uniform sampler2D colorsTexture;
|
|
21
23
|
#if SH_DEGREE>0
|
|
22
24
|
uniform highp usampler2D shTexture0;
|
|
@@ -31,7 +33,7 @@ varying vec4 vColor;varying vec2 vPosition;
|
|
|
31
33
|
#include<gaussianSplatting>
|
|
32
34
|
void main () {Splat splat=readSplat(splatIndex);vec3 covA=splat.covA.xyz;vec3 covB=vec3(splat.covA.w,splat.covB.xy);vec4 worldPos=world*vec4(splat.center.xyz,1.0);vColor=splat.color;vPosition=position;
|
|
33
35
|
#if SH_DEGREE>0
|
|
34
|
-
vec3 dir=normalize(worldPos.xyz-vEyePosition.xyz);dir.y*=-1.;
|
|
36
|
+
mat3 worldRot=mat3(world);mat3 normWorldRot=inverseMat3(worldRot);vec3 dir=normalize(normWorldRot*(worldPos.xyz-vEyePosition.xyz));dir.y*=-1.;
|
|
35
37
|
vColor.xyz=computeSH(splat,splat.color.xyz,dir);
|
|
36
38
|
#endif
|
|
37
39
|
gl_Position=gaussianSplatting(position,worldPos.xyz,vec2(1.,1.),covA,covB,world,view,projection);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gaussianSplatting.vertex.js","sourceRoot":"","sources":["../../../../dev/core/src/Shaders/gaussianSplatting.vertex.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,qDAAqD,CAAC;AAC7D,OAAO,kDAAkD,CAAC;AAC1D,OAAO,6CAA6C,CAAC;AACrD,OAAO,uCAAuC,CAAC;AAC/C,OAAO,sCAAsC,CAAC;AAC9C,OAAO,oCAAoC,CAAC;AAC5C,OAAO,kCAAkC,CAAC;AAC1C,OAAO,4BAA4B,CAAC;AACpC,OAAO,iCAAiC,CAAC;AAEzC,MAAM,IAAI,GAAG,+BAA+B,CAAC;AAC7C,MAAM,MAAM,GAAG
|
|
1
|
+
{"version":3,"file":"gaussianSplatting.vertex.js","sourceRoot":"","sources":["../../../../dev/core/src/Shaders/gaussianSplatting.vertex.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,qDAAqD,CAAC;AAC7D,OAAO,kDAAkD,CAAC;AAC1D,OAAO,6CAA6C,CAAC;AACrD,OAAO,uCAAuC,CAAC;AAC/C,OAAO,sCAAsC,CAAC;AAC9C,OAAO,kCAAkC,CAAC;AAC1C,OAAO,oCAAoC,CAAC;AAC5C,OAAO,kCAAkC,CAAC;AAC1C,OAAO,4BAA4B,CAAC;AACpC,OAAO,iCAAiC,CAAC;AAEzC,MAAM,IAAI,GAAG,+BAA+B,CAAC;AAC7C,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8Bd,CAAC;AACF,aAAa;AACb,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACxC,gBAAgB;AAChB,MAAM,CAAC,MAAM,6BAA6B,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\nimport \"./ShadersInclude/gaussianSplattingVertexDeclaration\";\nimport \"./ShadersInclude/gaussianSplattingUboDeclaration\";\nimport \"./ShadersInclude/clipPlaneVertexDeclaration\";\nimport \"./ShadersInclude/fogVertexDeclaration\";\nimport \"./ShadersInclude/logDepthDeclaration\";\nimport \"./ShadersInclude/helperFunctions\";\nimport \"./ShadersInclude/gaussianSplatting\";\nimport \"./ShadersInclude/clipPlaneVertex\";\nimport \"./ShadersInclude/fogVertex\";\nimport \"./ShadersInclude/logDepthVertex\";\n\nconst name = \"gaussianSplattingVertexShader\";\nconst shader = `#include<__decl__gaussianSplattingVertex>\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<logDepthDeclaration>\n#include<helperFunctions>\nattribute float splatIndex;uniform vec2 invViewport;uniform vec2 dataTextureSize;uniform vec2 focal;uniform sampler2D covariancesATexture;uniform sampler2D covariancesBTexture;uniform sampler2D centersTexture;uniform sampler2D colorsTexture;\n#if SH_DEGREE>0\nuniform highp usampler2D shTexture0;\n#endif\n#if SH_DEGREE>1\nuniform highp usampler2D shTexture1;\n#endif\n#if SH_DEGREE>2\nuniform highp usampler2D shTexture2;\n#endif\nvarying vec4 vColor;varying vec2 vPosition;\n#include<gaussianSplatting>\nvoid main () {Splat splat=readSplat(splatIndex);vec3 covA=splat.covA.xyz;vec3 covB=vec3(splat.covA.w,splat.covB.xy);vec4 worldPos=world*vec4(splat.center.xyz,1.0);vColor=splat.color;vPosition=position;\n#if SH_DEGREE>0\nmat3 worldRot=mat3(world);mat3 normWorldRot=inverseMat3(worldRot);vec3 dir=normalize(normWorldRot*(worldPos.xyz-vEyePosition.xyz));dir.y*=-1.; \nvColor.xyz=computeSH(splat,splat.color.xyz,dir);\n#endif\ngl_Position=gaussianSplatting(position,worldPos.xyz,vec2(1.,1.),covA,covB,world,view,projection);\n#include<clipPlaneVertex>\n#include<fogVertex>\n#include<logDepthVertex>\n}\n`;\n// Sideeffect\nShaderStore.ShadersStore[name] = shader;\n/** @internal */\nexport const gaussianSplattingVertexShader = { name, shader };\n"]}
|
|
@@ -281,7 +281,13 @@ environmentIrradiance=fromRGBD(environmentIrradiance4);
|
|
|
281
281
|
environmentIrradiance=toLinearSpaceVec3(environmentIrradiance.rgb);
|
|
282
282
|
#endif
|
|
283
283
|
#endif
|
|
284
|
-
environmentIrradiance*=vReflectionColor.rgb;
|
|
284
|
+
environmentIrradiance*=vReflectionColor.rgb;
|
|
285
|
+
#ifdef MIX_IBL_RADIANCE_WITH_IRRADIANCE
|
|
286
|
+
outParams.environmentRadiance=vec4f(mix(environmentRadiance.rgb,environmentIrradiance,alphaG),environmentRadiance.a);
|
|
287
|
+
#else
|
|
288
|
+
outParams.environmentRadiance=environmentRadiance;
|
|
289
|
+
#endif
|
|
290
|
+
outParams.environmentIrradiance=environmentIrradiance;outParams.reflectionCoords=reflectionCoords;return outParams;}
|
|
285
291
|
#endif
|
|
286
292
|
`;
|
|
287
293
|
// Sideeffect
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pbrBlockReflection.js","sourceRoot":"","sources":["../../../../../dev/core/src/ShadersWGSL/ShadersInclude/pbrBlockReflection.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,IAAI,GAAG,oBAAoB,CAAC;AAClC,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0Rd,CAAC;AACF,aAAa;AACb,WAAW,CAAC,wBAAwB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACpD,gBAAgB;AAChB,MAAM,CAAC,MAAM,sBAAsB,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore\";\n\nconst name = \"pbrBlockReflection\";\nconst shader = `#ifdef REFLECTION\nstruct reflectionOutParams\n{environmentRadiance: vec4f\n,environmentIrradiance: vec3f\n#ifdef REFLECTIONMAP_3D\n,reflectionCoords: vec3f\n#else\n,reflectionCoords: vec2f\n#endif\n#ifdef SS_TRANSLUCENCY\n#ifdef USESPHERICALFROMREFLECTIONMAP\n#if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)\n,irradianceVector: vec3f\n#endif\n#endif\n#endif\n};\n#define pbr_inline\n#ifdef REFLECTIONMAP_3D\nfn createReflectionCoords(\nvPositionW: vec3f,\nnormalW: vec3f,\n#ifdef ANISOTROPIC\nanisotropicOut: anisotropicOutParams,\n#endif\n)->vec3f\n{var reflectionCoords: vec3f;\n#else\nfn createReflectionCoords(\nvPositionW: vec3f,\nnormalW: vec3f,\n#ifdef ANISOTROPIC\nanisotropicOut: anisotropicOutParams,\n#endif\n)->vec2f\n{ \nvar reflectionCoords: vec2f;\n#endif\n#ifdef ANISOTROPIC\nvar reflectionVector: vec3f=computeReflectionCoords( vec4f(vPositionW,1.0),anisotropicOut.anisotropicNormal);\n#else\nvar reflectionVector: vec3f=computeReflectionCoords( vec4f(vPositionW,1.0),normalW);\n#endif\n#ifdef REFLECTIONMAP_OPPOSITEZ\nreflectionVector.z*=-1.0;\n#endif\n#ifdef REFLECTIONMAP_3D\nreflectionCoords=reflectionVector;\n#else\nreflectionCoords=reflectionVector.xy;\n#ifdef REFLECTIONMAP_PROJECTION\nreflectionCoords/=reflectionVector.z;\n#endif\nreflectionCoords.y=1.0-reflectionCoords.y;\n#endif\nreturn reflectionCoords;}\n#define pbr_inline\nfn sampleReflectionTexture(\nalphaG: f32\n,vReflectionMicrosurfaceInfos: vec3f\n,vReflectionInfos: vec2f\n,vReflectionColor: vec3f\n#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\n,NdotVUnclamped: f32\n#endif\n#ifdef LINEARSPECULARREFLECTION\n,roughness: f32\n#endif\n#ifdef REFLECTIONMAP_3D\n,reflectionSampler: texture_cube<f32>\n,reflectionSamplerSampler: sampler\n,reflectionCoords: vec3f\n#else\n,reflectionSampler: texture_2d<f32>\n,reflectionSamplerSampler: sampler\n,reflectionCoords: vec2f\n#endif\n#ifndef LODBASEDMICROSFURACE\n#ifdef REFLECTIONMAP_3D\n,reflectionLowSampler: texture_cube<f32>\n,reflectionLowSamplerSampler: sampler\n,reflectionHighSampler: texture_cube<f32>\n,reflectionHighSamplerSampler: sampler\n#else\n,reflectionLowSampler: texture_2d<f32>\n,reflectionLowSamplerSampler: sampler\n,reflectionHighSampler: texture_2d<f32>\n,reflectionHighSamplerSampler: sampler\n#endif\n#endif\n#ifdef REALTIME_FILTERING\n,vReflectionFilteringInfo: vec2f\n#endif \n)->vec4f\n{var environmentRadiance: vec4f;\n#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\nvar reflectionLOD: f32=getLodFromAlphaGNdotV(vReflectionMicrosurfaceInfos.x,alphaG,NdotVUnclamped);\n#elif defined(LINEARSPECULARREFLECTION)\nvar reflectionLOD: f32=getLinearLodFromRoughness(vReflectionMicrosurfaceInfos.x,roughness);\n#else\nvar reflectionLOD: f32=getLodFromAlphaG(vReflectionMicrosurfaceInfos.x,alphaG);\n#endif\n#ifdef LODBASEDMICROSFURACE\nreflectionLOD=reflectionLOD*vReflectionMicrosurfaceInfos.y+vReflectionMicrosurfaceInfos.z;\n#ifdef LODINREFLECTIONALPHA\nvar automaticReflectionLOD: f32=UNPACK_LOD(textureSample(reflectionSampler,reflectionSamplerSampler,reflectionCoords).a);var requestedReflectionLOD: f32=max(automaticReflectionLOD,reflectionLOD);\n#else\nvar requestedReflectionLOD: f32=reflectionLOD;\n#endif\n#ifdef REALTIME_FILTERING\nenvironmentRadiance= vec4f(radiance(alphaG,reflectionSampler,reflectionSamplerSampler,reflectionCoords,vReflectionFilteringInfo),1.0);\n#else\nenvironmentRadiance=textureSampleLevel(reflectionSampler,reflectionSamplerSampler,reflectionCoords,reflectionLOD);\n#endif\n#else\nvar lodReflectionNormalized: f32=saturate(reflectionLOD/log2(vReflectionMicrosurfaceInfos.x));var lodReflectionNormalizedDoubled: f32=lodReflectionNormalized*2.0;var environmentMid: vec4f=textureSample(reflectionSampler,reflectionSamplerSampler,reflectionCoords);if (lodReflectionNormalizedDoubled<1.0){environmentRadiance=mix(\ntextureSample(reflectionHighSampler,reflectionHighSamplerSampler,reflectionCoords),\nenvironmentMid,\nlodReflectionNormalizedDoubled\n);} else {environmentRadiance=mix(\nenvironmentMid,\ntextureSample(reflectionLowSampler,reflectionLowSamplerSampler,reflectionCoords),\nlodReflectionNormalizedDoubled-1.0\n);}\n#endif\nvar envRadiance=environmentRadiance.rgb;\n#ifdef RGBDREFLECTION\nenvRadiance=fromRGBD(environmentRadiance);\n#endif\n#ifdef GAMMAREFLECTION\nenvRadiance=toLinearSpaceVec3(environmentRadiance.rgb);\n#endif\nenvRadiance*=vReflectionInfos.x;envRadiance*=vReflectionColor.rgb;return vec4f(envRadiance,environmentRadiance.a);}\n#define pbr_inline\nfn reflectionBlock(\nvPositionW: vec3f\n,normalW: vec3f\n,alphaG: f32\n,vReflectionMicrosurfaceInfos: vec3f\n,vReflectionInfos: vec2f\n,vReflectionColor: vec3f\n#ifdef ANISOTROPIC\n,anisotropicOut: anisotropicOutParams\n#endif\n#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\n,NdotVUnclamped: f32\n#endif\n#ifdef LINEARSPECULARREFLECTION\n,roughness: f32\n#endif\n#ifdef REFLECTIONMAP_3D\n,reflectionSampler: texture_cube<f32>\n,reflectionSamplerSampler: sampler\n#else\n,reflectionSampler: texture_2d<f32>\n,reflectionSamplerSampler: sampler\n#endif\n#if defined(NORMAL) && defined(USESPHERICALINVERTEX)\n,vEnvironmentIrradiance: vec3f\n#endif\n#if (defined(USESPHERICALFROMREFLECTIONMAP) && (!defined(NORMAL) || !defined(USESPHERICALINVERTEX))) || (defined(USEIRRADIANCEMAP) && defined(REFLECTIONMAP_3D))\n,reflectionMatrix: mat4x4f\n#endif\n#ifdef USEIRRADIANCEMAP\n#ifdef REFLECTIONMAP_3D\n,irradianceSampler: texture_cube<f32>\n,irradianceSamplerSampler: sampler \n#else\n,irradianceSampler: texture_2d<f32>\n,irradianceSamplerSampler: sampler \n#endif\n#endif\n#ifndef LODBASEDMICROSFURACE\n#ifdef REFLECTIONMAP_3D\n,reflectionLowSampler: texture_cube<f32>\n,reflectionLowSamplerSampler: sampler \n,reflectionHighSampler: texture_cube<f32>\n,reflectionHighSamplerSampler: sampler \n#else\n,reflectionLowSampler: texture_2d<f32>\n,reflectionLowSamplerSampler: sampler \n,reflectionHighSampler: texture_2d<f32>\n,reflectionHighSamplerSampler: sampler \n#endif\n#endif\n#ifdef REALTIME_FILTERING\n,vReflectionFilteringInfo: vec2f\n#ifdef IBL_CDF_FILTERING\n,icdfSampler: texture_2d<f32>\n,icdfSamplerSampler: sampler\n#endif\n#endif\n)->reflectionOutParams\n{var outParams: reflectionOutParams;var environmentRadiance: vec4f= vec4f(0.,0.,0.,0.);\n#ifdef REFLECTIONMAP_3D\nvar reflectionCoords: vec3f= vec3f(0.);\n#else\nvar reflectionCoords: vec2f= vec2f(0.);\n#endif\nreflectionCoords=createReflectionCoords(\nvPositionW,\nnormalW,\n#ifdef ANISOTROPIC\nanisotropicOut,\n#endif \n);environmentRadiance=sampleReflectionTexture(\nalphaG\n,vReflectionMicrosurfaceInfos\n,vReflectionInfos\n,vReflectionColor\n#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\n,NdotVUnclamped\n#endif\n#ifdef LINEARSPECULARREFLECTION\n,roughness\n#endif\n#ifdef REFLECTIONMAP_3D\n,reflectionSampler\n,reflectionSamplerSampler\n,reflectionCoords\n#else\n,reflectionSampler\n,reflectionSamplerSampler\n,reflectionCoords\n#endif\n#ifndef LODBASEDMICROSFURACE\n,reflectionLowSampler\n,reflectionLowSamplerSampler\n,reflectionHighSampler\n,reflectionHighSamplerSampler\n#endif\n#ifdef REALTIME_FILTERING\n,vReflectionFilteringInfo\n#endif \n);var environmentIrradiance: vec3f= vec3f(0.,0.,0.);\n#if (defined(USESPHERICALFROMREFLECTIONMAP) && (!defined(NORMAL) || !defined(USESPHERICALINVERTEX))) || (defined(USEIRRADIANCEMAP) && defined(REFLECTIONMAP_3D))\n#ifdef ANISOTROPIC\nvar irradianceVector: vec3f= (reflectionMatrix* vec4f(anisotropicOut.anisotropicNormal,0)).xyz;\n#else\nvar irradianceVector: vec3f= (reflectionMatrix* vec4f(normalW,0)).xyz;\n#endif\n#ifdef REFLECTIONMAP_OPPOSITEZ\nirradianceVector.z*=-1.0;\n#endif\n#ifdef INVERTCUBICMAP\nirradianceVector.y*=-1.0;\n#endif\n#endif\n#ifdef USESPHERICALFROMREFLECTIONMAP\n#if defined(NORMAL) && defined(USESPHERICALINVERTEX)\nenvironmentIrradiance=vEnvironmentIrradiance;\n#else\n#if defined(REALTIME_FILTERING)\nenvironmentIrradiance=irradiance(reflectionSampler,reflectionSamplerSampler,irradianceVector,vReflectionFilteringInfo\n#ifdef IBL_CDF_FILTERING\n,icdfSampler\n,icdfSamplerSampler\n#endif\n);\n#else\nenvironmentIrradiance=computeEnvironmentIrradiance(irradianceVector);\n#endif\n#ifdef SS_TRANSLUCENCY\noutParams.irradianceVector=irradianceVector;\n#endif\n#endif\n#elif defined(USEIRRADIANCEMAP)\n#ifdef REFLECTIONMAP_3D\nvar environmentIrradiance4: vec4f=textureSample(irradianceSampler,irradianceSamplerSampler,irradianceVector);\n#else\nvar environmentIrradiance4: vec4f=textureSample(irradianceSampler,irradianceSamplerSampler,reflectionCoords);\n#endif\nenvironmentIrradiance=environmentIrradiance4.rgb;\n#ifdef RGBDREFLECTION\nenvironmentIrradiance=fromRGBD(environmentIrradiance4);\n#endif\n#ifdef GAMMAREFLECTION\nenvironmentIrradiance=toLinearSpaceVec3(environmentIrradiance.rgb);\n#endif\n#endif\nenvironmentIrradiance*=vReflectionColor.rgb;outParams.environmentRadiance=environmentRadiance;outParams.environmentIrradiance=environmentIrradiance;outParams.reflectionCoords=reflectionCoords;return outParams;}\n#endif\n`;\n// Sideeffect\nShaderStore.IncludesShadersStoreWGSL[name] = shader;\n/** @internal */\nexport const pbrBlockReflectionWGSL = { name, shader };\n"]}
|
|
1
|
+
{"version":3,"file":"pbrBlockReflection.js","sourceRoot":"","sources":["../../../../../dev/core/src/ShadersWGSL/ShadersInclude/pbrBlockReflection.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,IAAI,GAAG,oBAAoB,CAAC;AAClC,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgSd,CAAC;AACF,aAAa;AACb,WAAW,CAAC,wBAAwB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACpD,gBAAgB;AAChB,MAAM,CAAC,MAAM,sBAAsB,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore\";\n\nconst name = \"pbrBlockReflection\";\nconst shader = `#ifdef REFLECTION\nstruct reflectionOutParams\n{environmentRadiance: vec4f\n,environmentIrradiance: vec3f\n#ifdef REFLECTIONMAP_3D\n,reflectionCoords: vec3f\n#else\n,reflectionCoords: vec2f\n#endif\n#ifdef SS_TRANSLUCENCY\n#ifdef USESPHERICALFROMREFLECTIONMAP\n#if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)\n,irradianceVector: vec3f\n#endif\n#endif\n#endif\n};\n#define pbr_inline\n#ifdef REFLECTIONMAP_3D\nfn createReflectionCoords(\nvPositionW: vec3f,\nnormalW: vec3f,\n#ifdef ANISOTROPIC\nanisotropicOut: anisotropicOutParams,\n#endif\n)->vec3f\n{var reflectionCoords: vec3f;\n#else\nfn createReflectionCoords(\nvPositionW: vec3f,\nnormalW: vec3f,\n#ifdef ANISOTROPIC\nanisotropicOut: anisotropicOutParams,\n#endif\n)->vec2f\n{ \nvar reflectionCoords: vec2f;\n#endif\n#ifdef ANISOTROPIC\nvar reflectionVector: vec3f=computeReflectionCoords( vec4f(vPositionW,1.0),anisotropicOut.anisotropicNormal);\n#else\nvar reflectionVector: vec3f=computeReflectionCoords( vec4f(vPositionW,1.0),normalW);\n#endif\n#ifdef REFLECTIONMAP_OPPOSITEZ\nreflectionVector.z*=-1.0;\n#endif\n#ifdef REFLECTIONMAP_3D\nreflectionCoords=reflectionVector;\n#else\nreflectionCoords=reflectionVector.xy;\n#ifdef REFLECTIONMAP_PROJECTION\nreflectionCoords/=reflectionVector.z;\n#endif\nreflectionCoords.y=1.0-reflectionCoords.y;\n#endif\nreturn reflectionCoords;}\n#define pbr_inline\nfn sampleReflectionTexture(\nalphaG: f32\n,vReflectionMicrosurfaceInfos: vec3f\n,vReflectionInfos: vec2f\n,vReflectionColor: vec3f\n#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\n,NdotVUnclamped: f32\n#endif\n#ifdef LINEARSPECULARREFLECTION\n,roughness: f32\n#endif\n#ifdef REFLECTIONMAP_3D\n,reflectionSampler: texture_cube<f32>\n,reflectionSamplerSampler: sampler\n,reflectionCoords: vec3f\n#else\n,reflectionSampler: texture_2d<f32>\n,reflectionSamplerSampler: sampler\n,reflectionCoords: vec2f\n#endif\n#ifndef LODBASEDMICROSFURACE\n#ifdef REFLECTIONMAP_3D\n,reflectionLowSampler: texture_cube<f32>\n,reflectionLowSamplerSampler: sampler\n,reflectionHighSampler: texture_cube<f32>\n,reflectionHighSamplerSampler: sampler\n#else\n,reflectionLowSampler: texture_2d<f32>\n,reflectionLowSamplerSampler: sampler\n,reflectionHighSampler: texture_2d<f32>\n,reflectionHighSamplerSampler: sampler\n#endif\n#endif\n#ifdef REALTIME_FILTERING\n,vReflectionFilteringInfo: vec2f\n#endif \n)->vec4f\n{var environmentRadiance: vec4f;\n#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\nvar reflectionLOD: f32=getLodFromAlphaGNdotV(vReflectionMicrosurfaceInfos.x,alphaG,NdotVUnclamped);\n#elif defined(LINEARSPECULARREFLECTION)\nvar reflectionLOD: f32=getLinearLodFromRoughness(vReflectionMicrosurfaceInfos.x,roughness);\n#else\nvar reflectionLOD: f32=getLodFromAlphaG(vReflectionMicrosurfaceInfos.x,alphaG);\n#endif\n#ifdef LODBASEDMICROSFURACE\nreflectionLOD=reflectionLOD*vReflectionMicrosurfaceInfos.y+vReflectionMicrosurfaceInfos.z;\n#ifdef LODINREFLECTIONALPHA\nvar automaticReflectionLOD: f32=UNPACK_LOD(textureSample(reflectionSampler,reflectionSamplerSampler,reflectionCoords).a);var requestedReflectionLOD: f32=max(automaticReflectionLOD,reflectionLOD);\n#else\nvar requestedReflectionLOD: f32=reflectionLOD;\n#endif\n#ifdef REALTIME_FILTERING\nenvironmentRadiance= vec4f(radiance(alphaG,reflectionSampler,reflectionSamplerSampler,reflectionCoords,vReflectionFilteringInfo),1.0);\n#else\nenvironmentRadiance=textureSampleLevel(reflectionSampler,reflectionSamplerSampler,reflectionCoords,reflectionLOD);\n#endif\n#else\nvar lodReflectionNormalized: f32=saturate(reflectionLOD/log2(vReflectionMicrosurfaceInfos.x));var lodReflectionNormalizedDoubled: f32=lodReflectionNormalized*2.0;var environmentMid: vec4f=textureSample(reflectionSampler,reflectionSamplerSampler,reflectionCoords);if (lodReflectionNormalizedDoubled<1.0){environmentRadiance=mix(\ntextureSample(reflectionHighSampler,reflectionHighSamplerSampler,reflectionCoords),\nenvironmentMid,\nlodReflectionNormalizedDoubled\n);} else {environmentRadiance=mix(\nenvironmentMid,\ntextureSample(reflectionLowSampler,reflectionLowSamplerSampler,reflectionCoords),\nlodReflectionNormalizedDoubled-1.0\n);}\n#endif\nvar envRadiance=environmentRadiance.rgb;\n#ifdef RGBDREFLECTION\nenvRadiance=fromRGBD(environmentRadiance);\n#endif\n#ifdef GAMMAREFLECTION\nenvRadiance=toLinearSpaceVec3(environmentRadiance.rgb);\n#endif\nenvRadiance*=vReflectionInfos.x;envRadiance*=vReflectionColor.rgb;return vec4f(envRadiance,environmentRadiance.a);}\n#define pbr_inline\nfn reflectionBlock(\nvPositionW: vec3f\n,normalW: vec3f\n,alphaG: f32\n,vReflectionMicrosurfaceInfos: vec3f\n,vReflectionInfos: vec2f\n,vReflectionColor: vec3f\n#ifdef ANISOTROPIC\n,anisotropicOut: anisotropicOutParams\n#endif\n#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\n,NdotVUnclamped: f32\n#endif\n#ifdef LINEARSPECULARREFLECTION\n,roughness: f32\n#endif\n#ifdef REFLECTIONMAP_3D\n,reflectionSampler: texture_cube<f32>\n,reflectionSamplerSampler: sampler\n#else\n,reflectionSampler: texture_2d<f32>\n,reflectionSamplerSampler: sampler\n#endif\n#if defined(NORMAL) && defined(USESPHERICALINVERTEX)\n,vEnvironmentIrradiance: vec3f\n#endif\n#if (defined(USESPHERICALFROMREFLECTIONMAP) && (!defined(NORMAL) || !defined(USESPHERICALINVERTEX))) || (defined(USEIRRADIANCEMAP) && defined(REFLECTIONMAP_3D))\n,reflectionMatrix: mat4x4f\n#endif\n#ifdef USEIRRADIANCEMAP\n#ifdef REFLECTIONMAP_3D\n,irradianceSampler: texture_cube<f32>\n,irradianceSamplerSampler: sampler \n#else\n,irradianceSampler: texture_2d<f32>\n,irradianceSamplerSampler: sampler \n#endif\n#endif\n#ifndef LODBASEDMICROSFURACE\n#ifdef REFLECTIONMAP_3D\n,reflectionLowSampler: texture_cube<f32>\n,reflectionLowSamplerSampler: sampler \n,reflectionHighSampler: texture_cube<f32>\n,reflectionHighSamplerSampler: sampler \n#else\n,reflectionLowSampler: texture_2d<f32>\n,reflectionLowSamplerSampler: sampler \n,reflectionHighSampler: texture_2d<f32>\n,reflectionHighSamplerSampler: sampler \n#endif\n#endif\n#ifdef REALTIME_FILTERING\n,vReflectionFilteringInfo: vec2f\n#ifdef IBL_CDF_FILTERING\n,icdfSampler: texture_2d<f32>\n,icdfSamplerSampler: sampler\n#endif\n#endif\n)->reflectionOutParams\n{var outParams: reflectionOutParams;var environmentRadiance: vec4f= vec4f(0.,0.,0.,0.);\n#ifdef REFLECTIONMAP_3D\nvar reflectionCoords: vec3f= vec3f(0.);\n#else\nvar reflectionCoords: vec2f= vec2f(0.);\n#endif\nreflectionCoords=createReflectionCoords(\nvPositionW,\nnormalW,\n#ifdef ANISOTROPIC\nanisotropicOut,\n#endif \n);environmentRadiance=sampleReflectionTexture(\nalphaG\n,vReflectionMicrosurfaceInfos\n,vReflectionInfos\n,vReflectionColor\n#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\n,NdotVUnclamped\n#endif\n#ifdef LINEARSPECULARREFLECTION\n,roughness\n#endif\n#ifdef REFLECTIONMAP_3D\n,reflectionSampler\n,reflectionSamplerSampler\n,reflectionCoords\n#else\n,reflectionSampler\n,reflectionSamplerSampler\n,reflectionCoords\n#endif\n#ifndef LODBASEDMICROSFURACE\n,reflectionLowSampler\n,reflectionLowSamplerSampler\n,reflectionHighSampler\n,reflectionHighSamplerSampler\n#endif\n#ifdef REALTIME_FILTERING\n,vReflectionFilteringInfo\n#endif \n);var environmentIrradiance: vec3f= vec3f(0.,0.,0.);\n#if (defined(USESPHERICALFROMREFLECTIONMAP) && (!defined(NORMAL) || !defined(USESPHERICALINVERTEX))) || (defined(USEIRRADIANCEMAP) && defined(REFLECTIONMAP_3D))\n#ifdef ANISOTROPIC\nvar irradianceVector: vec3f= (reflectionMatrix* vec4f(anisotropicOut.anisotropicNormal,0)).xyz;\n#else\nvar irradianceVector: vec3f= (reflectionMatrix* vec4f(normalW,0)).xyz;\n#endif\n#ifdef REFLECTIONMAP_OPPOSITEZ\nirradianceVector.z*=-1.0;\n#endif\n#ifdef INVERTCUBICMAP\nirradianceVector.y*=-1.0;\n#endif\n#endif\n#ifdef USESPHERICALFROMREFLECTIONMAP\n#if defined(NORMAL) && defined(USESPHERICALINVERTEX)\nenvironmentIrradiance=vEnvironmentIrradiance;\n#else\n#if defined(REALTIME_FILTERING)\nenvironmentIrradiance=irradiance(reflectionSampler,reflectionSamplerSampler,irradianceVector,vReflectionFilteringInfo\n#ifdef IBL_CDF_FILTERING\n,icdfSampler\n,icdfSamplerSampler\n#endif\n);\n#else\nenvironmentIrradiance=computeEnvironmentIrradiance(irradianceVector);\n#endif\n#ifdef SS_TRANSLUCENCY\noutParams.irradianceVector=irradianceVector;\n#endif\n#endif\n#elif defined(USEIRRADIANCEMAP)\n#ifdef REFLECTIONMAP_3D\nvar environmentIrradiance4: vec4f=textureSample(irradianceSampler,irradianceSamplerSampler,irradianceVector);\n#else\nvar environmentIrradiance4: vec4f=textureSample(irradianceSampler,irradianceSamplerSampler,reflectionCoords);\n#endif\nenvironmentIrradiance=environmentIrradiance4.rgb;\n#ifdef RGBDREFLECTION\nenvironmentIrradiance=fromRGBD(environmentIrradiance4);\n#endif\n#ifdef GAMMAREFLECTION\nenvironmentIrradiance=toLinearSpaceVec3(environmentIrradiance.rgb);\n#endif\n#endif\nenvironmentIrradiance*=vReflectionColor.rgb;\n#ifdef MIX_IBL_RADIANCE_WITH_IRRADIANCE\noutParams.environmentRadiance=vec4f(mix(environmentRadiance.rgb,environmentIrradiance,alphaG),environmentRadiance.a);\n#else\noutParams.environmentRadiance=environmentRadiance;\n#endif\noutParams.environmentIrradiance=environmentIrradiance;outParams.reflectionCoords=reflectionCoords;return outParams;}\n#endif\n`;\n// Sideeffect\nShaderStore.IncludesShadersStoreWGSL[name] = shader;\n/** @internal */\nexport const pbrBlockReflectionWGSL = { name, shader };\n"]}
|
|
@@ -51,8 +51,7 @@ finalColor=vec4f(finalColor.rgb,finalColor.a*uniforms.opacityIntensity);
|
|
|
51
51
|
finalColor=vec4f(finalColor.rgb,finalColor.a*fragmentInputs.vColor.a);
|
|
52
52
|
#endif
|
|
53
53
|
#ifdef ALPHATEST
|
|
54
|
-
if (finalColor.a<ALPHATESTVALUE)
|
|
55
|
-
discard;
|
|
54
|
+
if (finalColor.a<ALPHATESTVALUE) {discard;}
|
|
56
55
|
#endif
|
|
57
56
|
#ifdef EMISSIVE
|
|
58
57
|
var emissive: vec4f=textureSample(emissiveSampler,emissiveSamplerSampler,fragmentInputs.vUVEmissive);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glowMapGeneration.fragment.js","sourceRoot":"","sources":["../../../../dev/core/src/ShadersWGSL/glowMapGeneration.fragment.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,kCAAkC,CAAC;AAC1C,OAAO,+CAA+C,CAAC;AACvD,OAAO,oCAAoC,CAAC;AAE5C,MAAM,IAAI,GAAG,8BAA8B,CAAC;AAC5C,MAAM,MAAM,GAAG
|
|
1
|
+
{"version":3,"file":"glowMapGeneration.fragment.js","sourceRoot":"","sources":["../../../../dev/core/src/ShadersWGSL/glowMapGeneration.fragment.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,kCAAkC,CAAC;AAC1C,OAAO,+CAA+C,CAAC;AACvD,OAAO,oCAAoC,CAAC;AAE5C,MAAM,IAAI,GAAG,8BAA8B,CAAC;AAC5C,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8Dd,CAAC;AACF,aAAa;AACb,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAC5C,gBAAgB;AAChB,MAAM,CAAC,MAAM,gCAAgC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\nimport \"./ShadersInclude/helperFunctions\";\nimport \"./ShadersInclude/clipPlaneFragmentDeclaration\";\nimport \"./ShadersInclude/clipPlaneFragment\";\n\nconst name = \"glowMapGenerationPixelShader\";\nconst shader = `#if defined(DIFFUSE_ISLINEAR) || defined(EMISSIVE_ISLINEAR)\n#include<helperFunctions>\n#endif\n#ifdef DIFFUSE\nvarying vUVDiffuse: vec2f;var diffuseSamplerSampler: sampler;var diffuseSampler: texture_2d<f32>;\n#endif\n#ifdef OPACITY\nvarying vUVOpacity: vec2f;var opacitySamplerSampler: sampler;var opacitySampler: texture_2d<f32>;uniform opacityIntensity: f32;\n#endif\n#ifdef EMISSIVE\nvarying vUVEmissive: vec2f;var emissiveSamplerSampler: sampler;var emissiveSampler: texture_2d<f32>;\n#endif\n#ifdef VERTEXALPHA\nvarying vColor: vec4f;\n#endif\nuniform glowColor: vec4f;uniform glowIntensity: f32;\n#include<clipPlaneFragmentDeclaration>\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#include<clipPlaneFragment>\nvar finalColor: vec4f=uniforms.glowColor;\n#ifdef DIFFUSE\nvar albedoTexture: vec4f=textureSample(diffuseSampler,diffuseSamplerSampler,fragmentInputs.vUVDiffuse);\n#ifdef DIFFUSE_ISLINEAR\nalbedoTexture=toGammaSpace(albedoTexture);\n#endif\n#ifdef GLOW\nfinalColor=vec4f(finalColor.rgb,finalColor.a*albedoTexture.a);\n#endif\n#ifdef HIGHLIGHT\nfinalColor=vec4f(finalColor.rgb,albedoTexture.a);\n#endif\n#endif\n#ifdef OPACITY\nvar opacityMap: vec4f=textureSample(opacitySampler,opacitySamplerSampler,fragmentInputs.vUVOpacity);\n#ifdef OPACITYRGB\nfinalColor=vec4f(finalColor.rgb,finalColor.a*getLuminance(opacityMap.rgb));\n#else\nfinalColor=vec4f(finalColor.rgb,finalColor.a*opacityMap.a);\n#endif\nfinalColor=vec4f(finalColor.rgb,finalColor.a*uniforms.opacityIntensity);\n#endif\n#ifdef VERTEXALPHA\nfinalColor=vec4f(finalColor.rgb,finalColor.a*fragmentInputs.vColor.a);\n#endif\n#ifdef ALPHATEST\nif (finalColor.a<ALPHATESTVALUE) {discard;}\n#endif\n#ifdef EMISSIVE\nvar emissive: vec4f=textureSample(emissiveSampler,emissiveSamplerSampler,fragmentInputs.vUVEmissive);\n#ifdef EMISSIVE_ISLINEAR\nemissive=toGammaSpace(emissive);\n#endif\nfragmentOutputs.color=emissive*finalColor*uniforms.glowIntensity;\n#else\nfragmentOutputs.color=finalColor*uniforms.glowIntensity;\n#endif\n#ifdef HIGHLIGHT\nfragmentOutputs.color=vec4f(fragmentOutputs.color.rgb,uniforms.glowColor.a);\n#endif\n}\n`;\n// Sideeffect\nShaderStore.ShadersStoreWGSL[name] = shader;\n/** @internal */\nexport const glowMapGenerationPixelShaderWGSL = { name, shader };\n"]}
|
|
@@ -15,8 +15,7 @@ baseColor=toGammaSpace(baseColor);
|
|
|
15
15
|
baseColor=toLinearSpaceVec4(baseColor);
|
|
16
16
|
#endif
|
|
17
17
|
#ifdef ALPHATEST
|
|
18
|
-
if (baseColor.a<0.4)
|
|
19
|
-
discard;
|
|
18
|
+
if (baseColor.a<0.4) {discard;}
|
|
20
19
|
#endif
|
|
21
20
|
fragmentOutputs.color=baseColor*uniforms.color;
|
|
22
21
|
#define CUSTOM_FRAGMENT_MAIN_END
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layer.fragment.js","sourceRoot":"","sources":["../../../../dev/core/src/ShadersWGSL/layer.fragment.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,kCAAkC,CAAC;AAE1C,MAAM,IAAI,GAAG,kBAAkB,CAAC;AAChC,MAAM,MAAM,GAAG
|
|
1
|
+
{"version":3,"file":"layer.fragment.js","sourceRoot":"","sources":["../../../../dev/core/src/ShadersWGSL/layer.fragment.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,kCAAkC,CAAC;AAE1C,MAAM,IAAI,GAAG,kBAAkB,CAAC;AAChC,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;EAiBb,CAAC;AACH,aAAa;AACb,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAC5C,gBAAgB;AAChB,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\nimport \"./ShadersInclude/helperFunctions\";\n\nconst name = \"layerPixelShader\";\nconst shader = `varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;uniform color: vec4f;\n#include<helperFunctions>\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\nvar baseColor: vec4f=textureSample(textureSampler,textureSamplerSampler,input.vUV);\n#if defined(CONVERT_TO_GAMMA)\nbaseColor=toGammaSpace(baseColor);\n#elif defined(CONVERT_TO_LINEAR)\nbaseColor=toLinearSpaceVec4(baseColor);\n#endif\n#ifdef ALPHATEST\nif (baseColor.a<0.4) {discard;}\n#endif\nfragmentOutputs.color=baseColor*uniforms.color;\n#define CUSTOM_FRAGMENT_MAIN_END\n}`;\n// Sideeffect\nShaderStore.ShadersStoreWGSL[name] = shader;\n/** @internal */\nexport const layerPixelShaderWGSL = { name, shader };\n"]}
|
|
@@ -731,13 +731,13 @@ WebXRHandTracking.Name = WebXRFeatureName.HAND_TRACKING;
|
|
|
731
731
|
*/
|
|
732
732
|
WebXRHandTracking.Version = 1;
|
|
733
733
|
/** The base URL for the default hand model. */
|
|
734
|
-
WebXRHandTracking.DEFAULT_HAND_MODEL_BASE_URL = "https://assets.babylonjs.com/core/
|
|
734
|
+
WebXRHandTracking.DEFAULT_HAND_MODEL_BASE_URL = "https://assets.babylonjs.com/core/HandMeshes/";
|
|
735
735
|
/** The filename to use for the default right hand model. */
|
|
736
736
|
WebXRHandTracking.DEFAULT_HAND_MODEL_RIGHT_FILENAME = "r_hand_rhs.glb";
|
|
737
737
|
/** The filename to use for the default left hand model. */
|
|
738
738
|
WebXRHandTracking.DEFAULT_HAND_MODEL_LEFT_FILENAME = "l_hand_rhs.glb";
|
|
739
739
|
/** The URL pointing to the default hand model NodeMaterial shader. */
|
|
740
|
-
WebXRHandTracking.DEFAULT_HAND_MODEL_SHADER_URL = "https://assets.babylonjs.com/core/
|
|
740
|
+
WebXRHandTracking.DEFAULT_HAND_MODEL_SHADER_URL = "https://assets.babylonjs.com/core/HandMeshes/handsShader.json";
|
|
741
741
|
// We want to use lightweight models, diameter will initially be 1 but scaled to the values returned from WebXR.
|
|
742
742
|
WebXRHandTracking._ICOSPHERE_PARAMS = { radius: 0.5, flat: false, subdivisions: 2 };
|
|
743
743
|
WebXRHandTracking._RightHandGLB = null;
|