x_ite 11.5.9 → 11.5.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/README.md +4 -4
  2. package/dist/X3DUOM.xml +2 -0
  3. package/dist/assets/components/AnnotationComponent.js +2 -2
  4. package/dist/assets/components/AnnotationComponent.min.js +2 -2
  5. package/dist/assets/components/CADGeometryComponent.js +2 -2
  6. package/dist/assets/components/CADGeometryComponent.min.js +2 -2
  7. package/dist/assets/components/CubeMapTexturingComponent.js +5 -5
  8. package/dist/assets/components/CubeMapTexturingComponent.min.js +2 -2
  9. package/dist/assets/components/DISComponent.js +2 -2
  10. package/dist/assets/components/DISComponent.min.js +2 -2
  11. package/dist/assets/components/EventUtilitiesComponent.js +2 -2
  12. package/dist/assets/components/EventUtilitiesComponent.min.js +2 -2
  13. package/dist/assets/components/Geometry2DComponent.js +2 -2
  14. package/dist/assets/components/Geometry2DComponent.min.js +2 -2
  15. package/dist/assets/components/GeospatialComponent.js +2 -2
  16. package/dist/assets/components/GeospatialComponent.min.js +2 -2
  17. package/dist/assets/components/HAnimComponent.js +77 -2
  18. package/dist/assets/components/HAnimComponent.min.js +2 -2
  19. package/dist/assets/components/KeyDeviceSensorComponent.js +2 -2
  20. package/dist/assets/components/KeyDeviceSensorComponent.min.js +2 -2
  21. package/dist/assets/components/LayoutComponent.js +2 -2
  22. package/dist/assets/components/LayoutComponent.min.js +2 -2
  23. package/dist/assets/components/NURBSComponent.js +2 -2
  24. package/dist/assets/components/NURBSComponent.min.js +2 -2
  25. package/dist/assets/components/ParticleSystemsComponent.js +19 -19
  26. package/dist/assets/components/ParticleSystemsComponent.min.js +2 -2
  27. package/dist/assets/components/PickingComponent.js +2 -2
  28. package/dist/assets/components/PickingComponent.min.js +2 -2
  29. package/dist/assets/components/RigidBodyPhysicsComponent.js +16 -6
  30. package/dist/assets/components/RigidBodyPhysicsComponent.min.js +2 -2
  31. package/dist/assets/components/ScriptingComponent.js +2 -2
  32. package/dist/assets/components/ScriptingComponent.min.js +2 -2
  33. package/dist/assets/components/TextComponent.js +226 -114
  34. package/dist/assets/components/TextComponent.min.js +2 -2
  35. package/dist/assets/components/TextureProjectionComponent.js +2 -2
  36. package/dist/assets/components/TextureProjectionComponent.min.js +2 -2
  37. package/dist/assets/components/Texturing3DComponent.js +1504 -1498
  38. package/dist/assets/components/Texturing3DComponent.min.js +2 -2
  39. package/dist/assets/components/VolumeRenderingComponent.js +8 -8
  40. package/dist/assets/components/VolumeRenderingComponent.min.js +2 -2
  41. package/dist/assets/components/WebXRComponent.js +2 -2
  42. package/dist/assets/components/WebXRComponent.min.js +2 -2
  43. package/dist/assets/components/X_ITEComponent.js +276 -72
  44. package/dist/assets/components/X_ITEComponent.min.js +2 -2
  45. package/dist/assets/lib/draco_decoder_gltf.js +1 -1
  46. package/dist/assets/lib/libktx.js +1 -1
  47. package/dist/assets/lib/woff2_decoder.js +1 -1
  48. package/dist/example.html +1 -1
  49. package/dist/x_ite.css +1 -1
  50. package/dist/x_ite.js +54637 -54693
  51. package/dist/x_ite.min.js +2 -2
  52. package/dist/x_ite.min.mjs +2 -2
  53. package/dist/x_ite.mjs +54460 -54516
  54. package/dist/x_ite.zip +0 -0
  55. package/package.json +3 -3
