x_ite 16.0.3 → 16.0.5

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 (57) hide show
  1. package/README.md +6 -6
  2. package/dist/assets/components/AnnotationComponent.js +1 -1
  3. package/dist/assets/components/AnnotationComponent.min.js +1 -1
  4. package/dist/assets/components/CADGeometryComponent.js +1 -1
  5. package/dist/assets/components/CADGeometryComponent.min.js +1 -1
  6. package/dist/assets/components/CubeMapTexturingComponent.js +2 -2
  7. package/dist/assets/components/CubeMapTexturingComponent.min.js +2 -2
  8. package/dist/assets/components/DISComponent.js +1 -1
  9. package/dist/assets/components/DISComponent.min.js +1 -1
  10. package/dist/assets/components/EventUtilitiesComponent.js +1 -1
  11. package/dist/assets/components/EventUtilitiesComponent.min.js +1 -1
  12. package/dist/assets/components/GaussianSplatsComponent.js +1 -1
  13. package/dist/assets/components/GaussianSplatsComponent.min.js +1 -1
  14. package/dist/assets/components/Geometry2DComponent.js +1 -1
  15. package/dist/assets/components/Geometry2DComponent.min.js +1 -1
  16. package/dist/assets/components/Geometry3DComponent.js +1 -1
  17. package/dist/assets/components/Geometry3DComponent.min.js +1 -1
  18. package/dist/assets/components/GeospatialComponent.js +1 -1
  19. package/dist/assets/components/GeospatialComponent.min.js +1 -1
  20. package/dist/assets/components/HAnimComponent.js +1 -1
  21. package/dist/assets/components/HAnimComponent.min.js +1 -1
  22. package/dist/assets/components/KeyDeviceSensorComponent.js +1 -1
  23. package/dist/assets/components/KeyDeviceSensorComponent.min.js +1 -1
  24. package/dist/assets/components/LayoutComponent.js +1 -3
  25. package/dist/assets/components/LayoutComponent.min.js +2 -2
  26. package/dist/assets/components/NURBSComponent.js +1 -1
  27. package/dist/assets/components/NURBSComponent.min.js +1 -1
  28. package/dist/assets/components/ParticleSystemsComponent.js +2 -2
  29. package/dist/assets/components/ParticleSystemsComponent.min.js +2 -2
  30. package/dist/assets/components/PickingComponent.js +1 -1
  31. package/dist/assets/components/PickingComponent.min.js +1 -1
  32. package/dist/assets/components/RigidBodyPhysicsComponent.js +1 -1
  33. package/dist/assets/components/RigidBodyPhysicsComponent.min.js +1 -1
  34. package/dist/assets/components/ScriptingComponent.js +1 -1
  35. package/dist/assets/components/ScriptingComponent.min.js +1 -1
  36. package/dist/assets/components/TextComponent.js +1 -1
  37. package/dist/assets/components/TextComponent.min.js +1 -1
  38. package/dist/assets/components/TextureProjectionComponent.js +1 -1
  39. package/dist/assets/components/TextureProjectionComponent.min.js +1 -1
  40. package/dist/assets/components/Texturing3DComponent.js +9 -9
  41. package/dist/assets/components/Texturing3DComponent.min.js +2 -2
  42. package/dist/assets/components/VolumeRenderingComponent.js +3 -5
  43. package/dist/assets/components/VolumeRenderingComponent.min.js +2 -2
  44. package/dist/assets/components/WebXRComponent.js +1 -1
  45. package/dist/assets/components/WebXRComponent.min.js +1 -1
  46. package/dist/assets/components/X_ITEComponent.js +1 -1
  47. package/dist/assets/components/X_ITEComponent.min.js +1 -1
  48. package/dist/assets/lib/README.md +0 -1
  49. package/dist/example.html +1 -1
  50. package/dist/x_ite.css +1 -1
  51. package/dist/x_ite.d.ts +7 -7
  52. package/dist/x_ite.js +89 -92
  53. package/dist/x_ite.min.js +2 -2
  54. package/dist/x_ite.min.mjs +2 -2
  55. package/dist/x_ite.mjs +89 -92
  56. package/dist/x_ite.zip +0 -0
  57. package/package.json +1 -1
