x_ite 16.0.2 → 16.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/README.md +5 -5
  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 +4 -5
  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 -1
  25. package/dist/assets/components/LayoutComponent.min.js +1 -1
  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 -10
  41. package/dist/assets/components/Texturing3DComponent.min.js +2 -2
  42. package/dist/assets/components/VolumeRenderingComponent.js +1 -1
  43. package/dist/assets/components/VolumeRenderingComponent.min.js +1 -1
  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/example.html +1 -1
  49. package/dist/x_ite.css +1 -1
  50. package/dist/x_ite.js +79 -93
  51. package/dist/x_ite.min.js +2 -2
  52. package/dist/x_ite.min.mjs +2 -2
  53. package/dist/x_ite.mjs +79 -93
  54. package/dist/x_ite.zip +0 -0
  55. package/package.json +3 -3
package/dist/x_ite.mjs CHANGED
@@ -1,7 +1,7 @@
1
- /* X_ITE v16.0.2 */
1
+ /* X_ITE v16.0.4 */
2
2
  var __webpack_modules__ = ({
3
3
 
4
- /***/ 882
4
+ /***/ 72
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
- /***/ 512
1009
+ /***/ 402
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
- /***/ 444
2005
+ /***/ 258
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.2";
18829
+ const BROWSER_VERSION_default_ = "16.0.4";
18830
18830
  ;
18831
18831
 
18832
18832
  /* harmony default export */ const BROWSER_VERSION = (x_ite_Namespace .add ("BROWSER_VERSION", BROWSER_VERSION_default_));
@@ -31113,7 +31113,7 @@ const Plane3_default_ = Plane3;
31113
31113
 
31114
31114
  /* harmony default export */ const Geometry_Plane3 = (x_ite_Namespace .add ("Plane3", Plane3_default_));
31115
31115
  ;// ./src/standard/Math/Geometry/Triangle3.js
31116
- /* provided dependency */ var libtess = __webpack_require__(444);
31116
+ /* provided dependency */ var libtess = __webpack_require__(258);
31117
31117
 
31118
31118
 
31119
31119
  const Triangle3 =
@@ -47743,7 +47743,7 @@ const Bezier_default_ = Bezier;
47743
47743
 
47744
47744
  /* harmony default export */ const Algorithms_Bezier = (x_ite_Namespace .add ("Bezier", Bezier_default_));
47745
47745
  ;// ./src/x_ite/Parser/SVGParser.js
47746
- /* provided dependency */ var SVGParser_libtess = __webpack_require__(444);
47746
+ /* provided dependency */ var SVGParser_libtess = __webpack_require__(258);
47747
47747
 
47748
47748
 
47749
47749
 
@@ -54425,7 +54425,7 @@ function X3DCoreContext (element)
54425
54425
  </div>
54426
54426
  </div>`;
54427
54427
 
54428
- if (element .nodeName .toLowerCase () === "x3d-canvas" && element .shadowRoot)
54428
+ if (element .shadowRoot)
54429
54429
  {
54430
54430
  this [_shadow] = element .shadowRoot;
54431
54431
 
@@ -54435,7 +54435,7 @@ function X3DCoreContext (element)
54435
54435
  {
54436
54436
  const link = document .createElement ("link");
54437
54437
 
54438
- link .integrity = "sha384-Y7ZIRmsB0Ps2F6tEqyEto4cb+wz/wCof3usIJpWKEoKpx2a8ym7kD+woJa/Ho8QV";
54438
+ link .integrity = "sha384-r/Gb5cpjKIPkLAwOrsKEHLP6i0CMS4kHdw86CIUHces4jE1JV+E2ip+Bb42dwD2D";
54439
54439
  link .rel = "stylesheet";
54440
54440
  link .crossOrigin = "anonymous";
54441
54441
  link .onload = resolve;
@@ -59266,47 +59266,6 @@ const X3DLayeringContext_default_ = X3DLayeringContext;
59266
59266
  ;
59267
59267
 
59268
59268
  /* 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
59269
  ;// ./src/x_ite/Browser/Lighting/Distribution.js
59311
59270
  let Distribution_i = 0;
59312
59271
 
@@ -59324,12 +59283,11 @@ const Distribution_default_ = Distribution;
59324
59283
  ;// ./src/x_ite/Browser/Lighting/Filter2.fs.js
59325
59284
 
59326
59285
 
59327
-
59328
59286
  const Filter2_fs_default_ = /* glsl */ `#version 300 es
59329
59287
  precision highp float;precision highp int;precision highp samplerCube;
59330
- ${ToneMapping2_glsl ()}
59288
+ #include<ToneMapping>
59331
59289
  ${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.);}`
59290
+ 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
59291
  ;
59334
59292
 
59335
59293
  /* harmony default export */ const Filter2_fs = (x_ite_Namespace .add ("Filter2.fs", Filter2_fs_default_));
@@ -59454,19 +59412,18 @@ Object .assign (X3DLightingContext .prototype,
59454
59412
  // Render the texture.
59455
59413
 
59456
59414
  const
59457
- gl = this .getContext (),
59458
- executionContext = texture .getExecutionContext (),
59459
- currentFramebuffer = gl .getParameter (gl .FRAMEBUFFER_BINDING),
59460
- currentProgram = gl .getParameter (gl .CURRENT_PROGRAM),
59461
- shaderNode = this .getEnvironmentTextureShader (),
59462
- framebuffer = this [_filterFrameBuffer] ??= gl .createFramebuffer (),
59463
- size = texture .getSize (),
59464
- filtered = cachedNode ?? executionContext .createNode ("ImageCubeMapTexture", false);
59415
+ gl = this .getContext (),
59416
+ executionContext = texture .getExecutionContext (),
59417
+ shaderNode = this .getEnvironmentTextureShader (),
59418
+ framebuffer = this [_filterFrameBuffer] ??= gl .createFramebuffer (),
59419
+ size = texture .getSize (),
59420
+ filtered = cachedNode ?? executionContext .createNode ("ImageCubeMapTexture", false);
59465
59421
 
59466
59422
  // Setup texture.
59467
59423
 
59468
59424
  if (!cachedNode)
59469
59425
  {
59426
+ filtered .updateTextureParameters = Function .prototype;
59470
59427
  filtered .setName (name);
59471
59428
  filtered .setPrivate (true);
59472
59429
  filtered .setLinear (true);
@@ -59486,9 +59443,14 @@ Object .assign (X3DLightingContext .prototype,
59486
59443
 
59487
59444
  if (roughness .length > 1)
59488
59445
  {
59489
- gl .generateMipmap (gl .TEXTURE_CUBE_MAP);
59490
- gl .texParameteri (gl .TEXTURE_CUBE_MAP, gl .TEXTURE_MIN_FILTER, gl .LINEAR_MIPMAP_LINEAR);
59491
- gl .texParameteri (gl .TEXTURE_CUBE_MAP, gl .TEXTURE_MAG_FILTER, gl .LINEAR);
59446
+ gl .generateMipmap (filtered .getTarget ());
59447
+ gl .texParameteri (filtered .getTarget (), gl .TEXTURE_MIN_FILTER, gl .LINEAR_MIPMAP_LINEAR);
59448
+ gl .texParameteri (filtered .getTarget (), gl .TEXTURE_MAG_FILTER, gl .LINEAR);
59449
+ }
59450
+ else
59451
+ {
59452
+ gl .texParameteri (filtered .getTarget (), gl .TEXTURE_MIN_FILTER, gl .LINEAR);
59453
+ gl .texParameteri (filtered .getTarget (), gl .TEXTURE_MAG_FILTER, gl .LINEAR);
59492
59454
  }
59493
59455
 
59494
59456
  // Setup defaults.
@@ -59497,14 +59459,13 @@ Object .assign (X3DLightingContext .prototype,
59497
59459
  gl .disable (gl .DEPTH_TEST);
59498
59460
  gl .enable (gl .CULL_FACE);
59499
59461
  gl .frontFace (gl .CCW);
59500
- gl .clearColor (0, 0, 0, 0);
59501
59462
  gl .bindVertexArray (this .getFullscreenVertexArrayObject ());
59502
59463
 
59503
59464
  // Setup specular texture uniforms.
59504
59465
 
59505
59466
  gl .useProgram (shaderNode .getProgram ());
59506
59467
  gl .activeTexture (gl .TEXTURE0);
59507
- gl .bindTexture (gl .TEXTURE_CUBE_MAP, texture .getTexture ());
59468
+ gl .bindTexture (texture .getTarget (), texture .getTexture ());
59508
59469
  gl .uniform1i (shaderNode .x3d_TextureEXT, 0);
59509
59470
  gl .uniform1i (shaderNode .x3d_TextureSizeEXT, size);
59510
59471
  gl .uniform1i (shaderNode .x3d_TextureLinearEXT, texture .isLinear ());
@@ -59520,28 +59481,23 @@ Object .assign (X3DLightingContext .prototype,
59520
59481
 
59521
59482
  // console .log (level, mipSize, r, filtered .getLevels ());
59522
59483
 
59523
- // Setup mip level uniforms.
59484
+ // Setup values for each mip level.
59524
59485
 
59486
+ gl .viewport (0, 0, mipSize, mipSize);
59487
+ gl .scissor (0, 0, mipSize, mipSize);
59525
59488
  gl .uniform1f (shaderNode .x3d_RoughnessEXT, r);
59526
59489
 
59527
59490
  // Generate images.
59528
59491
 
59529
- gl .viewport (0, 0, mipSize, mipSize);
59530
- gl .scissor (0, 0, mipSize, mipSize);
59531
-
59532
- for (let i = 0; i < 6; ++ i)
59492
+ for (const [face, target] of filtered .getTargets () .entries ())
59533
59493
  {
59534
- gl .framebufferTexture2D (gl .FRAMEBUFFER, gl .COLOR_ATTACHMENT0, filtered .getTargets () [i], filtered .getTexture (), level);
59535
-
59536
- gl .clear (gl .COLOR_BUFFER_BIT);
59537
- gl .uniform1i (shaderNode .x3d_CurrentFaceEXT, i);
59494
+ gl .framebufferTexture2D (gl .FRAMEBUFFER, gl .COLOR_ATTACHMENT0, target, filtered .getTexture (), level);
59495
+ gl .uniform1i (shaderNode .x3d_CurrentFaceEXT, face);
59538
59496
  gl .drawArrays (gl .TRIANGLES, 0, 6);
59539
59497
  }
59540
59498
  }
59541
59499
 
59542
59500
  gl .enable (gl .DEPTH_TEST);
59543
- gl .useProgram (currentProgram);
59544
- gl .bindFramebuffer (gl .FRAMEBUFFER, currentFramebuffer);
59545
59501
 
59546
59502
  return filtered;
59547
59503
  },
@@ -67105,6 +67061,47 @@ vec3 getPunctualRadianceTransmission(const in vec3 normal,const in vec3 view,con
67105
67061
  ;
67106
67062
 
67107
67063
  /* harmony default export */ const Punctual2_glsl = (x_ite_Namespace .add ("Punctual2.glsl", Punctual2_glsl_default_));
67064
+ ;// ./src/assets/shaders/webgl2/pbr/ToneMapping2.glsl.js
67065
+ const ToneMapping2_glsl_default_ = () => /* glsl */ `
67066
+ 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);}
67067
+ #if defined(X3D_LINEAR_OUTPUT)
67068
+ vec3 toneMap(in vec3 color){
67069
+ #if defined(X3D_COLORSPACE_SRGB)
67070
+ color=sRGBToLinear(color);
67071
+ #endif
67072
+ return color;}
67073
+ #else
67074
+ #if defined(X3D_TONEMAP_ACES_NARKOWICZ)
67075
+ 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.);}
67076
+ #endif
67077
+ #if defined(X3D_TONEMAP_ACES_HILL)||defined(X3D_TONEMAP_ACES_HILL_EXPOSURE_BOOST)
67078
+ 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;}
67079
+ #endif
67080
+ #if defined(X3D_TONEMAP_KHR_PBR_NEUTRAL)
67081
+ 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);}
67082
+ #endif
67083
+ uniform float x3d_Exposure;vec3 toneMap(in vec3 color){color*=x3d_Exposure;
67084
+ #if defined(X3D_TONEMAP_ACES_NARKOWICZ)
67085
+ color=toneMapACES_Narkowicz(color);
67086
+ #endif
67087
+ #if defined(X3D_TONEMAP_ACES_HILL)
67088
+ color=toneMapACES_Hill(color);
67089
+ #endif
67090
+ #if defined(X3D_TONEMAP_ACES_HILL_EXPOSURE_BOOST)
67091
+ color/=.6;color=toneMapACES_Hill(color);
67092
+ #endif
67093
+ #if defined(X3D_TONEMAP_KHR_PBR_NEUTRAL)
67094
+ color=toneMap_KhronosPbrNeutral(color);
67095
+ #endif
67096
+ #if defined(X3D_COLORSPACE_LINEAR)
67097
+ color=linearToSRGB(color);
67098
+ #endif
67099
+ return color;}
67100
+ #endif
67101
+ `
67102
+ ;
67103
+
67104
+ /* harmony default export */ const ToneMapping2_glsl = (x_ite_Namespace .add ("ToneMapping2.glsl", ToneMapping2_glsl_default_));
67108
67105
  ;// ./src/assets/shaders/webgl2/Default2.vs.js
67109
67106
  const Default2_vs_default_ = () => /* glsl */ `#version 300 es
