@graphty/graphty-element 1.0.1
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/README.md +9 -0
- package/dist/basisTextureLoader-BqIvxvNl.js +312 -0
- package/dist/basisTextureLoader-BqIvxvNl.js.map +1 -0
- package/dist/custom-elements.json +1 -0
- package/dist/dds-BlAaKjyJ.js +357 -0
- package/dist/dds-BlAaKjyJ.js.map +1 -0
- package/dist/ddsTextureLoader-D7Jh83wc.js +44 -0
- package/dist/ddsTextureLoader-D7Jh83wc.js.map +1 -0
- package/dist/default.fragment-BNc4beoN.js +452 -0
- package/dist/default.fragment-BNc4beoN.js.map +1 -0
- package/dist/default.fragment-CSeCDRwv.js +512 -0
- package/dist/default.fragment-CSeCDRwv.js.map +1 -0
- package/dist/default.vertex-9pBFrn06.js +202 -0
- package/dist/default.vertex-9pBFrn06.js.map +1 -0
- package/dist/default.vertex-DDjK1DRv.js +185 -0
- package/dist/default.vertex-DDjK1DRv.js.map +1 -0
- package/dist/defaultUboDeclaration-CG47IDRY.js +9 -0
- package/dist/defaultUboDeclaration-CG47IDRY.js.map +1 -0
- package/dist/defaultUboDeclaration-Ct5CiQ-w.js +11 -0
- package/dist/defaultUboDeclaration-Ct5CiQ-w.js.map +1 -0
- package/dist/dumpTools-DA1xMSIZ.js +103 -0
- package/dist/dumpTools-DA1xMSIZ.js.map +1 -0
- package/dist/envTextureLoader-DdCLpySN.js +238 -0
- package/dist/envTextureLoader-DdCLpySN.js.map +1 -0
- package/dist/exrTextureLoader-CnJSRQ9w.js +741 -0
- package/dist/exrTextureLoader-CnJSRQ9w.js.map +1 -0
- package/dist/graphty.js +12 -0
- package/dist/graphty.js.map +1 -0
- package/dist/graphty.umd.cjs +12657 -0
- package/dist/graphty.umd.cjs.map +1 -0
- package/dist/greasedLine.fragment-BZnGGe-r.js +30 -0
- package/dist/greasedLine.fragment-BZnGGe-r.js.map +1 -0
- package/dist/greasedLine.fragment-DixuqXus.js +12 -0
- package/dist/greasedLine.fragment-DixuqXus.js.map +1 -0
- package/dist/greasedLine.vertex-BhhwFKPy.js +33 -0
- package/dist/greasedLine.vertex-BhhwFKPy.js.map +1 -0
- package/dist/greasedLine.vertex-DIhgGSOi.js +49 -0
- package/dist/greasedLine.vertex-DIhgGSOi.js.map +1 -0
- package/dist/harmonicsFunctions-B9jTNKTF.js +197 -0
- package/dist/harmonicsFunctions-B9jTNKTF.js.map +1 -0
- package/dist/harmonicsFunctions-D9ZL5yLA.js +194 -0
- package/dist/harmonicsFunctions-D9ZL5yLA.js.map +1 -0
- package/dist/hdrTextureLoader-DreWCvHD.js +112 -0
- package/dist/hdrTextureLoader-DreWCvHD.js.map +1 -0
- package/dist/helperFunctions-Dh1WD8YN.js +106 -0
- package/dist/helperFunctions-Dh1WD8YN.js.map +1 -0
- package/dist/helperFunctions-ZBnqb-in.js +79 -0
- package/dist/helperFunctions-ZBnqb-in.js.map +1 -0
- package/dist/iesTextureLoader-JdfAyRK-.js +94 -0
- package/dist/iesTextureLoader-JdfAyRK-.js.map +1 -0
- package/dist/index-ChGTkj2q.js +62191 -0
- package/dist/index-ChGTkj2q.js.map +1 -0
- package/dist/instancesVertex-BrWNnWxF.js +46 -0
- package/dist/instancesVertex-BrWNnWxF.js.map +1 -0
- package/dist/instancesVertex-evcSIvCA.js +55 -0
- package/dist/instancesVertex-evcSIvCA.js.map +1 -0
- package/dist/ktxTextureLoader-Dg1h0a-4.js +520 -0
- package/dist/ktxTextureLoader-Dg1h0a-4.js.map +1 -0
- package/dist/logDepthDeclaration-BHUUDd5l.js +12 -0
- package/dist/logDepthDeclaration-BHUUDd5l.js.map +1 -0
- package/dist/logDepthDeclaration-Bou5AJOP.js +28 -0
- package/dist/logDepthDeclaration-Bou5AJOP.js.map +1 -0
- package/dist/logDepthVertex-CCFGLExi.js +496 -0
- package/dist/logDepthVertex-CCFGLExi.js.map +1 -0
- package/dist/logDepthVertex-r_niddz9.js +496 -0
- package/dist/logDepthVertex-r_niddz9.js.map +1 -0
- package/dist/mesh.vertexData.functions-Bc9lJlrU.js +75 -0
- package/dist/mesh.vertexData.functions-Bc9lJlrU.js.map +1 -0
- package/dist/meshUboDeclaration-Dg__Mhmj.js +18 -0
- package/dist/meshUboDeclaration-Dg__Mhmj.js.map +1 -0
- package/dist/oitFragment-Bn29Ggvj.js +1191 -0
- package/dist/oitFragment-Bn29Ggvj.js.map +1 -0
- package/dist/oitFragment-D6JBEGk0.js +1328 -0
- package/dist/oitFragment-D6JBEGk0.js.map +1 -0
- package/dist/pass.fragment-C9O4ZLJL.js +11 -0
- package/dist/pass.fragment-C9O4ZLJL.js.map +1 -0
- package/dist/pass.fragment-Cf0ob1Y3.js +11 -0
- package/dist/pass.fragment-Cf0ob1Y3.js.map +1 -0
- package/dist/passCube.fragment-Mg8Qj5T9.js +30 -0
- package/dist/passCube.fragment-Mg8Qj5T9.js.map +1 -0
- package/dist/passCube.fragment-uM4B7TOI.js +30 -0
- package/dist/passCube.fragment-uM4B7TOI.js.map +1 -0
- package/dist/pbr.fragment-C8Lm3cwF.js +3176 -0
- package/dist/pbr.fragment-C8Lm3cwF.js.map +1 -0
- package/dist/pbr.fragment-siOdCYqI.js +3219 -0
- package/dist/pbr.fragment-siOdCYqI.js.map +1 -0
- package/dist/pbr.vertex-Bw_TrGQv.js +229 -0
- package/dist/pbr.vertex-Bw_TrGQv.js.map +1 -0
- package/dist/pbr.vertex-CmEPCcBW.js +365 -0
- package/dist/pbr.vertex-CmEPCcBW.js.map +1 -0
- package/dist/postprocess.vertex-B086G8mM.js +16 -0
- package/dist/postprocess.vertex-B086G8mM.js.map +1 -0
- package/dist/rgbdDecode.fragment-bNaGtQ-x.js +9 -0
- package/dist/rgbdDecode.fragment-bNaGtQ-x.js.map +1 -0
- package/dist/rgbdDecode.fragment-koAcppx0.js +9 -0
- package/dist/rgbdDecode.fragment-koAcppx0.js.map +1 -0
- package/dist/rgbdEncode.fragment-BDHL2P_i.js +9 -0
- package/dist/rgbdEncode.fragment-BDHL2P_i.js.map +1 -0
- package/dist/rgbdEncode.fragment-Dw0FS9aH.js +9 -0
- package/dist/rgbdEncode.fragment-Dw0FS9aH.js.map +1 -0
- package/dist/tgaTextureLoader-DIfkfgQh.js +199 -0
- package/dist/tgaTextureLoader-DIfkfgQh.js.map +1 -0
- package/package.json +124 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"harmonicsFunctions-D9ZL5yLA.js","sources":["../node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrUboDeclaration.js","../node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBRDFFunctions.js","../node_modules/@babylonjs/core/Shaders/ShadersInclude/harmonicsFunctions.js"],"sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore.js\";\nimport \"./sceneUboDeclaration.js\";\nimport \"./meshUboDeclaration.js\";\nconst name = \"pbrUboDeclaration\";\nconst shader = `layout(std140,column_major) uniform;uniform Material {vec2 vAlbedoInfos;vec2 vBaseWeightInfos;vec2 vBaseDiffuseRoughnessInfos;vec4 vAmbientInfos;vec2 vOpacityInfos;vec2 vEmissiveInfos;vec2 vLightmapInfos;vec3 vReflectivityInfos;vec2 vMicroSurfaceSamplerInfos;vec2 vReflectionInfos;vec2 vReflectionFilteringInfo;vec3 vReflectionPosition;vec3 vReflectionSize;vec3 vBumpInfos;mat4 albedoMatrix;mat4 baseWeightMatrix;mat4 baseDiffuseRoughnessMatrix;mat4 ambientMatrix;mat4 opacityMatrix;mat4 emissiveMatrix;mat4 lightmapMatrix;mat4 reflectivityMatrix;mat4 microSurfaceSamplerMatrix;mat4 bumpMatrix;vec2 vTangentSpaceParams;mat4 reflectionMatrix;vec3 vReflectionColor;vec4 vAlbedoColor;float baseWeight;float baseDiffuseRoughness;vec4 vLightingIntensity;vec3 vReflectionMicrosurfaceInfos;vec3 vReflectionDominantDirection;float pointSize;vec4 vReflectivityColor;vec3 vEmissiveColor;vec3 vAmbientColor;vec2 vDebugMode;vec4 vMetallicReflectanceFactors;vec2 vMetallicReflectanceInfos;mat4 metallicReflectanceMatrix;vec2 vReflectanceInfos;mat4 reflectanceMatrix;vec3 vSphericalL00;vec3 vSphericalL1_1;vec3 vSphericalL10;vec3 vSphericalL11;vec3 vSphericalL2_2;vec3 vSphericalL2_1;vec3 vSphericalL20;vec3 vSphericalL21;vec3 vSphericalL22;vec3 vSphericalX;vec3 vSphericalY;vec3 vSphericalZ;vec3 vSphericalXX_ZZ;vec3 vSphericalYY_ZZ;vec3 vSphericalZZ;vec3 vSphericalXY;vec3 vSphericalYZ;vec3 vSphericalZX;vec4 cameraInfo;\n#define ADDITIONAL_UBO_DECLARATION\n};\n#include<sceneUboDeclaration>\n#include<meshUboDeclaration>\n`;\n// Sideeffect\nif (!ShaderStore.IncludesShadersStore[name]) {\n ShaderStore.IncludesShadersStore[name] = shader;\n}\n/** @internal */\nexport const pbrUboDeclaration = { name, shader };\n//# sourceMappingURL=pbrUboDeclaration.js.map","// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore.js\";\nconst name = \"pbrBRDFFunctions\";\nconst shader = `#define FRESNEL_MAXIMUM_ON_ROUGH 0.25\n#define BRDF_DIFFUSE_MODEL_EON 0\n#define BRDF_DIFFUSE_MODEL_BURLEY 1\n#define BRDF_DIFFUSE_MODEL_LAMBERT 2\n#define BRDF_DIFFUSE_MODEL_LEGACY 3\n#define DIELECTRIC_SPECULAR_MODEL_GLTF 0\n#define DIELECTRIC_SPECULAR_MODEL_OPENPBR 1\n#define CONDUCTOR_SPECULAR_MODEL_GLTF 0\n#define CONDUCTOR_SPECULAR_MODEL_OPENPBR 1\n#ifndef PBR_VERTEX_SHADER\n#ifdef MS_BRDF_ENERGY_CONSERVATION\nvec3 getEnergyConservationFactor(const vec3 specularEnvironmentR0,const vec3 environmentBrdf) {return 1.0+specularEnvironmentR0*(1.0/environmentBrdf.y-1.0);}\n#endif\n#if CONDUCTOR_SPECULAR_MODEL==CONDUCTOR_SPECULAR_MODEL_OPENPBR \nvec3 getF82Specular(float NdotV,vec3 F0,vec3 edgeTint,float roughness) {const float cos_theta_max=0.142857143; \nconst float one_minus_cos_theta_max_to_the_fifth=0.462664366; \nconst float one_minus_cos_theta_max_to_the_sixth=0.396569457; \nvec3 white_minus_F0=vec3(1.0)-F0;vec3 b_numerator=(F0+white_minus_F0*one_minus_cos_theta_max_to_the_fifth)*(vec3(1.0)-edgeTint);const float b_denominator=cos_theta_max*one_minus_cos_theta_max_to_the_sixth;const float b_denominator_reciprocal=1.0/b_denominator;vec3 b=b_numerator*b_denominator_reciprocal; \nfloat cos_theta=max(roughness,NdotV);float one_minus_cos_theta=1.0-cos_theta;vec3 offset_from_F0=(white_minus_F0-b*cos_theta*one_minus_cos_theta)*pow(one_minus_cos_theta,5.0);return clamp(F0+offset_from_F0,0.0,1.0);}\n#endif\n#ifdef ENVIRONMENTBRDF\nvec3 getBRDFLookup(float NdotV,float perceptualRoughness) {vec2 UV=vec2(NdotV,perceptualRoughness);vec4 brdfLookup=texture2D(environmentBrdfSampler,UV);\n#ifdef ENVIRONMENTBRDF_RGBD\nbrdfLookup.rgb=fromRGBD(brdfLookup.rgba);\n#endif\nreturn brdfLookup.rgb;}\nvec3 getReflectanceFromBRDFLookup(const vec3 specularEnvironmentR0,const vec3 specularEnvironmentR90,const vec3 environmentBrdf) {\n#ifdef BRDF_V_HEIGHT_CORRELATED\nvec3 reflectance=(specularEnvironmentR90-specularEnvironmentR0)*environmentBrdf.x+specularEnvironmentR0*environmentBrdf.y;\n#else\nvec3 reflectance=specularEnvironmentR0*environmentBrdf.x+specularEnvironmentR90*environmentBrdf.y;\n#endif\nreturn reflectance;}\nvec3 getReflectanceFromBRDFLookup(const vec3 specularEnvironmentR0,const vec3 environmentBrdf) {\n#ifdef BRDF_V_HEIGHT_CORRELATED\nvec3 reflectance=mix(environmentBrdf.xxx,environmentBrdf.yyy,specularEnvironmentR0);\n#else\nvec3 reflectance=specularEnvironmentR0*environmentBrdf.x+environmentBrdf.y;\n#endif\nreturn reflectance;}\n#endif\n/* NOT USED\n#if defined(SHEEN) && defined(SHEEN_SOFTER)\nfloat getBRDFLookupCharlieSheen(float NdotV,float perceptualRoughness)\n{float c=1.0-NdotV;float c3=c*c*c;return 0.65584461*c3+1.0/(4.16526551+exp(-7.97291361*perceptualRoughness+6.33516894));}\n#endif\n*/\n#if !defined(ENVIRONMENTBRDF) || defined(REFLECTIONMAP_SKYBOX) || defined(ALPHAFRESNEL)\nvec3 getReflectanceFromAnalyticalBRDFLookup_Jones(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#if defined(SHEEN) && defined(ENVIRONMENTBRDF)\n/**\n* The sheen BRDF not containing F can be easily stored in the blue channel of the BRDF texture.\n* The blue channel contains DCharlie*VAshikhmin*NdotL as a lokkup table\n*/\nvec3 getSheenReflectanceFromBRDFLookup(const vec3 reflectance0,const vec3 environmentBrdf) {vec3 sheenEnvironmentReflectance=reflectance0*environmentBrdf.b;return sheenEnvironmentReflectance;}\n#endif\nvec3 fresnelSchlickGGX(float VdotH,vec3 reflectance0,vec3 reflectance90)\n{return reflectance0+(reflectance90-reflectance0)*pow5(1.0-VdotH);}\nfloat fresnelSchlickGGX(float VdotH,float reflectance0,float reflectance90)\n{return reflectance0+(reflectance90-reflectance0)*pow5(1.0-VdotH);}\n#ifdef CLEARCOAT\nvec3 getR0RemappedForClearCoat(vec3 f0) {\n#ifdef CLEARCOAT_DEFAULTIOR\n#ifdef MOBILE\nreturn saturate(f0*(f0*0.526868+0.529324)-0.0482256);\n#else\nreturn saturate(f0*(f0*(0.941892-0.263008*f0)+0.346479)-0.0285998);\n#endif\n#else\nvec3 s=sqrt(f0);vec3 t=(vClearCoatRefractionParams.z+vClearCoatRefractionParams.w*s)/(vClearCoatRefractionParams.w+vClearCoatRefractionParams.z*s);return square(t);\n#endif\n}\n#endif\n#ifdef IRIDESCENCE\nconst mat3 XYZ_TO_REC709=mat3(\n3.2404542,-0.9692660, 0.0556434,\n-1.5371385, 1.8760108,-0.2040259,\n-0.4985314, 0.0415560, 1.0572252\n);vec3 getIORTfromAirToSurfaceR0(vec3 f0) {vec3 sqrtF0=sqrt(f0);return (1.+sqrtF0)/(1.-sqrtF0);}\nvec3 getR0fromIORs(vec3 iorT,float iorI) {return square((iorT-vec3(iorI))/(iorT+vec3(iorI)));}\nfloat getR0fromIORs(float iorT,float iorI) {return square((iorT-iorI)/(iorT+iorI));}\nvec3 evalSensitivity(float opd,vec3 shift) {float phase=2.0*PI*opd*1.0e-9;const vec3 val=vec3(5.4856e-13,4.4201e-13,5.2481e-13);const vec3 pos=vec3(1.6810e+06,1.7953e+06,2.2084e+06);const vec3 var=vec3(4.3278e+09,9.3046e+09,6.6121e+09);vec3 xyz=val*sqrt(2.0*PI*var)*cos(pos*phase+shift)*exp(-square(phase)*var);xyz.x+=9.7470e-14*sqrt(2.0*PI*4.5282e+09)*cos(2.2399e+06*phase+shift[0])*exp(-4.5282e+09*square(phase));xyz/=1.0685e-7;vec3 srgb=XYZ_TO_REC709*xyz;return srgb;}\nvec3 evalIridescence(float outsideIOR,float eta2,float cosTheta1,float thinFilmThickness,vec3 baseF0) {vec3 I=vec3(1.0);float iridescenceIOR=mix(outsideIOR,eta2,smoothstep(0.0,0.03,thinFilmThickness));float sinTheta2Sq=square(outsideIOR/iridescenceIOR)*(1.0-square(cosTheta1));float cosTheta2Sq=1.0-sinTheta2Sq;if (cosTheta2Sq<0.0) {return I;}\nfloat cosTheta2=sqrt(cosTheta2Sq);float R0=getR0fromIORs(iridescenceIOR,outsideIOR);float R12=fresnelSchlickGGX(cosTheta1,R0,1.);float R21=R12;float T121=1.0-R12;float phi12=0.0;if (iridescenceIOR<outsideIOR) phi12=PI;float phi21=PI-phi12;vec3 baseIOR=getIORTfromAirToSurfaceR0(clamp(baseF0,0.0,0.9999)); \nvec3 R1=getR0fromIORs(baseIOR,iridescenceIOR);vec3 R23=fresnelSchlickGGX(cosTheta2,R1,vec3(1.));vec3 phi23=vec3(0.0);if (baseIOR[0]<iridescenceIOR) phi23[0]=PI;if (baseIOR[1]<iridescenceIOR) phi23[1]=PI;if (baseIOR[2]<iridescenceIOR) phi23[2]=PI;float opd=2.0*iridescenceIOR*thinFilmThickness*cosTheta2;vec3 phi=vec3(phi21)+phi23;vec3 R123=clamp(R12*R23,1e-5,0.9999);vec3 r123=sqrt(R123);vec3 Rs=square(T121)*R23/(vec3(1.0)-R123);vec3 C0=R12+Rs;I=C0;vec3 Cm=Rs-T121;for (int m=1; m<=2; ++m)\n{Cm*=r123;vec3 Sm=2.0*evalSensitivity(float(m)*opd,float(m)*phi);I+=Cm*Sm;}\nreturn max(I,vec3(0.0));}\n#endif\nfloat normalDistributionFunction_TrowbridgeReitzGGX(float NdotH,float alphaG)\n{float a2=square(alphaG);float d=NdotH*NdotH*(a2-1.0)+1.0;return a2/(PI*d*d);}\n#ifdef SHEEN\nfloat normalDistributionFunction_CharlieSheen(float NdotH,float alphaG)\n{float invR=1./alphaG;float cos2h=NdotH*NdotH;float sin2h=1.-cos2h;return (2.+invR)*pow(sin2h,invR*.5)/(2.*PI);}\n#endif\n#ifdef ANISOTROPIC\nfloat normalDistributionFunction_BurleyGGX_Anisotropic(float NdotH,float TdotH,float BdotH,const vec2 alphaTB) {float a2=alphaTB.x*alphaTB.y;vec3 v=vec3(alphaTB.y*TdotH,alphaTB.x *BdotH,a2*NdotH);float v2=dot(v,v);float w2=a2/v2;return a2*w2*w2*RECIPROCAL_PI;}\n#endif\n#ifdef BRDF_V_HEIGHT_CORRELATED\nfloat smithVisibility_GGXCorrelated(float NdotL,float NdotV,float alphaG) {\n#ifdef MOBILE\nfloat GGXV=NdotL*(NdotV*(1.0-alphaG)+alphaG);float GGXL=NdotV*(NdotL*(1.0-alphaG)+alphaG);return 0.5/(GGXV+GGXL);\n#else\nfloat a2=alphaG*alphaG;float GGXV=NdotL*sqrt(NdotV*(NdotV-a2*NdotV)+a2);float GGXL=NdotV*sqrt(NdotL*(NdotL-a2*NdotL)+a2);return 0.5/(GGXV+GGXL);\n#endif\n}\n#else\nfloat smithVisibilityG1_TrowbridgeReitzGGXFast(float dot,float alphaG)\n{\n#ifdef MOBILE\nreturn 1.0/(dot+alphaG+(1.0-alphaG)*dot ));\n#else\nfloat alphaSquared=alphaG*alphaG;return 1.0/(dot+sqrt(alphaSquared+(1.0-alphaSquared)*dot*dot));\n#endif\n}\nfloat smithVisibility_TrowbridgeReitzGGXFast(float NdotL,float NdotV,float alphaG)\n{float visibility=smithVisibilityG1_TrowbridgeReitzGGXFast(NdotL,alphaG)*smithVisibilityG1_TrowbridgeReitzGGXFast(NdotV,alphaG);return visibility;}\n#endif\n#ifdef ANISOTROPIC\nfloat smithVisibility_GGXCorrelated_Anisotropic(float NdotL,float NdotV,float TdotV,float BdotV,float TdotL,float BdotL,const vec2 alphaTB) {float lambdaV=NdotL*length(vec3(alphaTB.x*TdotV,alphaTB.y*BdotV,NdotV));float lambdaL=NdotV*length(vec3(alphaTB.x*TdotL,alphaTB.y*BdotL,NdotL));float v=0.5/(lambdaV+lambdaL);return v;}\n#endif\n#ifdef CLEARCOAT\nfloat visibility_Kelemen(float VdotH) {return 0.25/(VdotH*VdotH); }\n#endif\n#ifdef SHEEN\nfloat visibility_Ashikhmin(float NdotL,float NdotV)\n{return 1./(4.*(NdotL+NdotV-NdotL*NdotV));}\n/* NOT USED\n#ifdef SHEEN_SOFTER\nfloat l(float x,float alphaG)\n{float oneMinusAlphaSq=(1.0-alphaG)*(1.0-alphaG);float a=mix(21.5473,25.3245,oneMinusAlphaSq);float b=mix(3.82987,3.32435,oneMinusAlphaSq);float c=mix(0.19823,0.16801,oneMinusAlphaSq);float d=mix(-1.97760,-1.27393,oneMinusAlphaSq);float e=mix(-4.32054,-4.85967,oneMinusAlphaSq);return a/(1.0+b*pow(x,c))+d*x+e;}\nfloat lambdaSheen(float cosTheta,float alphaG)\n{return abs(cosTheta)<0.5 ? exp(l(cosTheta,alphaG)) : exp(2.0*l(0.5,alphaG)-l(1.0-cosTheta,alphaG));}\nfloat visibility_CharlieSheen(float NdotL,float NdotV,float alphaG)\n{float G=1.0/(1.0+lambdaSheen(NdotV,alphaG)+lambdaSheen(NdotL,alphaG));return G/(4.0*NdotV*NdotL);}\n#endif\n*/\n#endif\nfloat diffuseBRDF_Burley(float NdotL,float NdotV,float VdotH,float roughness) {float diffuseFresnelNV=pow5(saturateEps(1.0-NdotL));float diffuseFresnelNL=pow5(saturateEps(1.0-NdotV));float diffuseFresnel90=0.5+2.0*VdotH*VdotH*roughness;float fresnel =\n(1.0+(diffuseFresnel90-1.0)*diffuseFresnelNL) *\n(1.0+(diffuseFresnel90-1.0)*diffuseFresnelNV);return fresnel/PI;}\nconst float constant1_FON=0.5-2.0/(3.0*PI);const float constant2_FON=2.0/3.0-28.0/(15.0*PI);float E_FON_approx(float mu,float roughness)\n{float sigma=roughness; \nfloat mucomp=1.0-mu;float mucomp2=mucomp*mucomp;const mat2 Gcoeffs=mat2(0.0571085289,-0.332181442,\n0.491881867,0.0714429953);float GoverPi=dot(Gcoeffs*vec2(mucomp,mucomp2),vec2(1.0,mucomp2));return (1.0+sigma*GoverPi)/(1.0+constant1_FON*sigma);}\nvec3 diffuseBRDF_EON(vec3 albedo,float roughness,float NdotL,float NdotV,float LdotV)\n{vec3 rho=albedo;float sigma=roughness; \nfloat mu_i=NdotL; \nfloat mu_o=NdotV; \nfloat s=LdotV-mu_i*mu_o; \nfloat sovertF=s>0.0 ? s/max(mu_i,mu_o) : s; \nfloat AF=1.0/(1.0+constant1_FON*sigma); \nvec3 f_ss=(rho*RECIPROCAL_PI)*AF*(1.0+sigma*sovertF); \nfloat EFo=E_FON_approx(mu_o,sigma); \nfloat EFi=E_FON_approx(mu_i,sigma); \nfloat avgEF=AF*(1.0+constant2_FON*sigma); \nvec3 rho_ms=(rho*rho)*avgEF/(vec3(1.0)-rho*(1.0-avgEF));const float eps=1.0e-7;vec3 f_ms=(rho_ms*RECIPROCAL_PI)*max(eps,1.0-EFo) \n* max(eps,1.0-EFi)\n/ max(eps,1.0-avgEF);return (f_ss+f_ms);}\n#ifdef SS_TRANSLUCENCY\nvec3 transmittanceBRDF_Burley(const vec3 tintColor,const vec3 diffusionDistance,float thickness) {vec3 S=1./maxEps(diffusionDistance);vec3 temp=exp((-0.333333333*thickness)*S);return tintColor.rgb*0.25*(temp*temp*temp+3.0*temp);}\nfloat computeWrappedDiffuseNdotL(float NdotL,float w) {float t=1.0+w;float invt2=1.0/square(t);return saturate((NdotL+w)*invt2);}\n#endif\n#endif \n`;\n// Sideeffect\nif (!ShaderStore.IncludesShadersStore[name]) {\n ShaderStore.IncludesShadersStore[name] = shader;\n}\n/** @internal */\nexport const pbrBRDFFunctions = { name, shader };\n//# sourceMappingURL=pbrBRDFFunctions.js.map","// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore.js\";\nconst name = \"harmonicsFunctions\";\nconst shader = `#ifdef USESPHERICALFROMREFLECTIONMAP\n#ifdef SPHERICAL_HARMONICS\nvec3 computeEnvironmentIrradiance(vec3 normal) {return vSphericalL00\n+ vSphericalL1_1*(normal.y)\n+ vSphericalL10*(normal.z)\n+ vSphericalL11*(normal.x)\n+ vSphericalL2_2*(normal.y*normal.x)\n+ vSphericalL2_1*(normal.y*normal.z)\n+ vSphericalL20*((3.0*normal.z*normal.z)-1.0)\n+ vSphericalL21*(normal.z*normal.x)\n+ vSphericalL22*(normal.x*normal.x-(normal.y*normal.y));}\n#else\nvec3 computeEnvironmentIrradiance(vec3 normal) {float Nx=normal.x;float Ny=normal.y;float Nz=normal.z;vec3 C1=vSphericalZZ.rgb;vec3 Cx=vSphericalX.rgb;vec3 Cy=vSphericalY.rgb;vec3 Cz=vSphericalZ.rgb;vec3 Cxx_zz=vSphericalXX_ZZ.rgb;vec3 Cyy_zz=vSphericalYY_ZZ.rgb;vec3 Cxy=vSphericalXY.rgb;vec3 Cyz=vSphericalYZ.rgb;vec3 Czx=vSphericalZX.rgb;vec3 a1=Cyy_zz*Ny+Cy;vec3 a2=Cyz*Nz+a1;vec3 b1=Czx*Nz+Cx;vec3 b2=Cxy*Ny+b1;vec3 b3=Cxx_zz*Nx+b2;vec3 t1=Cz *Nz+C1;vec3 t2=a2 *Ny+t1;vec3 t3=b3 *Nx+t2;return t3;}\n#endif\n#endif\n`;\n// Sideeffect\nif (!ShaderStore.IncludesShadersStore[name]) {\n ShaderStore.IncludesShadersStore[name] = shader;\n}\n/** @internal */\nexport const harmonicsFunctions = { name, shader };\n//# sourceMappingURL=harmonicsFunctions.js.map"],"names":["name","shader","ShaderStore"],"mappings":";;AAIA,MAAMA,IAAO,qBACPC,IAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAOVC,EAAY,qBAAqBF,CAAI,MACtCE,EAAY,qBAAqBF,CAAI,IAAIC;ACX7C,MAAMD,IAAO,oBACPC,IAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAuKVC,EAAY,qBAAqBF,CAAI,MACtCE,EAAY,qBAAqBF,CAAI,IAAIC;ACzK7C,MAAMD,IAAO,sBACPC,IAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAiBVC,EAAY,qBAAqBF,CAAI,MACtCE,EAAY,qBAAqBF,CAAI,IAAIC;","x_google_ignoreList":[0,1,2]}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import "./index-ChGTkj2q.js";
|
|
2
|
+
function m(t, e) {
|
|
3
|
+
return e > 1023 ? t * Math.pow(2, 1023) * Math.pow(2, e - 1023) : e < -1074 ? t * Math.pow(2, -1074) * Math.pow(2, e + 1074) : t * Math.pow(2, e);
|
|
4
|
+
}
|
|
5
|
+
function p(t, e, r, i, l, n) {
|
|
6
|
+
l > 0 ? (l = m(1, l - 136), t[n + 0] = e * l, t[n + 1] = r * l, t[n + 2] = i * l) : (t[n + 0] = 0, t[n + 1] = 0, t[n + 2] = 0);
|
|
7
|
+
}
|
|
8
|
+
function g(t, e) {
|
|
9
|
+
let r = "", i = "";
|
|
10
|
+
for (let l = e; l < t.length - e && (i = String.fromCharCode(t[l]), i != `
|
|
11
|
+
`); l++)
|
|
12
|
+
r += i;
|
|
13
|
+
return r;
|
|
14
|
+
}
|
|
15
|
+
function D(t) {
|
|
16
|
+
let e = 0, r = 0, i = g(t, 0);
|
|
17
|
+
if (i[0] != "#" || i[1] != "?")
|
|
18
|
+
throw "Bad HDR Format.";
|
|
19
|
+
let l = !1, n = !1, o = 0;
|
|
20
|
+
do
|
|
21
|
+
o += i.length + 1, i = g(t, o), i == "FORMAT=32-bit_rle_rgbe" ? n = !0 : i.length == 0 && (l = !0);
|
|
22
|
+
while (!l);
|
|
23
|
+
if (!n)
|
|
24
|
+
throw "HDR Bad header format, unsupported FORMAT";
|
|
25
|
+
o += i.length + 1, i = g(t, o);
|
|
26
|
+
const a = /^-Y (.*) \+X (.*)$/g.exec(i);
|
|
27
|
+
if (!a || a.length < 3)
|
|
28
|
+
throw "HDR Bad header format, no size";
|
|
29
|
+
if (r = parseInt(a[2]), e = parseInt(a[1]), r < 8 || r > 32767)
|
|
30
|
+
throw "HDR Bad header format, unsupported size";
|
|
31
|
+
return o += i.length + 1, {
|
|
32
|
+
height: e,
|
|
33
|
+
width: r,
|
|
34
|
+
dataPosition: o
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function b(t, e) {
|
|
38
|
+
return H(t, e);
|
|
39
|
+
}
|
|
40
|
+
function H(t, e) {
|
|
41
|
+
let r = e.height;
|
|
42
|
+
const i = e.width;
|
|
43
|
+
let l, n, o, c, a, s = e.dataPosition, f = 0, d = 0, h = 0;
|
|
44
|
+
const B = new ArrayBuffer(i * 4), w = new Uint8Array(B), A = new ArrayBuffer(e.width * e.height * 4 * 3), u = new Float32Array(A);
|
|
45
|
+
for (; r > 0; ) {
|
|
46
|
+
if (l = t[s++], n = t[s++], o = t[s++], c = t[s++], l != 2 || n != 2 || o & 128 || e.width < 8 || e.width > 32767)
|
|
47
|
+
return F(t, e);
|
|
48
|
+
if ((o << 8 | c) != i)
|
|
49
|
+
throw "HDR Bad header format, wrong scan line width";
|
|
50
|
+
for (f = 0, h = 0; h < 4; h++)
|
|
51
|
+
for (d = (h + 1) * i; f < d; )
|
|
52
|
+
if (l = t[s++], n = t[s++], l > 128) {
|
|
53
|
+
if (a = l - 128, a == 0 || a > d - f)
|
|
54
|
+
throw "HDR Bad Format, bad scanline data (run)";
|
|
55
|
+
for (; a-- > 0; )
|
|
56
|
+
w[f++] = n;
|
|
57
|
+
} else {
|
|
58
|
+
if (a = l, a == 0 || a > d - f)
|
|
59
|
+
throw "HDR Bad Format, bad scanline data (non-run)";
|
|
60
|
+
if (w[f++] = n, --a > 0)
|
|
61
|
+
for (let R = 0; R < a; R++)
|
|
62
|
+
w[f++] = t[s++];
|
|
63
|
+
}
|
|
64
|
+
for (h = 0; h < i; h++)
|
|
65
|
+
l = w[h], n = w[h + i], o = w[h + 2 * i], c = w[h + 3 * i], p(u, l, n, o, c, (e.height - r) * i * 3 + h * 3);
|
|
66
|
+
r--;
|
|
67
|
+
}
|
|
68
|
+
return u;
|
|
69
|
+
}
|
|
70
|
+
function F(t, e) {
|
|
71
|
+
let r = e.height;
|
|
72
|
+
const i = e.width;
|
|
73
|
+
let l, n, o, c, a, s = e.dataPosition;
|
|
74
|
+
const f = new ArrayBuffer(e.width * e.height * 4 * 3), d = new Float32Array(f);
|
|
75
|
+
for (; r > 0; ) {
|
|
76
|
+
for (a = 0; a < e.width; a++)
|
|
77
|
+
l = t[s++], n = t[s++], o = t[s++], c = t[s++], p(d, l, n, o, c, (e.height - r) * i * 3 + a * 3);
|
|
78
|
+
r--;
|
|
79
|
+
}
|
|
80
|
+
return d;
|
|
81
|
+
}
|
|
82
|
+
class L {
|
|
83
|
+
constructor() {
|
|
84
|
+
this.supportCascades = !1;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Uploads the cube texture data to the WebGL texture. It has already been bound.
|
|
88
|
+
* Cube texture are not supported by .hdr files
|
|
89
|
+
*/
|
|
90
|
+
loadCubeData() {
|
|
91
|
+
throw ".hdr not supported in Cube.";
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Uploads the 2D texture data to the WebGL texture. It has already been bound once in the callback.
|
|
95
|
+
* @param data contains the texture data
|
|
96
|
+
* @param texture defines the BabylonJS internal texture
|
|
97
|
+
* @param callback defines the method to call once ready to upload
|
|
98
|
+
*/
|
|
99
|
+
loadData(e, r, i) {
|
|
100
|
+
const l = new Uint8Array(e.buffer, e.byteOffset, e.byteLength), n = D(l), o = b(l, n), c = n.width * n.height, a = new Float32Array(c * 4);
|
|
101
|
+
for (let s = 0; s < c; s += 1)
|
|
102
|
+
a[s * 4] = o[s * 3], a[s * 4 + 1] = o[s * 3 + 1], a[s * 4 + 2] = o[s * 3 + 2], a[s * 4 + 3] = 1;
|
|
103
|
+
i(n.width, n.height, r.generateMipMaps, !1, () => {
|
|
104
|
+
const s = r.getEngine();
|
|
105
|
+
r.type = 1, r.format = 5, r._gammaSpace = !1, s._uploadDataToTextureDirectly(r, a);
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
export {
|
|
110
|
+
L as _HDRTextureLoader
|
|
111
|
+
};
|
|
112
|
+
//# sourceMappingURL=hdrTextureLoader-DreWCvHD.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hdrTextureLoader-DreWCvHD.js","sources":["../node_modules/@babylonjs/core/Misc/HighDynamicRange/hdr.js","../node_modules/@babylonjs/core/Materials/Textures/Loaders/hdrTextureLoader.js"],"sourcesContent":["import { PanoramaToCubeMapTools } from \"./panoramaToCubemap.js\";\n/* This groups tools to convert HDR texture to native colors array. */\nfunction Ldexp(mantissa, exponent) {\n if (exponent > 1023) {\n return mantissa * Math.pow(2, 1023) * Math.pow(2, exponent - 1023);\n }\n if (exponent < -1074) {\n return mantissa * Math.pow(2, -1074) * Math.pow(2, exponent + 1074);\n }\n return mantissa * Math.pow(2, exponent);\n}\nfunction Rgbe2float(float32array, red, green, blue, exponent, index) {\n if (exponent > 0) {\n /*nonzero pixel*/\n exponent = Ldexp(1.0, exponent - (128 + 8));\n float32array[index + 0] = red * exponent;\n float32array[index + 1] = green * exponent;\n float32array[index + 2] = blue * exponent;\n }\n else {\n float32array[index + 0] = 0;\n float32array[index + 1] = 0;\n float32array[index + 2] = 0;\n }\n}\nfunction ReadStringLine(uint8array, startIndex) {\n let line = \"\";\n let character = \"\";\n for (let i = startIndex; i < uint8array.length - startIndex; i++) {\n character = String.fromCharCode(uint8array[i]);\n if (character == \"\\n\") {\n break;\n }\n line += character;\n }\n return line;\n}\n/**\n * Reads header information from an RGBE texture stored in a native array.\n * More information on this format are available here:\n * https://en.wikipedia.org/wiki/RGBE_image_format\n *\n * @param uint8array The binary file stored in native array.\n * @returns The header information.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function RGBE_ReadHeader(uint8array) {\n let height = 0;\n let width = 0;\n let line = ReadStringLine(uint8array, 0);\n if (line[0] != \"#\" || line[1] != \"?\") {\n // eslint-disable-next-line no-throw-literal\n throw \"Bad HDR Format.\";\n }\n let endOfHeader = false;\n let findFormat = false;\n let lineIndex = 0;\n do {\n lineIndex += line.length + 1;\n line = ReadStringLine(uint8array, lineIndex);\n if (line == \"FORMAT=32-bit_rle_rgbe\") {\n findFormat = true;\n }\n else if (line.length == 0) {\n endOfHeader = true;\n }\n } while (!endOfHeader);\n if (!findFormat) {\n // eslint-disable-next-line no-throw-literal\n throw \"HDR Bad header format, unsupported FORMAT\";\n }\n lineIndex += line.length + 1;\n line = ReadStringLine(uint8array, lineIndex);\n const sizeRegexp = /^-Y (.*) \\+X (.*)$/g;\n const match = sizeRegexp.exec(line);\n // TODO. Support +Y and -X if needed.\n if (!match || match.length < 3) {\n // eslint-disable-next-line no-throw-literal\n throw \"HDR Bad header format, no size\";\n }\n width = parseInt(match[2]);\n height = parseInt(match[1]);\n if (width < 8 || width > 0x7fff) {\n // eslint-disable-next-line no-throw-literal\n throw \"HDR Bad header format, unsupported size\";\n }\n lineIndex += line.length + 1;\n return {\n height: height,\n width: width,\n dataPosition: lineIndex,\n };\n}\n/**\n * Returns the cubemap information (each faces texture data) extracted from an RGBE texture.\n * This RGBE texture needs to store the information as a panorama.\n *\n * More information on this format are available here:\n * https://en.wikipedia.org/wiki/RGBE_image_format\n *\n * @param buffer The binary file stored in an array buffer.\n * @param size The expected size of the extracted cubemap.\n * @param supersample enable supersampling the cubemap (default: false)\n * @returns The Cube Map information.\n */\nexport function GetCubeMapTextureData(buffer, size, supersample = false) {\n const uint8array = new Uint8Array(buffer);\n const hdrInfo = RGBE_ReadHeader(uint8array);\n const data = RGBE_ReadPixels(uint8array, hdrInfo);\n const cubeMapData = PanoramaToCubeMapTools.ConvertPanoramaToCubemap(data, hdrInfo.width, hdrInfo.height, size, supersample);\n return cubeMapData;\n}\n/**\n * Returns the pixels data extracted from an RGBE texture.\n * This pixels will be stored left to right up to down in the R G B order in one array.\n *\n * More information on this format are available here:\n * https://en.wikipedia.org/wiki/RGBE_image_format\n *\n * @param uint8array The binary file stored in an array buffer.\n * @param hdrInfo The header information of the file.\n * @returns The pixels data in RGB right to left up to down order.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function RGBE_ReadPixels(uint8array, hdrInfo) {\n return ReadRGBEPixelsRLE(uint8array, hdrInfo);\n}\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction ReadRGBEPixelsRLE(uint8array, hdrInfo) {\n let numScanlines = hdrInfo.height;\n const scanlineWidth = hdrInfo.width;\n let a, b, c, d, count;\n let dataIndex = hdrInfo.dataPosition;\n let index = 0, endIndex = 0, i = 0;\n const scanLineArrayBuffer = new ArrayBuffer(scanlineWidth * 4); // four channel R G B E\n const scanLineArray = new Uint8Array(scanLineArrayBuffer);\n // 3 channels of 4 bytes per pixel in float.\n const resultBuffer = new ArrayBuffer(hdrInfo.width * hdrInfo.height * 4 * 3);\n const resultArray = new Float32Array(resultBuffer);\n // read in each successive scanline\n while (numScanlines > 0) {\n a = uint8array[dataIndex++];\n b = uint8array[dataIndex++];\n c = uint8array[dataIndex++];\n d = uint8array[dataIndex++];\n if (a != 2 || b != 2 || c & 0x80 || hdrInfo.width < 8 || hdrInfo.width > 32767) {\n return ReadRGBEPixelsNotRLE(uint8array, hdrInfo);\n }\n if (((c << 8) | d) != scanlineWidth) {\n // eslint-disable-next-line no-throw-literal\n throw \"HDR Bad header format, wrong scan line width\";\n }\n index = 0;\n // read each of the four channels for the scanline into the buffer\n for (i = 0; i < 4; i++) {\n endIndex = (i + 1) * scanlineWidth;\n while (index < endIndex) {\n a = uint8array[dataIndex++];\n b = uint8array[dataIndex++];\n if (a > 128) {\n // a run of the same value\n count = a - 128;\n if (count == 0 || count > endIndex - index) {\n // eslint-disable-next-line no-throw-literal\n throw \"HDR Bad Format, bad scanline data (run)\";\n }\n while (count-- > 0) {\n scanLineArray[index++] = b;\n }\n }\n else {\n // a non-run\n count = a;\n if (count == 0 || count > endIndex - index) {\n // eslint-disable-next-line no-throw-literal\n throw \"HDR Bad Format, bad scanline data (non-run)\";\n }\n scanLineArray[index++] = b;\n if (--count > 0) {\n for (let j = 0; j < count; j++) {\n scanLineArray[index++] = uint8array[dataIndex++];\n }\n }\n }\n }\n }\n // now convert data from buffer into floats\n for (i = 0; i < scanlineWidth; i++) {\n a = scanLineArray[i];\n b = scanLineArray[i + scanlineWidth];\n c = scanLineArray[i + 2 * scanlineWidth];\n d = scanLineArray[i + 3 * scanlineWidth];\n Rgbe2float(resultArray, a, b, c, d, (hdrInfo.height - numScanlines) * scanlineWidth * 3 + i * 3);\n }\n numScanlines--;\n }\n return resultArray;\n}\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction ReadRGBEPixelsNotRLE(uint8array, hdrInfo) {\n // this file is not run length encoded\n // read values sequentially\n let numScanlines = hdrInfo.height;\n const scanlineWidth = hdrInfo.width;\n let a, b, c, d, i;\n let dataIndex = hdrInfo.dataPosition;\n // 3 channels of 4 bytes per pixel in float.\n const resultBuffer = new ArrayBuffer(hdrInfo.width * hdrInfo.height * 4 * 3);\n const resultArray = new Float32Array(resultBuffer);\n // read in each successive scanline\n while (numScanlines > 0) {\n for (i = 0; i < hdrInfo.width; i++) {\n a = uint8array[dataIndex++];\n b = uint8array[dataIndex++];\n c = uint8array[dataIndex++];\n d = uint8array[dataIndex++];\n Rgbe2float(resultArray, a, b, c, d, (hdrInfo.height - numScanlines) * scanlineWidth * 3 + i * 3);\n }\n numScanlines--;\n }\n return resultArray;\n}\n/**\n * @deprecated Use functions separately\n */\nexport const HDRTools = {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n RGBE_ReadHeader,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n GetCubeMapTextureData,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n RGBE_ReadPixels,\n};\n//# sourceMappingURL=hdr.js.map","import { RGBE_ReadHeader, RGBE_ReadPixels } from \"../../../Misc/HighDynamicRange/hdr.js\";\n\n/**\n * Implementation of the HDR Texture Loader.\n * @internal\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport class _HDRTextureLoader {\n constructor() {\n /**\n * Defines whether the loader supports cascade loading the different faces.\n */\n this.supportCascades = false;\n }\n /**\n * Uploads the cube texture data to the WebGL texture. It has already been bound.\n * Cube texture are not supported by .hdr files\n */\n loadCubeData() {\n // eslint-disable-next-line no-throw-literal\n throw \".hdr not supported in Cube.\";\n }\n /**\n * Uploads the 2D texture data to the WebGL texture. It has already been bound once in the callback.\n * @param data contains the texture data\n * @param texture defines the BabylonJS internal texture\n * @param callback defines the method to call once ready to upload\n */\n loadData(data, texture, callback) {\n const uint8array = new Uint8Array(data.buffer, data.byteOffset, data.byteLength);\n const hdrInfo = RGBE_ReadHeader(uint8array);\n const pixelsDataRGB32 = RGBE_ReadPixels(uint8array, hdrInfo);\n const pixels = hdrInfo.width * hdrInfo.height;\n const pixelsDataRGBA32 = new Float32Array(pixels * 4);\n for (let i = 0; i < pixels; i += 1) {\n pixelsDataRGBA32[i * 4] = pixelsDataRGB32[i * 3];\n pixelsDataRGBA32[i * 4 + 1] = pixelsDataRGB32[i * 3 + 1];\n pixelsDataRGBA32[i * 4 + 2] = pixelsDataRGB32[i * 3 + 2];\n pixelsDataRGBA32[i * 4 + 3] = 1;\n }\n callback(hdrInfo.width, hdrInfo.height, texture.generateMipMaps, false, () => {\n const engine = texture.getEngine();\n texture.type = 1;\n texture.format = 5;\n texture._gammaSpace = false;\n engine._uploadDataToTextureDirectly(texture, pixelsDataRGBA32);\n });\n }\n}\n//# sourceMappingURL=hdrTextureLoader.js.map"],"names":["Ldexp","mantissa","exponent","Rgbe2float","float32array","red","green","blue","index","ReadStringLine","uint8array","startIndex","line","character","i","RGBE_ReadHeader","height","width","endOfHeader","findFormat","lineIndex","match","RGBE_ReadPixels","hdrInfo","ReadRGBEPixelsRLE","numScanlines","scanlineWidth","a","b","c","d","count","dataIndex","endIndex","scanLineArrayBuffer","scanLineArray","resultBuffer","resultArray","ReadRGBEPixelsNotRLE","j","_HDRTextureLoader","data","texture","callback","pixelsDataRGB32","pixels","pixelsDataRGBA32","engine"],"mappings":";AAEA,SAASA,EAAMC,GAAUC,GAAU;AAC/B,SAAIA,IAAW,OACJD,IAAW,KAAK,IAAI,GAAG,IAAI,IAAI,KAAK,IAAI,GAAGC,IAAW,IAAI,IAEjEA,IAAW,QACJD,IAAW,KAAK,IAAI,GAAG,KAAK,IAAI,KAAK,IAAI,GAAGC,IAAW,IAAI,IAE/DD,IAAW,KAAK,IAAI,GAAGC,CAAQ;AAC1C;AACA,SAASC,EAAWC,GAAcC,GAAKC,GAAOC,GAAML,GAAUM,GAAO;AACjE,EAAIN,IAAW,KAEXA,IAAWF,EAAM,GAAKE,IAAY,GAAQ,GAC1CE,EAAaI,IAAQ,CAAC,IAAIH,IAAMH,GAChCE,EAAaI,IAAQ,CAAC,IAAIF,IAAQJ,GAClCE,EAAaI,IAAQ,CAAC,IAAID,IAAOL,MAGjCE,EAAaI,IAAQ,CAAC,IAAI,GAC1BJ,EAAaI,IAAQ,CAAC,IAAI,GAC1BJ,EAAaI,IAAQ,CAAC,IAAI;AAElC;AACA,SAASC,EAAeC,GA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ACjCuB,IAAmB,IAAI,aAAaD,IAAS,CAAC;AACpD,aAAS/B,IAAI,GAAGA,IAAI+B,GAAQ/B,KAAK;AAC7B,MAAAgC,EAAiBhC,IAAI,CAAC,IAAI8B,EAAgB9B,IAAI,CAAC,GAC/CgC,EAAiBhC,IAAI,IAAI,CAAC,IAAI8B,EAAgB9B,IAAI,IAAI,CAAC,GACvDgC,EAAiBhC,IAAI,IAAI,CAAC,IAAI8B,EAAgB9B,IAAI,IAAI,CAAC,GACvDgC,EAAiBhC,IAAI,IAAI,CAAC,IAAI;AAElC,IAAA6B,EAASpB,EAAQ,OAAOA,EAAQ,QAAQmB,EAAQ,iBAAiB,IAAO,MAAM;AAC1E,YAAMK,IAASL,EAAQ,UAAS;AAChC,MAAAA,EAAQ,OAAO,GACfA,EAAQ,SAAS,GACjBA,EAAQ,cAAc,IACtBK,EAAO,6BAA6BL,GAASI,CAAgB;AAAA,IACzE,CAAS;AAAA,EACT;AACA;","x_google_ignoreList":[0,1]}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { S as e } from "./index-ChGTkj2q.js";
|
|
2
|
+
const a = "helperFunctions", o = `const float PI=3.1415926535897932384626433832795;const float TWO_PI=6.283185307179586;const float HALF_PI=1.5707963267948966;const float RECIPROCAL_PI=0.3183098861837907;const float RECIPROCAL_PI2=0.15915494309189535;const float RECIPROCAL_PI4=0.07957747154594767;const float HALF_MIN=5.96046448e-08;
|
|
3
|
+
const float LinearEncodePowerApprox=2.2;const float GammaEncodePowerApprox=1.0/LinearEncodePowerApprox;const vec3 LuminanceEncodeApprox=vec3(0.2126,0.7152,0.0722);const float Epsilon=0.0000001;
|
|
4
|
+
#define saturate(x) clamp(x,0.0,1.0)
|
|
5
|
+
#define absEps(x) abs(x)+Epsilon
|
|
6
|
+
#define maxEps(x) max(x,Epsilon)
|
|
7
|
+
#define saturateEps(x) clamp(x,Epsilon,1.0)
|
|
8
|
+
mat3 transposeMat3(mat3 inMatrix) {vec3 i0=inMatrix[0];vec3 i1=inMatrix[1];vec3 i2=inMatrix[2];mat3 outMatrix=mat3(
|
|
9
|
+
vec3(i0.x,i1.x,i2.x),
|
|
10
|
+
vec3(i0.y,i1.y,i2.y),
|
|
11
|
+
vec3(i0.z,i1.z,i2.z)
|
|
12
|
+
);return outMatrix;}
|
|
13
|
+
mat3 inverseMat3(mat3 inMatrix) {float a00=inMatrix[0][0],a01=inMatrix[0][1],a02=inMatrix[0][2];float a10=inMatrix[1][0],a11=inMatrix[1][1],a12=inMatrix[1][2];float a20=inMatrix[2][0],a21=inMatrix[2][1],a22=inMatrix[2][2];float b01=a22*a11-a12*a21;float b11=-a22*a10+a12*a20;float b21=a21*a10-a11*a20;float det=a00*b01+a01*b11+a02*b21;return mat3(b01,(-a22*a01+a02*a21),(a12*a01-a02*a11),
|
|
14
|
+
b11,(a22*a00-a02*a20),(-a12*a00+a02*a10),
|
|
15
|
+
b21,(-a21*a00+a01*a20),(a11*a00-a01*a10))/det;}
|
|
16
|
+
#if USE_EXACT_SRGB_CONVERSIONS
|
|
17
|
+
vec3 toLinearSpaceExact(vec3 color)
|
|
18
|
+
{vec3 nearZeroSection=0.0773993808*color;vec3 remainingSection=pow(0.947867299*(color+vec3(0.055)),vec3(2.4));
|
|
19
|
+
#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)
|
|
20
|
+
return mix(remainingSection,nearZeroSection,lessThanEqual(color,vec3(0.04045)));
|
|
21
|
+
#else
|
|
22
|
+
return
|
|
23
|
+
vec3(
|
|
24
|
+
color.r<=0.04045 ? nearZeroSection.r : remainingSection.r,
|
|
25
|
+
color.g<=0.04045 ? nearZeroSection.g : remainingSection.g,
|
|
26
|
+
color.b<=0.04045 ? nearZeroSection.b : remainingSection.b);
|
|
27
|
+
#endif
|
|
28
|
+
}
|
|
29
|
+
vec3 toGammaSpaceExact(vec3 color)
|
|
30
|
+
{vec3 nearZeroSection=12.92*color;vec3 remainingSection=1.055*pow(color,vec3(0.41666))-vec3(0.055);
|
|
31
|
+
#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)
|
|
32
|
+
return mix(remainingSection,nearZeroSection,lessThanEqual(color,vec3(0.0031308)));
|
|
33
|
+
#else
|
|
34
|
+
return
|
|
35
|
+
vec3(
|
|
36
|
+
color.r<=0.0031308 ? nearZeroSection.r : remainingSection.r,
|
|
37
|
+
color.g<=0.0031308 ? nearZeroSection.g : remainingSection.g,
|
|
38
|
+
color.b<=0.0031308 ? nearZeroSection.b : remainingSection.b);
|
|
39
|
+
#endif
|
|
40
|
+
}
|
|
41
|
+
#endif
|
|
42
|
+
float toLinearSpace(float color)
|
|
43
|
+
{
|
|
44
|
+
#if USE_EXACT_SRGB_CONVERSIONS
|
|
45
|
+
float nearZeroSection=0.0773993808*color;float remainingSection=pow(0.947867299*(color+0.055),2.4);return color<=0.04045 ? nearZeroSection : remainingSection;
|
|
46
|
+
#else
|
|
47
|
+
return pow(color,LinearEncodePowerApprox);
|
|
48
|
+
#endif
|
|
49
|
+
}
|
|
50
|
+
vec3 toLinearSpace(vec3 color)
|
|
51
|
+
{
|
|
52
|
+
#if USE_EXACT_SRGB_CONVERSIONS
|
|
53
|
+
return toLinearSpaceExact(color);
|
|
54
|
+
#else
|
|
55
|
+
return pow(color,vec3(LinearEncodePowerApprox));
|
|
56
|
+
#endif
|
|
57
|
+
}
|
|
58
|
+
vec4 toLinearSpace(vec4 color)
|
|
59
|
+
{
|
|
60
|
+
#if USE_EXACT_SRGB_CONVERSIONS
|
|
61
|
+
return vec4(toLinearSpaceExact(color.rgb),color.a);
|
|
62
|
+
#else
|
|
63
|
+
return vec4(pow(color.rgb,vec3(LinearEncodePowerApprox)),color.a);
|
|
64
|
+
#endif
|
|
65
|
+
}
|
|
66
|
+
float toGammaSpace(float color)
|
|
67
|
+
{
|
|
68
|
+
#if USE_EXACT_SRGB_CONVERSIONS
|
|
69
|
+
float nearZeroSection=12.92*color;float remainingSection=1.055*pow(color,0.41666)-0.055;return color<=0.0031308 ? nearZeroSection : remainingSection;
|
|
70
|
+
#else
|
|
71
|
+
return pow(color,GammaEncodePowerApprox);
|
|
72
|
+
#endif
|
|
73
|
+
}
|
|
74
|
+
vec3 toGammaSpace(vec3 color)
|
|
75
|
+
{
|
|
76
|
+
#if USE_EXACT_SRGB_CONVERSIONS
|
|
77
|
+
return toGammaSpaceExact(color);
|
|
78
|
+
#else
|
|
79
|
+
return pow(color,vec3(GammaEncodePowerApprox));
|
|
80
|
+
#endif
|
|
81
|
+
}
|
|
82
|
+
vec4 toGammaSpace(vec4 color)
|
|
83
|
+
{
|
|
84
|
+
#if USE_EXACT_SRGB_CONVERSIONS
|
|
85
|
+
return vec4(toGammaSpaceExact(color.rgb),color.a);
|
|
86
|
+
#else
|
|
87
|
+
return vec4(pow(color.rgb,vec3(GammaEncodePowerApprox)),color.a);
|
|
88
|
+
#endif
|
|
89
|
+
}
|
|
90
|
+
float square(float value)
|
|
91
|
+
{return value*value;}
|
|
92
|
+
vec3 square(vec3 value)
|
|
93
|
+
{return value*value;}
|
|
94
|
+
float pow5(float value) {float sq=value*value;return sq*sq*value;}
|
|
95
|
+
float getLuminance(vec3 color)
|
|
96
|
+
{return saturate(dot(color,LuminanceEncodeApprox));}
|
|
97
|
+
float getRand(vec2 seed) {return fract(sin(dot(seed.xy ,vec2(12.9898,78.233)))*43758.5453);}
|
|
98
|
+
float dither(vec2 seed,float varianceAmount) {float rand=getRand(seed);float normVariance=varianceAmount/255.0;float dither=mix(-normVariance,normVariance,rand);return dither;}
|
|
99
|
+
const float rgbdMaxRange=255.;vec4 toRGBD(vec3 color) {float maxRGB=maxEps(max(color.r,max(color.g,color.b)));float D =max(rgbdMaxRange/maxRGB,1.);D =saturate(floor(D)/255.);vec3 rgb=color.rgb*D;rgb=toGammaSpace(rgb);return vec4(saturate(rgb),D);}
|
|
100
|
+
vec3 fromRGBD(vec4 rgbd) {rgbd.rgb=toLinearSpace(rgbd.rgb);return rgbd.rgb/rgbd.a;}
|
|
101
|
+
vec3 parallaxCorrectNormal( vec3 vertexPos,vec3 origVec,vec3 cubeSize,vec3 cubePos ) {vec3 invOrigVec=vec3(1.)/origVec;vec3 halfSize=cubeSize*0.5;vec3 intersecAtMaxPlane=(cubePos+halfSize-vertexPos)*invOrigVec;vec3 intersecAtMinPlane=(cubePos-halfSize-vertexPos)*invOrigVec;vec3 largestIntersec=max(intersecAtMaxPlane,intersecAtMinPlane);float distance=min(min(largestIntersec.x,largestIntersec.y),largestIntersec.z);vec3 intersectPositionWS=vertexPos+origVec*distance;return intersectPositionWS-cubePos;}
|
|
102
|
+
vec3 equirectangularToCubemapDirection(vec2 uv) {float longitude=uv.x*TWO_PI-PI;float latitude=HALF_PI-uv.y*PI;vec3 direction;direction.x=cos(latitude)*sin(longitude);direction.y=sin(latitude);direction.z=cos(latitude)*cos(longitude);return direction;}
|
|
103
|
+
float sqrtClamped(float value) {return sqrt(max(value,0.));}
|
|
104
|
+
float avg(vec3 value) {return dot(value,vec3(0.333333333));}`;
|
|
105
|
+
e.IncludesShadersStore[a] || (e.IncludesShadersStore[a] = o);
|
|
106
|
+
//# sourceMappingURL=helperFunctions-Dh1WD8YN.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helperFunctions-Dh1WD8YN.js","sources":["../node_modules/@babylonjs/core/Shaders/ShadersInclude/helperFunctions.js"],"sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore.js\";\nconst name = \"helperFunctions\";\nconst shader = `const float PI=3.1415926535897932384626433832795;const float TWO_PI=6.283185307179586;const float HALF_PI=1.5707963267948966;const float RECIPROCAL_PI=0.3183098861837907;const float RECIPROCAL_PI2=0.15915494309189535;const float RECIPROCAL_PI4=0.07957747154594767;const float HALF_MIN=5.96046448e-08; \nconst float LinearEncodePowerApprox=2.2;const float GammaEncodePowerApprox=1.0/LinearEncodePowerApprox;const vec3 LuminanceEncodeApprox=vec3(0.2126,0.7152,0.0722);const float Epsilon=0.0000001;\n#define saturate(x) clamp(x,0.0,1.0)\n#define absEps(x) abs(x)+Epsilon\n#define maxEps(x) max(x,Epsilon)\n#define saturateEps(x) clamp(x,Epsilon,1.0)\nmat3 transposeMat3(mat3 inMatrix) {vec3 i0=inMatrix[0];vec3 i1=inMatrix[1];vec3 i2=inMatrix[2];mat3 outMatrix=mat3(\nvec3(i0.x,i1.x,i2.x),\nvec3(i0.y,i1.y,i2.y),\nvec3(i0.z,i1.z,i2.z)\n);return outMatrix;}\nmat3 inverseMat3(mat3 inMatrix) {float a00=inMatrix[0][0],a01=inMatrix[0][1],a02=inMatrix[0][2];float a10=inMatrix[1][0],a11=inMatrix[1][1],a12=inMatrix[1][2];float a20=inMatrix[2][0],a21=inMatrix[2][1],a22=inMatrix[2][2];float b01=a22*a11-a12*a21;float b11=-a22*a10+a12*a20;float b21=a21*a10-a11*a20;float det=a00*b01+a01*b11+a02*b21;return mat3(b01,(-a22*a01+a02*a21),(a12*a01-a02*a11),\nb11,(a22*a00-a02*a20),(-a12*a00+a02*a10),\nb21,(-a21*a00+a01*a20),(a11*a00-a01*a10))/det;}\n#if USE_EXACT_SRGB_CONVERSIONS\nvec3 toLinearSpaceExact(vec3 color)\n{vec3 nearZeroSection=0.0773993808*color;vec3 remainingSection=pow(0.947867299*(color+vec3(0.055)),vec3(2.4));\n#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)\nreturn mix(remainingSection,nearZeroSection,lessThanEqual(color,vec3(0.04045)));\n#else\nreturn\nvec3(\ncolor.r<=0.04045 ? nearZeroSection.r : remainingSection.r,\ncolor.g<=0.04045 ? nearZeroSection.g : remainingSection.g,\ncolor.b<=0.04045 ? nearZeroSection.b : remainingSection.b);\n#endif\n}\nvec3 toGammaSpaceExact(vec3 color)\n{vec3 nearZeroSection=12.92*color;vec3 remainingSection=1.055*pow(color,vec3(0.41666))-vec3(0.055);\n#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)\nreturn mix(remainingSection,nearZeroSection,lessThanEqual(color,vec3(0.0031308)));\n#else\nreturn\nvec3(\ncolor.r<=0.0031308 ? nearZeroSection.r : remainingSection.r,\ncolor.g<=0.0031308 ? nearZeroSection.g : remainingSection.g,\ncolor.b<=0.0031308 ? nearZeroSection.b : remainingSection.b);\n#endif\n}\n#endif\nfloat toLinearSpace(float color)\n{\n#if USE_EXACT_SRGB_CONVERSIONS\nfloat nearZeroSection=0.0773993808*color;float remainingSection=pow(0.947867299*(color+0.055),2.4);return color<=0.04045 ? nearZeroSection : remainingSection;\n#else\nreturn pow(color,LinearEncodePowerApprox);\n#endif\n}\nvec3 toLinearSpace(vec3 color)\n{\n#if USE_EXACT_SRGB_CONVERSIONS\nreturn toLinearSpaceExact(color);\n#else\nreturn pow(color,vec3(LinearEncodePowerApprox));\n#endif\n}\nvec4 toLinearSpace(vec4 color)\n{\n#if USE_EXACT_SRGB_CONVERSIONS\nreturn vec4(toLinearSpaceExact(color.rgb),color.a);\n#else\nreturn vec4(pow(color.rgb,vec3(LinearEncodePowerApprox)),color.a);\n#endif\n}\nfloat toGammaSpace(float color)\n{\n#if USE_EXACT_SRGB_CONVERSIONS\nfloat nearZeroSection=12.92*color;float remainingSection=1.055*pow(color,0.41666)-0.055;return color<=0.0031308 ? nearZeroSection : remainingSection;\n#else\nreturn pow(color,GammaEncodePowerApprox);\n#endif\n}\nvec3 toGammaSpace(vec3 color)\n{\n#if USE_EXACT_SRGB_CONVERSIONS\nreturn toGammaSpaceExact(color);\n#else\nreturn pow(color,vec3(GammaEncodePowerApprox));\n#endif\n}\nvec4 toGammaSpace(vec4 color)\n{\n#if USE_EXACT_SRGB_CONVERSIONS\nreturn vec4(toGammaSpaceExact(color.rgb),color.a);\n#else\nreturn vec4(pow(color.rgb,vec3(GammaEncodePowerApprox)),color.a);\n#endif\n}\nfloat square(float value)\n{return value*value;}\nvec3 square(vec3 value)\n{return value*value;}\nfloat pow5(float value) {float sq=value*value;return sq*sq*value;}\nfloat getLuminance(vec3 color)\n{return saturate(dot(color,LuminanceEncodeApprox));}\nfloat getRand(vec2 seed) {return fract(sin(dot(seed.xy ,vec2(12.9898,78.233)))*43758.5453);}\nfloat dither(vec2 seed,float varianceAmount) {float rand=getRand(seed);float normVariance=varianceAmount/255.0;float dither=mix(-normVariance,normVariance,rand);return dither;}\nconst float rgbdMaxRange=255.;vec4 toRGBD(vec3 color) {float maxRGB=maxEps(max(color.r,max(color.g,color.b)));float D =max(rgbdMaxRange/maxRGB,1.);D =saturate(floor(D)/255.);vec3 rgb=color.rgb*D;rgb=toGammaSpace(rgb);return vec4(saturate(rgb),D);}\nvec3 fromRGBD(vec4 rgbd) {rgbd.rgb=toLinearSpace(rgbd.rgb);return rgbd.rgb/rgbd.a;}\nvec3 parallaxCorrectNormal( vec3 vertexPos,vec3 origVec,vec3 cubeSize,vec3 cubePos ) {vec3 invOrigVec=vec3(1.)/origVec;vec3 halfSize=cubeSize*0.5;vec3 intersecAtMaxPlane=(cubePos+halfSize-vertexPos)*invOrigVec;vec3 intersecAtMinPlane=(cubePos-halfSize-vertexPos)*invOrigVec;vec3 largestIntersec=max(intersecAtMaxPlane,intersecAtMinPlane);float distance=min(min(largestIntersec.x,largestIntersec.y),largestIntersec.z);vec3 intersectPositionWS=vertexPos+origVec*distance;return intersectPositionWS-cubePos;}\nvec3 equirectangularToCubemapDirection(vec2 uv) {float longitude=uv.x*TWO_PI-PI;float latitude=HALF_PI-uv.y*PI;vec3 direction;direction.x=cos(latitude)*sin(longitude);direction.y=sin(latitude);direction.z=cos(latitude)*cos(longitude);return direction;}\nfloat sqrtClamped(float value) {return sqrt(max(value,0.));}\nfloat avg(vec3 value) {return dot(value,vec3(0.333333333));}`;\n// Sideeffect\nif (!ShaderStore.IncludesShadersStore[name]) {\n ShaderStore.IncludesShadersStore[name] = shader;\n}\n/** @internal */\nexport const helperFunctions = { name, shader };\n//# sourceMappingURL=helperFunctions.js.map"],"names":["name","shader","ShaderStore"],"mappings":";AAEA,MAAMA,IAAO,mBACPC,IAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAwGVC,EAAY,qBAAqBF,CAAI,MACtCE,EAAY,qBAAqBF,CAAI,IAAIC;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { S as e } from "./index-ChGTkj2q.js";
|
|
2
|
+
const r = "helperFunctions", a = `const PI: f32=3.1415926535897932384626433832795;const TWO_PI: f32=6.283185307179586;const HALF_PI: f32=1.5707963267948966;const RECIPROCAL_PI: f32=0.3183098861837907;const RECIPROCAL_PI2: f32=0.15915494309189535;const RECIPROCAL_PI4: f32=0.07957747154594767;const HALF_MIN: f32=5.96046448e-08;
|
|
3
|
+
const LinearEncodePowerApprox: f32=2.2;const GammaEncodePowerApprox: f32=1.0/LinearEncodePowerApprox;const LuminanceEncodeApprox: vec3f=vec3f(0.2126,0.7152,0.0722);const Epsilon:f32=0.0000001;fn square(x: f32)->f32 {return x*x;}
|
|
4
|
+
fn saturate(x: f32)->f32 {return clamp(x,0.0,1.0);}
|
|
5
|
+
fn saturateVec3(x: vec3f)->vec3f {return clamp(x,vec3f(),vec3f(1.0));}
|
|
6
|
+
fn saturateEps(x: f32)->f32 {return clamp(x,Epsilon,1.0);}
|
|
7
|
+
fn maxEps(x: f32)->f32 {return max(x,Epsilon);}
|
|
8
|
+
fn maxEpsVec3(x: vec3f)->vec3f {return max(x,vec3f(Epsilon));}
|
|
9
|
+
fn absEps(x: f32)->f32 {return abs(x)+Epsilon;}
|
|
10
|
+
fn transposeMat3(inMatrix: mat3x3f)->mat3x3f {let i0: vec3f=inMatrix[0];let i1: vec3f=inMatrix[1];let i2: vec3f=inMatrix[2];let outMatrix:mat3x3f=mat3x3f(
|
|
11
|
+
vec3(i0.x,i1.x,i2.x),
|
|
12
|
+
vec3(i0.y,i1.y,i2.y),
|
|
13
|
+
vec3(i0.z,i1.z,i2.z)
|
|
14
|
+
);return outMatrix;}
|
|
15
|
+
fn inverseMat3(inMatrix: mat3x3f)->mat3x3f {let a00: f32=inMatrix[0][0];let a01: f32=inMatrix[0][1];let a02: f32=inMatrix[0][2];let a10: f32=inMatrix[1][0];let a11: f32=inMatrix[1][1];let a12: f32=inMatrix[1][2];let a20: f32=inMatrix[2][0];let a21: f32=inMatrix[2][1];let a22: f32=inMatrix[2][2];let b01: f32=a22*a11-a12*a21;let b11: f32=-a22*a10+a12*a20;let b21: f32=a21*a10-a11*a20;let det: f32=a00*b01+a01*b11+a02*b21;return mat3x3f(b01/det,(-a22*a01+a02*a21)/det,(a12*a01-a02*a11)/det,
|
|
16
|
+
b11/det,(a22*a00-a02*a20)/det,(-a12*a00+a02*a10)/det,
|
|
17
|
+
b21/det,(-a21*a00+a01*a20)/det,(a11*a00-a01*a10)/det);}
|
|
18
|
+
#if USE_EXACT_SRGB_CONVERSIONS
|
|
19
|
+
fn toLinearSpaceExact(color: vec3f)->vec3f
|
|
20
|
+
{let nearZeroSection: vec3f=0.0773993808*color;let remainingSection: vec3f=pow(0.947867299*(color+vec3f(0.055)),vec3f(2.4));return mix(remainingSection,nearZeroSection,lessThanEqual(color,vec3f(0.04045)));}
|
|
21
|
+
fn toGammaSpaceExact(color: vec3f)->vec3f
|
|
22
|
+
{let nearZeroSection: vec3f=12.92*color;let remainingSection: vec3f=1.055*pow(color,vec3f(0.41666))-vec3f(0.055);return mix(remainingSection,nearZeroSection,lessThanEqual(color,vec3f(0.0031308)));}
|
|
23
|
+
#endif
|
|
24
|
+
fn toLinearSpace(color: f32)->f32
|
|
25
|
+
{
|
|
26
|
+
#if USE_EXACT_SRGB_CONVERSIONS
|
|
27
|
+
var nearZeroSection=0.0773993808*color;var remainingSection=pow(0.947867299*(color+0.055),2.4);return select(remainingSection,nearZeroSection,color<=0.04045);
|
|
28
|
+
#else
|
|
29
|
+
return pow(color,LinearEncodePowerApprox);
|
|
30
|
+
#endif
|
|
31
|
+
}
|
|
32
|
+
fn toLinearSpaceVec3(color: vec3f)->vec3f
|
|
33
|
+
{
|
|
34
|
+
#if USE_EXACT_SRGB_CONVERSIONS
|
|
35
|
+
return toLinearSpaceExact(color);
|
|
36
|
+
#else
|
|
37
|
+
return pow(color,vec3f(LinearEncodePowerApprox));
|
|
38
|
+
#endif
|
|
39
|
+
}
|
|
40
|
+
fn toLinearSpaceVec4(color: vec4<f32>)->vec4<f32>
|
|
41
|
+
{
|
|
42
|
+
#if USE_EXACT_SRGB_CONVERSIONS
|
|
43
|
+
return vec4f(toLinearSpaceExact(color.rgb),color.a);
|
|
44
|
+
#else
|
|
45
|
+
return vec4f(pow(color.rgb,vec3f(LinearEncodePowerApprox)),color.a);
|
|
46
|
+
#endif
|
|
47
|
+
}
|
|
48
|
+
fn toGammaSpace(color: vec4<f32>)->vec4<f32>
|
|
49
|
+
{
|
|
50
|
+
#if USE_EXACT_SRGB_CONVERSIONS
|
|
51
|
+
return vec4<f32>(toGammaSpaceExact(color.rgb),color.a);
|
|
52
|
+
#else
|
|
53
|
+
return vec4<f32>(pow(color.rgb,vec3f(GammaEncodePowerApprox)),color.a);
|
|
54
|
+
#endif
|
|
55
|
+
}
|
|
56
|
+
fn toGammaSpaceVec3(color: vec3f)->vec3f
|
|
57
|
+
{
|
|
58
|
+
#if USE_EXACT_SRGB_CONVERSIONS
|
|
59
|
+
return toGammaSpaceExact(color);
|
|
60
|
+
#else
|
|
61
|
+
return pow(color,vec3f(GammaEncodePowerApprox));
|
|
62
|
+
#endif
|
|
63
|
+
}
|
|
64
|
+
fn squareVec3(value: vec3f)->vec3f
|
|
65
|
+
{return value*value;}
|
|
66
|
+
fn pow5(value: f32)->f32 {let sq: f32=value*value;return sq*sq*value;}
|
|
67
|
+
fn getLuminance(color: vec3f)->f32
|
|
68
|
+
{return saturate(dot(color,LuminanceEncodeApprox));}
|
|
69
|
+
fn getRand(seed: vec2<f32>)->f32 {return fract(sin(dot(seed.xy ,vec2<f32>(12.9898,78.233)))*43758.5453);}
|
|
70
|
+
fn dither(seed: vec2<f32>,varianceAmount: f32)->f32 {let rand: f32=getRand(seed);let normVariance: f32=varianceAmount/255.0;let dither: f32=mix(-normVariance,normVariance,rand);return dither;}
|
|
71
|
+
const rgbdMaxRange: f32=255.0;fn toRGBD(color: vec3f)->vec4<f32> {let maxRGB: f32=max(max(color.r,max(color.g,color.b)),Epsilon);var D: f32 =max(rgbdMaxRange/maxRGB,1.);D =clamp(floor(D)/255.0,0.,1.);var rgb: vec3f =color.rgb*D;rgb=toGammaSpaceVec3(rgb);return vec4<f32>(saturateVec3(rgb),D);}
|
|
72
|
+
fn fromRGBD(rgbd: vec4<f32>)->vec3f {let rgb=toLinearSpaceVec3(rgbd.rgb);return rgb/rgbd.a;}
|
|
73
|
+
fn parallaxCorrectNormal(vertexPos: vec3f,origVec: vec3f,cubeSize: vec3f,cubePos: vec3f)->vec3f {let invOrigVec: vec3f=vec3f(1.)/origVec;let halfSize: vec3f=cubeSize*0.5;let intersecAtMaxPlane: vec3f=(cubePos+halfSize-vertexPos)*invOrigVec;let intersecAtMinPlane: vec3f=(cubePos-halfSize-vertexPos)*invOrigVec;let largestIntersec: vec3f=max(intersecAtMaxPlane,intersecAtMinPlane);let distance: f32=min(min(largestIntersec.x,largestIntersec.y),largestIntersec.z);let intersectPositionWS: vec3f=vertexPos+origVec*distance;return intersectPositionWS-cubePos;}
|
|
74
|
+
fn equirectangularToCubemapDirection(uv : vec2f)->vec3f {var longitude : f32=uv.x*TWO_PI-PI;var latitude : f32=HALF_PI-uv.y*PI;var direction : vec3f;direction.x=cos(latitude)*sin(longitude);direction.y=sin(latitude);direction.z=cos(latitude)*cos(longitude);return direction;}
|
|
75
|
+
fn sqrtClamped(value: f32)->f32 {return sqrt(max(value,0.));}
|
|
76
|
+
fn avg(value: vec3f)->f32 {return dot(value,vec3f(0.333333333));}
|
|
77
|
+
`;
|
|
78
|
+
e.IncludesShadersStoreWGSL[r] || (e.IncludesShadersStoreWGSL[r] = a);
|
|
79
|
+
//# sourceMappingURL=helperFunctions-ZBnqb-in.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helperFunctions-ZBnqb-in.js","sources":["../node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/helperFunctions.js"],"sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore.js\";\nconst name = \"helperFunctions\";\nconst shader = `const PI: f32=3.1415926535897932384626433832795;const TWO_PI: f32=6.283185307179586;const HALF_PI: f32=1.5707963267948966;const RECIPROCAL_PI: f32=0.3183098861837907;const RECIPROCAL_PI2: f32=0.15915494309189535;const RECIPROCAL_PI4: f32=0.07957747154594767;const HALF_MIN: f32=5.96046448e-08; \nconst LinearEncodePowerApprox: f32=2.2;const GammaEncodePowerApprox: f32=1.0/LinearEncodePowerApprox;const LuminanceEncodeApprox: vec3f=vec3f(0.2126,0.7152,0.0722);const Epsilon:f32=0.0000001;fn square(x: f32)->f32 {return x*x;}\nfn saturate(x: f32)->f32 {return clamp(x,0.0,1.0);}\nfn saturateVec3(x: vec3f)->vec3f {return clamp(x,vec3f(),vec3f(1.0));}\nfn saturateEps(x: f32)->f32 {return clamp(x,Epsilon,1.0);}\nfn maxEps(x: f32)->f32 {return max(x,Epsilon);}\nfn maxEpsVec3(x: vec3f)->vec3f {return max(x,vec3f(Epsilon));}\nfn absEps(x: f32)->f32 {return abs(x)+Epsilon;}\nfn transposeMat3(inMatrix: mat3x3f)->mat3x3f {let i0: vec3f=inMatrix[0];let i1: vec3f=inMatrix[1];let i2: vec3f=inMatrix[2];let outMatrix:mat3x3f=mat3x3f(\nvec3(i0.x,i1.x,i2.x),\nvec3(i0.y,i1.y,i2.y),\nvec3(i0.z,i1.z,i2.z)\n);return outMatrix;}\nfn inverseMat3(inMatrix: mat3x3f)->mat3x3f {let a00: f32=inMatrix[0][0];let a01: f32=inMatrix[0][1];let a02: f32=inMatrix[0][2];let a10: f32=inMatrix[1][0];let a11: f32=inMatrix[1][1];let a12: f32=inMatrix[1][2];let a20: f32=inMatrix[2][0];let a21: f32=inMatrix[2][1];let a22: f32=inMatrix[2][2];let b01: f32=a22*a11-a12*a21;let b11: f32=-a22*a10+a12*a20;let b21: f32=a21*a10-a11*a20;let det: f32=a00*b01+a01*b11+a02*b21;return mat3x3f(b01/det,(-a22*a01+a02*a21)/det,(a12*a01-a02*a11)/det,\nb11/det,(a22*a00-a02*a20)/det,(-a12*a00+a02*a10)/det,\nb21/det,(-a21*a00+a01*a20)/det,(a11*a00-a01*a10)/det);}\n#if USE_EXACT_SRGB_CONVERSIONS\nfn toLinearSpaceExact(color: vec3f)->vec3f\n{let nearZeroSection: vec3f=0.0773993808*color;let remainingSection: vec3f=pow(0.947867299*(color+vec3f(0.055)),vec3f(2.4));return mix(remainingSection,nearZeroSection,lessThanEqual(color,vec3f(0.04045)));}\nfn toGammaSpaceExact(color: vec3f)->vec3f\n{let nearZeroSection: vec3f=12.92*color;let remainingSection: vec3f=1.055*pow(color,vec3f(0.41666))-vec3f(0.055);return mix(remainingSection,nearZeroSection,lessThanEqual(color,vec3f(0.0031308)));}\n#endif\nfn toLinearSpace(color: f32)->f32\n{\n#if USE_EXACT_SRGB_CONVERSIONS\nvar nearZeroSection=0.0773993808*color;var remainingSection=pow(0.947867299*(color+0.055),2.4);return select(remainingSection,nearZeroSection,color<=0.04045);\n#else\nreturn pow(color,LinearEncodePowerApprox);\n#endif\n}\nfn toLinearSpaceVec3(color: vec3f)->vec3f\n{\n#if USE_EXACT_SRGB_CONVERSIONS\nreturn toLinearSpaceExact(color);\n#else\nreturn pow(color,vec3f(LinearEncodePowerApprox));\n#endif\n}\nfn toLinearSpaceVec4(color: vec4<f32>)->vec4<f32>\n{\n#if USE_EXACT_SRGB_CONVERSIONS\nreturn vec4f(toLinearSpaceExact(color.rgb),color.a);\n#else\nreturn vec4f(pow(color.rgb,vec3f(LinearEncodePowerApprox)),color.a);\n#endif\n}\nfn toGammaSpace(color: vec4<f32>)->vec4<f32>\n{\n#if USE_EXACT_SRGB_CONVERSIONS\nreturn vec4<f32>(toGammaSpaceExact(color.rgb),color.a);\n#else\nreturn vec4<f32>(pow(color.rgb,vec3f(GammaEncodePowerApprox)),color.a);\n#endif\n}\nfn toGammaSpaceVec3(color: vec3f)->vec3f\n{\n#if USE_EXACT_SRGB_CONVERSIONS\nreturn toGammaSpaceExact(color);\n#else\nreturn pow(color,vec3f(GammaEncodePowerApprox));\n#endif\n}\nfn squareVec3(value: vec3f)->vec3f\n{return value*value;}\nfn pow5(value: f32)->f32 {let sq: f32=value*value;return sq*sq*value;}\nfn getLuminance(color: vec3f)->f32\n{return saturate(dot(color,LuminanceEncodeApprox));}\nfn getRand(seed: vec2<f32>)->f32 {return fract(sin(dot(seed.xy ,vec2<f32>(12.9898,78.233)))*43758.5453);}\nfn dither(seed: vec2<f32>,varianceAmount: f32)->f32 {let rand: f32=getRand(seed);let normVariance: f32=varianceAmount/255.0;let dither: f32=mix(-normVariance,normVariance,rand);return dither;}\nconst rgbdMaxRange: f32=255.0;fn toRGBD(color: vec3f)->vec4<f32> {let maxRGB: f32=max(max(color.r,max(color.g,color.b)),Epsilon);var D: f32 =max(rgbdMaxRange/maxRGB,1.);D =clamp(floor(D)/255.0,0.,1.);var rgb: vec3f =color.rgb*D;rgb=toGammaSpaceVec3(rgb);return vec4<f32>(saturateVec3(rgb),D);}\nfn fromRGBD(rgbd: vec4<f32>)->vec3f {let rgb=toLinearSpaceVec3(rgbd.rgb);return rgb/rgbd.a;}\nfn parallaxCorrectNormal(vertexPos: vec3f,origVec: vec3f,cubeSize: vec3f,cubePos: vec3f)->vec3f {let invOrigVec: vec3f=vec3f(1.)/origVec;let halfSize: vec3f=cubeSize*0.5;let intersecAtMaxPlane: vec3f=(cubePos+halfSize-vertexPos)*invOrigVec;let intersecAtMinPlane: vec3f=(cubePos-halfSize-vertexPos)*invOrigVec;let largestIntersec: vec3f=max(intersecAtMaxPlane,intersecAtMinPlane);let distance: f32=min(min(largestIntersec.x,largestIntersec.y),largestIntersec.z);let intersectPositionWS: vec3f=vertexPos+origVec*distance;return intersectPositionWS-cubePos;}\nfn equirectangularToCubemapDirection(uv : vec2f)->vec3f {var longitude : f32=uv.x*TWO_PI-PI;var latitude : f32=HALF_PI-uv.y*PI;var direction : vec3f;direction.x=cos(latitude)*sin(longitude);direction.y=sin(latitude);direction.z=cos(latitude)*cos(longitude);return direction;}\nfn sqrtClamped(value: f32)->f32 {return sqrt(max(value,0.));}\nfn avg(value: vec3f)->f32 {return dot(value,vec3f(0.333333333));}\n`;\n// Sideeffect\nif (!ShaderStore.IncludesShadersStoreWGSL[name]) {\n ShaderStore.IncludesShadersStoreWGSL[name] = shader;\n}\n/** @internal */\nexport const helperFunctionsWGSL = { name, shader };\n//# sourceMappingURL=helperFunctions.js.map"],"names":["name","shader","ShaderStore"],"mappings":";AAEA,MAAMA,IAAO,mBACPC,IAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA6EVC,EAAY,yBAAyBF,CAAI,MAC1CE,EAAY,yBAAyBF,CAAI,IAAIC;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { L as p } from "./index-ChGTkj2q.js";
|
|
2
|
+
function O(t) {
|
|
3
|
+
return t.split(" ").filter((s) => s !== "").map((s) => parseFloat(s));
|
|
4
|
+
}
|
|
5
|
+
function x(t, s, o) {
|
|
6
|
+
for (; o.length !== s; ) {
|
|
7
|
+
const n = O(t.lines[t.index++]);
|
|
8
|
+
o.push(...n);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
function V(t, s, o) {
|
|
12
|
+
let n = 0, e = 0, r = 0, u = 0, f = 0, h = 0;
|
|
13
|
+
for (let i = 0; i < t.numberOfHorizontalAngles - 1; i++)
|
|
14
|
+
if (o < t.horizontalAngles[i + 1] || i === t.numberOfHorizontalAngles - 2) {
|
|
15
|
+
e = i, r = t.horizontalAngles[i], u = t.horizontalAngles[i + 1];
|
|
16
|
+
break;
|
|
17
|
+
}
|
|
18
|
+
for (let i = 0; i < t.numberOfVerticalAngles - 1; i++)
|
|
19
|
+
if (s < t.verticalAngles[i + 1] || i === t.numberOfVerticalAngles - 2) {
|
|
20
|
+
n = i, f = t.verticalAngles[i], h = t.verticalAngles[i + 1];
|
|
21
|
+
break;
|
|
22
|
+
}
|
|
23
|
+
const c = u - r, A = h - f;
|
|
24
|
+
if (A === 0)
|
|
25
|
+
return 0;
|
|
26
|
+
const g = c === 0 ? 0 : (o - r) / c, b = (s - f) / A, d = c === 0 ? e : e + 1, l = p(t.candelaValues[e][n], t.candelaValues[d][n], g), a = p(t.candelaValues[e][n + 1], t.candelaValues[d][n + 1], g);
|
|
27
|
+
return p(l, a, b);
|
|
28
|
+
}
|
|
29
|
+
function z(t) {
|
|
30
|
+
const n = {
|
|
31
|
+
lines: new TextDecoder("utf-8").decode(t).split(`
|
|
32
|
+
`),
|
|
33
|
+
index: 0
|
|
34
|
+
}, e = { version: n.lines[0], candelaValues: [], horizontalAngles: [], verticalAngles: [], numberOfHorizontalAngles: 0, numberOfVerticalAngles: 0 };
|
|
35
|
+
for (n.index = 1; n.lines.length > 0 && !n.lines[n.index].includes("TILT="); )
|
|
36
|
+
n.index++;
|
|
37
|
+
n.lines[n.index].includes("INCLUDE"), n.index++;
|
|
38
|
+
const r = O(n.lines[n.index++]);
|
|
39
|
+
e.numberOfLights = r[0], e.lumensPerLamp = r[1], e.candelaMultiplier = r[2], e.numberOfVerticalAngles = r[3], e.numberOfHorizontalAngles = r[4], e.photometricType = r[5], e.unitsType = r[6], e.width = r[7], e.length = r[8], e.height = r[9];
|
|
40
|
+
const u = O(n.lines[n.index++]);
|
|
41
|
+
e.ballastFactor = u[0], e.fileGenerationType = u[1], e.inputWatts = u[2];
|
|
42
|
+
for (let l = 0; l < e.numberOfHorizontalAngles; l++)
|
|
43
|
+
e.candelaValues[l] = [];
|
|
44
|
+
x(n, e.numberOfVerticalAngles, e.verticalAngles), x(n, e.numberOfHorizontalAngles, e.horizontalAngles);
|
|
45
|
+
for (let l = 0; l < e.numberOfHorizontalAngles; l++)
|
|
46
|
+
x(n, e.numberOfVerticalAngles, e.candelaValues[l]);
|
|
47
|
+
let f = -1;
|
|
48
|
+
for (let l = 0; l < e.numberOfHorizontalAngles; l++)
|
|
49
|
+
for (let a = 0; a < e.numberOfVerticalAngles; a++)
|
|
50
|
+
e.candelaValues[l][a] *= e.candelaValues[l][a] * e.candelaMultiplier * e.ballastFactor * e.fileGenerationType, f = Math.max(f, e.candelaValues[l][a]);
|
|
51
|
+
if (f > 0)
|
|
52
|
+
for (let l = 0; l < e.numberOfHorizontalAngles; l++)
|
|
53
|
+
for (let a = 0; a < e.numberOfVerticalAngles; a++)
|
|
54
|
+
e.candelaValues[l][a] /= f;
|
|
55
|
+
const h = 180, c = h * 2, A = c * h, g = new Float32Array(c * h), b = e.horizontalAngles[0], d = e.horizontalAngles[e.numberOfHorizontalAngles - 1];
|
|
56
|
+
for (let l = 0; l < A; l++) {
|
|
57
|
+
let a = l % c;
|
|
58
|
+
const m = Math.floor(l / c);
|
|
59
|
+
d - b !== 0 && (a < b || a >= d) && (a %= d * 2, a > d && (a = d * 2 - a)), g[m + a * h] = V(e, m, a);
|
|
60
|
+
}
|
|
61
|
+
return {
|
|
62
|
+
width: c / 2,
|
|
63
|
+
height: 1,
|
|
64
|
+
data: g
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
class y {
|
|
68
|
+
constructor() {
|
|
69
|
+
this.supportCascades = !1;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Uploads the cube texture data to the WebGL texture. It has already been bound.
|
|
73
|
+
*/
|
|
74
|
+
loadCubeData() {
|
|
75
|
+
throw ".ies not supported in Cube.";
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Uploads the 2D texture data to the WebGL texture. It has already been bound once in the callback.
|
|
79
|
+
* @param data contains the texture data
|
|
80
|
+
* @param texture defines the BabylonJS internal texture
|
|
81
|
+
* @param callback defines the method to call once ready to upload
|
|
82
|
+
*/
|
|
83
|
+
loadData(s, o, n) {
|
|
84
|
+
const e = new Uint8Array(s.buffer, s.byteOffset, s.byteLength), r = z(e);
|
|
85
|
+
n(r.width, r.height, !1, !1, () => {
|
|
86
|
+
const u = o.getEngine();
|
|
87
|
+
o.type = 1, o.format = 6, o._gammaSpace = !1, u._uploadDataToTextureDirectly(o, r.data);
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
export {
|
|
92
|
+
y as _IESTextureLoader
|
|
93
|
+
};
|
|
94
|
+
//# sourceMappingURL=iesTextureLoader-JdfAyRK-.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iesTextureLoader-JdfAyRK-.js","sources":["../node_modules/@babylonjs/core/Lights/IES/iesLoader.js","../node_modules/@babylonjs/core/Materials/Textures/Loaders/iesTextureLoader.js"],"sourcesContent":["import { Lerp } from \"../../Maths/math.scalar.functions.js\";\nfunction LineToArray(line) {\n return line\n .split(\" \")\n .filter((x) => x !== \"\")\n .map((x) => parseFloat(x));\n}\nfunction ReadArray(dataPointer, count, targetArray) {\n while (targetArray.length !== count) {\n const line = LineToArray(dataPointer.lines[dataPointer.index++]);\n targetArray.push(...line);\n }\n}\nfunction InterpolateCandelaValues(data, phi, theta) {\n let phiIndex = 0;\n let thetaIndex = 0;\n let startTheta = 0;\n let endTheta = 0;\n let startPhi = 0;\n let endPhi = 0;\n // Check if the angle is outside the range\n for (let index = 0; index < data.numberOfHorizontalAngles - 1; index++) {\n if (theta < data.horizontalAngles[index + 1] || index === data.numberOfHorizontalAngles - 2) {\n thetaIndex = index;\n startTheta = data.horizontalAngles[index];\n endTheta = data.horizontalAngles[index + 1];\n break;\n }\n }\n for (let index = 0; index < data.numberOfVerticalAngles - 1; index++) {\n if (phi < data.verticalAngles[index + 1] || index === data.numberOfVerticalAngles - 2) {\n phiIndex = index;\n startPhi = data.verticalAngles[index];\n endPhi = data.verticalAngles[index + 1];\n break;\n }\n }\n const deltaTheta = endTheta - startTheta;\n const deltaPhi = endPhi - startPhi;\n if (deltaPhi === 0) {\n return 0;\n }\n // Interpolate\n const t1 = deltaTheta === 0 ? 0 : (theta - startTheta) / deltaTheta;\n const t2 = (phi - startPhi) / deltaPhi;\n const nextThetaIndex = deltaTheta === 0 ? thetaIndex : thetaIndex + 1;\n const v1 = Lerp(data.candelaValues[thetaIndex][phiIndex], data.candelaValues[nextThetaIndex][phiIndex], t1);\n const v2 = Lerp(data.candelaValues[thetaIndex][phiIndex + 1], data.candelaValues[nextThetaIndex][phiIndex + 1], t1);\n const v = Lerp(v1, v2, t2);\n return v;\n}\n/**\n * Generates IES data buffer from a string representing the IES data.\n * @param uint8Array defines the IES data\n * @returns the IES data buffer\n * @see https://ieslibrary.com/browse\n * @see https://playground.babylonjs.com/#UQGPDT#1\n */\nexport function LoadIESData(uint8Array) {\n const decoder = new TextDecoder(\"utf-8\");\n const source = decoder.decode(uint8Array);\n // Read data\n const dataPointer = {\n lines: source.split(\"\\n\"),\n index: 0,\n };\n const data = { version: dataPointer.lines[0], candelaValues: [], horizontalAngles: [], verticalAngles: [], numberOfHorizontalAngles: 0, numberOfVerticalAngles: 0 };\n // Skip metadata\n dataPointer.index = 1;\n while (dataPointer.lines.length > 0 && !dataPointer.lines[dataPointer.index].includes(\"TILT=\")) {\n dataPointer.index++;\n }\n // Process tilt data?\n if (dataPointer.lines[dataPointer.index].includes(\"INCLUDE\")) {\n // Not supported yet as I did not manage to find an example :)\n }\n dataPointer.index++;\n // Header\n const header = LineToArray(dataPointer.lines[dataPointer.index++]);\n data.numberOfLights = header[0];\n data.lumensPerLamp = header[1];\n data.candelaMultiplier = header[2];\n data.numberOfVerticalAngles = header[3];\n data.numberOfHorizontalAngles = header[4];\n data.photometricType = header[5]; // We ignore cylindrical type for now. Will add support later if needed\n data.unitsType = header[6];\n data.width = header[7];\n data.length = header[8];\n data.height = header[9];\n // Additional data\n const additionalData = LineToArray(dataPointer.lines[dataPointer.index++]);\n data.ballastFactor = additionalData[0];\n data.fileGenerationType = additionalData[1];\n data.inputWatts = additionalData[2];\n // Prepare arrays\n for (let index = 0; index < data.numberOfHorizontalAngles; index++) {\n data.candelaValues[index] = [];\n }\n // Vertical angles\n ReadArray(dataPointer, data.numberOfVerticalAngles, data.verticalAngles);\n // Horizontal angles\n ReadArray(dataPointer, data.numberOfHorizontalAngles, data.horizontalAngles);\n // Candela values\n for (let index = 0; index < data.numberOfHorizontalAngles; index++) {\n ReadArray(dataPointer, data.numberOfVerticalAngles, data.candelaValues[index]);\n }\n // Evaluate candela values\n let maxCandela = -1;\n for (let index = 0; index < data.numberOfHorizontalAngles; index++) {\n for (let subIndex = 0; subIndex < data.numberOfVerticalAngles; subIndex++) {\n data.candelaValues[index][subIndex] *= data.candelaValues[index][subIndex] * data.candelaMultiplier * data.ballastFactor * data.fileGenerationType;\n maxCandela = Math.max(maxCandela, data.candelaValues[index][subIndex]);\n }\n }\n // Normalize candela values\n if (maxCandela > 0) {\n for (let index = 0; index < data.numberOfHorizontalAngles; index++) {\n for (let subIndex = 0; subIndex < data.numberOfVerticalAngles; subIndex++) {\n data.candelaValues[index][subIndex] /= maxCandela;\n }\n }\n }\n // Create the cylindrical texture\n const height = 180;\n const width = height * 2;\n const size = width * height;\n const arrayBuffer = new Float32Array(width * height);\n // Fill the texture\n const startTheta = data.horizontalAngles[0];\n const endTheta = data.horizontalAngles[data.numberOfHorizontalAngles - 1];\n for (let index = 0; index < size; index++) {\n let theta = index % width;\n const phi = Math.floor(index / width);\n // Symmetry\n if (endTheta - startTheta !== 0 && (theta < startTheta || theta >= endTheta)) {\n theta %= endTheta * 2;\n if (theta > endTheta) {\n theta = endTheta * 2 - theta;\n }\n }\n arrayBuffer[phi + theta * height] = InterpolateCandelaValues(data, phi, theta);\n }\n // So far we only need the first half of the first row of the texture as we only support IES for spot light. We can add support for other types later.\n return {\n width: width / 2,\n height: 1,\n data: arrayBuffer,\n };\n}\n//# sourceMappingURL=iesLoader.js.map","\nimport { LoadIESData } from \"../../../Lights/IES/iesLoader.js\";\n/**\n * Implementation of the IES Texture Loader.\n * @internal\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport class _IESTextureLoader {\n constructor() {\n /**\n * Defines whether the loader supports cascade loading the different faces.\n */\n this.supportCascades = false;\n }\n /**\n * Uploads the cube texture data to the WebGL texture. It has already been bound.\n */\n loadCubeData() {\n // eslint-disable-next-line no-throw-literal\n throw \".ies not supported in Cube.\";\n }\n /**\n * Uploads the 2D texture data to the WebGL texture. It has already been bound once in the callback.\n * @param data contains the texture data\n * @param texture defines the BabylonJS internal texture\n * @param callback defines the method to call once ready to upload\n */\n loadData(data, texture, callback) {\n const uint8array = new Uint8Array(data.buffer, data.byteOffset, data.byteLength);\n const textureData = LoadIESData(uint8array);\n callback(textureData.width, textureData.height, false, false, () => {\n const engine = texture.getEngine();\n texture.type = 1;\n texture.format = 6;\n texture._gammaSpace = false;\n engine._uploadDataToTextureDirectly(texture, textureData.data);\n });\n }\n}\n//# sourceMappingURL=iesTextureLoader.js.map"],"names":["LineToArray","line","x","ReadArray","dataPointer","count","targetArray","InterpolateCandelaValues","data","phi","theta","phiIndex","thetaIndex","startTheta","endTheta","startPhi","endPhi","index","deltaTheta","deltaPhi","t1","t2","nextThetaIndex","v1","Lerp","v2","LoadIESData","uint8Array","header","additionalData","maxCandela","subIndex","height","width","size","arrayBuffer","_IESTextureLoader","texture","callback","uint8array","textureData","engine"],"mappings":";AACA,SAASA,EAAYC,GAAM;AACvB,SAAOA,EACF,MAAM,GAAG,EACT,OAAO,CAACC,MAAMA,MAAM,EAAE,EACtB,IAAI,CAACA,MAAM,WAAWA,CAAC,CAAC;AACjC;AACA,SAASC,EAAUC,GAAaC,GAAOC,GAAa;AAChD,SAAOA,EAAY,WAAWD,KAAO;AACjC,UAAMJ,IAAOD,EAAYI,EAAY,MAAMA,EAAY,OAAO,CAAC;AAC/D,IAAAE,EAAY,KAAK,GAAGL,CAAI;AAAA,EAChC;AACA;AACA,SAASM,EAAyBC,GAAMC,GAAKC,GAAO;AAChD,MAAIC,IAAW,GACXC,IAAa,GACbC,IAAa,GACbC,IAAW,GACXC,IAAW,GACXC,IAAS;AAEb,WAASC,IAAQ,GAAGA,IAAQT,EAAK,2BAA2B,GAAGS;AAC3D,QAAIP,IAAQF,EAAK,iBAAiBS,IAAQ,CAAC,KAAKA,MAAUT,EAAK,2BAA2B,GAAG;AACzF,MAAAI,IAAaK,GACbJ,IAAaL,EAAK,iBAAiBS,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