@@ -1,5 +1,5 @@
1
- /* X_ITE v11.5.9 */
2
- const __X_ITE_X3D__ = window [Symbol .for ("X_ITE.X3D-11.5.9")];
1
+ /* X_ITE v11.5.11 */
2
+ const __X_ITE_X3D__ = window [Symbol .for ("X_ITE.X3D-11.5.11")];
3
3
  /******/ (() => { // webpackBootstrap
4
4
  /******/ "use strict";
5
5
  /******/ // The require scope
@@ -200,24 +200,19 @@ let i = 0;
200
200
 
201
201
  const ExtensionKeys =
202
202
  {
203
- ANISOTROPY_MATERIAL_EXTENSION: i ++,
204
- CLEARCOAT_MATERIAL_EXTENSION: i ++,
205
- DIFFUSE_TRANSMISSION_EXTENSION: i ++,
206
- DISPERSION_MATERIAL_EXTENSION: i ++,
207
- EMISSIVE_STRENGTH_MATERIAL_EXTENSION: i ++,
208
- IOR_MATERIAL_EXTENSION: i ++,
209
- IRIDESCENCE_MATERIAL_EXTENSION: i ++,
210
- SHEEN_MATERIAL_EXTENSION: i ++,
211
- SPECULAR_MATERIAL_EXTENSION: i ++,
212
- TRANSMISSION_MATERIAL_EXTENSION: i ++,
213
- UNLIT_MATERIAL_EXTENSION: i ++,
214
- VOLUME_MATERIAL_EXTENSION: i ++,
203
+ add (name)
204
+ {
205
+ this [name] = i ++;
206
+ },
215
207
  };
216
208
 
217
209
  const ExtensionKeys_default_ = ExtensionKeys;
218
210
  ;
219
211
 
220
212
  /* harmony default export */ const X_ITE_ExtensionKeys = (external_X_ITE_X3D_Namespace_default().add ("ExtensionKeys", ExtensionKeys_default_));
213
+ ;// external "__X_ITE_X3D__ .MaterialTextures"
214
+ const external_X_ITE_X3D_MaterialTextures_namespaceObject = __X_ITE_X3D__ .MaterialTextures;
215
+ var external_X_ITE_X3D_MaterialTextures_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_MaterialTextures_namespaceObject);
221
216
  ;// ./src/x_ite/Components/X_ITE/AnisotropyMaterialExtension.js
222
217
  /*******************************************************************************
223
218
  *
@@ -275,6 +270,16 @@ const ExtensionKeys_default_ = ExtensionKeys;
275
270
 
276
271
 
277
272
 
273
+ // Register key.
274
+
275
+ X_ITE_ExtensionKeys .add ("ANISOTROPY_MATERIAL_EXTENSION");
276
+
277
+ // Register textures.
278
+
279
+
280
+
281
+ external_X_ITE_X3D_MaterialTextures_default().add ("x3d_AnisotropyTextureEXT");
282
+
278
283
  /**
279
284
  * THIS NODE IS STILL EXPERIMENTAL.
280
285
  */
@@ -288,7 +293,7 @@ function AnisotropyMaterialExtension (executionContext)
288
293
  // Units
289
294
 
290
295
  this ._anisotropyRotation .setUnit ("angle");
291
-
296
+
292
297
  // Private properties
293
298
 
294
299
  this .anisotropyArray = new Float32Array (3);
@@ -340,6 +345,10 @@ Object .assign (Object .setPrototypeOf (AnisotropyMaterialExtension .prototype,
340
345
 
341
346
  this .anisotropyTextureNode ?.getShaderOptions (options, "ANISOTROPY", true);
342
347
  },
348
+ getShaderUniforms (uniforms)
349
+ {
350
+ uniforms .push ("x3d_AnisotropyEXT");
351
+ },
343
352
  setShaderUniforms (gl, shaderObject, renderObject, textureTransformMapping, textureCoordinateMapping)
344
353
  {
345
354
  gl .uniform3fv (shaderObject .x3d_AnisotropyEXT, this .anisotropyArray);
@@ -621,6 +630,18 @@ var external_X_ITE_X3D_Algorithm_default = /*#__PURE__*/__webpack_require__.n(ex
621
630
 
622
631
 
623
632
 
633
+ // Register key.
634
+
635
+ X_ITE_ExtensionKeys .add ("CLEARCOAT_MATERIAL_EXTENSION");
636
+
637
+ // Register textures.
638
+
639
+
640
+
641
+ external_X_ITE_X3D_MaterialTextures_default().add ("x3d_ClearcoatTextureEXT");
642
+ external_X_ITE_X3D_MaterialTextures_default().add ("x3d_ClearcoatRoughnessTextureEXT");
643
+ external_X_ITE_X3D_MaterialTextures_default().add ("x3d_ClearcoatNormalTextureEXT");
644
+
624
645
  /**
625
646
  * THIS NODE IS STILL EXPERIMENTAL.
626
647
  */
@@ -693,6 +714,11 @@ Object .assign (Object .setPrototypeOf (ClearcoatMaterialExtension .prototype, X
693
714
  this .clearcoatRoughnessTextureNode ?.getShaderOptions (options, "CLEARCOAT_ROUGHNESS", true);
694
715
  this .clearcoatNormalTextureNode ?.getShaderOptions (options, "CLEARCOAT_NORMAL", true);
695
716
  },
717
+ getShaderUniforms (uniforms)
718
+ {
719
+ uniforms .push ("x3d_ClearcoatEXT");
720
+ uniforms .push ("x3d_ClearcoatRoughnessEXT");
721
+ },
696
722
  setShaderUniforms (gl, shaderObject, renderObject, textureTransformMapping, textureCoordinateMapping)
697
723
  {
698
724
  gl .uniform1f (shaderObject .x3d_ClearcoatEXT, this .clearcoat);
@@ -959,6 +985,18 @@ const DepthMode_default_ = DepthMode;
959
985
 
960
986
 
961
987
 
988
+
989
+ // Register key.
990
+
991
+ X_ITE_ExtensionKeys .add ("DIFFUSE_TRANSMISSION_MATERIAL_EXTENSION");
992
+
993
+ // Register textures.
994
+
995
+
996
+
997
+ external_X_ITE_X3D_MaterialTextures_default().add ("x3d_DiffuseTransmissionTextureEXT");
998
+ external_X_ITE_X3D_MaterialTextures_default().add ("x3d_DiffuseTransmissionColorTextureEXT");
999
+
962
1000
  /**
963
1001
  * THIS NODE IS STILL EXPERIMENTAL.
964
1002
  */
@@ -990,7 +1028,7 @@ Object .assign (Object .setPrototypeOf (DiffuseTransmissionMaterialExtension .pr
990
1028
  },
991
1029
  set_diffuseTransmission__ ()
992
1030
  {
993
- this .diffuseTransmission = Math .max (this ._diffuseTransmission .getValue (), 0);
1031
+ this .diffuseTransmission = external_X_ITE_X3D_Algorithm_default().clamp (this ._diffuseTransmission .getValue (), 0, 1);
994
1032
  },
995
1033
  set_diffuseTransmissionTexture__ ()
996
1034
  {
@@ -1010,7 +1048,7 @@ Object .assign (Object .setPrototypeOf (DiffuseTransmissionMaterialExtension .pr
1010
1048
  },
1011
1049
  getExtensionKey ()
1012
1050
  {
1013
- return X_ITE_ExtensionKeys .DIFFUSE_TRANSMISSION_EXTENSION;
1051
+ return X_ITE_ExtensionKeys .DIFFUSE_TRANSMISSION_MATERIAL_EXTENSION;
1014
1052
  },
1015
1053
  getShaderOptions (options)
1016
1054
  {
@@ -1024,6 +1062,11 @@ Object .assign (Object .setPrototypeOf (DiffuseTransmissionMaterialExtension .pr
1024
1062
  this .diffuseTransmissionTextureNode ?.getShaderOptions (options, "DIFFUSE_TRANSMISSION", true);
1025
1063
  this .diffuseTransmissionColorTextureNode ?.getShaderOptions (options, "DIFFUSE_TRANSMISSION_COLOR", true);
1026
1064
  },
1065
+ getShaderUniforms (uniforms)
1066
+ {
1067
+ uniforms .push ("x3d_DiffuseTransmissionEXT");
1068
+ uniforms .push ("x3d_DiffuseTransmissionColorEXT");
1069
+ },
1027
1070
  setShaderUniforms (gl, shaderObject, renderObject, textureTransformMapping, textureCoordinateMapping)
1028
1071
  {
1029
1072
  gl .uniform1f (shaderObject .x3d_DiffuseTransmissionEXT, this .diffuseTransmission);
@@ -1128,6 +1171,10 @@ const DiffuseTransmissionMaterialExtension_default_ = DiffuseTransmissionMateria
1128
1171
 
1129
1172
 
1130
1173
 
1174
+ // Register key.
1175
+
1176
+ X_ITE_ExtensionKeys .add ("DISPERSION_MATERIAL_EXTENSION");
1177
+
1131
1178
  /**
1132
1179
  * THIS NODE IS STILL EXPERIMENTAL.
1133
1180
  */
@@ -1161,6 +1208,10 @@ Object .assign (Object .setPrototypeOf (DispersionMaterialExtension .prototype,
1161
1208
  {
1162
1209
  options .push ("X3D_DISPERSION_MATERIAL_EXT");
1163
1210
  },
1211
+ getShaderUniforms (uniforms)
1212
+ {
1213
+ uniforms .push ("x3d_DispersionEXT");
1214
+ },
1164
1215
  setShaderUniforms (gl, shaderObject, renderObject, textureTransformMapping, textureCoordinateMapping)
1165
1216
  {
1166
1217
  gl .uniform1f (shaderObject .x3d_DispersionEXT, this .dispersion);
@@ -1240,6 +1291,10 @@ const DispersionMaterialExtension_default_ = DispersionMaterialExtension;
1240
1291
 
1241
1292
 
1242
1293
 
1294
+ // Register key.
1295
+
1296
+ X_ITE_ExtensionKeys .add ("EMISSIVE_STRENGTH_MATERIAL_EXTENSION");
1297
+
1243
1298
  /**
1244
1299
  * THIS NODE IS STILL EXPERIMENTAL.
1245
1300
  */
@@ -1273,6 +1328,10 @@ Object .assign (Object .setPrototypeOf (EmissiveStrengthMaterialExtension .proto
1273
1328
  {
1274
1329
  options .push ("X3D_EMISSIVE_STRENGTH_MATERIAL_EXT");
1275
1330
  },
1331
+ getShaderUniforms (uniforms)
1332
+ {
1333
+ uniforms .push ("x3d_EmissiveStrengthEXT");
1334
+ },
1276
1335
  setShaderUniforms (gl, shaderObject, renderObject, textureTransformMapping, textureCoordinateMapping)
1277
1336
  {
1278
1337
  gl .uniform1f (shaderObject .x3d_EmissiveStrengthEXT, this .emissiveStrength);
@@ -1610,6 +1669,10 @@ const InstancedShape_default_ = InstancedShape;
1610
1669
 
1611
1670
 
1612
1671
 
1672
+ // Register key.
1673
+
1674
+ X_ITE_ExtensionKeys .add ("IOR_MATERIAL_EXTENSION");
1675
+
1613
1676
  /**
1614
1677
  * THIS NODE IS STILL EXPERIMENTAL.
1615
1678
  */
@@ -1643,6 +1706,10 @@ Object .assign (Object .setPrototypeOf (IORMaterialExtension .prototype, X_ITE_X
1643
1706
  {
1644
1707
  options .push ("X3D_IOR_MATERIAL_EXT");
1645
1708
  },
1709
+ getShaderUniforms (uniforms)
1710
+ {
1711
+ uniforms .push ("x3d_IorEXT");
1712
+ },
1646
1713
  setShaderUniforms (gl, shaderObject, renderObject, textureTransformMapping, textureCoordinateMapping)
1647
1714
  {
1648
1715
  gl .uniform1f (shaderObject .x3d_IorEXT, this .indexOfRefraction);
@@ -1666,6 +1733,18 @@ const IORMaterialExtension_default_ = IORMaterialExtension;
1666
1733
  ;
1667
1734
 
1668
1735
  /* harmony default export */ const X_ITE_IORMaterialExtension = (external_X_ITE_X3D_Namespace_default().add ("IORMaterialExtension", IORMaterialExtension_default_));
1736
+ ;// external "__X_ITE_X3D__ .ShaderRegistry"
1737
+ const external_X_ITE_X3D_ShaderRegistry_namespaceObject = __X_ITE_X3D__ .ShaderRegistry;
1738
+ var external_X_ITE_X3D_ShaderRegistry_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_ShaderRegistry_namespaceObject);
1739
+ ;// ./src/assets/shaders/webgl2/pbr/Iridescence2.glsl.js
1740
+ const Iridescence2_glsl_default_ = () => /* glsl */ `
1741
+ #if defined(X3D_IRIDESCENCE_MATERIAL_EXT)
1742
+ const mat3 XYZ_TO_REC709=mat3(3.2404542,-.9692660,.0556434,-1.5371385,1.8760108,-.2040259,-.4985314,.0415560,1.0572252);float sq(const in float v){return v*v;}vec3 sq(const in vec3 v){return v*v;}vec3 Fresnel0ToIor(const in vec3 fresnel0){vec3 sqrtF0=sqrt(fresnel0);return(vec3(1)+sqrtF0)/(vec3(1)-sqrtF0);}vec3 IorToFresnel0(const in vec3 transmittedIor,const in float incidentIor){return sq((transmittedIor-vec3(incidentIor))/(transmittedIor+vec3(incidentIor)));}float IorToFresnel0(const in float transmittedIor,const in float incidentIor){return sq((transmittedIor-incidentIor)/(transmittedIor+incidentIor));}vec3 evalSensitivity(const in float OPD,const in vec3 shift){float phase=2.*M_PI*OPD*1.0e-9;vec3 val=vec3(5.4856e-13,4.4201e-13,5.2481e-13);vec3 pos=vec3(1.6810e+06,1.7953e+06,2.2084e+06);vec3 var=vec3(4.3278e+09,9.3046e+09,6.6121e+09);vec3 xyz=val*sqrt(2.*M_PI*var)*cos(pos*phase+shift)*exp(-sq(phase)*var);xyz.x+=9.7470e-14*sqrt(2.*M_PI*4.5282e+09)*cos(2.2399e+06*phase+shift[0])*exp(-4.5282e+09*sq(phase));xyz/=1.0685e-7;vec3 srgb=XYZ_TO_REC709*xyz;return srgb;}vec3 evalIridescence(const in float outsideIOR,const in float eta2,const in float cosTheta1,const in float thinFilmThickness,const in vec3 baseF0){vec3 I;float iridescenceIor=mix(outsideIOR,eta2,smoothstep(0.,.03,thinFilmThickness));float sinTheta2Sq=sq(outsideIOR/iridescenceIor)*(1.-sq(cosTheta1));float cosTheta2Sq=1.-sinTheta2Sq;if(cosTheta2Sq<0.)return vec3(1);float cosTheta2=sqrt(cosTheta2Sq);float R0=IorToFresnel0(iridescenceIor,outsideIOR);float R12=F_Schlick(R0,cosTheta1);float R21=R12;float T121=1.-R12;float phi12=0.;if(iridescenceIor<outsideIOR)phi12=M_PI;float phi21=M_PI-phi12;vec3 baseIOR=Fresnel0ToIor(clamp(baseF0,0.,.9999));vec3 R1=IorToFresnel0(baseIOR,iridescenceIor);vec3 R23=F_Schlick(R1,cosTheta2);vec3 phi23=vec3(0);if(baseIOR[0]<iridescenceIor)phi23[0]=M_PI;if(baseIOR[1]<iridescenceIor)phi23[1]=M_PI;if(baseIOR[2]<iridescenceIor)phi23[2]=M_PI;float OPD=2.*iridescenceIor*thinFilmThickness*cosTheta2;vec3 phi=vec3(phi21)+phi23;vec3 R123=clamp(R12*R23,1e-5,.9999);vec3 r123=sqrt(R123);vec3 Rs=sq(T121)*R23/(vec3(1)-R123);vec3 C0=R12+Rs;I=C0;vec3 Cm=Rs-T121;for(int m=1;m<=2;++m){Cm*=r123;vec3 Sm=2.*evalSensitivity(float(m)*OPD,float(m)*phi);I+=Cm*Sm;}return max(I,vec3(0));}
1743
+ #endif
1744
+ `
1745
+ ;
1746
+
1747
+ /* harmony default export */ const Iridescence2_glsl = (external_X_ITE_X3D_Namespace_default().add ("Iridescence2.glsl", Iridescence2_glsl_default_));
1669
1748
  ;// ./src/x_ite/Components/X_ITE/IridescenceMaterialExtension.js
1670
1749
  /*******************************************************************************
1671
1750
  *
@@ -1723,6 +1802,24 @@ const IORMaterialExtension_default_ = IORMaterialExtension;
1723
1802
 
1724
1803
 
1725
1804
 
1805
+ // Register key.
1806
+
1807
+ X_ITE_ExtensionKeys .add ("IRIDESCENCE_MATERIAL_EXTENSION");
1808
+
1809
+ // Register shaders.
1810
+
1811
+
1812
+
1813
+
1814
+ external_X_ITE_X3D_ShaderRegistry_default().addInclude ("Iridescence", Iridescence2_glsl);
1815
+
1816
+ // Register textures.
1817
+
1818
+
1819
+
1820
+ external_X_ITE_X3D_MaterialTextures_default().add ("x3d_IridescenceTextureEXT");
1821
+ external_X_ITE_X3D_MaterialTextures_default().add ("x3d_IridescenceThicknessTextureEXT");
1822
+
1726
1823
  /**
1727
1824
  * THIS NODE IS STILL EXPERIMENTAL.
1728
1825
  */
@@ -1798,6 +1895,13 @@ Object .assign (Object .setPrototypeOf (IridescenceMaterialExtension .prototype,
1798
1895
  this .iridescenceTextureNode ?.getShaderOptions (options, "IRIDESCENCE", true);
1799
1896
  this .iridescenceThicknessTextureNode ?.getShaderOptions (options, "IRIDESCENCE_THICKNESS", true);
1800
1897
  },
1898
+ getShaderUniforms (uniforms)
1899
+ {
1900
+ uniforms .push ("x3d_IridescenceEXT");
1901
+ uniforms .push ("x3d_IridescenceIndexOfRefractionEXT");
1902
+ uniforms .push ("x3d_IridescenceThicknessMinimumEXT");
1903
+ uniforms .push ("x3d_IridescenceThicknessMaximumEXT");
1904
+ },
1801
1905
  setShaderUniforms (gl, shaderObject, renderObject, textureTransformMapping, textureCoordinateMapping)
1802
1906
  {
1803
1907
  gl .uniform1f (shaderObject .x3d_IridescenceEXT, this .iridescence);
@@ -1908,6 +2012,17 @@ const IridescenceMaterialExtension_default_ = IridescenceMaterialExtension;
1908
2012
 
1909
2013
 
1910
2014
 
2015
+ // Register key.
2016
+
2017
+ X_ITE_ExtensionKeys .add ("SHEEN_MATERIAL_EXTENSION");
2018
+
2019
+ // Register textures.
2020
+
2021
+
2022
+
2023
+ external_X_ITE_X3D_MaterialTextures_default().add ("x3d_SheenColorTextureEXT");
2024
+ external_X_ITE_X3D_MaterialTextures_default().add ("x3d_SheenRoughnessTextureEXT");
2025
+
1911
2026
  /**
1912
2027
  * THIS NODE IS STILL EXPERIMENTAL.
1913
2028
  */
@@ -1977,6 +2092,12 @@ Object .assign (Object .setPrototypeOf (SheenMaterialExtension .prototype, X_ITE
1977
2092
  this .sheenColorTextureNode ?.getShaderOptions (options, "SHEEN_COLOR", true);
1978
2093
  this .sheenRoughnessTextureNode ?.getShaderOptions (options, "SHEEN_ROUGHNESS", true);
1979
2094
  },
2095
+ getShaderUniforms (uniforms)
2096
+ {
2097
+ uniforms .push ("x3d_SheenColorEXT");
2098
+ uniforms .push ("x3d_SheenRoughnessEXT");
2099
+ uniforms .push ("x3d_SheenELUTTextureEXT");
2100
+ },
1980
2101
  setShaderUniforms (gl, shaderObject, renderObject, textureTransformMapping, textureCoordinateMapping)
1981
2102
  {
1982
2103
  gl .uniform3fv (shaderObject .x3d_SheenColorEXT, this .sheenColorArray);
@@ -2037,6 +2158,78 @@ const SheenMaterialExtension_default_ = SheenMaterialExtension;
2037
2158
  ;// external "__X_ITE_X3D__ .X3DOneSidedMaterialNode"
2038
2159
  const external_X_ITE_X3D_X3DOneSidedMaterialNode_namespaceObject = __X_ITE_X3D__ .X3DOneSidedMaterialNode;
2039
2160
  var external_X_ITE_X3D_X3DOneSidedMaterialNode_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_X3DOneSidedMaterialNode_namespaceObject);
2161
+ ;// ./src/assets/shaders/webgl2/pbr/SpecularGlossiness2.glsl.js
2162
+
2163
+
2164
+ const SpecularGlossiness2_glsl_default_ = () => /* glsl */ `
2165
+ #pragma X3D include "../common/Fragment.glsl"
2166
+ #pragma X3D include "../common/Shadow.glsl"
2167
+ #if defined(X3D_LIGHTING)
2168
+ uniform x3d_LightSourceParameters x3d_LightSource[X3D_NUM_LIGHTS];
2169
+ #endif
2170
+ uniform x3d_PhysicalMaterialParameters x3d_Material;
2171
+ #pragma X3D include "pbr/BRDF.glsl"
2172
+ #pragma X3D include "pbr/MaterialInfo.glsl"
2173
+ #pragma X3D include "pbr/Punctual.glsl"
2174
+ #pragma X3D include "pbr/IBL.glsl"
2175
+ ${external_X_ITE_X3D_MaterialTextures_default().texture ("x3d_SpecularGlossinessTexture", "rgba", "linear")}
2176
+ MaterialInfo getSpecularGlossinessInfo(in MaterialInfo info){vec3 specular=x3d_Material.specularColor;float glossiness=x3d_Material.glossiness;
2177
+ #if defined(X3D_SPECULAR_GLOSSINESS_TEXTURE)
2178
+ vec4 sgSample=getSpecularGlossinessTexture();glossiness*=sgSample.a;specular*=sgSample.rgb;
2179
+ #endif
2180
+ info.perceptualRoughness=1.-glossiness;info.f0_dielectric=min(specular,vec3(1));return info;}vec4 getMaterialColor(){vec4 baseColor=getBaseColor();
2181
+ #if defined(X3D_TEXTURE_PROJECTION)
2182
+ baseColor.rgb*=getTextureProjectorColor();
2183
+ #endif
2184
+ vec3 color=vec3(0);vec3 v=normalize(-vertex);
2185
+ #if defined(X3D_USE_IBL)||defined(X3D_LIGHTING)
2186
+ NormalInfo normalInfo=getNormalInfo(x3d_Material.normalScale);vec3 n=normalInfo.n;float NdotV=clamp(dot(n,v),0.,1.);
2187
+ #endif
2188
+ MaterialInfo materialInfo;materialInfo.baseColor=baseColor.rgb;materialInfo.f90_dielectric=vec3(1);materialInfo.metallic=0.;materialInfo=getSpecularGlossinessInfo(materialInfo);materialInfo.perceptualRoughness=clamp(materialInfo.perceptualRoughness,0.,1.);materialInfo.alphaRoughness=materialInfo.perceptualRoughness*materialInfo.perceptualRoughness;vec3 f_emissive=vec3(0);
2189
+ #if defined(X3D_USE_IBL)
2190
+ vec3 f_diffuse=getDiffuseLight(n)*baseColor.rgb;vec3 f_specular_dielectric=getIBLRadianceGGX(n,v,materialInfo.perceptualRoughness);vec3 f_dielectric_fresnel_ibl=getIBLGGXFresnel(n,v,materialInfo.perceptualRoughness,materialInfo.f0_dielectric,1.);vec3 f_dielectric_brdf_ibl=mix(f_diffuse,f_specular_dielectric,f_dielectric_fresnel_ibl);color=f_dielectric_brdf_ibl;
2191
+ #if defined(X3D_OCCLUSION_TEXTURE)
2192
+ float ao=getOcclusionFactor();color*=1.+x3d_Material.occlusionStrength*(ao-1.);
2193
+ #endif
2194
+ #endif
2195
+ #if defined(X3D_LIGHTING)
2196
+ for(int i=0;i<X3D_NUM_LIGHTS;++i){x3d_LightSourceParameters light=x3d_LightSource[i];vec3 pointToLight;float distanceToLight;if(light.type!=x3d_DirectionalLight){pointToLight=light.location-vertex;distanceToLight=length(light.matrix*pointToLight);}else{pointToLight=-light.direction;distanceToLight=-1.;}if(distanceToLight<=light.radius||light.radius<0.){vec3 l=normalize(pointToLight);vec3 h=normalize(l+v);float NdotL=clamp(dot(n,l),0.,1.);float NdotV=clamp(dot(n,v),0.,1.);float NdotH=clamp(dot(n,h),0.,1.);float VdotH=clamp(dot(v,h),0.,1.);vec3 dielectric_fresnel=F_Schlick(materialInfo.f0_dielectric,materialInfo.f90_dielectric,abs(VdotH));vec3 lightIntensity=getLightIntensity(light,l,distanceToLight);
2197
+ #if defined(X3D_SHADOWS)
2198
+ lightIntensity=mix(lightIntensity,light.shadowColor,getShadowIntensity(i,light));
2199
+ #endif
2200
+ vec3 l_diffuse=lightIntensity*NdotL*BRDF_lambertian(baseColor.rgb);vec3 intensity=lightIntensity;vec3 l_specular_dielectric=intensity*NdotL*BRDF_specularGGX(materialInfo.alphaRoughness,NdotL,NdotV,NdotH);vec3 l_dielectric_brdf=mix(l_diffuse,l_specular_dielectric,dielectric_fresnel);color+=l_dielectric_brdf;}}
2201
+ #endif
2202
+ f_emissive=getEmissiveColor();
2203
+ #if defined(X3D_UNLIT_MATERIAL_EXT)
2204
+ color=baseColor.rgb;
2205
+ #elif(defined(X3D_GEOMETRY_0D)||defined(X3D_GEOMETRY_1D))&&!defined(X3D_NORMALS)
2206
+ color=f_emissive+baseColor.rgb;
2207
+ #else
2208
+ color=f_emissive+color;
2209
+ #endif
2210
+ return vec4(color,baseColor.a);}void main(){fragment_main();}`
2211
+ ;
2212
+
2213
+ /* harmony default export */ const SpecularGlossiness2_glsl = (external_X_ITE_X3D_Namespace_default().add ("SpecularGlossiness2.glsl", SpecularGlossiness2_glsl_default_));
2214
+ ;// ./src/assets/shaders/webgl1/SpecularGlossiness1.fs.js
2215
+ const SpecularGlossiness1_fs_default_ = () => /* glsl */ `
2216
+ #extension GL_OES_standard_derivatives:enable
2217
+ #extension GL_EXT_frag_depth:enable
2218
+ #extension GL_EXT_shader_texture_lod:enable
2219
+ precision highp float;precision highp int;precision highp sampler2D;precision highp samplerCube;
2220
+ #pragma X3D include "pbr/SpecularGlossiness.glsl"
2221
+ `
2222
+ ;
2223
+
2224
+ /* harmony default export */ const SpecularGlossiness1_fs = (external_X_ITE_X3D_Namespace_default().add ("SpecularGlossiness1.fs", SpecularGlossiness1_fs_default_));
2225
+ ;// ./src/assets/shaders/webgl2/SpecularGlossiness2.fs.js
2226
+ const SpecularGlossiness2_fs_default_ = () => /* glsl */ `#version 300 es
2227
+ precision highp float;precision highp int;precision highp sampler2D;precision highp sampler3D;precision highp samplerCube;
2228
+ #pragma X3D include "pbr/SpecularGlossiness.glsl"
2229
+ `
2230
+ ;
2231
+
2232
+ /* harmony default export */ const SpecularGlossiness2_fs = (external_X_ITE_X3D_Namespace_default().add ("SpecularGlossiness2.fs", SpecularGlossiness2_fs_default_));
2040
2233
  ;// ./src/x_ite/Components/X_ITE/SpecularGlossinessMaterial.js
2041
2234
  /*******************************************************************************
2042
2235
  *
@@ -2094,6 +2287,16 @@ var external_X_ITE_X3D_X3DOneSidedMaterialNode_default = /*#__PURE__*/__webpack_
2094
2287
 
2095
2288
 
2096
2289
 
2290
+ // Register shaders.
2291
+
2292
+
2293
+
2294
+
2295
+
2296
+
2297
+ external_X_ITE_X3D_ShaderRegistry_default().addInclude ("SpecularGlossiness", SpecularGlossiness2_glsl);
2298
+ external_X_ITE_X3D_ShaderRegistry_default().addFragment ("SpecularGlossiness", SpecularGlossiness1_fs, SpecularGlossiness2_fs);
2299
+
2097
2300
  /**
2098
2301
  * THIS NODE IS DEPRECIATED SINCE X3D VERSION 4.0.
2099
2302
  */
@@ -2108,7 +2311,6 @@ function SpecularGlossinessMaterial (executionContext)
2108
2311
 
2109
2312
  this .diffuseColorArray = new Float32Array (3);
2110
2313
  this .specularColorArray = new Float32Array (3);
2111
- this .extensionNodes = [ ];
2112
2314
  }
2113
2315
 
2114
2316
  Object .assign (Object .setPrototypeOf (SpecularGlossinessMaterial .prototype, (external_X_ITE_X3D_X3DOneSidedMaterialNode_default()).prototype),
@@ -2125,7 +2327,6 @@ Object .assign (Object .setPrototypeOf (SpecularGlossinessMaterial .prototype, (
2125
2327
  this ._specularGlossinessTexture .addInterest ("set_specularGlossinessTexture__", this);
2126
2328
  this ._occlusionStrength .addInterest ("set_occlusionStrength__", this);
2127
2329
  this ._occlusionTexture .addInterest ("set_occlusionTexture__", this);
2128
- this ._extensions .addInterest ("set_extensions__", this);
2129
2330
 
2130
2331
  this .set_diffuseColor__ ();
2131
2332
  this .set_diffuseTexture__ ();
@@ -2134,12 +2335,11 @@ Object .assign (Object .setPrototypeOf (SpecularGlossinessMaterial .prototype, (
2134
2335
  this .set_specularGlossinessTexture__ ();
2135
2336
  this .set_occlusionStrength__ ();
2136
2337
  this .set_occlusionTexture__ ();
2137
- this .set_extensions__ ();
2138
2338
  this .set_transparent__ ();
2139
2339
  },
2140
2340
  getMaterialKey ()
2141
2341
  {
2142
- return this .materialKey;
2342
+ return 4;
2143
2343
  },
2144
2344
  getTextureIndices: (() =>
2145
2345
  {
@@ -2210,49 +2410,12 @@ Object .assign (Object .setPrototypeOf (SpecularGlossinessMaterial .prototype, (
2210
2410
 
2211
2411
  this .setTexture (this .getTextureIndices () .OCCLUSION_TEXTURE, this .occlusionTextureNode);
2212
2412
  },
2213
- set_extensions__ ()
2214
- {
2215
- const extensionNodes = this .extensionNodes;
2216
-
2217
- for (const extensionNode of extensionNodes)
2218
- extensionNode .removeInterest ("set_extensionsKey__", this);
2219
-
2220
- extensionNodes .length = 0;
2221
-
2222
- for (const node of this ._extensions)
2223
- {
2224
- const extensionNode = external_X_ITE_X3D_X3DCast_default() ((external_X_ITE_X3D_X3DConstants_default()).X3DMaterialExtensionNode, node);
2225
-
2226
- if (extensionNode)
2227
- extensionNodes .push (extensionNode);
2228
- }
2229
-
2230
- extensionNodes .sort ((a, b) => a .getExtensionKey () - b .getExtensionKey ());
2231
-
2232
- for (const extensionNode of extensionNodes)
2233
- extensionNode .addInterest ("set_extensionsKey__", this);
2234
-
2235
- this .setTransmission (extensionNodes .some (extensionNode => extensionNode .getType () .includes ((external_X_ITE_X3D_X3DConstants_default()).TransmissionMaterialExtension)));
2236
-
2237
- this .set_extensionsKey__ ();
2238
- },
2239
- set_extensionsKey__ ()
2240
- {
2241
- const extensionsKey = this .extensionNodes
2242
- .map (extensionNode => `${extensionNode .getExtensionKey () .toString (16)}${extensionNode .getTextureBits () .toString (16)}`)
2243
- .join ("");
2244
-
2245
- this .materialKey = `[4.${extensionsKey}]`;
2246
- },
2247
2413
  createShader (key, geometryContext, renderContext)
2248
2414
  {
2249
2415
  const
2250
2416
  browser = this .getBrowser (),
2251
2417
  options = this .getShaderOptions (geometryContext, renderContext);
2252
2418
 
2253
- for (const extensionNode of this .extensionNodes)
2254
- extensionNode .getShaderOptions (options);
2255
-
2256
2419
  options .push ("X3D_PHYSICAL_MATERIAL", "X3D_MATERIAL_SPECULAR_GLOSSINESS");
2257
2420
 
2258
2421
  if (+this .getTextureBits ())
@@ -2262,7 +2425,7 @@ Object .assign (Object .setPrototypeOf (SpecularGlossinessMaterial .prototype, (
2262
2425
  this .occlusionTextureNode ?.getShaderOptions (options, "OCCLUSION");
2263
2426
  }
2264
2427
 
2265
- const shaderNode = browser .createShader ("SpecularGlossiness", "Default", "Physical", options);
2428
+ const shaderNode = browser .createShader ("SpecularGlossiness", "Default", "SpecularGlossiness", options);
2266
2429
 
2267
2430
  browser .getShaders () .set (key, shaderNode);
2268
2431
 
@@ -2272,9 +2435,6 @@ Object .assign (Object .setPrototypeOf (SpecularGlossinessMaterial .prototype, (
2272
2435
  {
2273
2436
  external_X_ITE_X3D_X3DOneSidedMaterialNode_default().prototype .setShaderUniforms .call (this, gl, shaderObject, renderObject, textureTransformMapping, textureCoordinateMapping);
2274
2437
 
2275
- for (const extensionNode of this .extensionNodes)
2276
- extensionNode .setShaderUniforms (gl, shaderObject, renderObject, textureTransformMapping, textureCoordinateMapping);
2277
-
2278
2438
  gl .uniform3fv (shaderObject .x3d_DiffuseColor, this .diffuseColorArray);
2279
2439
  gl .uniform3fv (shaderObject .x3d_SpecularColor, this .specularColorArray);
2280
2440
  gl .uniform1f (shaderObject .x3d_Glossiness, this .glossiness);
@@ -2337,7 +2497,6 @@ Object .defineProperties (SpecularGlossinessMaterial,
2337
2497
  new (external_X_ITE_X3D_X3DFieldDefinition_default()) ((external_X_ITE_X3D_X3DConstants_default()).inputOutput, "normalTextureMapping", new (external_X_ITE_X3D_Fields_default()).SFString ()),
2338
2498
  new (external_X_ITE_X3D_X3DFieldDefinition_default()) ((external_X_ITE_X3D_X3DConstants_default()).inputOutput, "normalTexture", new (external_X_ITE_X3D_Fields_default()).SFNode ()),
2339
2499
  new (external_X_ITE_X3D_X3DFieldDefinition_default()) ((external_X_ITE_X3D_X3DConstants_default()).inputOutput, "transparency", new (external_X_ITE_X3D_Fields_default()).SFFloat ()),
2340
- new (external_X_ITE_X3D_X3DFieldDefinition_default()) ((external_X_ITE_X3D_X3DConstants_default()).inputOutput, "extensions", new (external_X_ITE_X3D_Fields_default()).MFNode ()), // experimental
2341
2500
  ]),
2342
2501
  enumerable: true,
2343
2502
  },
@@ -2412,6 +2571,17 @@ const SpecularGlossinessMaterial_default_ = SpecularGlossinessMaterial;
2412
2571
 
2413
2572
 
2414
2573
 
2574
+ // Register key.
2575
+
2576
+ X_ITE_ExtensionKeys .add ("SPECULAR_MATERIAL_EXTENSION");
2577
+
2578
+ // Register textures.
2579
+
2580
+
2581
+
2582
+ external_X_ITE_X3D_MaterialTextures_default().add ("x3d_SpecularTextureEXT");
2583
+ external_X_ITE_X3D_MaterialTextures_default().add ("x3d_SpecularColorTextureEXT");
2584
+
2415
2585
  /**
2416
2586
  * THIS NODE IS STILL EXPERIMENTAL.
2417
2587
  */
@@ -2477,6 +2647,11 @@ Object .assign (Object .setPrototypeOf (SpecularMaterialExtension .prototype, X_
2477
2647
  this .specularTextureNode ?.getShaderOptions (options, "SPECULAR", true);
2478
2648
  this .specularColorTextureNode ?.getShaderOptions (options, "SPECULAR_COLOR", true);
2479
2649
  },
2650
+ getShaderUniforms (uniforms)
2651
+ {
2652
+ uniforms .push ("x3d_SpecularEXT");
2653
+ uniforms .push ("x3d_SpecularColorEXT");
2654
+ },
2480
2655
  setShaderUniforms (gl, shaderObject, renderObject, textureTransformMapping, textureCoordinateMapping)
2481
2656
  {
2482
2657
  gl .uniform1f (shaderObject .x3d_SpecularEXT, this .specular);
@@ -2582,6 +2757,17 @@ const SpecularMaterialExtension_default_ = SpecularMaterialExtension;
2582
2757
 
2583
2758
 
2584
2759
 
2760
+
2761
+ // Register key.
2762
+
2763
+ X_ITE_ExtensionKeys .add ("TRANSMISSION_MATERIAL_EXTENSION");
2764
+
2765
+ // Register textures.
2766
+
2767
+
2768
+
2769
+ external_X_ITE_X3D_MaterialTextures_default().add ("x3d_TransmissionTextureEXT");
2770
+
2585
2771
  /**
2586
2772
  * THIS NODE IS STILL EXPERIMENTAL.
2587
2773
  */
@@ -2607,7 +2793,7 @@ Object .assign (Object .setPrototypeOf (TransmissionMaterialExtension .prototype
2607
2793
  },
2608
2794
  set_transmission__ ()
2609
2795
  {
2610
- this .transmission = Math .max (this ._transmission .getValue (), 0);
2796
+ this .transmission = external_X_ITE_X3D_Algorithm_default().clamp (this ._transmission .getValue (), 0, 1);
2611
2797
  },
2612
2798
  set_transmissionTexture__ ()
2613
2799
  {
@@ -2630,6 +2816,11 @@ Object .assign (Object .setPrototypeOf (TransmissionMaterialExtension .prototype
2630
2816
 
2631
2817
  this .transmissionTextureNode ?.getShaderOptions (options, "TRANSMISSION", true);
2632
2818
  },
2819
+ getShaderUniforms (uniforms)
2820
+ {
2821
+ uniforms .push ("x3d_TransmissionEXT");
2822
+ uniforms .push ("x3d_TransmissionSamplerEXT");
2823
+ },
2633
2824
  setShaderUniforms: (() =>
2634
2825
  {
2635
2826
  const zeros = new Float32Array (16);
@@ -2645,26 +2836,23 @@ Object .assign (Object .setPrototypeOf (TransmissionMaterialExtension .prototype
2645
2836
  if (renderObject .isTransmission ())
2646
2837
  {
2647
2838
  var
2648
- transmissionBufferTexture = browser .getDefaultTexture2D (),
2649
- transmissionUnit = browser .getDefaultTexture2DUnit ();
2839
+ transmissionUnit = browser .getDefaultTexture2DUnit (),
2840
+ transmissionBufferTexture = browser .getDefaultTexture2D ();
2650
2841
 
2651
2842
  // Hide object by using a model view matrix with zeros.
2652
2843
  gl .uniformMatrix4fv (shaderObject .x3d_ModelViewMatrix, false, zeros);
2653
- gl .uniform2i (shaderObject .x3d_TransmissionFramebufferSizeEXT, 1, 1);
2654
2844
  }
2655
2845
  else
2656
2846
  {
2657
2847
  var
2658
2848
  transmissionBuffer = browser .getTransmissionBuffer (),
2659
- transmissionBufferTexture = transmissionBuffer .getColorTexture (),
2660
- transmissionUnit = browser .getTexture2DUnit ();
2661
-
2662
- gl .uniform2i (shaderObject .x3d_TransmissionFramebufferSizeEXT, transmissionBuffer .getWidth (), transmissionBuffer .getHeight ());
2849
+ transmissionUnit = browser .getTexture2DUnit (),
2850
+ transmissionBufferTexture = transmissionBuffer .getColorTexture ();
2663
2851
  }
2664
2852
 
2665
2853
  gl .activeTexture (gl .TEXTURE0 + transmissionUnit);
2666
2854
  gl .bindTexture (gl .TEXTURE_2D, transmissionBufferTexture);
2667
- gl .uniform1i (shaderObject .x3d_TransmissionFramebufferSamplerEXT, transmissionUnit);
2855
+ gl .uniform1i (shaderObject .x3d_TransmissionSamplerEXT, transmissionUnit);
2668
2856
 
2669
2857
  if (!+this .getTextureBits ())
2670
2858
  return;
@@ -2756,6 +2944,16 @@ const TransmissionMaterialExtension_default_ = TransmissionMaterialExtension;
2756
2944
 
2757
2945
 
2758
2946
 
2947
+ // Register key.
2948
+
2949
+ X_ITE_ExtensionKeys .add ("VOLUME_MATERIAL_EXTENSION");
2950
+
2951
+ // Register textures.
2952
+
2953
+
2954
+
2955
+ external_X_ITE_X3D_MaterialTextures_default().add ("x3d_ThicknessTextureEXT");
2956
+
2759
2957
  /**
2760
2958
  * THIS NODE IS STILL EXPERIMENTAL.
2761
2959
  */
@@ -2825,6 +3023,12 @@ Object .assign (Object .setPrototypeOf (VolumeMaterialExtension .prototype, X_IT
2825
3023
 
2826
3024
  this .thicknessTextureNode ?.getShaderOptions (options, "THICKNESS", true);
2827
3025
  },
3026
+ getShaderUniforms (uniforms)
3027
+ {
3028
+ uniforms .push ("x3d_ThicknessEXT");
3029
+ uniforms .push ("x3d_AttenuationDistanceEXT");
3030
+ uniforms .push ("x3d_AttenuationColorEXT");
3031
+ },
2828
3032
  setShaderUniforms (gl, shaderObject, renderObject, textureTransformMapping, textureCoordinateMapping)
2829
3033
  {
2830
3034
  gl .uniform1f (shaderObject .x3d_ThicknessEXT, this .thickness);