67110
67107
  precision highp int;precision highp float;precision highp sampler2D;precision highp sampler3D;precision highp samplerCube;
@@ -72128,10 +72125,8 @@ Object .assign (X3DTexturingContext .prototype,
72128
72125
  textureProperties ._magnificationFilter = "AVG_PIXEL";
72129
72126
  textureProperties ._minificationFilter = "AVG_PIXEL";
72130
72127
  textureProperties ._textureCompression = "FASTEST";
72131
- textureProperties ._generateMipMaps = true;
72132
72128
 
72133
72129
  gl .hint (gl .GENERATE_MIPMAP_HINT, gl .FASTEST);
72134
- //gl .hint (gl .PERSPECTIVE_CORRECTION_HINT, gl .FASTEST);
72135
72130
  break;
72136
72131
  }
72137
72132
  case TextureQuality .MEDIUM:
@@ -72139,10 +72134,8 @@ Object .assign (X3DTexturingContext .prototype,
72139
72134
  textureProperties ._magnificationFilter = "NICEST";
72140
72135
  textureProperties ._minificationFilter = "NEAREST_PIXEL_AVG_MIPMAP";
72141
72136
  textureProperties ._textureCompression = "NICEST";
72142
- textureProperties ._generateMipMaps = true;
72143
72137
 
72144
72138
  gl .hint (gl .GENERATE_MIPMAP_HINT, gl .FASTEST);
72145
- //gl .hint (gl .PERSPECTIVE_CORRECTION_HINT, gl .FASTEST);
72146
72139
  break;
72147
72140
  }