package/dist/x_ite.mjs CHANGED
@@ -1,7 +1,7 @@
1
- /* X_ITE v16.0.3 */
1
+ /* X_ITE v16.0.5 */
2
2
  var __webpack_modules__ = ({
3
3
 
4
- /***/ 521
4
+ /***/ 998
5
5
  (module, exports) {
6
6
 
7
7
  var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*
@@ -1006,7 +1006,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
1006
1006
 
1007
1007
  /***/ },
1008
1008
 
1009
- /***/ 939
1009
+ /***/ 844
1010
1010
  (module) {
1011
1011
 
1012
1012
  (function webpackUniversalModuleDefinition(root, factory) {
@@ -2002,7 +2002,7 @@ return /******/ (function(modules) { // webpackBootstrap
2002
2002
 
2003
2003
  /***/ },
2004
2004
 
2005
- /***/ 159
2005
+ /***/ 728
2006
2006
  (module) {
2007
2007
 
2008
2008
  /**
@@ -18826,7 +18826,7 @@ const Legacy_default_ = Legacy;
18826
18826
 
18827
18827
  /* harmony default export */ const Browser_Legacy = (x_ite_Namespace .add ("Legacy", Legacy_default_));
18828
18828
  ;// ./src/x_ite/BROWSER_VERSION.js
18829
- const BROWSER_VERSION_default_ = "16.0.3";
18829
+ const BROWSER_VERSION_default_ = "16.0.5";
18830
18830
  ;
18831
18831
 
18832
18832
  /* harmony default export */ const BROWSER_VERSION = (x_ite_Namespace .add ("BROWSER_VERSION", BROWSER_VERSION_default_));
@@ -20447,7 +20447,7 @@ Object .assign (Object .setPrototypeOf (ContextMenu .prototype, Base_X3DBaseNode
20447
20447
  layer .addEventListener ("mousedown", () => this .hide ());
20448
20448
  layer .addEventListener ("contextmenu", () => this .hide ());
20449
20449
 
20450
- root .appendChild (layer);
20450
+ root .append (layer);
20451
20451
 
20452
20452
  this [_hide] = () =>
20453
20453
  {
@@ -20476,16 +20476,16 @@ Object .assign (Object .setPrototypeOf (ContextMenu .prototype, Base_X3DBaseNode
20476
20476
 
20477
20477
  ul .addEventListener ("contextmenu", () => this .hide ());
20478
20478
 
20479
- root .appendChild (ul);
20479
+ root .append (ul);
20480
20480
 
20481
20481
  const background = document .createElement ("div");
20482
20482
 
20483
20483
  background .classList .add ("context-menu-background");
20484
20484
 
20485
- ul .appendChild (background);
20485
+ ul .append (background);
20486
20486
 
20487
20487
  for (const k in menu .items)
20488
- ul .appendChild (this .createItem (menu .items [k], "context-menu-root", k, level + 1));
20488
+ ul .append (this .createItem (menu .items [k], "context-menu-root", k, level + 1));
20489
20489
 
20490
20490
  // Show
20491
20491
  // Must animate children because of blurish background.
@@ -30319,8 +30319,8 @@ Object .assign (Object .setPrototypeOf (JSONParser .prototype, Parser_X3DParser
30319
30319
  createCDATA (document, element, str)
30320
30320
  {
30321
30321
  const
30322
- docu = helper.parseXML ("<xml></xml>",),
30323
- cdata = docu .createCDATASection (str);
30322
+ root = helper.parseXML ("<xml></xml>",),
30323
+ cdata = root .createCDATASection (str);
30324
30324
 
30325
30325
  element .append (cdata);
30326
30326
  },
@@ -30365,7 +30365,6 @@ Object .assign (Object .setPrototypeOf (JSONParser .prototype, Parser_X3DParser
30365
30365
  this .convertToDOM (object [key] [childkey], childkey, child);
30366
30366
 
30367
30367
  element .append (child);
30368
- element .append (document .createTextNode ("\n"));
30369
30368
  }
30370
30369
  }
30371
30370
  }
@@ -30376,7 +30375,6 @@ Object .assign (Object .setPrototypeOf (JSONParser .prototype, Parser_X3DParser
30376
30375
  this .convertToDOM (object [key], key, child);
30377
30376
 
30378
30377
  element .append (child);
30379
- element .append (document .createTextNode ("\n"));
30380
30378
  }
30381
30379
  }
30382
30380
  },
@@ -31113,7 +31111,7 @@ const Plane3_default_ = Plane3;
31113
31111
 
31114
31112
  /* harmony default export */ const Geometry_Plane3 = (x_ite_Namespace .add ("Plane3", Plane3_default_));
31115
31113
  ;// ./src/standard/Math/Geometry/Triangle3.js
31116
- /* provided dependency */ var libtess = __webpack_require__(159);
31114
+ /* provided dependency */ var libtess = __webpack_require__(728);
31117
31115
 
31118
31116
 
31119
31117
  const Triangle3 =
@@ -47743,7 +47741,7 @@ const Bezier_default_ = Bezier;
47743
47741
 
47744
47742
  /* harmony default export */ const Algorithms_Bezier = (x_ite_Namespace .add ("Bezier", Bezier_default_));
47745
47743
  ;// ./src/x_ite/Parser/SVGParser.js
47746
- /* provided dependency */ var SVGParser_libtess = __webpack_require__(159);
47744
+ /* provided dependency */ var SVGParser_libtess = __webpack_require__(728);
47747
47745
 
47748
47746
 
47749
47747
 
@@ -54435,7 +54433,7 @@ function X3DCoreContext (element)
54435
54433
  {
54436
54434
  const link = document .createElement ("link");
54437
54435
 
54438
- link .integrity = "sha384-kJEneJ/A3x8UCAr9atGL38mNOYbyOsYx1KrBl+f1Al3bK4S1tzl/AYvqtxknYzkx";
54436
+ link .integrity = "sha384-z3n/GOGoKsMpVZSKJ93fURwkAP+Pc26L4fyoX8sqfSjRbaqYaOKMzV8xyfYFto4R";
54439
54437
  link .rel = "stylesheet";
54440
54438
  link .crossOrigin = "anonymous";
54441
54439
  link .onload = resolve;
@@ -55226,13 +55224,13 @@ Object .assign (Object .setPrototypeOf (TextureProperties .prototype, Core_X3DNo
55226
55224
  {
55227
55225
  const minificationFilters = new Map ([
55228
55226
  ["AVG_PIXEL_AVG_MIPMAP", ["LINEAR", "LINEAR_MIPMAP_LINEAR"]],
55229
- ["AVG_PIXEL", ["LINEAR", "LINEAR"]],
55230
55227
  ["AVG_PIXEL_NEAREST_MIPMAP", ["LINEAR", "LINEAR_MIPMAP_NEAREST"]],
55231
55228
  ["NEAREST_PIXEL_AVG_MIPMAP", ["NEAREST", "NEAREST_MIPMAP_LINEAR"]],
55232
55229
  ["NEAREST_PIXEL_NEAREST_MIPMAP", ["NEAREST", "NEAREST_MIPMAP_NEAREST"]],
55230
+ ["AVG_PIXEL", ["LINEAR", "LINEAR"]],
55233
55231
  ["NEAREST_PIXEL", ["NEAREST", "NEAREST"]],
55234
55232
  ["NICEST", ["LINEAR", "LINEAR_MIPMAP_LINEAR"]],
55235
- ["FASTEST", ["NEAREST", "NEAREST"]],
55233
+ ["FASTEST", ["NEAREST", "NEAREST_MIPMAP_NEAREST"]],
55236
55234
  ]);
55237
55235
 
55238
55236
  return function (mipMaps = true)
@@ -55329,7 +55327,7 @@ Object .assign (X3DEnvironmentalEffectsContext .prototype,
55329
55327
  backgroundTextureProperties ._boundaryModeR = "CLAMP_TO_EDGE";
55330
55328
  backgroundTextureProperties ._minificationFilter = "NICEST";
55331
55329
  backgroundTextureProperties ._magnificationFilter = "NICEST";
55332
- backgroundTextureProperties ._textureCompression = "DEFAULT";
55330
+
55333
55331
  backgroundTextureProperties .setup ();
55334
55332
 
55335
55333
  return backgroundTextureProperties;
@@ -59266,47 +59264,6 @@ const X3DLayeringContext_default_ = X3DLayeringContext;
59266
59264
  ;
59267
59265
 
59268
59266
  /* harmony default export */ const Layering_X3DLayeringContext = (x_ite_Namespace .add ("X3DLayeringContext", X3DLayeringContext_default_));
59269
- ;// ./src/assets/shaders/webgl2/pbr/ToneMapping2.glsl.js
59270
- const ToneMapping2_glsl_default_ = () => /* glsl */ `
59271
- const float GAMMA=2.2;const float INV_GAMMA=1./GAMMA;vec3 linearToSRGB(const in vec3 color){return pow(color,vec3(INV_GAMMA));}vec4 linearToSRGB(const in vec4 color){return vec4(linearToSRGB(color.rgb),color.a);}vec3 sRGBToLinear(const in vec3 color){return pow(color,vec3(GAMMA));}vec4 sRGBToLinear(const in vec4 color){return vec4(sRGBToLinear(color.rgb),color.a);}
59272
- #if defined(X3D_LINEAR_OUTPUT)
59273
- vec3 toneMap(in vec3 color){
59274
- #if defined(X3D_COLORSPACE_SRGB)
59275
- color=sRGBToLinear(color);
59276
- #endif
59277
- return color;}
59278
- #else
59279
- #if defined(X3D_TONEMAP_ACES_NARKOWICZ)
59280
- vec3 toneMapACES_Narkowicz(const in vec3 color){const float A=2.51;const float B=.03;const float C=2.43;const float D=.59;const float E=.14;return clamp((color*(A*color+B))/(color*(C*color+D)+E),0.,1.);}
59281
- #endif
59282
- #if defined(X3D_TONEMAP_ACES_HILL)||defined(X3D_TONEMAP_ACES_HILL_EXPOSURE_BOOST)
59283
- const mat3 ACESInputMat=mat3(.59719,.07600,.02840,.35458,.90834,.13383,.04823,.01566,.83777);const mat3 ACESOutputMat=mat3(1.60475,-.10208,-.00327,-.53108,1.10813,-.07276,-.07367,-.00605,1.07602);vec3 RRTAndODTFit(const in vec3 color){vec3 a=color*(color+.0245786)-.000090537;vec3 b=color*(.983729*color+.4329510)+.238081;return a/b;}vec3 toneMapACES_Hill(in vec3 color){color=ACESInputMat*color;color=RRTAndODTFit(color);color=ACESOutputMat*color;color=clamp(color,0.,1.);return color;}
59284
- #endif
59285
- #if defined(X3D_TONEMAP_KHR_PBR_NEUTRAL)
59286
- vec3 toneMap_KhronosPbrNeutral(in vec3 color){const float startCompression=.8-.04;const float desaturation=.15;float x=min(color.r,min(color.g,color.b));float offset=x<.08?x-6.25*x*x:.04;color-=offset;float peak=max(color.r,max(color.g,color.b));if(peak<startCompression)return color;const float d=1.-startCompression;float newPeak=1.-d*d/(peak+d-startCompression);color*=newPeak/peak;float g=1.-1./(desaturation*(peak-newPeak)+1.);return mix(color,newPeak*vec3(1),g);}
59287
- #endif
59288
- uniform float x3d_Exposure;vec3 toneMap(in vec3 color){color*=x3d_Exposure;
59289
- #if defined(X3D_TONEMAP_ACES_NARKOWICZ)
59290
- color=toneMapACES_Narkowicz(color);
59291
- #endif
59292
- #if defined(X3D_TONEMAP_ACES_HILL)
59293
- color=toneMapACES_Hill(color);
59294
- #endif
59295
- #if defined(X3D_TONEMAP_ACES_HILL_EXPOSURE_BOOST)
59296
- color/=.6;color=toneMapACES_Hill(color);
59297
- #endif
59298
- #if defined(X3D_TONEMAP_KHR_PBR_NEUTRAL)
59299
- color=toneMap_KhronosPbrNeutral(color);
59300
- #endif
59301
- #if defined(X3D_COLORSPACE_LINEAR)
59302
- color=linearToSRGB(color);
59303
- #endif
59304
- return color;}
59305
- #endif
59306
- `
59307
- ;
59308
-
59309
- /* harmony default export */ const ToneMapping2_glsl = (x_ite_Namespace .add ("ToneMapping2.glsl", ToneMapping2_glsl_default_));
59310
59267
  ;// ./src/x_ite/Browser/Lighting/Distribution.js
59311
59268
  let Distribution_i = 0;
59312
59269
 
@@ -59324,12 +59281,11 @@ const Distribution_default_ = Distribution;
59324
59281
  ;// ./src/x_ite/Browser/Lighting/Filter2.fs.js
59325
59282
 
59326
59283
 
59327
-
59328
59284
  const Filter2_fs_default_ = /* glsl */ `#version 300 es
59329
59285
  precision highp float;precision highp int;precision highp samplerCube;
59330
- ${ToneMapping2_glsl ()}
59286
+ #include<ToneMapping>
59331
59287
  ${Object .entries (Lighting_Distribution) .map (([name, value]) => `#define X3D_${name} ${value}`) .join ("\n")}
59332
- const float M_PI=3.1415926535897932384626433832795;uniform samplerCube x3d_TextureEXT;uniform int x3d_TextureSizeEXT;uniform bool x3d_TextureLinearEXT;uniform int x3d_CurrentFaceEXT;uniform int x3d_DistributionEXT;uniform int x3d_SampleCountEXT;uniform float x3d_RoughnessEXT;uniform float x3d_LodBiasEXT;uniform float x3d_IntensityEXT;uniform vec3 x3d_FlipEXT;in vec2 texCoord;out vec4 x3d_FragColor;mat3 generateTBN(const in vec3 normal){vec3 bitangent=vec3(0.,1.,0.);float NdotUp=dot(normal,vec3(0.,1.,0.));float epsilon=.0000001;if(1.-abs(NdotUp)<=epsilon){if(NdotUp>0.)bitangent=vec3(0.,0.,1.);else bitangent=vec3(0.,0.,-1.);}vec3 tangent=normalize(cross(bitangent,normal));bitangent=cross(normal,tangent);return mat3(tangent,bitangent,normal);}struct MicrofacetDistributionSample{float pdf;float cosTheta;float sinTheta;float phi;};float radicalInverse_VdC(in uint bits){bits=(bits<<16u)|(bits>>16u);bits=((bits&0x55555555u)<<1u)|((bits&0xAAAAAAAAu)>>1u);bits=((bits&0x33333333u)<<2u)|((bits&0xCCCCCCCCu)>>2u);bits=((bits&0x0F0F0F0Fu)<<4u)|((bits&0xF0F0F0F0u)>>4u);bits=((bits&0x00FF00FFu)<<8u)|((bits&0xFF00FF00u)>>8u);return float(bits)*2.3283064365386963e-10;}vec2 hammersley2d(const in int i,const in int N){return vec2(float(i)/float(N),radicalInverse_VdC(uint(i)));}MicrofacetDistributionSample Lambertian(const in vec2 xi,const in float roughness){MicrofacetDistributionSample lambertian;lambertian.cosTheta=sqrt(1.-xi.y);lambertian.sinTheta=sqrt(xi.y);lambertian.phi=2.*M_PI*xi.x;lambertian.pdf=lambertian.cosTheta/M_PI;return lambertian;}float saturate(const in float v){return clamp(v,0.,1.);}float D_GGX(const in float NdotH,const in float roughness){float a=NdotH*roughness;float k=roughness/(1.-NdotH*NdotH+a*a);return k*k*(1./M_PI);}MicrofacetDistributionSample GGX(const in vec2 xi,const in float roughness){MicrofacetDistributionSample ggx;float alpha=roughness*roughness;ggx.cosTheta=saturate(sqrt((1.-xi.y)/(1.+(alpha*alpha-1.)*xi.y)));ggx.sinTheta=sqrt(1.-ggx.cosTheta*ggx.cosTheta);ggx.phi=2.*M_PI*xi.x;ggx.pdf=D_GGX(ggx.cosTheta,alpha);ggx.pdf/=4.;return ggx;}float D_Charlie(in float sheenRoughness,const in float NdotH){sheenRoughness=max(sheenRoughness,.000001);float invR=1./sheenRoughness;float cos2h=NdotH*NdotH;float sin2h=1.-cos2h;return(2.+invR)*pow(sin2h,invR*.5)/(2.*M_PI);}MicrofacetDistributionSample Charlie(const in vec2 xi,const in float roughness){MicrofacetDistributionSample charlie;float alpha=roughness*roughness;charlie.sinTheta=pow(xi.y,alpha/(2.*alpha+1.));charlie.cosTheta=sqrt(1.-charlie.sinTheta*charlie.sinTheta);charlie.phi=2.*M_PI*xi.x;charlie.pdf=D_Charlie(alpha,charlie.cosTheta);charlie.pdf/=4.;return charlie;}vec4 getImportanceSample(const in int sampleIndex,const in vec3 N,const in float roughness){vec2 xi=hammersley2d(sampleIndex,x3d_SampleCountEXT);MicrofacetDistributionSample importanceSample;switch(x3d_DistributionEXT){case X3D_LAMBERTIAN:{importanceSample=Lambertian(xi,roughness);break;}case X3D_GGX:{importanceSample=GGX(xi,roughness);break;}case X3D_CHARLIE:{importanceSample=Charlie(xi,roughness);break;}}vec3 localSpaceDirection=normalize(vec3(importanceSample.sinTheta*cos(importanceSample.phi),importanceSample.sinTheta*sin(importanceSample.phi),importanceSample.cosTheta));mat3 TBN=generateTBN(N);vec3 direction=TBN*localSpaceDirection;return vec4(direction,importanceSample.pdf);}float computeLod(const in float pdf){float lod=.5*log2(6.*float(x3d_TextureSizeEXT)*float(x3d_TextureSizeEXT)/(float(x3d_SampleCountEXT)*pdf));return lod;}vec3 filterColor(const in vec3 N){vec3 color=vec3(0);float weight=0.;for(int i=0;i<x3d_SampleCountEXT;++i){vec4 importanceSample=getImportanceSample(i,N,x3d_RoughnessEXT);vec3 H=importanceSample.xyz;float pdf=importanceSample.w;float lod=computeLod(pdf);lod+=x3d_LodBiasEXT;switch(x3d_DistributionEXT){case X3D_LAMBERTIAN:{vec3 lambertian=textureLod(x3d_TextureEXT,H,lod).rgb;if(!x3d_TextureLinearEXT)lambertian=sRGBToLinear(lambertian);color+=lambertian;break;}case X3D_GGX:case X3D_CHARLIE:{vec3 V=N;vec3 L=normalize(reflect(-V,H));float NdotL=dot(N,L);if(NdotL>0.){if(x3d_RoughnessEXT==0.){lod=x3d_LodBiasEXT;}vec3 sampleColor=textureLod(x3d_TextureEXT,L,lod).rgb;if(!x3d_TextureLinearEXT)sampleColor=sRGBToLinear(sampleColor);color+=sampleColor*NdotL;weight+=NdotL;}break;}}}if(weight!=0.0f)color/=weight;else color/=float(x3d_SampleCountEXT);return color*x3d_IntensityEXT;}vec3 getNormal(const in int face,const in vec2 t){float x;float y;float z;switch(face){case 0:x=t.x;y=-t.y;z=1.;break;case 1:x=-t.x;y=-t.y;z=-1.;break;case 2:x=-1.;y=-t.y;z=t.x;break;case 3:x=1.;y=-t.y;z=-t.x;break;case 4:x=t.x;y=1.;z=t.y;break;case 5:x=t.x;y=-1.;z=-t.y;break;}return normalize(vec3(x,y,z))*x3d_FlipEXT;}void main(){vec3 normal=getNormal(x3d_CurrentFaceEXT,texCoord);x3d_FragColor=vec4(filterColor(normal),1.);}`
59288
+ const float M_PI=3.141592653589793;uniform samplerCube x3d_TextureEXT;uniform int x3d_TextureSizeEXT;uniform bool x3d_TextureLinearEXT;uniform int x3d_CurrentFaceEXT;uniform int x3d_DistributionEXT;uniform int x3d_SampleCountEXT;uniform float x3d_RoughnessEXT;uniform float x3d_LodBiasEXT;uniform float x3d_IntensityEXT;uniform vec3 x3d_FlipEXT;in vec2 texCoord;out vec4 x3d_FragColor;mat3 generateTBN(const in vec3 normal){vec3 bitangent=vec3(0.,1.,0.);float NdotUp=dot(normal,vec3(0.,1.,0.));float epsilon=.0000001;if(1.-abs(NdotUp)<=epsilon){if(NdotUp>0.)bitangent=vec3(0.,0.,1.);else bitangent=vec3(0.,0.,-1.);}vec3 tangent=normalize(cross(bitangent,normal));bitangent=cross(normal,tangent);return mat3(tangent,bitangent,normal);}struct MicrofacetDistributionSample{float pdf;float cosTheta;float sinTheta;float phi;};float radicalInverse_VdC(in uint bits){bits=(bits<<16u)|(bits>>16u);bits=((bits&0x55555555u)<<1u)|((bits&0xAAAAAAAAu)>>1u);bits=((bits&0x33333333u)<<2u)|((bits&0xCCCCCCCCu)>>2u);bits=((bits&0x0F0F0F0Fu)<<4u)|((bits&0xF0F0F0F0u)>>4u);bits=((bits&0x00FF00FFu)<<8u)|((bits&0xFF00FF00u)>>8u);return float(bits)*2.3283064365386963e-10;}vec2 hammersley2d(const in int i,const in int N){return vec2(float(i)/float(N),radicalInverse_VdC(uint(i)));}MicrofacetDistributionSample Lambertian(const in vec2 xi,const in float roughness){MicrofacetDistributionSample lambertian;lambertian.cosTheta=sqrt(1.-xi.y);lambertian.sinTheta=sqrt(xi.y);lambertian.phi=2.*M_PI*xi.x;lambertian.pdf=lambertian.cosTheta/M_PI;return lambertian;}float saturate(const in float v){return clamp(v,0.,1.);}float D_GGX(const in float NdotH,const in float roughness){float a=NdotH*roughness;float k=roughness/(1.-NdotH*NdotH+a*a);return k*k*(1./M_PI);}MicrofacetDistributionSample GGX(const in vec2 xi,const in float roughness){MicrofacetDistributionSample ggx;float alpha=roughness*roughness;ggx.cosTheta=saturate(sqrt((1.-xi.y)/(1.+(alpha*alpha-1.)*xi.y)));ggx.sinTheta=sqrt(1.-ggx.cosTheta*ggx.cosTheta);ggx.phi=2.*M_PI*xi.x;ggx.pdf=D_GGX(ggx.cosTheta,alpha);ggx.pdf/=4.;return ggx;}float D_Charlie(in float sheenRoughness,const in float NdotH){sheenRoughness=max(sheenRoughness,.000001);float invR=1./sheenRoughness;float cos2h=NdotH*NdotH;float sin2h=1.-cos2h;return(2.+invR)*pow(sin2h,invR*.5)/(2.*M_PI);}MicrofacetDistributionSample Charlie(const in vec2 xi,const in float roughness){MicrofacetDistributionSample charlie;float alpha=roughness*roughness;charlie.sinTheta=pow(xi.y,alpha/(2.*alpha+1.));charlie.cosTheta=sqrt(1.-charlie.sinTheta*charlie.sinTheta);charlie.phi=2.*M_PI*xi.x;charlie.pdf=D_Charlie(alpha,charlie.cosTheta);charlie.pdf/=4.;return charlie;}vec4 getImportanceSample(const in int sampleIndex,const in vec3 N,const in float roughness){vec2 xi=hammersley2d(sampleIndex,x3d_SampleCountEXT);MicrofacetDistributionSample importanceSample;switch(x3d_DistributionEXT){case X3D_LAMBERTIAN:{importanceSample=Lambertian(xi,roughness);break;}case X3D_GGX:{importanceSample=GGX(xi,roughness);break;}case X3D_CHARLIE:{importanceSample=Charlie(xi,roughness);break;}}vec3 localSpaceDirection=normalize(vec3(importanceSample.sinTheta*cos(importanceSample.phi),importanceSample.sinTheta*sin(importanceSample.phi),importanceSample.cosTheta));mat3 TBN=generateTBN(N);vec3 direction=TBN*localSpaceDirection;return vec4(direction,importanceSample.pdf);}float computeLod(const in float pdf){float lod=.5*log2(6.*float(x3d_TextureSizeEXT)*float(x3d_TextureSizeEXT)/(float(x3d_SampleCountEXT)*pdf));return lod;}vec3 filterColor(const in vec3 N){vec3 color=vec3(0);float weight=0.;for(int i=0;i<x3d_SampleCountEXT;++i){vec4 importanceSample=getImportanceSample(i,N,x3d_RoughnessEXT);vec3 H=importanceSample.xyz;float pdf=importanceSample.w;float lod=computeLod(pdf);lod+=x3d_LodBiasEXT;switch(x3d_DistributionEXT){case X3D_LAMBERTIAN:{vec3 lambertian=textureLod(x3d_TextureEXT,H,lod).rgb;if(!x3d_TextureLinearEXT)lambertian=sRGBToLinear(lambertian);color+=lambertian;break;}case X3D_GGX:case X3D_CHARLIE:{vec3 V=N;vec3 L=normalize(reflect(-V,H));float NdotL=dot(N,L);if(NdotL>0.){if(x3d_RoughnessEXT==0.){lod=x3d_LodBiasEXT;}vec3 sampleColor=textureLod(x3d_TextureEXT,L,lod).rgb;if(!x3d_TextureLinearEXT)sampleColor=sRGBToLinear(sampleColor);color+=sampleColor*NdotL;weight+=NdotL;}break;}}}if(weight!=0.)color/=weight;else color/=float(x3d_SampleCountEXT);return color*x3d_IntensityEXT;}vec3 getNormal(const in int face,const in vec2 t){float x;float y;float z;switch(face){case 0:x=t.x;y=-t.y;z=1.;break;case 1:x=-t.x;y=-t.y;z=-1.;break;case 2:x=-1.;y=-t.y;z=t.x;break;case 3:x=1.;y=-t.y;z=-t.x;break;case 4:x=t.x;y=1.;z=t.y;break;case 5:x=t.x;y=-1.;z=-t.y;break;}return normalize(vec3(x,y,z))*x3d_FlipEXT;}void main(){vec3 normal=getNormal(x3d_CurrentFaceEXT,texCoord);x3d_FragColor=vec4(filterColor(normal),1.);}`
59333
59289
  ;
59334
59290
 
59335
59291
  /* harmony default export */ const Filter2_fs = (x_ite_Namespace .add ("Filter2.fs", Filter2_fs_default_));
@@ -59382,7 +59338,6 @@ Object .assign (X3DLightingContext .prototype,
59382
59338
  texture = new Texturing_ImageTexture (this .getPrivateScene ()),
59383
59339
  textureProperties = new Texturing_TextureProperties (this .getPrivateScene ());
59384
59340
 
59385
- textureProperties ._generateMipMaps = false;
59386
59341
  textureProperties ._minificationFilter = "AVG_PIXEL";
59387
59342
  textureProperties ._magnificationFilter = "AVG_PIXEL";
59388
59343
  textureProperties ._boundaryModeS = "CLAMP_TO_BOUNDARY";
@@ -59449,7 +59404,7 @@ Object .assign (X3DLightingContext .prototype,
59449
59404
  ],
59450
59405
  });
59451
59406
  },
59452
- filterEnvironmentTexture ({ name, texture, distribution, sampleCount, roughness, flipX, cachedNode })
59407
+ filterEnvironmentTexture ({ name, texture, distribution, sampleCount, roughnesses, flipX, cachedNode })
59453
59408
  {
59454
59409
  // Render the texture.
59455
59410
 
@@ -59483,12 +59438,17 @@ Object .assign (X3DLightingContext .prototype,
59483
59438
  for (const target of filtered .getTargets ())
59484
59439
  gl .texImage2D (target, 0, gl .RGBA, size, size, 0, gl .RGBA, gl .UNSIGNED_BYTE, data);
59485
59440
 
59486
- if (roughness .length > 1)
59441
+ if (roughnesses .length > 1)
59487
59442
  {
59488
59443
  gl .generateMipmap (filtered .getTarget ());
59489
59444
  gl .texParameteri (filtered .getTarget (), gl .TEXTURE_MIN_FILTER, gl .LINEAR_MIPMAP_LINEAR);
59490
59445
  gl .texParameteri (filtered .getTarget (), gl .TEXTURE_MAG_FILTER, gl .LINEAR);
59491
59446
  }
59447
+ else
59448
+ {
59449
+ gl .texParameteri (filtered .getTarget (), gl .TEXTURE_MIN_FILTER, gl .LINEAR);
59450
+ gl .texParameteri (filtered .getTarget (), gl .TEXTURE_MAG_FILTER, gl .LINEAR);
59451
+ }
59492
59452
 
59493
59453
  // Setup defaults.
59494
59454
 
@@ -59512,20 +59472,19 @@ Object .assign (X3DLightingContext .prototype,
59512
59472
  gl .uniform1f (shaderNode .x3d_IntensityEXT, 1);
59513
59473
  gl .uniform3f (shaderNode .x3d_FlipEXT, flipX ? -1 : 1, 1, 1);
59514
59474
 
59515
- for (const [level, r] of roughness .entries ())
59475
+ for (const [level, roughness] of roughnesses .entries ())
59516
59476
  {
59517
59477
  const mipSize = size >> level;
59518
59478
 
59519
59479
  // console .log (level, mipSize, r, filtered .getLevels ());
59520
59480
 
59521
- // Setup mip level uniforms.
59522
-
59523
- gl .uniform1f (shaderNode .x3d_RoughnessEXT, r);
59524
-
59525
- // Generate images.
59481
+ // Setup values for each mip level.
59526
59482
 
59527
59483
  gl .viewport (0, 0, mipSize, mipSize);
59528
59484
  gl .scissor (0, 0, mipSize, mipSize);
59485
+ gl .uniform1f (shaderNode .x3d_RoughnessEXT, roughness);
59486
+
59487
+ // Generate images.
59529
59488
 
59530
59489
  for (const [face, target] of filtered .getTargets () .entries ())
59531
59490
  {
@@ -67099,6 +67058,47 @@ vec3 getPunctualRadianceTransmission(const in vec3 normal,const in vec3 view,con
67099
67058
  ;
67100
67059
 
67101
67060
  /* harmony default export */ const Punctual2_glsl = (x_ite_Namespace .add ("Punctual2.glsl", Punctual2_glsl_default_));
67061
+ ;// ./src/assets/shaders/webgl2/pbr/ToneMapping2.glsl.js
67062
+ const ToneMapping2_glsl_default_ = () => /* glsl */ `
67063
+ const float GAMMA=2.2;const float INV_GAMMA=1./GAMMA;vec3 linearToSRGB(const in vec3 color){return pow(color,vec3(INV_GAMMA));}vec4 linearToSRGB(const in vec4 color){return vec4(linearToSRGB(color.rgb),color.a);}vec3 sRGBToLinear(const in vec3 color){return pow(color,vec3(GAMMA));}vec4 sRGBToLinear(const in vec4 color){return vec4(sRGBToLinear(color.rgb),color.a);}
67064
+ #if defined(X3D_LINEAR_OUTPUT)
67065
+ vec3 toneMap(in vec3 color){
67066
+ #if defined(X3D_COLORSPACE_SRGB)
67067
+ color=sRGBToLinear(color);
67068
+ #endif
67069
+ return color;}
67070
+ #else
67071
+ #if defined(X3D_TONEMAP_ACES_NARKOWICZ)
67072
+ vec3 toneMapACES_Narkowicz(const in vec3 color){const float A=2.51;const float B=.03;const float C=2.43;const float D=.59;const float E=.14;return clamp((color*(A*color+B))/(color*(C*color+D)+E),0.,1.);}
67073
+ #endif
67074
+ #if defined(X3D_TONEMAP_ACES_HILL)||defined(X3D_TONEMAP_ACES_HILL_EXPOSURE_BOOST)
67075
+ const mat3 ACESInputMat=mat3(.59719,.07600,.02840,.35458,.90834,.13383,.04823,.01566,.83777);const mat3 ACESOutputMat=mat3(1.60475,-.10208,-.00327,-.53108,1.10813,-.07276,-.07367,-.00605,1.07602);vec3 RRTAndODTFit(const in vec3 color){vec3 a=color*(color+.0245786)-.000090537;vec3 b=color*(.983729*color+.4329510)+.238081;return a/b;}vec3 toneMapACES_Hill(in vec3 color){color=ACESInputMat*color;color=RRTAndODTFit(color);color=ACESOutputMat*color;color=clamp(color,0.,1.);return color;}
67076
+ #endif
67077
+ #if defined(X3D_TONEMAP_KHR_PBR_NEUTRAL)
67078
+ vec3 toneMap_KhronosPbrNeutral(in vec3 color){const float startCompression=.8-.04;const float desaturation=.15;float x=min(color.r,min(color.g,color.b));float offset=x<.08?x-6.25*x*x:.04;color-=offset;float peak=max(color.r,max(color.g,color.b));if(peak<startCompression)return color;const float d=1.-startCompression;float newPeak=1.-d*d/(peak+d-startCompression);color*=newPeak/peak;float g=1.-1./(desaturation*(peak-newPeak)+1.);return mix(color,newPeak*vec3(1),g);}
67079
+ #endif
67080
+ uniform float x3d_Exposure;vec3 toneMap(in vec3 color){color*=x3d_Exposure;
67081
+ #if defined(X3D_TONEMAP_ACES_NARKOWICZ)
67082
+ color=toneMapACES_Narkowicz(color);
67083
+ #endif
67084
+ #if defined(X3D_TONEMAP_ACES_HILL)
67085
+ color=toneMapACES_Hill(color);
67086
+ #endif
67087
+ #if defined(X3D_TONEMAP_ACES_HILL_EXPOSURE_BOOST)
67088
+ color/=.6;color=toneMapACES_Hill(color);
67089
+ #endif
67090
+ #if defined(X3D_TONEMAP_KHR_PBR_NEUTRAL)
67091
+ color=toneMap_KhronosPbrNeutral(color);
67092
+ #endif
67093
+ #if defined(X3D_COLORSPACE_LINEAR)
67094
+ color=linearToSRGB(color);
67095
+ #endif
67096
+ return color;}
67097
+ #endif
67098
+ `
67099
+ ;
67100
+
67101
+ /* harmony default export */ const ToneMapping2_glsl = (x_ite_Namespace .add ("ToneMapping2.glsl", ToneMapping2_glsl_default_));
67102
67102
  ;// ./src/assets/shaders/webgl2/Default2.vs.js
67103
67103
  const Default2_vs_default_ = () => /* glsl */ `#version 300 es
67104
67104
  precision highp int;precision highp float;precision highp sampler2D;precision highp sampler3D;precision highp samplerCube;
@@ -71275,7 +71275,6 @@ Object .assign (X3DShapeContext .prototype,
71275
71275
 
71276
71276
  lineFillTextureProperties ._minificationFilter = "NEAREST_PIXEL";
71277
71277
  lineFillTextureProperties ._magnificationFilter = "NEAREST_PIXEL";
71278
- lineFillTextureProperties ._textureCompression = "DEFAULT";
71279
71278
 
71280
71279
  lineFillTextureProperties .setup ();
71281
71280
 
@@ -71306,8 +71305,7 @@ Object .assign (X3DShapeContext .prototype,
71306
71305
  ],
71307
71306
  [ ],
71308
71307
  [ ],
71309
- ]
71310
- [pass];
71308
+ ] [pass];
71311
71309
 
71312
71310
  const transformFeedbackVaryings = [
71313
71311
  [
@@ -71325,8 +71323,7 @@ Object .assign (X3DShapeContext .prototype,
71325
71323
  "instanceNormalMatrix1", "tangent1", "normal1",
71326
71324
  "instanceNormalMatrix2", "tangent2", "normal2",
71327
71325
  ],
71328
- ]
71329
- [pass];
71326
+ ] [pass];
71330
71327
 
71331
71328
  return this .createShader ({
71332
71329
  name: `LineTransform${instanced ? "Instanced" : ""}`,
@@ -72119,8 +72116,8 @@ Object .assign (X3DTexturingContext .prototype,
72119
72116
  {
72120
72117
  case TextureQuality .LOW:
72121
72118
  {
72122
- textureProperties ._magnificationFilter = "AVG_PIXEL";
72123
- textureProperties ._minificationFilter = "AVG_PIXEL";
72119
+ textureProperties ._magnificationFilter = "FASTEST";
72120
+ textureProperties ._minificationFilter = "FASTEST";
72124
72121
  textureProperties ._textureCompression = "FASTEST";
72125
72122
 
72126
72123
  gl .hint (gl .GENERATE_MIPMAP_HINT, gl .FASTEST);
@@ -72129,7 +72126,7 @@ Object .assign (X3DTexturingContext .prototype,
72129
72126
  case TextureQuality .MEDIUM:
72130
72127
  {
72131
72128
  textureProperties ._magnificationFilter = "NICEST";
72132
- textureProperties ._minificationFilter = "NEAREST_PIXEL_AVG_MIPMAP";
72129
+ textureProperties ._minificationFilter = "AVG_PIXEL_NEAREST_MIPMAP";
72133
72130
  textureProperties ._textureCompression = "NICEST";
72134
72131
 
72135
72132
  gl .hint (gl .GENERATE_MIPMAP_HINT, gl .FASTEST);
@@ -81463,7 +81460,7 @@ Object .assign (Object .setPrototypeOf (EnvironmentLight .prototype, Lighting_X3
81463
81460
  texture: this .specularTexture,
81464
81461
  distribution: Lighting_Distribution .LAMBERTIAN,
81465
81462
  sampleCount: 2048,
81466
- roughness: [0],
81463
+ roughnesses: [0],
81467
81464
  flipX: !this .traverseSpecular,
81468
81465
  cachedNode: this .generatedDiffuseTexture,
81469
81466
  });
@@ -81482,15 +81479,15 @@ Object .assign (Object .setPrototypeOf (EnvironmentLight .prototype, Lighting_X3
81482
81479
  console .info ("Generating specular texture for EnvironmentLight.");
81483
81480
 
81484
81481
  const
81485
- levels = this .specularTexture .getLevels (),
81486
- roughness = Array .from ({ length: levels + 1 }, (_, i) => i / (levels || 1));
81482
+ levels = this .specularTexture .getLevels (),
81483
+ roughnesses = Array .from ({ length: levels + 1 }, (_, i) => i / (levels || 1));
81487
81484
 
81488
81485
  return browser .filterEnvironmentTexture ({
81489
81486
  name: "GeneratedSpecularTexture",
81490
81487
  texture: this .specularTexture,
81491
81488
  distribution: Lighting_Distribution .GGX,
81492
81489
  sampleCount: 1024,
81493
- roughness,
81490
+ roughnesses,
81494
81491
  flipX: !this .traverseSpecular,
81495
81492
  cachedNode: this .generatedSpecularTexture,
81496
81493
  });
@@ -81509,15 +81506,15 @@ Object .assign (Object .setPrototypeOf (EnvironmentLight .prototype, Lighting_X3
81509
81506
  console .info ("Generating sheen texture for EnvironmentLight.");
81510
81507
 
81511
81508
  const
81512
- levels = this .specularTexture .getLevels (),
81513
- roughness = Array .from ({ length: levels + 1 }, (_, i) => Math .max (i / (levels || 1), 2, 0.000001));
81509
+ levels = this .specularTexture .getLevels (),
81510
+ roughnesses = Array .from ({ length: levels + 1 }, (_, i) => Math .max (i / (levels || 1), 2, 0.000001));
81514
81511
 
81515
81512
  return browser .filterEnvironmentTexture ({
81516
81513
  name: "GeneratedSheenTexture",
81517
81514
  texture: this .specularTexture,
81518
81515
  distribution: Lighting_Distribution .CHARLIE,
81519
81516
  sampleCount: 64,
81520
- roughness: roughness,
81517
+ roughnesses,
81521
81518
  flipX: !this .traverseSpecular,
81522
81519
  cachedNode: this .generatedSheenTexture,
81523
81520
  });
@@ -90936,8 +90933,8 @@ const PNGMedia_default_ = PNGMedia;
90936
90933
 
90937
90934
  /* harmony default export */ const Texturing_PNGMedia = (x_ite_Namespace .add ("PNGMedia", PNGMedia_default_));
90938
90935
  ;// ./src/x_ite/Components/Texturing/MovieTexture.js
90939
- /* provided dependency */ var SuperGif = __webpack_require__(521);
90940
- /* provided dependency */ var APNG = __webpack_require__(939);
90936
+ /* provided dependency */ var SuperGif = __webpack_require__(998);
90937
+ /* provided dependency */ var APNG = __webpack_require__(844);
90941
90938
 
90942
90939
 
90943
90940
 
@@ -93270,7 +93267,7 @@ Object .assign (Object .setPrototypeOf (X3DBrowser .prototype, Browser_X3DBrowse
93270
93267
  console .log (string);
93271
93268
 
93272
93269
  for (const element of this [_console])
93273
- element .append (document .createTextNode (string));
93270
+ element .append (string);
93274
93271
  },
93275
93272
  println (... args)
93276
93273
  {
@@ -93279,7 +93276,7 @@ Object .assign (Object .setPrototypeOf (X3DBrowser .prototype, Browser_X3DBrowse
93279
93276
  console .log (string);
93280
93277
 
93281
93278
  for (const element of this [_console])
93282
- element .append (document .createTextNode (`${string}\n`));
93279
+ element .append (`${string}\n`);
93283
93280
  },
93284
93281
  toVRMLStream (generator)
93285
93282
  {
@@ -93642,7 +93639,7 @@ const QuickSort_default_ = QuickSort;
93642
93639
 
93643
93640
  /* harmony default export */ const Algorithms_QuickSort = (x_ite_Namespace .add ("QuickSort", QuickSort_default_));
93644
93641
  ;// ./src/lib/libtess.js
93645
- /* provided dependency */ var libtess_libtess = __webpack_require__(159);
93642
+ /* provided dependency */ var libtess_libtess = __webpack_require__(728);
93646
93643
  const libtess_default_ = libtess_libtess;
93647
93644
  ;
93648
93645
 
package/dist/x_ite.zip CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "x_ite",
3
- "version": "16.0.3",
3
+ "version": "16.0.5",
4
4
  "description": "X_ITE X3D Browser and VRML Viewer — View and Manipulate X3D, VRML, glTF and Other 3D Sources in HTML",
5
5
  "main": "dist/x_ite.js",
6
6
  "module": "dist/x_ite.mjs",