@crystaldesign/real-time-viewer 24.13.0-beta.2 → 24.13.0-beta.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/esm/index.js +91 -50
- package/build/types/real-time-viewer/src/parser/createCams/index.d.ts.map +1 -1
- package/build/types/real-time-viewer/src/store/SceneStore.d.ts +1 -0
- package/build/types/real-time-viewer/src/store/SceneStore.d.ts.map +1 -1
- package/build/types/real-time-viewer/src/store/UIStore.d.ts +1 -0
- package/build/types/real-time-viewer/src/store/UIStore.d.ts.map +1 -1
- package/build/umd/1896.real-time-viewer.umd.min.js +1 -1
- package/build/umd/3243.real-time-viewer.umd.min.js +1 -1
- package/build/umd/3351.real-time-viewer.umd.min.js +1 -1
- package/build/umd/4091.real-time-viewer.umd.min.js +1 -1
- package/build/umd/410.real-time-viewer.umd.min.js +1 -1
- package/build/umd/4153.real-time-viewer.umd.min.js +1 -1
- package/build/umd/5478.real-time-viewer.umd.min.js +1 -1
- package/build/umd/6095.real-time-viewer.umd.min.js +1 -1
- package/build/umd/653.real-time-viewer.umd.min.js +1 -1
- package/build/umd/6829.real-time-viewer.umd.min.js +1 -1
- package/build/umd/7229.real-time-viewer.umd.min.js +1 -1
- package/build/umd/7607.real-time-viewer.umd.min.js +1 -1
- package/build/umd/7729.real-time-viewer.umd.min.js +1 -1
- package/build/umd/7754.real-time-viewer.umd.min.js +1 -1
- package/build/umd/8078.real-time-viewer.umd.min.js +1 -1
- package/build/umd/815.real-time-viewer.umd.min.js +1 -1
- package/build/umd/8240.real-time-viewer.umd.min.js +1 -1
- package/build/umd/8526.real-time-viewer.umd.min.js +1 -1
- package/build/umd/930.real-time-viewer.umd.min.js +1 -1
- package/build/umd/real-time-viewer.umd.min.js +1 -1
- package/build/umd/report.html +4 -5
- package/package.json +2 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see 3243.real-time-viewer.umd.min.js.LICENSE.txt */
|
|
2
|
-
"use strict";(self.webpackChunkCrystaldesignRealTimeViewer=self.webpackChunkCrystaldesignRealTimeViewer||[]).push([[3243],{1740:(e,n,o)=>{var i=o(7416);o(2889);const r="backgroundUboDeclaration",l="layout(std140,column_major) uniform;uniform Material\n{uniform vec4 vPrimaryColor;uniform vec4 vPrimaryColorShadow;uniform vec2 vDiffuseInfos;uniform vec2 vReflectionInfos;uniform mat4 diffuseMatrix;uniform mat4 reflectionMatrix;uniform vec3 vReflectionMicrosurfaceInfos;uniform float fFovMultiplier;uniform float pointSize;uniform float shadowLevel;uniform float alpha;uniform vec3 vBackgroundCenter;uniform vec4 vReflectionControl;uniform vec2 projectedGroundInfos;};\n#include<sceneUboDeclaration>\n";i.v.IncludesShadersStore[r]=l},5001:(e,n,o)=>{const i="lightsFragmentFunctions",r="struct lightingInfo\n{vec3 diffuse;\n#ifdef SPECULARTERM\nvec3 specular;\n#endif\n#ifdef NDOTL\nfloat ndl;\n#endif\n};lightingInfo computeLighting(vec3 viewDirectionW,vec3 vNormal,vec4 lightData,vec3 diffuseColor,vec3 specularColor,float range,float glossiness) {lightingInfo result;vec3 lightVectorW;float attenuation=1.0;if (lightData.w==0.)\n{vec3 direction=lightData.xyz-vPositionW;attenuation=max(0.,1.0-length(direction)/range);lightVectorW=normalize(direction);}\nelse\n{lightVectorW=normalize(-lightData.xyz);}\nfloat ndl=max(0.,dot(vNormal,lightVectorW));\n#ifdef NDOTL\nresult.ndl=ndl;\n#endif\nresult.diffuse=ndl*diffuseColor*attenuation;\n#ifdef SPECULARTERM\nvec3 angleW=normalize(viewDirectionW+lightVectorW);float specComp=max(0.,dot(vNormal,angleW));specComp=pow(specComp,max(1.,glossiness));result.specular=specComp*specularColor*attenuation;\n#endif\nreturn result;}\nlightingInfo computeSpotLighting(vec3 viewDirectionW,vec3 vNormal,vec4 lightData,vec4 lightDirection,vec3 diffuseColor,vec3 specularColor,float range,float glossiness) {lightingInfo result;vec3 direction=lightData.xyz-vPositionW;vec3 lightVectorW=normalize(direction);float attenuation=max(0.,1.0-length(direction)/range);float cosAngle=max(0.,dot(lightDirection.xyz,-lightVectorW));if (cosAngle>=lightDirection.w)\n{cosAngle=max(0.,pow(cosAngle,lightData.w));attenuation*=cosAngle;float ndl=max(0.,dot(vNormal,lightVectorW));\n#ifdef NDOTL\nresult.ndl=ndl;\n#endif\nresult.diffuse=ndl*diffuseColor*attenuation;\n#ifdef SPECULARTERM\nvec3 angleW=normalize(viewDirectionW+lightVectorW);float specComp=max(0.,dot(vNormal,angleW));specComp=pow(specComp,max(1.,glossiness));result.specular=specComp*specularColor*attenuation;\n#endif\nreturn result;}\nresult.diffuse=vec3(0.);\n#ifdef SPECULARTERM\nresult.specular=vec3(0.);\n#endif\n#ifdef NDOTL\nresult.ndl=0.;\n#endif\nreturn result;}\nlightingInfo computeHemisphericLighting(vec3 viewDirectionW,vec3 vNormal,vec4 lightData,vec3 diffuseColor,vec3 specularColor,vec3 groundColor,float glossiness) {lightingInfo result;float ndl=dot(vNormal,lightData.xyz)*0.5+0.5;\n#ifdef NDOTL\nresult.ndl=ndl;\n#endif\nresult.diffuse=mix(groundColor,diffuseColor,ndl);\n#ifdef SPECULARTERM\nvec3 angleW=normalize(viewDirectionW+lightData.xyz);float specComp=max(0.,dot(vNormal,angleW));specComp=pow(specComp,max(1.,glossiness));result.specular=specComp*specularColor;\n#endif\nreturn result;}\n#define inline\nvec3 computeProjectionTextureDiffuseLighting(sampler2D projectionLightSampler,mat4 textureProjectionMatrix,vec3 posW){vec4 strq=textureProjectionMatrix*vec4(posW,1.0);strq/=strq.w;vec3 textureColor=texture2D(projectionLightSampler,strq.xy).rgb;return textureColor;}";o(7416).v.IncludesShadersStore[i]=r},3243:(e,n,o)=>{o.r(n),o.d(n,{backgroundPixelShader:()=>c});var i=o(7416);const r="backgroundFragmentDeclaration",l="uniform vec4 vEyePosition;uniform vec4 vPrimaryColor;\n#ifdef USEHIGHLIGHTANDSHADOWCOLORS\nuniform vec4 vPrimaryColorShadow;\n#endif\nuniform float shadowLevel;uniform float alpha;\n#ifdef DIFFUSE\nuniform vec2 vDiffuseInfos;\n#endif\n#ifdef REFLECTION\nuniform vec2 vReflectionInfos;uniform mat4 reflectionMatrix;uniform vec3 vReflectionMicrosurfaceInfos;\n#endif\n#if defined(REFLECTIONFRESNEL) || defined(OPACITYFRESNEL)\nuniform vec3 vBackgroundCenter;\n#endif\n#ifdef REFLECTIONFRESNEL\nuniform vec4 vReflectionControl;\n#endif\n#if defined(REFLECTIONMAP_SPHERICAL) || defined(REFLECTIONMAP_PROJECTION) || defined(REFRACTION)\nuniform mat4 view;\n#endif\n#ifdef PROJECTED_GROUND\nuniform vec2 projectedGroundInfos;\n#endif\n";i.v.IncludesShadersStore[r]=l;o(1740),o(5276),o(2628),o(6757),o(8494),o(3323),o(5001),o(198),o(3936),o(9481),o(2397),o(2302),o(5764),o(6012),o(6564),o(5225);const t="backgroundPixelShader",f="#ifdef TEXTURELODSUPPORT\n#extension GL_EXT_shader_texture_lod : enable\n#endif\nprecision highp float;\n#include<__decl__backgroundFragment>\n#include<helperFunctions>\nvarying vec3 vPositionW;\n#ifdef MAINUV1\nvarying vec2 vMainUV1;\n#endif \n#ifdef MAINUV2 \nvarying vec2 vMainUV2; \n#endif \n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef DIFFUSE\n#if DIFFUSEDIRECTUV==1\n#define vDiffuseUV vMainUV1\n#elif DIFFUSEDIRECTUV==2\n#define vDiffuseUV vMainUV2\n#else\nvarying vec2 vDiffuseUV;\n#endif\nuniform sampler2D diffuseSampler;\n#endif\n#ifdef REFLECTION\n#ifdef REFLECTIONMAP_3D\n#define sampleReflection(s,c) textureCube(s,c)\nuniform samplerCube reflectionSampler;\n#ifdef TEXTURELODSUPPORT\n#define sampleReflectionLod(s,c,l) textureCubeLodEXT(s,c,l)\n#else\nuniform samplerCube reflectionSamplerLow;uniform samplerCube reflectionSamplerHigh;\n#endif\n#else\n#define sampleReflection(s,c) texture2D(s,c)\nuniform sampler2D reflectionSampler;\n#ifdef TEXTURELODSUPPORT\n#define sampleReflectionLod(s,c,l) texture2DLodEXT(s,c,l)\n#else\nuniform samplerCube reflectionSamplerLow;uniform samplerCube reflectionSamplerHigh;\n#endif\n#endif\n#ifdef REFLECTIONMAP_SKYBOX\nvarying vec3 vPositionUVW;\n#else\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvarying vec3 vDirectionW;\n#endif\n#endif\n#include<reflectionFunction>\n#endif\n#ifndef FROMLINEARSPACE\n#define FROMLINEARSPACE;\n#endif\n#ifndef SHADOWONLY\n#define SHADOWONLY;\n#endif\n#include<imageProcessingDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#include<imageProcessingFunctions>\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n#include<logDepthDeclaration>\n#include<clipPlaneFragmentDeclaration>\n#include<fogFragmentDeclaration>\n#ifdef REFLECTIONFRESNEL\n#define FRESNEL_MAXIMUM_ON_ROUGH 0.25\nvec3 fresnelSchlickEnvironmentGGX(float VdotN,vec3 reflectance0,vec3 reflectance90,float smoothness)\n{float weight=mix(FRESNEL_MAXIMUM_ON_ROUGH,1.0,smoothness);return reflectance0+weight*(reflectance90-reflectance0)*pow5(saturate(1.0-VdotN));}\n#endif\n#ifdef PROJECTED_GROUND\nfloat diskIntersectWithBackFaceCulling(vec3 ro,vec3 rd,vec3 c,float r) {float d=rd.y;if(d>0.0) { return 1e6; }\nvec3 o=ro-c;float t=-o.y/d;vec3 q=o+rd*t;return (dot(q,q)<r*r) ? t : 1e6;}\nfloat sphereIntersect(vec3 ro,vec3 rd,float ra) {float b=dot(ro,rd);float c=dot(ro,ro)-ra*ra;float h=b*b-c;if(h<0.0) { return -1.0; }\nh=sqrt(h);return-b+h;}\nvec3 project(vec3 viewDirectionW,vec3 eyePosition) {float radius=projectedGroundInfos.x;float height=projectedGroundInfos.y;vec3 camDir=-viewDirectionW;float skySphereDistance=sphereIntersect(eyePosition,camDir,radius);vec3 skySpherePositionW=eyePosition+camDir*skySphereDistance;vec3 p=normalize(skySpherePositionW);eyePosition.y-=height;float sIntersection=sphereIntersect(eyePosition,p,radius);vec3 h=vec3(0.0,-height,0.0);float dIntersection=diskIntersectWithBackFaceCulling(eyePosition,p,h,radius);p=(eyePosition+min(sIntersection,dIntersection)*p);return p;}\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=vec3(0.0,1.0,0.0);\n#endif\nfloat shadow=1.;float globalShadow=0.;float shadowLightCount=0.;float aggShadow=0.;float numLights=0.;\n#include<lightFragment>[0..maxSimultaneousLights]\n#ifdef SHADOWINUSE\nglobalShadow/=shadowLightCount;\n#else\nglobalShadow=1.0;\n#endif\n#ifndef BACKMAT_SHADOWONLY\nvec4 reflectionColor=vec4(1.,1.,1.,1.);\n#ifdef REFLECTION\n#ifdef PROJECTED_GROUND\nvec3 reflectionVector=project(viewDirectionW,vEyePosition.xyz);reflectionVector=vec3(reflectionMatrix*vec4(reflectionVector,1.));\n#else\nvec3 reflectionVector=computeReflectionCoords(vec4(vPositionW,1.0),normalW);\n#endif\n#ifdef REFLECTIONMAP_OPPOSITEZ\nreflectionVector.z*=-1.0;\n#endif\n#ifdef REFLECTIONMAP_3D\nvec3 reflectionCoords=reflectionVector;\n#else\nvec2 reflectionCoords=reflectionVector.xy;\n#ifdef REFLECTIONMAP_PROJECTION\nreflectionCoords/=reflectionVector.z;\n#endif\nreflectionCoords.y=1.0-reflectionCoords.y;\n#endif\n#ifdef REFLECTIONBLUR\nfloat reflectionLOD=vReflectionInfos.y;\n#ifdef TEXTURELODSUPPORT\nreflectionLOD=reflectionLOD*log2(vReflectionMicrosurfaceInfos.x)*vReflectionMicrosurfaceInfos.y+vReflectionMicrosurfaceInfos.z;reflectionColor=sampleReflectionLod(reflectionSampler,reflectionCoords,reflectionLOD);\n#else\nfloat lodReflectionNormalized=saturate(reflectionLOD);float lodReflectionNormalizedDoubled=lodReflectionNormalized*2.0;vec4 reflectionSpecularMid=sampleReflection(reflectionSampler,reflectionCoords);if(lodReflectionNormalizedDoubled<1.0){reflectionColor=mix(\nsampleReflection(reflectionSamplerHigh,reflectionCoords),\nreflectionSpecularMid,\nlodReflectionNormalizedDoubled\n);} else {reflectionColor=mix(\nreflectionSpecularMid,\nsampleReflection(reflectionSamplerLow,reflectionCoords),\nlodReflectionNormalizedDoubled-1.0\n);}\n#endif\n#else\nvec4 reflectionSample=sampleReflection(reflectionSampler,reflectionCoords);reflectionColor=reflectionSample;\n#endif\n#ifdef RGBDREFLECTION\nreflectionColor.rgb=fromRGBD(reflectionColor);\n#endif\n#ifdef GAMMAREFLECTION\nreflectionColor.rgb=toLinearSpace(reflectionColor.rgb);\n#endif\n#ifdef REFLECTIONBGR\nreflectionColor.rgb=reflectionColor.bgr;\n#endif\nreflectionColor.rgb*=vReflectionInfos.x;\n#endif\nvec3 diffuseColor=vec3(1.,1.,1.);float finalAlpha=alpha;\n#ifdef DIFFUSE\nvec4 diffuseMap=texture2D(diffuseSampler,vDiffuseUV);\n#ifdef GAMMADIFFUSE\ndiffuseMap.rgb=toLinearSpace(diffuseMap.rgb);\n#endif\ndiffuseMap.rgb*=vDiffuseInfos.y;\n#ifdef DIFFUSEHASALPHA\nfinalAlpha*=diffuseMap.a;\n#endif\ndiffuseColor=diffuseMap.rgb;\n#endif\n#ifdef REFLECTIONFRESNEL\nvec3 colorBase=diffuseColor;\n#else\nvec3 colorBase=reflectionColor.rgb*diffuseColor;\n#endif\ncolorBase=max(colorBase,0.0);\n#ifdef USERGBCOLOR\nvec3 finalColor=colorBase;\n#else\n#ifdef USEHIGHLIGHTANDSHADOWCOLORS\nvec3 mainColor=mix(vPrimaryColorShadow.rgb,vPrimaryColor.rgb,colorBase);\n#else\nvec3 mainColor=vPrimaryColor.rgb;\n#endif\nvec3 finalColor=colorBase*mainColor;\n#endif\n#ifdef REFLECTIONFRESNEL\nvec3 reflectionAmount=vReflectionControl.xxx;vec3 reflectionReflectance0=vReflectionControl.yyy;vec3 reflectionReflectance90=vReflectionControl.zzz;float VdotN=dot(normalize(vEyePosition.xyz),normalW);vec3 planarReflectionFresnel=fresnelSchlickEnvironmentGGX(saturate(VdotN),reflectionReflectance0,reflectionReflectance90,1.0);reflectionAmount*=planarReflectionFresnel;\n#ifdef REFLECTIONFALLOFF\nfloat reflectionDistanceFalloff=1.0-saturate(length(vPositionW.xyz-vBackgroundCenter)*vReflectionControl.w);reflectionDistanceFalloff*=reflectionDistanceFalloff;reflectionAmount*=reflectionDistanceFalloff;\n#endif\nfinalColor=mix(finalColor,reflectionColor.rgb,saturate(reflectionAmount));\n#endif\n#ifdef OPACITYFRESNEL\nfloat viewAngleToFloor=dot(normalW,normalize(vEyePosition.xyz-vBackgroundCenter));const float startAngle=0.1;float fadeFactor=saturate(viewAngleToFloor/startAngle);finalAlpha*=fadeFactor*fadeFactor;\n#endif\n#ifdef SHADOWINUSE\nfinalColor=mix(finalColor*shadowLevel,finalColor,globalShadow);\n#endif\nvec4 color=vec4(finalColor,finalAlpha);\n#else\nvec4 color=vec4(vPrimaryColor.rgb,(1.0-clamp(globalShadow,0.,1.))*alpha);\n#endif\n#include<logDepthFragment>\n#include<fogFragment>\n#ifdef IMAGEPROCESSINGPOSTPROCESS\n#if !defined(SKIPFINALCOLORCLAMP)\ncolor.rgb=clamp(color.rgb,0.,30.0);\n#endif\n#else\ncolor=applyImageProcessing(color);\n#endif\n#ifdef PREMULTIPLYALPHA\ncolor.rgb*=color.a;\n#endif\n#ifdef NOISE\ncolor.rgb+=dither(vPositionW.xy,0.5);color=max(color,0.0);\n#endif\ngl_FragColor=color;\n#define CUSTOM_FRAGMENT_MAIN_END\n}\n";i.v.ShadersStore[t]=f;const c={name:t,shader:f}}}]);
|
|
2
|
+
"use strict";(self.webpackChunkCrystaldesignRealTimeViewer=self.webpackChunkCrystaldesignRealTimeViewer||[]).push([[3243],{1740:(e,n,o)=>{var i=o(7416);o(2889);const r="backgroundUboDeclaration",l="layout(std140,column_major) uniform;uniform Material\n{uniform vec4 vPrimaryColor;uniform vec4 vPrimaryColorShadow;uniform vec2 vDiffuseInfos;uniform vec2 vReflectionInfos;uniform mat4 diffuseMatrix;uniform mat4 reflectionMatrix;uniform vec3 vReflectionMicrosurfaceInfos;uniform float fFovMultiplier;uniform float pointSize;uniform float shadowLevel;uniform float alpha;uniform vec3 vBackgroundCenter;uniform vec4 vReflectionControl;uniform vec2 projectedGroundInfos;};\n#include<sceneUboDeclaration>\n";i.v.IncludesShadersStore[r]=l},5001:(e,n,o)=>{const i="lightsFragmentFunctions",r="struct lightingInfo\n{vec3 diffuse;\n#ifdef SPECULARTERM\nvec3 specular;\n#endif\n#ifdef NDOTL\nfloat ndl;\n#endif\n};lightingInfo computeLighting(vec3 viewDirectionW,vec3 vNormal,vec4 lightData,vec3 diffuseColor,vec3 specularColor,float range,float glossiness) {lightingInfo result;vec3 lightVectorW;float attenuation=1.0;if (lightData.w==0.)\n{vec3 direction=lightData.xyz-vPositionW;attenuation=max(0.,1.0-length(direction)/range);lightVectorW=normalize(direction);}\nelse\n{lightVectorW=normalize(-lightData.xyz);}\nfloat ndl=max(0.,dot(vNormal,lightVectorW));\n#ifdef NDOTL\nresult.ndl=ndl;\n#endif\nresult.diffuse=ndl*diffuseColor*attenuation;\n#ifdef SPECULARTERM\nvec3 angleW=normalize(viewDirectionW+lightVectorW);float specComp=max(0.,dot(vNormal,angleW));specComp=pow(specComp,max(1.,glossiness));result.specular=specComp*specularColor*attenuation;\n#endif\nreturn result;}\nlightingInfo computeSpotLighting(vec3 viewDirectionW,vec3 vNormal,vec4 lightData,vec4 lightDirection,vec3 diffuseColor,vec3 specularColor,float range,float glossiness) {lightingInfo result;vec3 direction=lightData.xyz-vPositionW;vec3 lightVectorW=normalize(direction);float attenuation=max(0.,1.0-length(direction)/range);float cosAngle=max(0.,dot(lightDirection.xyz,-lightVectorW));if (cosAngle>=lightDirection.w)\n{cosAngle=max(0.,pow(cosAngle,lightData.w));attenuation*=cosAngle;float ndl=max(0.,dot(vNormal,lightVectorW));\n#ifdef NDOTL\nresult.ndl=ndl;\n#endif\nresult.diffuse=ndl*diffuseColor*attenuation;\n#ifdef SPECULARTERM\nvec3 angleW=normalize(viewDirectionW+lightVectorW);float specComp=max(0.,dot(vNormal,angleW));specComp=pow(specComp,max(1.,glossiness));result.specular=specComp*specularColor*attenuation;\n#endif\nreturn result;}\nresult.diffuse=vec3(0.);\n#ifdef SPECULARTERM\nresult.specular=vec3(0.);\n#endif\n#ifdef NDOTL\nresult.ndl=0.;\n#endif\nreturn result;}\nlightingInfo computeHemisphericLighting(vec3 viewDirectionW,vec3 vNormal,vec4 lightData,vec3 diffuseColor,vec3 specularColor,vec3 groundColor,float glossiness) {lightingInfo result;float ndl=dot(vNormal,lightData.xyz)*0.5+0.5;\n#ifdef NDOTL\nresult.ndl=ndl;\n#endif\nresult.diffuse=mix(groundColor,diffuseColor,ndl);\n#ifdef SPECULARTERM\nvec3 angleW=normalize(viewDirectionW+lightData.xyz);float specComp=max(0.,dot(vNormal,angleW));specComp=pow(specComp,max(1.,glossiness));result.specular=specComp*specularColor;\n#endif\nreturn result;}\n#define inline\nvec3 computeProjectionTextureDiffuseLighting(sampler2D projectionLightSampler,mat4 textureProjectionMatrix,vec3 posW){vec4 strq=textureProjectionMatrix*vec4(posW,1.0);strq/=strq.w;vec3 textureColor=texture2D(projectionLightSampler,strq.xy).rgb;return textureColor;}";o(7416).v.IncludesShadersStore[i]=r},3243:(e,n,o)=>{o.r(n),o.d(n,{backgroundPixelShader:()=>f});var i=o(7416);const r="uniform vec4 vEyePosition;uniform vec4 vPrimaryColor;\n#ifdef USEHIGHLIGHTANDSHADOWCOLORS\nuniform vec4 vPrimaryColorShadow;\n#endif\nuniform float shadowLevel;uniform float alpha;\n#ifdef DIFFUSE\nuniform vec2 vDiffuseInfos;\n#endif\n#ifdef REFLECTION\nuniform vec2 vReflectionInfos;uniform mat4 reflectionMatrix;uniform vec3 vReflectionMicrosurfaceInfos;\n#endif\n#if defined(REFLECTIONFRESNEL) || defined(OPACITYFRESNEL)\nuniform vec3 vBackgroundCenter;\n#endif\n#ifdef REFLECTIONFRESNEL\nuniform vec4 vReflectionControl;\n#endif\n#if defined(REFLECTIONMAP_SPHERICAL) || defined(REFLECTIONMAP_PROJECTION) || defined(REFRACTION)\nuniform mat4 view;\n#endif\n#ifdef PROJECTED_GROUND\nuniform vec2 projectedGroundInfos;\n#endif\n";i.v.IncludesShadersStore.backgroundFragmentDeclaration=r;o(1740),o(5276),o(2628),o(6757),o(8494),o(3323),o(5001),o(198),o(3936),o(9481),o(2397),o(2302),o(5764),o(6012),o(6564),o(5225);const l="backgroundPixelShader",t="#ifdef TEXTURELODSUPPORT\n#extension GL_EXT_shader_texture_lod : enable\n#endif\nprecision highp float;\n#include<__decl__backgroundFragment>\n#include<helperFunctions>\nvarying vec3 vPositionW;\n#ifdef MAINUV1\nvarying vec2 vMainUV1;\n#endif \n#ifdef MAINUV2 \nvarying vec2 vMainUV2; \n#endif \n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef DIFFUSE\n#if DIFFUSEDIRECTUV==1\n#define vDiffuseUV vMainUV1\n#elif DIFFUSEDIRECTUV==2\n#define vDiffuseUV vMainUV2\n#else\nvarying vec2 vDiffuseUV;\n#endif\nuniform sampler2D diffuseSampler;\n#endif\n#ifdef REFLECTION\n#ifdef REFLECTIONMAP_3D\n#define sampleReflection(s,c) textureCube(s,c)\nuniform samplerCube reflectionSampler;\n#ifdef TEXTURELODSUPPORT\n#define sampleReflectionLod(s,c,l) textureCubeLodEXT(s,c,l)\n#else\nuniform samplerCube reflectionSamplerLow;uniform samplerCube reflectionSamplerHigh;\n#endif\n#else\n#define sampleReflection(s,c) texture2D(s,c)\nuniform sampler2D reflectionSampler;\n#ifdef TEXTURELODSUPPORT\n#define sampleReflectionLod(s,c,l) texture2DLodEXT(s,c,l)\n#else\nuniform samplerCube reflectionSamplerLow;uniform samplerCube reflectionSamplerHigh;\n#endif\n#endif\n#ifdef REFLECTIONMAP_SKYBOX\nvarying vec3 vPositionUVW;\n#else\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvarying vec3 vDirectionW;\n#endif\n#endif\n#include<reflectionFunction>\n#endif\n#ifndef FROMLINEARSPACE\n#define FROMLINEARSPACE;\n#endif\n#ifndef SHADOWONLY\n#define SHADOWONLY;\n#endif\n#include<imageProcessingDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#include<imageProcessingFunctions>\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n#include<logDepthDeclaration>\n#include<clipPlaneFragmentDeclaration>\n#include<fogFragmentDeclaration>\n#ifdef REFLECTIONFRESNEL\n#define FRESNEL_MAXIMUM_ON_ROUGH 0.25\nvec3 fresnelSchlickEnvironmentGGX(float VdotN,vec3 reflectance0,vec3 reflectance90,float smoothness)\n{float weight=mix(FRESNEL_MAXIMUM_ON_ROUGH,1.0,smoothness);return reflectance0+weight*(reflectance90-reflectance0)*pow5(saturate(1.0-VdotN));}\n#endif\n#ifdef PROJECTED_GROUND\nfloat diskIntersectWithBackFaceCulling(vec3 ro,vec3 rd,vec3 c,float r) {float d=rd.y;if(d>0.0) { return 1e6; }\nvec3 o=ro-c;float t=-o.y/d;vec3 q=o+rd*t;return (dot(q,q)<r*r) ? t : 1e6;}\nfloat sphereIntersect(vec3 ro,vec3 rd,float ra) {float b=dot(ro,rd);float c=dot(ro,ro)-ra*ra;float h=b*b-c;if(h<0.0) { return -1.0; }\nh=sqrt(h);return-b+h;}\nvec3 project(vec3 viewDirectionW,vec3 eyePosition) {float radius=projectedGroundInfos.x;float height=projectedGroundInfos.y;vec3 camDir=-viewDirectionW;float skySphereDistance=sphereIntersect(eyePosition,camDir,radius);vec3 skySpherePositionW=eyePosition+camDir*skySphereDistance;vec3 p=normalize(skySpherePositionW);eyePosition.y-=height;float sIntersection=sphereIntersect(eyePosition,p,radius);vec3 h=vec3(0.0,-height,0.0);float dIntersection=diskIntersectWithBackFaceCulling(eyePosition,p,h,radius);p=(eyePosition+min(sIntersection,dIntersection)*p);return p;}\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=vec3(0.0,1.0,0.0);\n#endif\nfloat shadow=1.;float globalShadow=0.;float shadowLightCount=0.;float aggShadow=0.;float numLights=0.;\n#include<lightFragment>[0..maxSimultaneousLights]\n#ifdef SHADOWINUSE\nglobalShadow/=shadowLightCount;\n#else\nglobalShadow=1.0;\n#endif\n#ifndef BACKMAT_SHADOWONLY\nvec4 reflectionColor=vec4(1.,1.,1.,1.);\n#ifdef REFLECTION\n#ifdef PROJECTED_GROUND\nvec3 reflectionVector=project(viewDirectionW,vEyePosition.xyz);reflectionVector=vec3(reflectionMatrix*vec4(reflectionVector,1.));\n#else\nvec3 reflectionVector=computeReflectionCoords(vec4(vPositionW,1.0),normalW);\n#endif\n#ifdef REFLECTIONMAP_OPPOSITEZ\nreflectionVector.z*=-1.0;\n#endif\n#ifdef REFLECTIONMAP_3D\nvec3 reflectionCoords=reflectionVector;\n#else\nvec2 reflectionCoords=reflectionVector.xy;\n#ifdef REFLECTIONMAP_PROJECTION\nreflectionCoords/=reflectionVector.z;\n#endif\nreflectionCoords.y=1.0-reflectionCoords.y;\n#endif\n#ifdef REFLECTIONBLUR\nfloat reflectionLOD=vReflectionInfos.y;\n#ifdef TEXTURELODSUPPORT\nreflectionLOD=reflectionLOD*log2(vReflectionMicrosurfaceInfos.x)*vReflectionMicrosurfaceInfos.y+vReflectionMicrosurfaceInfos.z;reflectionColor=sampleReflectionLod(reflectionSampler,reflectionCoords,reflectionLOD);\n#else\nfloat lodReflectionNormalized=saturate(reflectionLOD);float lodReflectionNormalizedDoubled=lodReflectionNormalized*2.0;vec4 reflectionSpecularMid=sampleReflection(reflectionSampler,reflectionCoords);if(lodReflectionNormalizedDoubled<1.0){reflectionColor=mix(\nsampleReflection(reflectionSamplerHigh,reflectionCoords),\nreflectionSpecularMid,\nlodReflectionNormalizedDoubled\n);} else {reflectionColor=mix(\nreflectionSpecularMid,\nsampleReflection(reflectionSamplerLow,reflectionCoords),\nlodReflectionNormalizedDoubled-1.0\n);}\n#endif\n#else\nvec4 reflectionSample=sampleReflection(reflectionSampler,reflectionCoords);reflectionColor=reflectionSample;\n#endif\n#ifdef RGBDREFLECTION\nreflectionColor.rgb=fromRGBD(reflectionColor);\n#endif\n#ifdef GAMMAREFLECTION\nreflectionColor.rgb=toLinearSpace(reflectionColor.rgb);\n#endif\n#ifdef REFLECTIONBGR\nreflectionColor.rgb=reflectionColor.bgr;\n#endif\nreflectionColor.rgb*=vReflectionInfos.x;\n#endif\nvec3 diffuseColor=vec3(1.,1.,1.);float finalAlpha=alpha;\n#ifdef DIFFUSE\nvec4 diffuseMap=texture2D(diffuseSampler,vDiffuseUV);\n#ifdef GAMMADIFFUSE\ndiffuseMap.rgb=toLinearSpace(diffuseMap.rgb);\n#endif\ndiffuseMap.rgb*=vDiffuseInfos.y;\n#ifdef DIFFUSEHASALPHA\nfinalAlpha*=diffuseMap.a;\n#endif\ndiffuseColor=diffuseMap.rgb;\n#endif\n#ifdef REFLECTIONFRESNEL\nvec3 colorBase=diffuseColor;\n#else\nvec3 colorBase=reflectionColor.rgb*diffuseColor;\n#endif\ncolorBase=max(colorBase,0.0);\n#ifdef USERGBCOLOR\nvec3 finalColor=colorBase;\n#else\n#ifdef USEHIGHLIGHTANDSHADOWCOLORS\nvec3 mainColor=mix(vPrimaryColorShadow.rgb,vPrimaryColor.rgb,colorBase);\n#else\nvec3 mainColor=vPrimaryColor.rgb;\n#endif\nvec3 finalColor=colorBase*mainColor;\n#endif\n#ifdef REFLECTIONFRESNEL\nvec3 reflectionAmount=vReflectionControl.xxx;vec3 reflectionReflectance0=vReflectionControl.yyy;vec3 reflectionReflectance90=vReflectionControl.zzz;float VdotN=dot(normalize(vEyePosition.xyz),normalW);vec3 planarReflectionFresnel=fresnelSchlickEnvironmentGGX(saturate(VdotN),reflectionReflectance0,reflectionReflectance90,1.0);reflectionAmount*=planarReflectionFresnel;\n#ifdef REFLECTIONFALLOFF\nfloat reflectionDistanceFalloff=1.0-saturate(length(vPositionW.xyz-vBackgroundCenter)*vReflectionControl.w);reflectionDistanceFalloff*=reflectionDistanceFalloff;reflectionAmount*=reflectionDistanceFalloff;\n#endif\nfinalColor=mix(finalColor,reflectionColor.rgb,saturate(reflectionAmount));\n#endif\n#ifdef OPACITYFRESNEL\nfloat viewAngleToFloor=dot(normalW,normalize(vEyePosition.xyz-vBackgroundCenter));const float startAngle=0.1;float fadeFactor=saturate(viewAngleToFloor/startAngle);finalAlpha*=fadeFactor*fadeFactor;\n#endif\n#ifdef SHADOWINUSE\nfinalColor=mix(finalColor*shadowLevel,finalColor,globalShadow);\n#endif\nvec4 color=vec4(finalColor,finalAlpha);\n#else\nvec4 color=vec4(vPrimaryColor.rgb,(1.0-clamp(globalShadow,0.,1.))*alpha);\n#endif\n#include<logDepthFragment>\n#include<fogFragment>\n#ifdef IMAGEPROCESSINGPOSTPROCESS\n#if !defined(SKIPFINALCOLORCLAMP)\ncolor.rgb=clamp(color.rgb,0.,30.0);\n#endif\n#else\ncolor=applyImageProcessing(color);\n#endif\n#ifdef PREMULTIPLYALPHA\ncolor.rgb*=color.a;\n#endif\n#ifdef NOISE\ncolor.rgb+=dither(vPositionW.xy,0.5);color=max(color,0.0);\n#endif\ngl_FragColor=color;\n#define CUSTOM_FRAGMENT_MAIN_END\n}\n";i.v.ShadersStore.backgroundPixelShader=t;const f={name:l,shader:t}}}]);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see 3351.real-time-viewer.umd.min.js.LICENSE.txt */
|
|
2
|
-
"use strict";(self.webpackChunkCrystaldesignRealTimeViewer=self.webpackChunkCrystaldesignRealTimeViewer||[]).push([[3351],{6782:(e,n,r)=>{const t="kernelBlurVaryingDeclaration",a="varying sampleCoord{X}: vec2f;";r(7416).v.IncludesShadersStoreWGSL[t]=a},3351:(e,n,r)=>{r.r(n),r.d(n,{kernelBlurVertexShaderWGSL:()=>l});var t=r(7416);r(6782);const a="
|
|
2
|
+
"use strict";(self.webpackChunkCrystaldesignRealTimeViewer=self.webpackChunkCrystaldesignRealTimeViewer||[]).push([[3351],{6782:(e,n,r)=>{const t="kernelBlurVaryingDeclaration",a="varying sampleCoord{X}: vec2f;";r(7416).v.IncludesShadersStoreWGSL[t]=a},3351:(e,n,r)=>{r.r(n),r.d(n,{kernelBlurVertexShaderWGSL:()=>l});var t=r(7416);r(6782);const a="vertexOutputs.sampleCoord{X}=vertexOutputs.sampleCenter+uniforms.delta*KERNEL_OFFSET{X};";t.v.IncludesShadersStoreWGSL.kernelBlurVertex=a;const s="kernelBlurVertexShader",i="attribute position: vec2f;uniform delta: vec2f;varying sampleCenter: vec2f;\n#include<kernelBlurVaryingDeclaration>[0..varyingCount]\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {const madd: vec2f= vec2f(0.5,0.5);\n#define CUSTOM_VERTEX_MAIN_BEGIN\nvertexOutputs.sampleCenter=(input.position*madd+madd);\n#include<kernelBlurVertex>[0..varyingCount]\nvertexOutputs.position= vec4f(input.position,0.0,1.0);\n#define CUSTOM_VERTEX_MAIN_END\n}";t.v.ShadersStoreWGSL.kernelBlurVertexShader=i;const l={name:s,shader:i}}}]);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see 4091.real-time-viewer.umd.min.js.LICENSE.txt */
|
|
2
|
-
"use strict";(self.webpackChunkCrystaldesignRealTimeViewer=self.webpackChunkCrystaldesignRealTimeViewer||[]).push([[4091],{6782:(e,n,
|
|
2
|
+
"use strict";(self.webpackChunkCrystaldesignRealTimeViewer=self.webpackChunkCrystaldesignRealTimeViewer||[]).push([[4091],{6782:(e,n,r)=>{const t="kernelBlurVaryingDeclaration",a="varying sampleCoord{X}: vec2f;";r(7416).v.IncludesShadersStoreWGSL[t]=a},3284:(e,n,r)=>{const t="packingFunctions",a="fn pack(depth: f32)->vec4f\n{const bit_shift: vec4f= vec4f(255.0*255.0*255.0,255.0*255.0,255.0,1.0);const bit_mask: vec4f= vec4f(0.0,1.0/255.0,1.0/255.0,1.0/255.0);var res: vec4f=fract(depth*bit_shift);res-=res.xxyz*bit_mask;return res;}\nfn unpack(color: vec4f)->f32\n{const bit_shift: vec4f= vec4f(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(color,bit_shift);}";r(7416).v.IncludesShadersStoreWGSL[t]=a},4091:(e,n,r)=>{r.r(n),r.d(n,{kernelBlurPixelShaderWGSL:()=>i});var t=r(7416);r(6782),r(3284);const a="#ifdef DOF\nfactor=sampleCoC(fragmentInputs.sampleCoord{X}); \ncomputedWeight=KERNEL_WEIGHT{X}*factor;sumOfWeights+=computedWeight;\n#else\ncomputedWeight=KERNEL_WEIGHT{X};\n#endif\n#ifdef PACKEDFLOAT\nblend+=unpack(textureSample(textureSampler,textureSamplerSampler,fragmentInputs.sampleCoord{X}))*computedWeight;\n#else\nblend+=textureSample(textureSampler,textureSamplerSampler,fragmentInputs.sampleCoord{X})*computedWeight;\n#endif\n";t.v.IncludesShadersStoreWGSL.kernelBlurFragment=a;const l="#ifdef DOF\nfactor=sampleCoC(fragmentInputs.sampleCenter+uniforms.delta*KERNEL_DEP_OFFSET{X});computedWeight=KERNEL_DEP_WEIGHT{X}*factor;sumOfWeights+=computedWeight;\n#else\ncomputedWeight=KERNEL_DEP_WEIGHT{X};\n#endif\n#ifdef PACKEDFLOAT\nblend+=unpack(textureSample(textureSampler,textureSamplerSampler,fragmentInputs.sampleCenter+uniforms.delta*KERNEL_DEP_OFFSET{X}))*computedWeight;\n#else\nblend+=textureSample(textureSampler,textureSamplerSampler,fragmentInputs.sampleCenter+uniforms.delta*KERNEL_DEP_OFFSET{X})*computedWeight;\n#endif\n";t.v.IncludesShadersStoreWGSL.kernelBlurFragment2=l;const f="kernelBlurPixelShader",u="var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;uniform delta: vec2f;varying sampleCenter: vec2f;\n#ifdef DOF\nvar circleOfConfusionSamplerSampler: sampler;var circleOfConfusionSampler: texture_2d<f32>;fn sampleCoC(offset: vec2f)->f32 {var coc: f32=textureSample(circleOfConfusionSampler,circleOfConfusionSamplerSampler,offset).r;return coc; }\n#endif\n#include<kernelBlurVaryingDeclaration>[0..varyingCount]\n#ifdef PACKEDFLOAT\n#include<packingFunctions>\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {var computedWeight: f32=0.0;\n#ifdef PACKEDFLOAT\nvar blend: f32=0.;\n#else\nvar blend: vec4f= vec4f(0.);\n#endif\n#ifdef DOF\nvar sumOfWeights: f32=CENTER_WEIGHT; \nvar factor: f32=0.0;\n#ifdef PACKEDFLOAT\nblend+=unpack(textureSample(textureSampler,textureSamplerSampler,input.sampleCenter))*CENTER_WEIGHT;\n#else\nblend+=textureSample(textureSampler,textureSamplerSampler,input.sampleCenter)*CENTER_WEIGHT;\n#endif\n#endif\n#include<kernelBlurFragment>[0..varyingCount]\n#include<kernelBlurFragment2>[0..depCount]\n#ifdef PACKEDFLOAT\nfragmentOutputs.color=pack(blend);\n#else\nfragmentOutputs.color=blend;\n#endif\n#ifdef DOF\nfragmentOutputs.color/=sumOfWeights;\n#endif\n}";t.v.ShadersStoreWGSL.kernelBlurPixelShader=u;const i={name:f,shader:u}}}]);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see 410.real-time-viewer.umd.min.js.LICENSE.txt */
|
|
2
|
-
"use strict";(self.webpackChunkCrystaldesignRealTimeViewer=self.webpackChunkCrystaldesignRealTimeViewer||[]).push([[410],{410:(e,t,n)=>{n.r(t),n.d(t,{_ExrTextureLoader:()=>_ExrTextureLoader});var r=n(3146),a=n(1494);const o=65536,s=14,i=65537,l=16384;var c,u;!function(e){e[e.NO_COMPRESSION=0]="NO_COMPRESSION",e[e.RLE_COMPRESSION=1]="RLE_COMPRESSION",e[e.ZIPS_COMPRESSION=2]="ZIPS_COMPRESSION",e[e.ZIP_COMPRESSION=3]="ZIP_COMPRESSION",e[e.PIZ_COMPRESSION=4]="PIZ_COMPRESSION",e[e.PXR24_COMPRESSION=5]="PXR24_COMPRESSION"}(c||(c={})),function(e){e[e.INCREASING_Y=0]="INCREASING_Y",e[e.DECREASING_Y=1]="DECREASING_Y"}(u||(u={}));const f=function _GenerateTables(){const e=new ArrayBuffer(4),t=new Float32Array(e),n=new Uint32Array(e),r=new Uint32Array(512),a=new Uint32Array(512);for(let e=0;e<256;++e){const t=e-127;t<-27?(r[e]=0,r[256|e]=32768,a[e]=24,a[256|e]=24):t<-14?(r[e]=1024>>-t-14,r[256|e]=1024>>-t-14|32768,a[e]=-t-1,a[256|e]=-t-1):t<=15?(r[e]=t+15<<10,r[256|e]=t+15<<10|32768,a[e]=13,a[256|e]=13):t<128?(r[e]=31744,r[256|e]=64512,a[e]=24,a[256|e]=24):(r[e]=31744,r[256|e]=64512,a[e]=13,a[256|e]=13)}const o=new Uint32Array(2048),s=new Uint32Array(64),i=new Uint32Array(64);for(let e=1;e<1024;++e){let t=e<<13,n=0;for(;!(8388608&t);)t<<=1,n-=8388608;t&=-8388609,n+=947912704,o[e]=t|n}for(let e=1024;e<2048;++e)o[e]=939524096+(e-1024<<13);for(let e=1;e<31;++e)s[e]=e<<23;s[31]=1199570944,s[32]=2147483648;for(let e=33;e<63;++e)s[e]=2147483648+(e-32<<23);s[63]=3347054592;for(let e=1;e<64;++e)32!==e&&(i[e]=1024);return{floatView:t,uint32View:n,baseTable:r,shiftTable:a,mantissaTable:o,exponentTable:s,offsetTable:i}}();function ParseNullTerminatedString(e,t){const n=new Uint8Array(e);let r=0;for(;0!=n[t.value+r];)r+=1;const a=(new TextDecoder).decode(n.slice(t.value,t.value+r));return t.value=t.value+r+1,a}function ParseInt32(e,t){const n=e.getInt32(t.value,!0);return t.value+=4,n}function ParseUint32(e,t){const n=e.getUint32(t.value,!0);return t.value+=4,n}function ParseUint8(e,t){const n=e.getUint8(t.value);return t.value+=1,n}function ParseUint16(e,t){const n=e.getUint16(t.value,!0);return t.value+=2,n}function ParseUint8Array(e,t){const n=e[t.value];return t.value+=1,n}function ParseInt64(e,t){let n;return n="getBigInt64"in DataView.prototype?Number(e.getBigInt64(t.value,!0)):e.getUint32(t.value+4,!0)+Number(e.getUint32(t.value,!0)<<32),t.value+=8,n}function ParseFloat32(e,t){const n=e.getFloat32(t.value,!0);return t.value+=4,n}function ParseFloat16(e,t){return function DecodeFloat16(e){const t=(31744&e)>>10,n=1023&e;return(e>>15?-1:1)*(t?31===t?n?NaN:1/0:Math.pow(2,t-15)*(1+n/1024):n/1024*6103515625e-14)}(ParseUint16(e,t))}function DecodeFloat32(e,t){return function ToHalfFloat(e){if(Math.abs(e)>65504)throw new Error("Value out of range.Consider using float instead of half-float.");e=(0,a.Clamp)(e,-65504,65504),f.floatView[0]=e;const t=f.uint32View[0],n=t>>23&511;return f.baseTable[n]+((8388607&t)>>f.shiftTable[n])}(ParseFloat32(e,t))}function ParseValue(e,t,n,r){switch(n){case"string":case"stringvector":case"iccProfile":return function ParseFixedLengthString(e,t,n){const r=(new TextDecoder).decode(new Uint8Array(e).slice(t.value,t.value+n));return t.value=t.value+n,r}(e.buffer,t,r);case"chlist":return function ParseChlist(e,t,n){const r=t.value,a=[];for(;t.value<r+n-1;){const n=ParseNullTerminatedString(e.buffer,t),r=ParseInt32(e,t),o=ParseUint8(e,t);t.value+=3;const s=ParseInt32(e,t),i=ParseInt32(e,t);a.push({name:n,pixelType:r,pLinear:o,xSampling:s,ySampling:i})}return t.value+=1,a}(e,t,r);case"chromaticities":return function ParseChromaticities(e,t){return{redX:ParseFloat32(e,t),redY:ParseFloat32(e,t),greenX:ParseFloat32(e,t),greenY:ParseFloat32(e,t),blueX:ParseFloat32(e,t),blueY:ParseFloat32(e,t),whiteX:ParseFloat32(e,t),whiteY:ParseFloat32(e,t)}}(e,t);case"compression":return function ParseCompression(e,t){return ParseUint8(e,t)}(e,t);case"box2i":return function ParseBox2i(e,t){return{xMin:ParseInt32(e,t),yMin:ParseInt32(e,t),xMax:ParseInt32(e,t),yMax:ParseInt32(e,t)}}(e,t);case"lineOrder":return function ParseLineOrder(e,t){const n=ParseUint8(e,t);return u[n]}(e,t);case"float":return ParseFloat32(e,t);case"v2f":return function ParseV2f(e,t){return[ParseFloat32(e,t),ParseFloat32(e,t)]}(e,t);case"v3f":return function ParseV3f(e,t){return[ParseFloat32(e,t),ParseFloat32(e,t),ParseFloat32(e,t)]}(e,t);case"int":return ParseInt32(e,t);case"rational":return function ParseRational(e,t){return[ParseInt32(e,t),ParseUint32(e,t)]}(e,t);case"timecode":return function ParseTimecode(e,t){return[ParseUint32(e,t),ParseUint32(e,t)]}(e,t);case"preview":return t.value+=r,"skipped";default:return void(t.value+=r)}}function Predictor(e){for(let t=1;t<e.length;t++){const n=e[t-1]+e[t]-128;e[t]=n}}function InterleaveScalar(e,t){let n=0,r=Math.floor((e.length+1)/2),a=0;const o=e.length-1;for(;!(a>o||(t[a++]=e[n++],a>o));)t[a++]=e[r++]}function GetBits(e,t,n,r,a){for(;n<e;)t=t<<8|ParseUint8Array(r,a),n+=8;return{l:t>>(n-=e)&(1<<e)-1,c:t,lc:n}}function GetChar(e,t,n,r){return{c:e=e<<8|ParseUint8Array(n,r),lc:t+=8}}function GetCode(e,t,n,r,a,o,s,i,l){if(e==t){if(r<8){const e=GetChar(n,r,a,o);n=e.c,r=e.lc}let e=n>>(r-=8);if(e=new Uint8Array([e])[0],i.value+e>l)return null;const t=s[i.value-1];for(;e-- >0;)s[i.value++]=t}else{if(!(i.value<l))return null;s[i.value++]=e}return{c:n,lc:r}}const d=new Array(59);function HufUnpackEncTable(e,t,n,r,a,o){const s=t;let l=0,c=0;for(;r<=a;r++){if(s.value-t.value>n)return;let i=GetBits(6,l,c,e,s);const u=i.l;if(l=i.c,c=i.lc,o[r]=u,63==u){if(s.value-t.value>n)throw new Error("Error in HufUnpackEncTable");i=GetBits(8,l,c,e,s);let u=i.l+6;if(l=i.c,c=i.lc,r+u>a+1)throw new Error("Error in HufUnpackEncTable");for(;u--;)o[r++]=0;r--}else if(u>=59){let e=u-59+2;if(r+e>a+1)throw new Error("Error in HufUnpackEncTable");for(;e--;)o[r++]=0;r--}}!function HufCanonicalCodeTable(e){for(let e=0;e<=58;++e)d[e]=0;for(let t=0;t<i;++t)d[e[t]]+=1;let t=0;for(let e=58;e>0;--e){const n=t+d[e]>>1;d[e]=t,t=n}for(let t=0;t<i;++t){const n=e[t];n>0&&(e[t]=n|d[n]++<<6)}}(o)}function HufLength(e){return 63&e}function HufCode(e){return e>>6}function HufUncompress(e,t,n,r,a,o){const c=n.value,u=ParseUint32(t,n),f=ParseUint32(t,n);n.value+=4;const d=ParseUint32(t,n);if(n.value+=4,u<0||u>=i||f<0||f>=i)throw new Error("Wrong HUF_ENCSIZE");const w=new Array(i),p=new Array(l);!function HufClearDecTable(e){for(let t=0;t<l;t++)e[t]={},e[t].len=0,e[t].lit=0,e[t].p=null}(p);if(HufUnpackEncTable(e,n,r-(n.value-c),u,f,w),d>8*(r-(n.value-c)))throw new Error("Wrong hufUncompress");!function HufBuildDecTable(e,t,n,r){for(;t<=n;t++){const n=HufCode(e[t]),a=HufLength(e[t]);if(n>>a)throw new Error("Invalid table entry");if(a>s){const e=r[n>>a-s];if(e.len)throw new Error("Invalid table entry");if(e.lit++,e.p){const t=e.p;e.p=new Array(e.lit);for(let n=0;n<e.lit-1;++n)e.p[n]=t[n]}else e.p=new Array(1);e.p[e.lit-1]=t}else if(a){let e=0;for(let o=1<<s-a;o>0;o--){const o=r[(n<<s-a)+e];if(o.len||o.p)throw new Error("Invalid table entry");o.len=a,o.lit=t,e++}}}return!0}(w,u,f,p),function HufDecode(e,t,n,r,a,o,i,l,c){let u=0,f=0;const d=i,w=Math.trunc(r.value+(a+7)/8);for(;r.value<w;){let a=GetChar(u,f,n,r);for(u=a.c,f=a.lc;f>=s;){const i=t[u>>f-s&16383];if(i.len){f-=i.len;const e=GetCode(i.lit,o,u,f,n,r,l,c,d);e&&(u=e.c,f=e.lc)}else{if(!i.p)throw new Error("hufDecode issues");let t;for(t=0;t<i.lit;t++){const s=HufLength(e[i.p[t]]);for(;f<s&&r.value<w;)a=GetChar(u,f,n,r),u=a.c,f=a.lc;if(f>=s&&HufCode(e[i.p[t]])==(u>>f-s&(1<<s)-1)){f-=s;const e=GetCode(i.p[t],o,u,f,n,r,l,c,d);e&&(u=e.c,f=e.lc);break}}if(t==i.lit)throw new Error("HufDecode issues")}}}const p=8-a&7;for(u>>=p,f-=p;f>0;){const e=t[u<<s-f&16383];if(!e.len)throw new Error("HufDecode issues");{f-=e.len;const t=GetCode(e.lit,o,u,f,n,r,l,c,d);t&&(u=t.c,f=t.lc)}}return!0}(w,p,e,n,d,f,o,a,{value:0})}function UInt16(e){return 65535&e}function Int16(e){const t=UInt16(e);return t>32767?t-65536:t}function Wdec14(e,t){const n=Int16(e),r=Int16(t),a=n+(1&r)+(r>>1);return{a,b:a-r}}function Wdec16(e,t){const n=UInt16(e),r=UInt16(t),a=n-(r>>1)&65535;return{a:r+a-32768&65535,b:a}}function Wav2Decode(e,t,n,r,a,o,s){const i=s<16384,l=n>a?a:n;let c,u,f=1;for(;f<=l;)f<<=1;for(f>>=1,c=f,f>>=1;f>=1;){u=0;const s=u+o*(a-c),l=o*f,d=o*c,w=r*f,p=r*c;let h,P,y,b;for(;u<=s;u+=d){let a=u;const o=u+r*(n-c);for(;a<=o;a+=p){const n=a+w,r=a+l,o=r+w;if(i){let s=Wdec14(e[a+t],e[r+t]);h=s.a,y=s.b,s=Wdec14(e[n+t],e[o+t]),P=s.a,b=s.b,s=Wdec14(h,P),e[a+t]=s.a,e[n+t]=s.b,s=Wdec14(y,b),e[r+t]=s.a,e[o+t]=s.b}else{let s=Wdec16(e[a+t],e[r+t]);h=s.a,y=s.b,s=Wdec16(e[n+t],e[o+t]),P=s.a,b=s.b,s=Wdec16(h,P),e[a+t]=s.a,e[n+t]=s.b,s=Wdec16(y,b),e[r+t]=s.a,e[o+t]=s.b}}if(n&f){const n=a+l;let r;r=i?Wdec14(e[a+t],e[n+t]):Wdec16(e[a+t],e[n+t]),h=r.a,e[n+t]=r.b,e[a+t]=h}}if(a&f){let a=u;const o=u+r*(n-c);for(;a<=o;a+=p){const n=a+w;let r;r=i?Wdec14(e[a+t],e[n+t]):Wdec16(e[a+t],e[n+t]),h=r.a,e[n+t]=r.b,e[a+t]=h}}c=f,f>>=1}return u}function UncompressRAW(e){return new DataView(e.array.buffer,e.offset.value,e.size)}function UncompressRLE(e){const t=e.viewer.buffer.slice(e.offset.value,e.offset.value+e.size),n=new Uint8Array(function DecodeRunLength(e){let t=e.byteLength;const n=new Array;let r=0;const a=new DataView(e);for(;t>0;){const e=a.getInt8(r++);if(e<0){const o=-e;t-=o+1;for(let e=0;e<o;e++)n.push(a.getUint8(r++))}else{const o=e;t-=2;const s=a.getUint8(r++);for(let e=0;e<o+1;e++)n.push(s)}}return n}(t)),r=new Uint8Array(n.length);return Predictor(n),InterleaveScalar(n,r),new DataView(r.buffer)}function UncompressZIP(e){const t=e.array.slice(e.offset.value,e.offset.value+e.size),n=fflate.unzlibSync(t),r=new Uint8Array(n.length);return Predictor(n),InterleaveScalar(n,r),new DataView(r.buffer)}function UncompressPXR(e){const t=e.array.slice(e.offset.value,e.offset.value+e.size),n=fflate.unzlibSync(t),r=e.lines*e.channels*e.width,a=1==e.type?new Uint16Array(r):new Uint32Array(r);let o=0,s=0;const i=new Array(4);for(let t=0;t<e.lines;t++)for(let t=0;t<e.channels;t++){let t=0;switch(e.type){case 1:i[0]=o,i[1]=i[0]+e.width,o=i[1]+e.width;for(let r=0;r<e.width;++r){t+=n[i[0]++]<<8|n[i[1]++],a[s]=t,s++}break;case 2:i[0]=o,i[1]=i[0]+e.width,i[2]=i[1]+e.width,o=i[2]+e.width;for(let r=0;r<e.width;++r){t+=n[i[0]++]<<24|n[i[1]++]<<16|n[i[2]++]<<8,a[s]=t,s++}}}return new DataView(a.buffer)}function UncompressPIZ(e){const t=e.viewer,n={value:e.offset.value},r=new Uint16Array(e.width*e.scanlineBlockSize*(e.channels*e.type)),a=new Uint8Array(8192);let s=0;const i=new Array(e.channels);for(let t=0;t<e.channels;t++)i[t]={},i[t].start=s,i[t].end=i[t].start,i[t].nx=e.width,i[t].ny=e.lines,i[t].size=e.type,s+=i[t].nx*i[t].ny*i[t].size;const l=ParseUint16(t,n),c=ParseUint16(t,n);if(c>=8192)throw new Error("Wrong PIZ_COMPRESSION BITMAP_SIZE");if(l<=c)for(let e=0;e<c-l+1;e++)a[e+l]=ParseUint8(t,n);const u=new Uint16Array(o),f=function ReverseLutFromBitmap(e,t){let n=0;for(let r=0;r<o;++r)(0==r||e[r>>3]&1<<(7&r))&&(t[n++]=r);const r=n-1;for(;n<o;)t[n++]=0;return r}(a,u),d=ParseUint32(t,n);HufUncompress(e.array,t,n,d,r,s);for(let t=0;t<e.channels;++t){const e=i[t];for(let n=0;n<i[t].size;++n)Wav2Decode(r,e.start+n,e.nx,e.size,e.ny,e.nx*e.size,f)}!function ApplyLut(e,t,n){for(let r=0;r<n;++r)t[r]=e[t[r]]}(u,r,s);let w=0;const p=new Uint8Array(r.buffer.byteLength);for(let t=0;t<e.lines;t++)for(let t=0;t<e.channels;t++){const e=i[t],n=e.nx*e.size,a=new Uint8Array(r.buffer,2*e.end,2*n);p.set(a,w),w+=2*n,e.end+=n}return new DataView(p.buffer)}var w,p=n(8741);!function(e){e[e.Float=0]="Float",e[e.HalfFloat=1]="HalfFloat"}(w||(w={}));class ExrLoaderGlobalConfiguration{}ExrLoaderGlobalConfiguration.DefaultOutputType=w.HalfFloat,ExrLoaderGlobalConfiguration.FFLATEUrl="https://unpkg.com/fflate@0.8.2";class _ExrTextureLoader{constructor(){this.supportCascades=!1}loadCubeData(e,t,n,r,a){throw".exr not supported in Cube."}async loadData(e,t,n){const a=new DataView(e.buffer),o={value:0},s=function GetExrHeader(e,t){if(20000630!=e.getUint32(0,!0))throw new Error("Incorrect OpenEXR format");const n=e.getUint8(4),a=e.getUint8(5),o={singleTile:!!(2&a),longName:!!(4&a),deepFormat:!!(8&a),multiPart:!!(16&a)};t.value=8;const s={};let i=!0;for(;i;){const n=ParseNullTerminatedString(e.buffer,t);if(n){const a=ParseNullTerminatedString(e.buffer,t),o=ParseValue(e,t,a,ParseUint32(e,t));void 0===o?r.Y.Warn(`Unknown header attribute type ${a}'.`):s[n]=o}else i=!1}if(-5&a)throw new Error("Unsupported file format");return{version:n,spec:o,...s}}(a,o),i=await async function CreateDecoderAsync(e,t,n,r){const a={size:0,viewer:t,array:new Uint8Array(t.buffer),offset:n,width:e.dataWindow.xMax-e.dataWindow.xMin+1,height:e.dataWindow.yMax-e.dataWindow.yMin+1,channels:e.channels.length,channelLineOffsets:{},scanOrder:()=>0,bytesPerLine:0,outLineWidth:0,lines:0,scanlineBlockSize:0,inputSize:null,type:0,uncompress:null,getter:()=>0,format:5,outputChannels:0,decodeChannels:{},blockCount:null,byteArray:null,linearSpace:!1,textureType:0};switch(e.compression){case c.NO_COMPRESSION:a.lines=1,a.uncompress=UncompressRAW;break;case c.RLE_COMPRESSION:a.lines=1,a.uncompress=UncompressRLE;break;case c.ZIPS_COMPRESSION:a.lines=1,a.uncompress=UncompressZIP,await p.w1.LoadScriptAsync(ExrLoaderGlobalConfiguration.FFLATEUrl);break;case c.ZIP_COMPRESSION:a.lines=16,a.uncompress=UncompressZIP,await p.w1.LoadScriptAsync(ExrLoaderGlobalConfiguration.FFLATEUrl);break;case c.PIZ_COMPRESSION:a.lines=32,a.uncompress=UncompressPIZ;break;case c.PXR24_COMPRESSION:a.lines=16,a.uncompress=UncompressPXR,await p.w1.LoadScriptAsync(ExrLoaderGlobalConfiguration.FFLATEUrl);break;default:throw new Error(c[e.compression]+" is unsupported")}a.scanlineBlockSize=a.lines;const o={};for(const t of e.channels)switch(t.name){case"Y":case"R":case"G":case"B":case"A":o[t.name]=!0,a.type=t.pixelType}let s=!1;if(o.R&&o.G&&o.B)s=!o.A,a.outputChannels=4,a.decodeChannels={R:0,G:1,B:2,A:3};else{if(!o.Y)throw new Error("EXRLoader.parse: file contains unsupported data channels.");a.outputChannels=1,a.decodeChannels={Y:0}}if(1===a.type)switch(r){case w.Float:a.getter=ParseFloat16,a.inputSize=2;break;case w.HalfFloat:a.getter=ParseUint16,a.inputSize=2}else{if(2!==a.type)throw new Error("Unsupported pixelType "+a.type+" for "+e.compression);switch(r){case w.Float:a.getter=ParseFloat32,a.inputSize=4;break;case w.HalfFloat:a.getter=DecodeFloat32,a.inputSize=4}}a.blockCount=a.height/a.scanlineBlockSize;for(let e=0;e<a.blockCount;e++)ParseInt64(t,n);const i=a.width*a.height*a.outputChannels;switch(r){case w.Float:a.byteArray=new Float32Array(i),a.textureType=1,s&&a.byteArray.fill(1,0,i);break;case w.HalfFloat:a.byteArray=new Uint16Array(i),a.textureType=2,s&&a.byteArray.fill(15360,0,i);break;default:throw new Error("Unsupported type: "+r)}let l=0;for(const t of e.channels)void 0!==a.decodeChannels[t.name]&&(a.channelLineOffsets[t.name]=l*a.width),l+=2*t.pixelType;return a.bytesPerLine=a.width*l,a.outLineWidth=a.width*a.outputChannels,"INCREASING_Y"===e.lineOrder?a.scanOrder=e=>e:a.scanOrder=e=>a.height-1-e,4==a.outputChannels?(a.format=5,a.linearSpace=!0):(a.format=6,a.linearSpace=!1),a}(s,a,o,ExrLoaderGlobalConfiguration.DefaultOutputType);!function ScanData(e,t,n,r){const a={value:0};for(let o=0;o<e.height/e.scanlineBlockSize;o++){const s=ParseInt32(n,r)-t.dataWindow.yMin;e.size=ParseUint32(n,r),e.lines=s+e.scanlineBlockSize>e.height?e.height-s:e.scanlineBlockSize;const i=e.size<e.lines*e.bytesPerLine&&e.uncompress?e.uncompress(e):UncompressRAW(e);r.value+=e.size;for(let n=0;n<e.scanlineBlockSize;n++){const r=o*e.scanlineBlockSize,s=n+e.scanOrder(r);if(s>=e.height)continue;const l=n*e.bytesPerLine,c=(e.height-1-s)*e.outLineWidth;for(let n=0;n<e.channels;n++){const r=t.channels[n].name,o=e.channelLineOffsets[r],s=e.decodeChannels[r];if(void 0!==s){a.value=l+o;for(let t=0;t<e.width;t++){const n=c+t*e.outputChannels+s;e.byteArray&&(e.byteArray[n]=e.getter(i,a))}}}}}}(i,s,a,o);n(s.dataWindow.xMax-s.dataWindow.xMin+1,s.dataWindow.yMax-s.dataWindow.yMin+1,t.generateMipMaps,!1,(()=>{const e=t.getEngine();t.format=s.format,t.type=i.textureType,t.invertY=!1,t._gammaSpace=!s.linearSpace,i.byteArray&&e._uploadDataToTextureDirectly(t,i.byteArray,0,0,void 0,!0)}))}}}}]);
|
|
2
|
+
"use strict";(self.webpackChunkCrystaldesignRealTimeViewer=self.webpackChunkCrystaldesignRealTimeViewer||[]).push([[410],{410:(e,t,n)=>{n.r(t),n.d(t,{_ExrTextureLoader:()=>_ExrTextureLoader});var r=n(3146),a=n(1494);const o=65536,s=14,i=65537,l=16384;var c,u;!function(e){e[e.NO_COMPRESSION=0]="NO_COMPRESSION",e[e.RLE_COMPRESSION=1]="RLE_COMPRESSION",e[e.ZIPS_COMPRESSION=2]="ZIPS_COMPRESSION",e[e.ZIP_COMPRESSION=3]="ZIP_COMPRESSION",e[e.PIZ_COMPRESSION=4]="PIZ_COMPRESSION",e[e.PXR24_COMPRESSION=5]="PXR24_COMPRESSION"}(c||(c={})),function(e){e[e.INCREASING_Y=0]="INCREASING_Y",e[e.DECREASING_Y=1]="DECREASING_Y"}(u||(u={}));const f=function _GenerateTables(){const e=new ArrayBuffer(4),t=new Float32Array(e),n=new Uint32Array(e),r=new Uint32Array(512),a=new Uint32Array(512);for(let e=0;e<256;++e){const t=e-127;t<-27?(r[e]=0,r[256|e]=32768,a[e]=24,a[256|e]=24):t<-14?(r[e]=1024>>-t-14,r[256|e]=1024>>-t-14|32768,a[e]=-t-1,a[256|e]=-t-1):t<=15?(r[e]=t+15<<10,r[256|e]=t+15<<10|32768,a[e]=13,a[256|e]=13):t<128?(r[e]=31744,r[256|e]=64512,a[e]=24,a[256|e]=24):(r[e]=31744,r[256|e]=64512,a[e]=13,a[256|e]=13)}const o=new Uint32Array(2048),s=new Uint32Array(64),i=new Uint32Array(64);for(let e=1;e<1024;++e){let t=e<<13,n=0;for(;0==(8388608&t);)t<<=1,n-=8388608;t&=-8388609,n+=947912704,o[e]=t|n}for(let e=1024;e<2048;++e)o[e]=939524096+(e-1024<<13);for(let e=1;e<31;++e)s[e]=e<<23;s[31]=1199570944,s[32]=2147483648;for(let e=33;e<63;++e)s[e]=2147483648+(e-32<<23);s[63]=3347054592;for(let e=1;e<64;++e)32!==e&&(i[e]=1024);return{floatView:t,uint32View:n,baseTable:r,shiftTable:a,mantissaTable:o,exponentTable:s,offsetTable:i}}();function ParseNullTerminatedString(e,t){const n=new Uint8Array(e);let r=0;for(;0!=n[t.value+r];)r+=1;const a=(new TextDecoder).decode(n.slice(t.value,t.value+r));return t.value=t.value+r+1,a}function ParseInt32(e,t){const n=e.getInt32(t.value,!0);return t.value+=4,n}function ParseUint32(e,t){const n=e.getUint32(t.value,!0);return t.value+=4,n}function ParseUint8(e,t){const n=e.getUint8(t.value);return t.value+=1,n}function ParseUint16(e,t){const n=e.getUint16(t.value,!0);return t.value+=2,n}function ParseUint8Array(e,t){const n=e[t.value];return t.value+=1,n}function ParseInt64(e,t){let n;return n="getBigInt64"in DataView.prototype?Number(e.getBigInt64(t.value,!0)):e.getUint32(t.value+4,!0)+Number(e.getUint32(t.value,!0)<<32),t.value+=8,n}function ParseFloat32(e,t){const n=e.getFloat32(t.value,!0);return t.value+=4,n}function ParseFloat16(e,t){return function DecodeFloat16(e){const t=(31744&e)>>10,n=1023&e;return(e>>15?-1:1)*(t?31===t?n?NaN:1/0:Math.pow(2,t-15)*(1+n/1024):n/1024*6103515625e-14)}(ParseUint16(e,t))}function DecodeFloat32(e,t){return function ToHalfFloat(e){if(Math.abs(e)>65504)throw new Error("Value out of range.Consider using float instead of half-float.");e=(0,a.Clamp)(e,-65504,65504),f.floatView[0]=e;const t=f.uint32View[0],n=t>>23&511;return f.baseTable[n]+((8388607&t)>>f.shiftTable[n])}(ParseFloat32(e,t))}function ParseValue(e,t,n,r){switch(n){case"string":case"stringvector":case"iccProfile":return function ParseFixedLengthString(e,t,n){const r=(new TextDecoder).decode(new Uint8Array(e).slice(t.value,t.value+n));return t.value=t.value+n,r}(e.buffer,t,r);case"chlist":return function ParseChlist(e,t,n){const r=t.value,a=[];for(;t.value<r+n-1;){const n=ParseNullTerminatedString(e.buffer,t),r=ParseInt32(e,t),o=ParseUint8(e,t);t.value+=3;const s=ParseInt32(e,t),i=ParseInt32(e,t);a.push({name:n,pixelType:r,pLinear:o,xSampling:s,ySampling:i})}return t.value+=1,a}(e,t,r);case"chromaticities":return function ParseChromaticities(e,t){return{redX:ParseFloat32(e,t),redY:ParseFloat32(e,t),greenX:ParseFloat32(e,t),greenY:ParseFloat32(e,t),blueX:ParseFloat32(e,t),blueY:ParseFloat32(e,t),whiteX:ParseFloat32(e,t),whiteY:ParseFloat32(e,t)}}(e,t);case"compression":return function ParseCompression(e,t){return ParseUint8(e,t)}(e,t);case"box2i":return function ParseBox2i(e,t){return{xMin:ParseInt32(e,t),yMin:ParseInt32(e,t),xMax:ParseInt32(e,t),yMax:ParseInt32(e,t)}}(e,t);case"lineOrder":return function ParseLineOrder(e,t){const n=ParseUint8(e,t);return u[n]}(e,t);case"float":return ParseFloat32(e,t);case"v2f":return function ParseV2f(e,t){return[ParseFloat32(e,t),ParseFloat32(e,t)]}(e,t);case"v3f":return function ParseV3f(e,t){return[ParseFloat32(e,t),ParseFloat32(e,t),ParseFloat32(e,t)]}(e,t);case"int":return ParseInt32(e,t);case"rational":return function ParseRational(e,t){return[ParseInt32(e,t),ParseUint32(e,t)]}(e,t);case"timecode":return function ParseTimecode(e,t){return[ParseUint32(e,t),ParseUint32(e,t)]}(e,t);case"preview":return t.value+=r,"skipped";default:return void(t.value+=r)}}function Predictor(e){for(let t=1;t<e.length;t++){const n=e[t-1]+e[t]-128;e[t]=n}}function InterleaveScalar(e,t){let n=0,r=Math.floor((e.length+1)/2),a=0;const o=e.length-1;for(;!(a>o||(t[a++]=e[n++],a>o));)t[a++]=e[r++]}function GetBits(e,t,n,r,a){for(;n<e;)t=t<<8|ParseUint8Array(r,a),n+=8;return{l:t>>(n-=e)&(1<<e)-1,c:t,lc:n}}function GetChar(e,t,n,r){return{c:e=e<<8|ParseUint8Array(n,r),lc:t+=8}}function GetCode(e,t,n,r,a,o,s,i,l){if(e==t){if(r<8){const e=GetChar(n,r,a,o);n=e.c,r=e.lc}let e=n>>(r-=8);if(e=new Uint8Array([e])[0],i.value+e>l)return null;const t=s[i.value-1];for(;e-- >0;)s[i.value++]=t}else{if(!(i.value<l))return null;s[i.value++]=e}return{c:n,lc:r}}const d=new Array(59);function HufUnpackEncTable(e,t,n,r,a,o){const s=t;let l=0,c=0;for(;r<=a;r++){if(s.value-t.value>n)return;let i=GetBits(6,l,c,e,s);const u=i.l;if(l=i.c,c=i.lc,o[r]=u,63==u){if(s.value-t.value>n)throw new Error("Error in HufUnpackEncTable");i=GetBits(8,l,c,e,s);let u=i.l+6;if(l=i.c,c=i.lc,r+u>a+1)throw new Error("Error in HufUnpackEncTable");for(;u--;)o[r++]=0;r--}else if(u>=59){let e=u-59+2;if(r+e>a+1)throw new Error("Error in HufUnpackEncTable");for(;e--;)o[r++]=0;r--}}!function HufCanonicalCodeTable(e){for(let e=0;e<=58;++e)d[e]=0;for(let t=0;t<i;++t)d[e[t]]+=1;let t=0;for(let e=58;e>0;--e){const n=t+d[e]>>1;d[e]=t,t=n}for(let t=0;t<i;++t){const n=e[t];n>0&&(e[t]=n|d[n]++<<6)}}(o)}function HufLength(e){return 63&e}function HufCode(e){return e>>6}function HufUncompress(e,t,n,r,a,o){const c=n.value,u=ParseUint32(t,n),f=ParseUint32(t,n);n.value+=4;const d=ParseUint32(t,n);if(n.value+=4,u<0||u>=i||f<0||f>=i)throw new Error("Wrong HUF_ENCSIZE");const w=new Array(i),p=new Array(l);!function HufClearDecTable(e){for(let t=0;t<l;t++)e[t]={},e[t].len=0,e[t].lit=0,e[t].p=null}(p);if(HufUnpackEncTable(e,n,r-(n.value-c),u,f,w),d>8*(r-(n.value-c)))throw new Error("Wrong hufUncompress");!function HufBuildDecTable(e,t,n,r){for(;t<=n;t++){const n=HufCode(e[t]),a=HufLength(e[t]);if(n>>a)throw new Error("Invalid table entry");if(a>s){const e=r[n>>a-s];if(e.len)throw new Error("Invalid table entry");if(e.lit++,e.p){const t=e.p;e.p=new Array(e.lit);for(let n=0;n<e.lit-1;++n)e.p[n]=t[n]}else e.p=new Array(1);e.p[e.lit-1]=t}else if(a){let e=0;for(let o=1<<s-a;o>0;o--){const o=r[(n<<s-a)+e];if(o.len||o.p)throw new Error("Invalid table entry");o.len=a,o.lit=t,e++}}}return!0}(w,u,f,p),function HufDecode(e,t,n,r,a,o,i,l,c){let u=0,f=0;const d=i,w=Math.trunc(r.value+(a+7)/8);for(;r.value<w;){let a=GetChar(u,f,n,r);for(u=a.c,f=a.lc;f>=s;){const i=t[u>>f-s&16383];if(i.len){f-=i.len;const e=GetCode(i.lit,o,u,f,n,r,l,c,d);e&&(u=e.c,f=e.lc)}else{if(!i.p)throw new Error("hufDecode issues");let t;for(t=0;t<i.lit;t++){const s=HufLength(e[i.p[t]]);for(;f<s&&r.value<w;)a=GetChar(u,f,n,r),u=a.c,f=a.lc;if(f>=s&&HufCode(e[i.p[t]])==(u>>f-s&(1<<s)-1)){f-=s;const e=GetCode(i.p[t],o,u,f,n,r,l,c,d);e&&(u=e.c,f=e.lc);break}}if(t==i.lit)throw new Error("HufDecode issues")}}}const p=8-a&7;for(u>>=p,f-=p;f>0;){const e=t[u<<s-f&16383];if(!e.len)throw new Error("HufDecode issues");{f-=e.len;const t=GetCode(e.lit,o,u,f,n,r,l,c,d);t&&(u=t.c,f=t.lc)}}return!0}(w,p,e,n,d,f,o,a,{value:0})}function UInt16(e){return 65535&e}function Int16(e){const t=UInt16(e);return t>32767?t-65536:t}function Wdec14(e,t){const n=Int16(e),r=Int16(t),a=n+(1&r)+(r>>1);return{a,b:a-r}}function Wdec16(e,t){const n=UInt16(e),r=UInt16(t),a=n-(r>>1)&65535;return{a:r+a-32768&65535,b:a}}function Wav2Decode(e,t,n,r,a,o,s){const i=s<16384,l=n>a?a:n;let c,u,f=1;for(;f<=l;)f<<=1;for(f>>=1,c=f,f>>=1;f>=1;){u=0;const s=u+o*(a-c),l=o*f,d=o*c,w=r*f,p=r*c;let h,P,y,b;for(;u<=s;u+=d){let a=u;const o=u+r*(n-c);for(;a<=o;a+=p){const n=a+w,r=a+l,o=r+w;if(i){let s=Wdec14(e[a+t],e[r+t]);h=s.a,y=s.b,s=Wdec14(e[n+t],e[o+t]),P=s.a,b=s.b,s=Wdec14(h,P),e[a+t]=s.a,e[n+t]=s.b,s=Wdec14(y,b),e[r+t]=s.a,e[o+t]=s.b}else{let s=Wdec16(e[a+t],e[r+t]);h=s.a,y=s.b,s=Wdec16(e[n+t],e[o+t]),P=s.a,b=s.b,s=Wdec16(h,P),e[a+t]=s.a,e[n+t]=s.b,s=Wdec16(y,b),e[r+t]=s.a,e[o+t]=s.b}}if(n&f){const n=a+l;let r;r=i?Wdec14(e[a+t],e[n+t]):Wdec16(e[a+t],e[n+t]),h=r.a,e[n+t]=r.b,e[a+t]=h}}if(a&f){let a=u;const o=u+r*(n-c);for(;a<=o;a+=p){const n=a+w;let r;r=i?Wdec14(e[a+t],e[n+t]):Wdec16(e[a+t],e[n+t]),h=r.a,e[n+t]=r.b,e[a+t]=h}}c=f,f>>=1}return u}function UncompressRAW(e){return new DataView(e.array.buffer,e.offset.value,e.size)}function UncompressRLE(e){const t=e.viewer.buffer.slice(e.offset.value,e.offset.value+e.size),n=new Uint8Array(function DecodeRunLength(e){let t=e.byteLength;const n=new Array;let r=0;const a=new DataView(e);for(;t>0;){const e=a.getInt8(r++);if(e<0){const o=-e;t-=o+1;for(let e=0;e<o;e++)n.push(a.getUint8(r++))}else{const o=e;t-=2;const s=a.getUint8(r++);for(let e=0;e<o+1;e++)n.push(s)}}return n}(t)),r=new Uint8Array(n.length);return Predictor(n),InterleaveScalar(n,r),new DataView(r.buffer)}function UncompressZIP(e){const t=e.array.slice(e.offset.value,e.offset.value+e.size),n=fflate.unzlibSync(t),r=new Uint8Array(n.length);return Predictor(n),InterleaveScalar(n,r),new DataView(r.buffer)}function UncompressPXR(e){const t=e.array.slice(e.offset.value,e.offset.value+e.size),n=fflate.unzlibSync(t),r=e.lines*e.channels*e.width,a=1==e.type?new Uint16Array(r):new Uint32Array(r);let o=0,s=0;const i=new Array(4);for(let t=0;t<e.lines;t++)for(let t=0;t<e.channels;t++){let t=0;switch(e.type){case 1:i[0]=o,i[1]=i[0]+e.width,o=i[1]+e.width;for(let r=0;r<e.width;++r){t+=n[i[0]++]<<8|n[i[1]++],a[s]=t,s++}break;case 2:i[0]=o,i[1]=i[0]+e.width,i[2]=i[1]+e.width,o=i[2]+e.width;for(let r=0;r<e.width;++r){t+=n[i[0]++]<<24|n[i[1]++]<<16|n[i[2]++]<<8,a[s]=t,s++}}}return new DataView(a.buffer)}function UncompressPIZ(e){const t=e.viewer,n={value:e.offset.value},r=new Uint16Array(e.width*e.scanlineBlockSize*(e.channels*e.type)),a=new Uint8Array(8192);let s=0;const i=new Array(e.channels);for(let t=0;t<e.channels;t++)i[t]={},i[t].start=s,i[t].end=i[t].start,i[t].nx=e.width,i[t].ny=e.lines,i[t].size=e.type,s+=i[t].nx*i[t].ny*i[t].size;const l=ParseUint16(t,n),c=ParseUint16(t,n);if(c>=8192)throw new Error("Wrong PIZ_COMPRESSION BITMAP_SIZE");if(l<=c)for(let e=0;e<c-l+1;e++)a[e+l]=ParseUint8(t,n);const u=new Uint16Array(o),f=function ReverseLutFromBitmap(e,t){let n=0;for(let r=0;r<o;++r)(0==r||e[r>>3]&1<<(7&r))&&(t[n++]=r);const r=n-1;for(;n<o;)t[n++]=0;return r}(a,u),d=ParseUint32(t,n);HufUncompress(e.array,t,n,d,r,s);for(let t=0;t<e.channels;++t){const e=i[t];for(let n=0;n<i[t].size;++n)Wav2Decode(r,e.start+n,e.nx,e.size,e.ny,e.nx*e.size,f)}!function ApplyLut(e,t,n){for(let r=0;r<n;++r)t[r]=e[t[r]]}(u,r,s);let w=0;const p=new Uint8Array(r.buffer.byteLength);for(let t=0;t<e.lines;t++)for(let t=0;t<e.channels;t++){const e=i[t],n=e.nx*e.size,a=new Uint8Array(r.buffer,2*e.end,2*n);p.set(a,w),w+=2*n,e.end+=n}return new DataView(p.buffer)}var w,p=n(8741);!function(e){e[e.Float=0]="Float",e[e.HalfFloat=1]="HalfFloat"}(w||(w={}));class ExrLoaderGlobalConfiguration{}ExrLoaderGlobalConfiguration.DefaultOutputType=w.HalfFloat,ExrLoaderGlobalConfiguration.FFLATEUrl="https://unpkg.com/fflate@0.8.2";class _ExrTextureLoader{constructor(){this.supportCascades=!1}loadCubeData(e,t,n,r,a){throw".exr not supported in Cube."}async loadData(e,t,n){const a=new DataView(e.buffer),o={value:0},s=function GetExrHeader(e,t){if(20000630!=e.getUint32(0,!0))throw new Error("Incorrect OpenEXR format");const n=e.getUint8(4),a=e.getUint8(5),o={singleTile:!!(2&a),longName:!!(4&a),deepFormat:!!(8&a),multiPart:!!(16&a)};t.value=8;const s={};let i=!0;for(;i;){const n=ParseNullTerminatedString(e.buffer,t);if(n){const a=ParseNullTerminatedString(e.buffer,t),o=ParseValue(e,t,a,ParseUint32(e,t));void 0===o?r.Y.Warn(`Unknown header attribute type ${a}'.`):s[n]=o}else i=!1}if(0!=(-5&a))throw new Error("Unsupported file format");return{version:n,spec:o,...s}}(a,o),i=await async function CreateDecoderAsync(e,t,n,r){const a={size:0,viewer:t,array:new Uint8Array(t.buffer),offset:n,width:e.dataWindow.xMax-e.dataWindow.xMin+1,height:e.dataWindow.yMax-e.dataWindow.yMin+1,channels:e.channels.length,channelLineOffsets:{},scanOrder:()=>0,bytesPerLine:0,outLineWidth:0,lines:0,scanlineBlockSize:0,inputSize:null,type:0,uncompress:null,getter:()=>0,format:5,outputChannels:0,decodeChannels:{},blockCount:null,byteArray:null,linearSpace:!1,textureType:0};switch(e.compression){case c.NO_COMPRESSION:a.lines=1,a.uncompress=UncompressRAW;break;case c.RLE_COMPRESSION:a.lines=1,a.uncompress=UncompressRLE;break;case c.ZIPS_COMPRESSION:a.lines=1,a.uncompress=UncompressZIP,await p.w1.LoadScriptAsync(ExrLoaderGlobalConfiguration.FFLATEUrl);break;case c.ZIP_COMPRESSION:a.lines=16,a.uncompress=UncompressZIP,await p.w1.LoadScriptAsync(ExrLoaderGlobalConfiguration.FFLATEUrl);break;case c.PIZ_COMPRESSION:a.lines=32,a.uncompress=UncompressPIZ;break;case c.PXR24_COMPRESSION:a.lines=16,a.uncompress=UncompressPXR,await p.w1.LoadScriptAsync(ExrLoaderGlobalConfiguration.FFLATEUrl);break;default:throw new Error(c[e.compression]+" is unsupported")}a.scanlineBlockSize=a.lines;const o={};for(const t of e.channels)switch(t.name){case"Y":case"R":case"G":case"B":case"A":o[t.name]=!0,a.type=t.pixelType}let s=!1;if(o.R&&o.G&&o.B)s=!o.A,a.outputChannels=4,a.decodeChannels={R:0,G:1,B:2,A:3};else{if(!o.Y)throw new Error("EXRLoader.parse: file contains unsupported data channels.");a.outputChannels=1,a.decodeChannels={Y:0}}if(1===a.type)switch(r){case w.Float:a.getter=ParseFloat16,a.inputSize=2;break;case w.HalfFloat:a.getter=ParseUint16,a.inputSize=2}else{if(2!==a.type)throw new Error("Unsupported pixelType "+a.type+" for "+e.compression);switch(r){case w.Float:a.getter=ParseFloat32,a.inputSize=4;break;case w.HalfFloat:a.getter=DecodeFloat32,a.inputSize=4}}a.blockCount=a.height/a.scanlineBlockSize;for(let e=0;e<a.blockCount;e++)ParseInt64(t,n);const i=a.width*a.height*a.outputChannels;switch(r){case w.Float:a.byteArray=new Float32Array(i),a.textureType=1,s&&a.byteArray.fill(1,0,i);break;case w.HalfFloat:a.byteArray=new Uint16Array(i),a.textureType=2,s&&a.byteArray.fill(15360,0,i);break;default:throw new Error("Unsupported type: "+r)}let l=0;for(const t of e.channels)void 0!==a.decodeChannels[t.name]&&(a.channelLineOffsets[t.name]=l*a.width),l+=2*t.pixelType;return a.bytesPerLine=a.width*l,a.outLineWidth=a.width*a.outputChannels,"INCREASING_Y"===e.lineOrder?a.scanOrder=e=>e:a.scanOrder=e=>a.height-1-e,4==a.outputChannels?(a.format=5,a.linearSpace=!0):(a.format=6,a.linearSpace=!1),a}(s,a,o,ExrLoaderGlobalConfiguration.DefaultOutputType);!function ScanData(e,t,n,r){const a={value:0};for(let o=0;o<e.height/e.scanlineBlockSize;o++){const s=ParseInt32(n,r)-t.dataWindow.yMin;e.size=ParseUint32(n,r),e.lines=s+e.scanlineBlockSize>e.height?e.height-s:e.scanlineBlockSize;const i=e.size<e.lines*e.bytesPerLine&&e.uncompress?e.uncompress(e):UncompressRAW(e);r.value+=e.size;for(let n=0;n<e.scanlineBlockSize;n++){const r=o*e.scanlineBlockSize,s=n+e.scanOrder(r);if(s>=e.height)continue;const l=n*e.bytesPerLine,c=(e.height-1-s)*e.outLineWidth;for(let n=0;n<e.channels;n++){const r=t.channels[n].name,o=e.channelLineOffsets[r],s=e.decodeChannels[r];if(void 0!==s){a.value=l+o;for(let t=0;t<e.width;t++){const n=c+t*e.outputChannels+s;e.byteArray&&(e.byteArray[n]=e.getter(i,a))}}}}}}(i,s,a,o);n(s.dataWindow.xMax-s.dataWindow.xMin+1,s.dataWindow.yMax-s.dataWindow.yMin+1,t.generateMipMaps,!1,(()=>{const e=t.getEngine();t.format=s.format,t.type=i.textureType,t.invertY=!1,t._gammaSpace=!s.linearSpace,i.byteArray&&e._uploadDataToTextureDirectly(t,i.byteArray,0,0,void 0,!0)}))}}}}]);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see 4153.real-time-viewer.umd.min.js.LICENSE.txt */
|
|
2
|
-
"use strict";(self.webpackChunkCrystaldesignRealTimeViewer=self.webpackChunkCrystaldesignRealTimeViewer||[]).push([[4153],{1740:(n,e,i)=>{var o=i(7416);i(2889);const t="backgroundUboDeclaration",f="layout(std140,column_major) uniform;uniform Material\n{uniform vec4 vPrimaryColor;uniform vec4 vPrimaryColorShadow;uniform vec2 vDiffuseInfos;uniform vec2 vReflectionInfos;uniform mat4 diffuseMatrix;uniform mat4 reflectionMatrix;uniform vec3 vReflectionMicrosurfaceInfos;uniform float fFovMultiplier;uniform float pointSize;uniform float shadowLevel;uniform float alpha;uniform vec3 vBackgroundCenter;uniform vec4 vReflectionControl;uniform vec2 projectedGroundInfos;};\n#include<sceneUboDeclaration>\n";o.v.IncludesShadersStore[t]=f},7987:(n,e,i)=>{const o="fogVertex",t="#ifdef FOG\nvFogDistance=(view*worldPos).xyz;\n#endif\n";i(7416).v.IncludesShadersStore[o]=t},373:(n,e,i)=>{const o="fogVertexDeclaration",t="#ifdef FOG\nvarying vec3 vFogDistance;\n#endif\n";i(7416).v.IncludesShadersStore[o]=t},6589:(n,e,i)=>{const o="lightVxFragmentDeclaration",t="#ifdef LIGHT{X}\nuniform vec4 vLightData{X};uniform vec4 vLightDiffuse{X};\n#ifdef SPECULARTERM\nuniform vec4 vLightSpecular{X};\n#else\nvec4 vLightSpecular{X}=vec4(0.);\n#endif\n#ifdef SHADOW{X}\n#ifdef SHADOWCSM{X}\nuniform mat4 lightMatrix{X}[SHADOWCSMNUM_CASCADES{X}];varying vec4 vPositionFromLight{X}[SHADOWCSMNUM_CASCADES{X}];varying float vDepthMetric{X}[SHADOWCSMNUM_CASCADES{X}];varying vec4 vPositionFromCamera{X};\n#elif defined(SHADOWCUBE{X})\n#else\nvarying vec4 vPositionFromLight{X};varying float vDepthMetric{X};uniform mat4 lightMatrix{X};\n#endif\nuniform vec4 shadowsInfo{X};uniform vec2 depthValues{X};\n#endif\n#ifdef SPOTLIGHT{X}\nuniform vec4 vLightDirection{X};uniform vec4 vLightFalloff{X};\n#elif defined(POINTLIGHT{X})\nuniform vec4 vLightFalloff{X};\n#elif defined(HEMILIGHT{X})\nuniform vec3 vLightGround{X};\n#endif\n#endif\n";i(7416).v.IncludesShadersStore[o]=t},5377:(n,e,i)=>{const o="lightVxUboDeclaration",t="#ifdef LIGHT{X}\nuniform Light{X}\n{vec4 vLightData;vec4 vLightDiffuse;vec4 vLightSpecular;\n#ifdef SPOTLIGHT{X}\nvec4 vLightDirection;vec4 vLightFalloff;\n#elif defined(POINTLIGHT{X})\nvec4 vLightFalloff;\n#elif defined(HEMILIGHT{X})\nvec3 vLightGround;\n#endif\nvec4 shadowsInfo;vec2 depthValues;} light{X};\n#ifdef SHADOW{X}\n#ifdef SHADOWCSM{X}\nuniform mat4 lightMatrix{X}[SHADOWCSMNUM_CASCADES{X}];varying vec4 vPositionFromLight{X}[SHADOWCSMNUM_CASCADES{X}];varying float vDepthMetric{X}[SHADOWCSMNUM_CASCADES{X}];varying vec4 vPositionFromCamera{X};\n#elif defined(SHADOWCUBE{X})\n#else\nvarying vec4 vPositionFromLight{X};varying float vDepthMetric{X};uniform mat4 lightMatrix{X};\n#endif\n#endif\n#endif\n";i(7416).v.IncludesShadersStore[o]=t},9481:(n,e,i)=>{const o="logDepthDeclaration",t="#ifdef LOGARITHMICDEPTH\nuniform float logarithmicDepthConstant;varying float vFragmentDepth;\n#endif\n";i(7416).v.IncludesShadersStore[o]=t},627:(n,e,i)=>{const o="logDepthVertex",t="#ifdef LOGARITHMICDEPTH\nvFragmentDepth=1.0+gl_Position.w;gl_Position.z=log2(max(0.000001,vFragmentDepth))*logarithmicDepthConstant;\n#endif\n";i(7416).v.IncludesShadersStore[o]=t},8520:(n,e,i)=>{const o="shadowsVertex",t="#ifdef SHADOWS\n#if defined(SHADOWCSM{X})\nvPositionFromCamera{X}=view*worldPos;for (int i=0; i<SHADOWCSMNUM_CASCADES{X}; i++) {vPositionFromLight{X}[i]=lightMatrix{X}[i]*worldPos;\n#ifdef USE_REVERSE_DEPTHBUFFER\nvDepthMetric{X}[i]=(-vPositionFromLight{X}[i].z+light{X}.depthValues.x)/light{X}.depthValues.y;\n#else\nvDepthMetric{X}[i]=(vPositionFromLight{X}[i].z+light{X}.depthValues.x)/light{X}.depthValues.y;\n#endif\n}\n#elif defined(SHADOW{X}) && !defined(SHADOWCUBE{X})\nvPositionFromLight{X}=lightMatrix{X}*worldPos;\n#ifdef USE_REVERSE_DEPTHBUFFER\nvDepthMetric{X}=(-vPositionFromLight{X}.z+light{X}.depthValues.x)/light{X}.depthValues.y;\n#else\nvDepthMetric{X}=(vPositionFromLight{X}.z+light{X}.depthValues.x)/light{X}.depthValues.y;\n#endif\n#endif\n#endif\n";i(7416).v.IncludesShadersStore[o]=t},4153:(n,e,i)=>{i.r(e),i.d(e,{backgroundVertexShader:()=>
|
|
2
|
+
"use strict";(self.webpackChunkCrystaldesignRealTimeViewer=self.webpackChunkCrystaldesignRealTimeViewer||[]).push([[4153],{1740:(n,e,i)=>{var o=i(7416);i(2889);const t="backgroundUboDeclaration",f="layout(std140,column_major) uniform;uniform Material\n{uniform vec4 vPrimaryColor;uniform vec4 vPrimaryColorShadow;uniform vec2 vDiffuseInfos;uniform vec2 vReflectionInfos;uniform mat4 diffuseMatrix;uniform mat4 reflectionMatrix;uniform vec3 vReflectionMicrosurfaceInfos;uniform float fFovMultiplier;uniform float pointSize;uniform float shadowLevel;uniform float alpha;uniform vec3 vBackgroundCenter;uniform vec4 vReflectionControl;uniform vec2 projectedGroundInfos;};\n#include<sceneUboDeclaration>\n";o.v.IncludesShadersStore[t]=f},7987:(n,e,i)=>{const o="fogVertex",t="#ifdef FOG\nvFogDistance=(view*worldPos).xyz;\n#endif\n";i(7416).v.IncludesShadersStore[o]=t},373:(n,e,i)=>{const o="fogVertexDeclaration",t="#ifdef FOG\nvarying vec3 vFogDistance;\n#endif\n";i(7416).v.IncludesShadersStore[o]=t},6589:(n,e,i)=>{const o="lightVxFragmentDeclaration",t="#ifdef LIGHT{X}\nuniform vec4 vLightData{X};uniform vec4 vLightDiffuse{X};\n#ifdef SPECULARTERM\nuniform vec4 vLightSpecular{X};\n#else\nvec4 vLightSpecular{X}=vec4(0.);\n#endif\n#ifdef SHADOW{X}\n#ifdef SHADOWCSM{X}\nuniform mat4 lightMatrix{X}[SHADOWCSMNUM_CASCADES{X}];varying vec4 vPositionFromLight{X}[SHADOWCSMNUM_CASCADES{X}];varying float vDepthMetric{X}[SHADOWCSMNUM_CASCADES{X}];varying vec4 vPositionFromCamera{X};\n#elif defined(SHADOWCUBE{X})\n#else\nvarying vec4 vPositionFromLight{X};varying float vDepthMetric{X};uniform mat4 lightMatrix{X};\n#endif\nuniform vec4 shadowsInfo{X};uniform vec2 depthValues{X};\n#endif\n#ifdef SPOTLIGHT{X}\nuniform vec4 vLightDirection{X};uniform vec4 vLightFalloff{X};\n#elif defined(POINTLIGHT{X})\nuniform vec4 vLightFalloff{X};\n#elif defined(HEMILIGHT{X})\nuniform vec3 vLightGround{X};\n#endif\n#endif\n";i(7416).v.IncludesShadersStore[o]=t},5377:(n,e,i)=>{const o="lightVxUboDeclaration",t="#ifdef LIGHT{X}\nuniform Light{X}\n{vec4 vLightData;vec4 vLightDiffuse;vec4 vLightSpecular;\n#ifdef SPOTLIGHT{X}\nvec4 vLightDirection;vec4 vLightFalloff;\n#elif defined(POINTLIGHT{X})\nvec4 vLightFalloff;\n#elif defined(HEMILIGHT{X})\nvec3 vLightGround;\n#endif\nvec4 shadowsInfo;vec2 depthValues;} light{X};\n#ifdef SHADOW{X}\n#ifdef SHADOWCSM{X}\nuniform mat4 lightMatrix{X}[SHADOWCSMNUM_CASCADES{X}];varying vec4 vPositionFromLight{X}[SHADOWCSMNUM_CASCADES{X}];varying float vDepthMetric{X}[SHADOWCSMNUM_CASCADES{X}];varying vec4 vPositionFromCamera{X};\n#elif defined(SHADOWCUBE{X})\n#else\nvarying vec4 vPositionFromLight{X};varying float vDepthMetric{X};uniform mat4 lightMatrix{X};\n#endif\n#endif\n#endif\n";i(7416).v.IncludesShadersStore[o]=t},9481:(n,e,i)=>{const o="logDepthDeclaration",t="#ifdef LOGARITHMICDEPTH\nuniform float logarithmicDepthConstant;varying float vFragmentDepth;\n#endif\n";i(7416).v.IncludesShadersStore[o]=t},627:(n,e,i)=>{const o="logDepthVertex",t="#ifdef LOGARITHMICDEPTH\nvFragmentDepth=1.0+gl_Position.w;gl_Position.z=log2(max(0.000001,vFragmentDepth))*logarithmicDepthConstant;\n#endif\n";i(7416).v.IncludesShadersStore[o]=t},8520:(n,e,i)=>{const o="shadowsVertex",t="#ifdef SHADOWS\n#if defined(SHADOWCSM{X})\nvPositionFromCamera{X}=view*worldPos;for (int i=0; i<SHADOWCSMNUM_CASCADES{X}; i++) {vPositionFromLight{X}[i]=lightMatrix{X}[i]*worldPos;\n#ifdef USE_REVERSE_DEPTHBUFFER\nvDepthMetric{X}[i]=(-vPositionFromLight{X}[i].z+light{X}.depthValues.x)/light{X}.depthValues.y;\n#else\nvDepthMetric{X}[i]=(vPositionFromLight{X}[i].z+light{X}.depthValues.x)/light{X}.depthValues.y;\n#endif\n}\n#elif defined(SHADOW{X}) && !defined(SHADOWCUBE{X})\nvPositionFromLight{X}=lightMatrix{X}*worldPos;\n#ifdef USE_REVERSE_DEPTHBUFFER\nvDepthMetric{X}=(-vPositionFromLight{X}.z+light{X}.depthValues.x)/light{X}.depthValues.y;\n#else\nvDepthMetric{X}=(vPositionFromLight{X}.z+light{X}.depthValues.x)/light{X}.depthValues.y;\n#endif\n#endif\n#endif\n";i(7416).v.IncludesShadersStore[o]=t},4153:(n,e,i)=>{i.r(e),i.d(e,{backgroundVertexShader:()=>a});var o=i(7416);const t="uniform mat4 view;uniform mat4 viewProjection;uniform float shadowLevel;\n#ifdef DIFFUSE\nuniform mat4 diffuseMatrix;uniform vec2 vDiffuseInfos;\n#endif\n#ifdef REFLECTION\nuniform vec2 vReflectionInfos;uniform mat4 reflectionMatrix;uniform vec3 vReflectionMicrosurfaceInfos;uniform float fFovMultiplier;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\n";o.v.IncludesShadersStore.backgroundVertexDeclaration=t;i(1740),i(5276),i(3827),i(2335),i(4122),i(110),i(373),i(6589),i(5377),i(9481),i(9449),i(6096),i(3749),i(3888),i(7987),i(8520),i(627);const f="backgroundVertexShader",r="precision highp float;\n#include<__decl__backgroundVertex>\n#include<helperFunctions>\nattribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef MAINUV1\nvarying vec2 vMainUV1;\n#endif\n#ifdef MAINUV2\nvarying vec2 vMainUV2;\n#endif\n#if defined(DIFFUSE) && DIFFUSEDIRECTUV==0\nvarying vec2 vDiffuseUV;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightVxFragment>[0..maxSimultaneousLights]\n#ifdef REFLECTIONMAP_SKYBOX\nvarying vec3 vPositionUVW;\n#endif\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvarying vec3 vDirectionW;\n#endif\n#include<logDepthDeclaration>\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#ifdef REFLECTIONMAP_SKYBOX\nvPositionUVW=position;\n#endif\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\n#ifdef MULTIVIEW\nif (gl_ViewID_OVR==0u) {gl_Position=viewProjection*finalWorld*vec4(position,1.0);} else {gl_Position=viewProjectionR*finalWorld*vec4(position,1.0);}\n#else\ngl_Position=viewProjection*finalWorld*vec4(position,1.0);\n#endif\nvec4 worldPos=finalWorld*vec4(position,1.0);vPositionW=vec3(worldPos);\n#ifdef NORMAL\nmat3 normalWorld=mat3(finalWorld);\n#ifdef NONUNIFORMSCALING\nnormalWorld=transposeMat3(inverseMat3(normalWorld));\n#endif\nvNormalW=normalize(normalWorld*normal);\n#endif\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvDirectionW=normalize(vec3(finalWorld*vec4(position,0.0)));\n#ifdef EQUIRECTANGULAR_RELFECTION_FOV\nmat3 screenToWorld=inverseMat3(mat3(finalWorld*viewProjection));vec3 segment=mix(vDirectionW,screenToWorld*vec3(0.0,0.0,1.0),abs(fFovMultiplier-1.0));if (fFovMultiplier<=1.0) {vDirectionW=normalize(segment);} else {vDirectionW=normalize(vDirectionW+(vDirectionW-segment));}\n#endif\n#endif\n#ifndef UV1\nvec2 uv=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\n#ifdef MAINUV1\nvMainUV1=uv;\n#endif\n#ifdef MAINUV2\nvMainUV2=uv2;\n#endif\n#if defined(DIFFUSE) && DIFFUSEDIRECTUV==0\nif (vDiffuseInfos.x==0.)\n{vDiffuseUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));}\nelse\n{vDiffuseUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));}\n#endif\n#include<clipPlaneVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#ifdef VERTEXCOLOR\nvColor=color;\n#endif\n#if defined(POINTSIZE) && !defined(WEBGPU)\ngl_PointSize=pointSize;\n#endif\n#include<logDepthVertex>\n#define CUSTOM_VERTEX_MAIN_END\n}\n";o.v.ShadersStore.backgroundVertexShader=r;const a={name:f,shader:r}}}]);
|