72148
72141
  case TextureQuality .HIGH:
@@ -72150,10 +72143,8 @@ Object .assign (X3DTexturingContext .prototype,
72150
72143
  textureProperties ._magnificationFilter = "NICEST";
72151
72144
  textureProperties ._minificationFilter = "NICEST";
72152
72145
  textureProperties ._textureCompression = "NICEST";
72153
- textureProperties ._generateMipMaps = true;
72154
72146
 
72155
72147
  gl .hint (gl .GENERATE_MIPMAP_HINT, gl .NICEST);
72156
- //gl .hint (gl .PERSPECTIVE_CORRECTION_HINT, gl .NICEST);
72157
72148
  break;
72158
72149
  }
72159
72150
  }
@@ -81290,9 +81281,9 @@ Object .assign (EnvironmentLightContainer .prototype,
81290
81281
 
81291
81282
  this .modelViewMatrix .push (modelViewMatrix);
81292
81283
  },
81293
- renderShadowMap (renderObject)
81284
+ renderShadowMap (/* renderObject */)
81294
81285
  { },
81295
- setGlobalVariables (renderObject)
81286
+ setGlobalVariables (/* renderObject */)
81296
81287
  {
81297
81288
  this .modelViewMatrix .get () .getTransform (null, this .rotation);
81298
81289
 
@@ -81372,11 +81363,6 @@ Object .assign (EnvironmentLightContainer .prototype,
81372
81363
  gl .uniform1i (uniforms .diffuseTextureLevels, diffuseTexture ?.getLevels () ?? 0);
81373
81364
  gl .uniform1i (uniforms .specularTextureLevels, specularTexture ?.getLevels () ?? 0);
81374
81365
 
81375
- if (lightNode .traverseSpecular)
81376
- gl .uniform3f (uniforms .flipX, 1, 1, 1);
81377
- else
81378
- gl .uniform3f (uniforms .flipX, -1, 1, 1);
81379
-
81380
81366
  if (uniforms .sheenTexture)
81381
81367
  {
81382
81368
  const sheenTexture = lightNode .getSheenTexture ();
@@ -90953,8 +90939,8 @@ const PNGMedia_default_ = PNGMedia;
90953
90939
 
90954
90940
  /* harmony default export */ const Texturing_PNGMedia = (x_ite_Namespace .add ("PNGMedia", PNGMedia_default_));
90955
90941
  ;// ./src/x_ite/Components/Texturing/MovieTexture.js
90956
- /* provided dependency */ var SuperGif = __webpack_require__(882);
90957
- /* provided dependency */ var APNG = __webpack_require__(512);
90942
+ /* provided dependency */ var SuperGif = __webpack_require__(72);
90943
+ /* provided dependency */ var APNG = __webpack_require__(402);
90958
90944
 
90959
90945
 
90960
90946
 
@@ -93659,7 +93645,7 @@ const QuickSort_default_ = QuickSort;
93659
93645
 
93660
93646
  /* harmony default export */ const Algorithms_QuickSort = (x_ite_Namespace .add ("QuickSort", QuickSort_default_));
93661
93647
  ;// ./src/lib/libtess.js
93662
- /* provided dependency */ var libtess_libtess = __webpack_require__(444);
93648
+ /* provided dependency */ var libtess_libtess = __webpack_require__(258);
93663
93649
  const libtess_default_ = libtess_libtess;
93664
93650
  ;
93665
93651
 
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.2",
3
+ "version": "16.0.4",
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",
@@ -137,8 +137,8 @@
137
137
  "string-replace-webpack-plugin": "^0.1.3",
138
138
  "terser": "5.49.0",
139
139
  "terser-webpack-plugin": "^5.6.1",
140
- "webpack": "^5.109.0",
141
- "webpack-cli": "^7.2.1",
140
+ "webpack": "^5.109.2",
141
+ "webpack-cli": "^7.2.2",
142
142
  "webpack-shell-plugin-next": "^2.3.3",
143
143
  "woff2-encoder": "^2.0.0",
144
144
  "wrapper-webpack-plugin": "^2.2.2"