@vived/component-pneumatic-panel 1.1.1 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/README.md +3 -1
  2. package/dist/Domain/Controllers/applyPanelState.d.ts +4 -0
  3. package/dist/Domain/Controllers/applyPanelState.d.ts.map +1 -0
  4. package/dist/Domain/Controllers/getPanelState.d.ts +4 -0
  5. package/dist/Domain/Controllers/getPanelState.d.ts.map +1 -0
  6. package/dist/Domain/Controllers/onPanelHoverEnter.d.ts +7 -0
  7. package/dist/Domain/Controllers/onPanelHoverEnter.d.ts.map +1 -0
  8. package/dist/Domain/Controllers/onPanelHoverExit.d.ts +7 -0
  9. package/dist/Domain/Controllers/onPanelHoverExit.d.ts.map +1 -0
  10. package/dist/Domain/Controllers/panelHitboxHoverEnter.d.ts +7 -0
  11. package/dist/Domain/Controllers/panelHitboxHoverEnter.d.ts.map +1 -0
  12. package/dist/Domain/Controllers/panelHitboxHoverExit.d.ts +7 -0
  13. package/dist/Domain/Controllers/panelHitboxHoverExit.d.ts.map +1 -0
  14. package/dist/Domain/Controllers/panelStateDefaults.d.ts +8 -0
  15. package/dist/Domain/Controllers/panelStateDefaults.d.ts.map +1 -0
  16. package/dist/Domain/Mocks/MockPneumaticPanelSelectUC.d.ts +5 -1
  17. package/dist/Domain/Mocks/MockPneumaticPanelSelectUC.d.ts.map +1 -1
  18. package/dist/Domain/UCs/PneumaticPanelSelectUC.d.ts +14 -0
  19. package/dist/Domain/UCs/PneumaticPanelSelectUC.d.ts.map +1 -1
  20. package/dist/Domain/makeDomainForTesting.d.ts +6 -0
  21. package/dist/Domain/makeDomainForTesting.d.ts.map +1 -0
  22. package/dist/Frameworks/Babylon/PanelOutlineController.d.ts +32 -0
  23. package/dist/Frameworks/Babylon/PanelOutlineController.d.ts.map +1 -0
  24. package/dist/Frameworks/Babylon/PneumaticPanelBabylonView.d.ts.map +1 -1
  25. package/dist/Frameworks/Babylon/PneumaticPanelHitboxView.d.ts +2 -1
  26. package/dist/Frameworks/Babylon/PneumaticPanelHitboxView.d.ts.map +1 -1
  27. package/dist/PneumaticPanelFacade.d.ts +128 -0
  28. package/dist/PneumaticPanelFacade.d.ts.map +1 -0
  29. package/dist/clipPlaneFragment-BRmzi2tV.js +55 -0
  30. package/dist/clipPlaneFragment-CDdVuU0n.js +55 -0
  31. package/dist/clipPlaneVertex-CIEg9nQi.js +358 -0
  32. package/dist/clipPlaneVertex-CIarPzTc.js +391 -0
  33. package/dist/dumpTools-BUC-AUZt.js +110 -0
  34. package/dist/glowBlurPostProcess.fragment-DDhSDO38.js +13 -0
  35. package/dist/glowBlurPostProcess.fragment-fpk0xJVe.js +13 -0
  36. package/dist/glowMapGeneration.fragment-BBSNxu8K.js +193 -0
  37. package/dist/glowMapGeneration.fragment-Cl-xwsZp.js +161 -0
  38. package/dist/glowMapGeneration.vertex-CzQHgJdT.js +85 -0
  39. package/dist/glowMapGeneration.vertex-DErxE57o.js +85 -0
  40. package/dist/glowMapMerge.vertex-BQosy0g5.js +14 -0
  41. package/dist/glowMapMerge.vertex-tVYqLRGm.js +13 -0
  42. package/dist/index-CmNnQLDH.js +36863 -0
  43. package/dist/index.d.ts +7 -0
  44. package/dist/index.d.ts.map +1 -1
  45. package/dist/index.js +51 -5192
  46. package/dist/pass.fragment-D3pYn4R1.js +10 -0
  47. package/dist/selection.fragment-CGZK1kVt.js +45 -0
  48. package/dist/selection.fragment-DjWRsu7R.js +45 -0
  49. package/dist/selection.vertex-DY_1B2lX.js +84 -0
  50. package/dist/selection.vertex-PhS5tOTA.js +83 -0
  51. package/dist/selectionOutline.fragment-Bp__J_pC.js +53 -0
  52. package/dist/selectionOutline.fragment-DmyQJACa.js +54 -0
  53. package/dist/thinEngine-dZnz-Owz.js +4 -0
  54. package/package.json +1 -1
@@ -0,0 +1,193 @@
1
+ import { S as e } from "./index-CmNnQLDH.js";
2
+ import { a as i, c } from "./clipPlaneFragment-BRmzi2tV.js";
3
+ const o = "helperFunctions", t = `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;
4
+ 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;
5
+ #define saturate(x) clamp(x,0.0,1.0)
6
+ #define absEps(x) abs(x)+Epsilon
7
+ #define maxEps(x) max(x,Epsilon)
8
+ #define saturateEps(x) clamp(x,Epsilon,1.0)
9
+ mat3 transposeMat3(mat3 inMatrix) {vec3 i0=inMatrix[0];vec3 i1=inMatrix[1];vec3 i2=inMatrix[2];mat3 outMatrix=mat3(
10
+ vec3(i0.x,i1.x,i2.x),
11
+ vec3(i0.y,i1.y,i2.y),
12
+ vec3(i0.z,i1.z,i2.z)
13
+ );return outMatrix;}
14
+ 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),
15
+ b11,(a22*a00-a02*a20),(-a12*a00+a02*a10),
16
+ b21,(-a21*a00+a01*a20),(a11*a00-a01*a10))/det;}
17
+ #if USE_EXACT_SRGB_CONVERSIONS
18
+ vec3 toLinearSpaceExact(vec3 color)
19
+ {vec3 nearZeroSection=0.0773993808*color;vec3 remainingSection=pow(0.947867299*(color+vec3(0.055)),vec3(2.4));
20
+ #if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)
21
+ return mix(remainingSection,nearZeroSection,lessThanEqual(color,vec3(0.04045)));
22
+ #else
23
+ return
24
+ vec3(
25
+ color.r<=0.04045 ? nearZeroSection.r : remainingSection.r,
26
+ color.g<=0.04045 ? nearZeroSection.g : remainingSection.g,
27
+ color.b<=0.04045 ? nearZeroSection.b : remainingSection.b);
28
+ #endif
29
+ }
30
+ vec3 toGammaSpaceExact(vec3 color)
31
+ {vec3 nearZeroSection=12.92*color;vec3 remainingSection=1.055*pow(color,vec3(0.41666))-vec3(0.055);
32
+ #if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)
33
+ return mix(remainingSection,nearZeroSection,lessThanEqual(color,vec3(0.0031308)));
34
+ #else
35
+ return
36
+ vec3(
37
+ color.r<=0.0031308 ? nearZeroSection.r : remainingSection.r,
38
+ color.g<=0.0031308 ? nearZeroSection.g : remainingSection.g,
39
+ color.b<=0.0031308 ? nearZeroSection.b : remainingSection.b);
40
+ #endif
41
+ }
42
+ #endif
43
+ float toLinearSpace(float color)
44
+ {
45
+ #if USE_EXACT_SRGB_CONVERSIONS
46
+ float nearZeroSection=0.0773993808*color;float remainingSection=pow(0.947867299*(color+0.055),2.4);return color<=0.04045 ? nearZeroSection : remainingSection;
47
+ #else
48
+ return pow(color,LinearEncodePowerApprox);
49
+ #endif
50
+ }
51
+ vec3 toLinearSpace(vec3 color)
52
+ {
53
+ #if USE_EXACT_SRGB_CONVERSIONS
54
+ return toLinearSpaceExact(color);
55
+ #else
56
+ return pow(color,vec3(LinearEncodePowerApprox));
57
+ #endif
58
+ }
59
+ vec4 toLinearSpace(vec4 color)
60
+ {
61
+ #if USE_EXACT_SRGB_CONVERSIONS
62
+ return vec4(toLinearSpaceExact(color.rgb),color.a);
63
+ #else
64
+ return vec4(pow(color.rgb,vec3(LinearEncodePowerApprox)),color.a);
65
+ #endif
66
+ }
67
+ float toGammaSpace(float color)
68
+ {
69
+ #if USE_EXACT_SRGB_CONVERSIONS
70
+ float nearZeroSection=12.92*color;float remainingSection=1.055*pow(color,0.41666)-0.055;return color<=0.0031308 ? nearZeroSection : remainingSection;
71
+ #else
72
+ return pow(color,GammaEncodePowerApprox);
73
+ #endif
74
+ }
75
+ vec3 toGammaSpace(vec3 color)
76
+ {
77
+ #if USE_EXACT_SRGB_CONVERSIONS
78
+ return toGammaSpaceExact(color);
79
+ #else
80
+ return pow(color,vec3(GammaEncodePowerApprox));
81
+ #endif
82
+ }
83
+ vec4 toGammaSpace(vec4 color)
84
+ {
85
+ #if USE_EXACT_SRGB_CONVERSIONS
86
+ return vec4(toGammaSpaceExact(color.rgb),color.a);
87
+ #else
88
+ return vec4(pow(color.rgb,vec3(GammaEncodePowerApprox)),color.a);
89
+ #endif
90
+ }
91
+ float square(float value)
92
+ {return value*value;}
93
+ vec3 square(vec3 value)
94
+ {return value*value;}
95
+ float pow5(float value) {float sq=value*value;return sq*sq*value;}
96
+ vec3 double_refract(vec3 I,vec3 N,float eta) {vec3 Tfront=refract(I,N,1.0/eta);vec3 Nback=normalize(reflect(N,Tfront));return refract(Tfront,-Nback,eta);}
97
+ float getLuminanceUnclamped(vec3 color)
98
+ {return dot(color,LuminanceEncodeApprox);}
99
+ float getLuminance(vec3 color)
100
+ {return saturate(getLuminanceUnclamped(color));}
101
+ float getRand(vec2 seed) {return fract(sin(dot(seed.xy ,vec2(12.9898,78.233)))*43758.5453);}
102
+ float dither(vec2 seed,float varianceAmount) {float rand=getRand(seed);float normVariance=varianceAmount/255.0;float dither=mix(-normVariance,normVariance,rand);return dither;}
103
+ 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);}
104
+ vec3 fromRGBD(vec4 rgbd) {rgbd.rgb=toLinearSpace(rgbd.rgb);return rgbd.rgb/rgbd.a;}
105
+ 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;}
106
+ 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;}
107
+ float sqrtClamped(float value) {return sqrt(max(value,0.));}
108
+ float avg(vec3 value) {return dot(value,vec3(0.333333333));}
109
+ #if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)
110
+ uint extractBits(uint value,int offset,int width) {return (value>>offset) & ((1u<<width)-1u);}
111
+ int onlyBitPosition(uint value) {return (floatBitsToInt(float(value))>>23)-0x7f;}
112
+ vec3 singleScatterToMultiScatterAlbedo(vec3 rho_ss) {vec3 s=sqrt(max(vec3(1.0)-rho_ss,vec3(0.0)));return (vec3(1.0)-s)*(vec3(1.0)-vec3(0.139)*s)/(vec3(1.0)+vec3(1.17)*s);}
113
+ vec3 multiScatterToSingleScatterAlbedo(vec3 rho_ms) {vec3 s=4.09712+4.20863*rho_ms-sqrt(9.59217+41.6808*rho_ms+17.7126*rho_ms*rho_ms);return 1.0-s*s;}
114
+ vec3 multiScatterToSingleScatterAlbedo(vec3 rho_ms,float aniso) {vec3 s=4.09712+4.20863*rho_ms-sqrt(9.59217+41.6808*rho_ms+17.7126*rho_ms*rho_ms);return (1.0-s*s)/maxEps(1.0-aniso*s*s);}
115
+ float min3(vec3 v) {return min(v.x,min(v.y,v.z));}
116
+ float max3(vec3 v) {return max(v.x,max(v.y,v.z));}
117
+ float uint2float(uint i) {return uintBitsToFloat(0x3F800000u | (i>>9u))-1.0;}
118
+ vec2 plasticSequence(const uint rstate) {return vec2(uint2float(rstate*3242174889u),
119
+ uint2float(rstate*2447445414u));}
120
+ #endif
121
+ `;
122
+ e.IncludesShadersStore[o] || (e.IncludesShadersStore[o] = t);
123
+ const l = { name: o, shader: t }, r = "glowMapGenerationPixelShader", n = `#if defined(DIFFUSE_ISLINEAR) || defined(EMISSIVE_ISLINEAR)
124
+ #include<helperFunctions>
125
+ #endif
126
+ #ifdef DIFFUSE
127
+ varying vec2 vUVDiffuse;uniform sampler2D diffuseSampler;
128
+ #endif
129
+ #ifdef OPACITY
130
+ varying vec2 vUVOpacity;uniform sampler2D opacitySampler;uniform float opacityIntensity;
131
+ #endif
132
+ #ifdef EMISSIVE
133
+ varying vec2 vUVEmissive;uniform sampler2D emissiveSampler;
134
+ #endif
135
+ #ifdef VERTEXALPHA
136
+ varying vec4 vColor;
137
+ #endif
138
+ uniform vec4 glowColor;uniform float glowIntensity;
139
+ #include<clipPlaneFragmentDeclaration>
140
+ #define CUSTOM_FRAGMENT_DEFINITIONS
141
+ void main(void)
142
+ {
143
+ #include<clipPlaneFragment>
144
+ vec4 finalColor=glowColor;
145
+ #ifdef DIFFUSE
146
+ vec4 albedoTexture=texture2D(diffuseSampler,vUVDiffuse);
147
+ #ifdef DIFFUSE_ISLINEAR
148
+ albedoTexture=toGammaSpace(albedoTexture);
149
+ #endif
150
+ #ifdef GLOW
151
+ finalColor.a*=albedoTexture.a;
152
+ #endif
153
+ #ifdef HIGHLIGHT
154
+ finalColor.a=albedoTexture.a;
155
+ #endif
156
+ #endif
157
+ #ifdef OPACITY
158
+ vec4 opacityMap=texture2D(opacitySampler,vUVOpacity);
159
+ #ifdef OPACITYRGB
160
+ finalColor.a*=getLuminance(opacityMap.rgb);
161
+ #else
162
+ finalColor.a*=opacityMap.a;
163
+ #endif
164
+ finalColor.a*=opacityIntensity;
165
+ #endif
166
+ #ifdef VERTEXALPHA
167
+ finalColor.a*=vColor.a;
168
+ #endif
169
+ #ifdef ALPHATEST
170
+ if (finalColor.a<ALPHATESTVALUE)
171
+ discard;
172
+ #endif
173
+ #ifdef EMISSIVE
174
+ vec4 emissive=texture2D(emissiveSampler,vUVEmissive);
175
+ #ifdef EMISSIVE_ISLINEAR
176
+ emissive=toGammaSpace(emissive);
177
+ #endif
178
+ gl_FragColor=emissive*finalColor*glowIntensity;
179
+ #else
180
+ gl_FragColor=finalColor*glowIntensity;
181
+ #endif
182
+ #ifdef HIGHLIGHT
183
+ gl_FragColor.a=glowColor.a;
184
+ #endif
185
+ }`;
186
+ e.ShadersStore[r] || (e.ShadersStore[r] = n);
187
+ const f = [l, i, c];
188
+ for (const a of f)
189
+ e.IncludesShadersStore[a.name] || (e.IncludesShadersStore[a.name] = a.shader);
190
+ const d = { name: r, shader: n };
191
+ export {
192
+ d as glowMapGenerationPixelShader
193
+ };
@@ -0,0 +1,161 @@
1
+ import { S as e } from "./index-CmNnQLDH.js";
2
+ import { c as o, a as c } from "./clipPlaneFragment-CDdVuU0n.js";
3
+ const a = "helperFunctions", t = `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;
4
+ 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;}
5
+ fn saturate(x: f32)->f32 {return clamp(x,0.0,1.0);}
6
+ fn saturateVec3(x: vec3f)->vec3f {return clamp(x,vec3f(),vec3f(1.0));}
7
+ fn saturateEps(x: f32)->f32 {return clamp(x,Epsilon,1.0);}
8
+ fn maxEps(x: f32)->f32 {return max(x,Epsilon);}
9
+ fn maxEpsVec3(x: vec3f)->vec3f {return max(x,vec3f(Epsilon));}
10
+ fn absEps(x: f32)->f32 {return abs(x)+Epsilon;}
11
+ fn transposeMat3(inMatrix: mat3x3f)->mat3x3f {let i0: vec3f=inMatrix[0];let i1: vec3f=inMatrix[1];let i2: vec3f=inMatrix[2];let outMatrix:mat3x3f=mat3x3f(
12
+ vec3(i0.x,i1.x,i2.x),
13
+ vec3(i0.y,i1.y,i2.y),
14
+ vec3(i0.z,i1.z,i2.z)
15
+ );return outMatrix;}
16
+ 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,
17
+ b11/det,(a22*a00-a02*a20)/det,(-a12*a00+a02*a10)/det,
18
+ b21/det,(-a21*a00+a01*a20)/det,(a11*a00-a01*a10)/det);}
19
+ #if USE_EXACT_SRGB_CONVERSIONS
20
+ fn toLinearSpaceExact(color: vec3f)->vec3f
21
+ {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)));}
22
+ fn toGammaSpaceExact(color: vec3f)->vec3f
23
+ {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)));}
24
+ #endif
25
+ fn toLinearSpace(color: f32)->f32
26
+ {
27
+ #if USE_EXACT_SRGB_CONVERSIONS
28
+ var nearZeroSection=0.0773993808*color;var remainingSection=pow(0.947867299*(color+0.055),2.4);return select(remainingSection,nearZeroSection,color<=0.04045);
29
+ #else
30
+ return pow(color,LinearEncodePowerApprox);
31
+ #endif
32
+ }
33
+ fn toLinearSpaceVec3(color: vec3f)->vec3f
34
+ {
35
+ #if USE_EXACT_SRGB_CONVERSIONS
36
+ return toLinearSpaceExact(color);
37
+ #else
38
+ return pow(color,vec3f(LinearEncodePowerApprox));
39
+ #endif
40
+ }
41
+ fn toLinearSpaceVec4(color: vec4<f32>)->vec4<f32>
42
+ {
43
+ #if USE_EXACT_SRGB_CONVERSIONS
44
+ return vec4f(toLinearSpaceExact(color.rgb),color.a);
45
+ #else
46
+ return vec4f(pow(color.rgb,vec3f(LinearEncodePowerApprox)),color.a);
47
+ #endif
48
+ }
49
+ fn toGammaSpace(color: vec4<f32>)->vec4<f32>
50
+ {
51
+ #if USE_EXACT_SRGB_CONVERSIONS
52
+ return vec4<f32>(toGammaSpaceExact(color.rgb),color.a);
53
+ #else
54
+ return vec4<f32>(pow(color.rgb,vec3f(GammaEncodePowerApprox)),color.a);
55
+ #endif
56
+ }
57
+ fn toGammaSpaceVec3(color: vec3f)->vec3f
58
+ {
59
+ #if USE_EXACT_SRGB_CONVERSIONS
60
+ return toGammaSpaceExact(color);
61
+ #else
62
+ return pow(color,vec3f(GammaEncodePowerApprox));
63
+ #endif
64
+ }
65
+ fn squareVec3(value: vec3f)->vec3f
66
+ {return value*value;}
67
+ fn pow5(value: f32)->f32 {let sq: f32=value*value;return sq*sq*value;}
68
+ fn double_refract(I: vec3f,N: vec3f,eta: f32)->vec3f {let Tfront: vec3f=refract(I,N,1.0/eta);let Nback: vec3f=normalize(reflect(N,Tfront));return refract(Tfront,-Nback,eta);}
69
+ fn getLuminanceUnclamped(color: vec3f)->f32
70
+ {return dot(color,LuminanceEncodeApprox);}
71
+ fn getLuminance(color: vec3f)->f32
72
+ {return saturate(getLuminanceUnclamped(color));}
73
+ fn getRand(seed: vec2<f32>)->f32 {return fract(sin(dot(seed.xy ,vec2<f32>(12.9898,78.233)))*43758.5453);}
74
+ 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;}
75
+ 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);}
76
+ fn fromRGBD(rgbd: vec4<f32>)->vec3f {let rgb=toLinearSpaceVec3(rgbd.rgb);return rgb/rgbd.a;}
77
+ 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;}
78
+ 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;}
79
+ fn sqrtClamped(value: f32)->f32 {return sqrt(max(value,0.));}
80
+ fn avg(value: vec3f)->f32 {return dot(value,vec3f(0.333333333));}
81
+ fn singleScatterToMultiScatterAlbedo(rho_ss: vec3f)->vec3f {let s: vec3f=sqrt(max(vec3f(1.0)-rho_ss,vec3f(0.0)));return (vec3f(1.0)-s)*(vec3f(1.0)-vec3f(0.139)*s)/(vec3f(1.0)+vec3f(1.17)*s);}
82
+ fn multiScatterToSingleScatterAlbedo(rho_ms: vec3f)->vec3f {let s: vec3f=4.09712f+4.20863f*rho_ms-sqrt(9.59217f+41.6808f*rho_ms+17.7126f*rho_ms*rho_ms);return 1.0f-s*s;}
83
+ fn multiScatterToSingleScatterAlbedoWithAniso(rho_ms: vec3f,aniso: f32)->vec3f {let s: vec3f=4.09712+4.20863f*rho_ms-sqrt(9.59217f+41.6808f*rho_ms+17.7126f*rho_ms*rho_ms);return (vec3f(1.0f)-s*s)/maxEpsVec3(vec3f(1.0f)-vec3f(aniso)*s*s);}
84
+ fn min3(v: vec3f)->f32 {return min(v.x,min(v.y,v.z));}
85
+ fn max3(v: vec3f)->f32 {return max(v.x,max(v.y,v.z));}
86
+ fn uint2float(i: u32)->f32 {return bitcast<f32>(0x3F800000u | (i>>9u))-1.0;}
87
+ fn plasticSequence(rstate: u32)->vec2f {return vec2f(uint2float(rstate*3242174889u),
88
+ uint2float(rstate*2447445414u));}
89
+ `;
90
+ e.IncludesShadersStoreWGSL[a] || (e.IncludesShadersStoreWGSL[a] = t);
91
+ const i = { name: a, shader: t }, n = "glowMapGenerationPixelShader", f = `#if defined(DIFFUSE_ISLINEAR) || defined(EMISSIVE_ISLINEAR)
92
+ #include<helperFunctions>
93
+ #endif
94
+ #ifdef DIFFUSE
95
+ varying vUVDiffuse: vec2f;var diffuseSamplerSampler: sampler;var diffuseSampler: texture_2d<f32>;
96
+ #endif
97
+ #ifdef OPACITY
98
+ varying vUVOpacity: vec2f;var opacitySamplerSampler: sampler;var opacitySampler: texture_2d<f32>;uniform opacityIntensity: f32;
99
+ #endif
100
+ #ifdef EMISSIVE
101
+ varying vUVEmissive: vec2f;var emissiveSamplerSampler: sampler;var emissiveSampler: texture_2d<f32>;
102
+ #endif
103
+ #ifdef VERTEXALPHA
104
+ varying vColor: vec4f;
105
+ #endif
106
+ uniform glowColor: vec4f;uniform glowIntensity: f32;
107
+ #include<clipPlaneFragmentDeclaration>
108
+ #define CUSTOM_FRAGMENT_DEFINITIONS
109
+ @fragment
110
+ fn main(input: FragmentInputs)->FragmentOutputs {
111
+ #include<clipPlaneFragment>
112
+ var finalColor: vec4f=uniforms.glowColor;
113
+ #ifdef DIFFUSE
114
+ var albedoTexture: vec4f=textureSample(diffuseSampler,diffuseSamplerSampler,fragmentInputs.vUVDiffuse);
115
+ #ifdef DIFFUSE_ISLINEAR
116
+ albedoTexture=toGammaSpace(albedoTexture);
117
+ #endif
118
+ #ifdef GLOW
119
+ finalColor=vec4f(finalColor.rgb,finalColor.a*albedoTexture.a);
120
+ #endif
121
+ #ifdef HIGHLIGHT
122
+ finalColor=vec4f(finalColor.rgb,albedoTexture.a);
123
+ #endif
124
+ #endif
125
+ #ifdef OPACITY
126
+ var opacityMap: vec4f=textureSample(opacitySampler,opacitySamplerSampler,fragmentInputs.vUVOpacity);
127
+ #ifdef OPACITYRGB
128
+ finalColor=vec4f(finalColor.rgb,finalColor.a*getLuminance(opacityMap.rgb));
129
+ #else
130
+ finalColor=vec4f(finalColor.rgb,finalColor.a*opacityMap.a);
131
+ #endif
132
+ finalColor=vec4f(finalColor.rgb,finalColor.a*uniforms.opacityIntensity);
133
+ #endif
134
+ #ifdef VERTEXALPHA
135
+ finalColor=vec4f(finalColor.rgb,finalColor.a*fragmentInputs.vColor.a);
136
+ #endif
137
+ #ifdef ALPHATEST
138
+ if (finalColor.a<ALPHATESTVALUE) {discard;}
139
+ #endif
140
+ #ifdef EMISSIVE
141
+ var emissive: vec4f=textureSample(emissiveSampler,emissiveSamplerSampler,fragmentInputs.vUVEmissive);
142
+ #ifdef EMISSIVE_ISLINEAR
143
+ emissive=toGammaSpace(emissive);
144
+ #endif
145
+ fragmentOutputs.color=emissive*finalColor*uniforms.glowIntensity;
146
+ #else
147
+ fragmentOutputs.color=finalColor*uniforms.glowIntensity;
148
+ #endif
149
+ #ifdef HIGHLIGHT
150
+ fragmentOutputs.color=vec4f(fragmentOutputs.color.rgb,uniforms.glowColor.a);
151
+ #endif
152
+ }
153
+ `;
154
+ e.ShadersStoreWGSL[n] || (e.ShadersStoreWGSL[n] = f);
155
+ const l = [i, o, c];
156
+ for (const r of l)
157
+ e.IncludesShadersStoreWGSL[r.name] || (e.IncludesShadersStoreWGSL[r.name] = r.shader);
158
+ const m = { name: n, shader: f };
159
+ export {
160
+ m as glowMapGenerationPixelShaderWGSL
161
+ };
@@ -0,0 +1,85 @@
1
+ import { S as e } from "./index-CmNnQLDH.js";
2
+ import { c as n, a as o, k as r, h as d, f as s, i as f, j as c, m as v, g as l, d as V, b as u, e as p } from "./clipPlaneVertex-CIEg9nQi.js";
3
+ const a = "glowMapGenerationVertexShader", t = `attribute vec3 position;
4
+ #include<bonesDeclaration>
5
+ #include<bakedVertexAnimationDeclaration>
6
+ #include<morphTargetsVertexGlobalDeclaration>
7
+ #include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]
8
+ #include<clipPlaneVertexDeclaration>
9
+ #include<instancesDeclaration>
10
+ uniform mat4 viewProjection;varying vec4 vPosition;
11
+ #ifdef UV1
12
+ attribute vec2 uv;
13
+ #endif
14
+ #ifdef UV2
15
+ attribute vec2 uv2;
16
+ #endif
17
+ #ifdef DIFFUSE
18
+ varying vec2 vUVDiffuse;uniform mat4 diffuseMatrix;
19
+ #endif
20
+ #ifdef OPACITY
21
+ varying vec2 vUVOpacity;uniform mat4 opacityMatrix;
22
+ #endif
23
+ #ifdef EMISSIVE
24
+ varying vec2 vUVEmissive;uniform mat4 emissiveMatrix;
25
+ #endif
26
+ #ifdef VERTEXALPHA
27
+ attribute vec4 color;varying vec4 vColor;
28
+ #endif
29
+ #define CUSTOM_VERTEX_DEFINITIONS
30
+ void main(void)
31
+ {vec3 positionUpdated=position;
32
+ #ifdef UV1
33
+ vec2 uvUpdated=uv;
34
+ #endif
35
+ #ifdef UV2
36
+ vec2 uv2Updated=uv2;
37
+ #endif
38
+ #include<morphTargetsVertexGlobal>
39
+ #include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]
40
+ #include<instancesVertex>
41
+ #include<bonesVertex>
42
+ #include<bakedVertexAnimation>
43
+ vec4 worldPos=finalWorld*vec4(positionUpdated,1.0);
44
+ #ifdef CUBEMAP
45
+ vPosition=worldPos;gl_Position=viewProjection*finalWorld*vec4(position,1.0);
46
+ #else
47
+ vPosition=viewProjection*worldPos;gl_Position=vPosition;
48
+ #endif
49
+ #ifdef DIFFUSE
50
+ #ifdef DIFFUSEUV1
51
+ vUVDiffuse=vec2(diffuseMatrix*vec4(uvUpdated,1.0,0.0));
52
+ #endif
53
+ #ifdef DIFFUSEUV2
54
+ vUVDiffuse=vec2(diffuseMatrix*vec4(uv2Updated,1.0,0.0));
55
+ #endif
56
+ #endif
57
+ #ifdef OPACITY
58
+ #ifdef OPACITYUV1
59
+ vUVOpacity=vec2(opacityMatrix*vec4(uvUpdated,1.0,0.0));
60
+ #endif
61
+ #ifdef OPACITYUV2
62
+ vUVOpacity=vec2(opacityMatrix*vec4(uv2Updated,1.0,0.0));
63
+ #endif
64
+ #endif
65
+ #ifdef EMISSIVE
66
+ #ifdef EMISSIVEUV1
67
+ vUVEmissive=vec2(emissiveMatrix*vec4(uvUpdated,1.0,0.0));
68
+ #endif
69
+ #ifdef EMISSIVEUV2
70
+ vUVEmissive=vec2(emissiveMatrix*vec4(uv2Updated,1.0,0.0));
71
+ #endif
72
+ #endif
73
+ #ifdef VERTEXALPHA
74
+ vColor=color;
75
+ #endif
76
+ #include<clipPlaneVertex>
77
+ }`;
78
+ e.ShadersStore[a] || (e.ShadersStore[a] = t);
79
+ const m = [n, o, r, d, s, f, c, v, l, V, u, p];
80
+ for (const i of m)
81
+ e.IncludesShadersStore[i.name] || (e.IncludesShadersStore[i.name] = i.shader);
82
+ const S = { name: a, shader: t };
83
+ export {
84
+ S as glowMapGenerationVertexShader
85
+ };
@@ -0,0 +1,85 @@
1
+ import { S as e } from "./index-CmNnQLDH.js";
2
+ import { c as a, b as n, h as f, m as o, e as s, i as d, j as u, k as v, g as c, d as x, a as p, f as l } from "./clipPlaneVertex-CIarPzTc.js";
3
+ const t = "glowMapGenerationVertexShader", r = `attribute position: vec3f;
4
+ #include<bonesDeclaration>
5
+ #include<bakedVertexAnimationDeclaration>
6
+ #include<morphTargetsVertexGlobalDeclaration>
7
+ #include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]
8
+ #include<clipPlaneVertexDeclaration>
9
+ #include<instancesDeclaration>
10
+ uniform viewProjection: mat4x4f;varying vPosition: vec4f;
11
+ #ifdef UV1
12
+ attribute uv: vec2f;
13
+ #endif
14
+ #ifdef UV2
15
+ attribute uv2: vec2f;
16
+ #endif
17
+ #ifdef DIFFUSE
18
+ varying vUVDiffuse: vec2f;uniform diffuseMatrix: mat4x4f;
19
+ #endif
20
+ #ifdef OPACITY
21
+ varying vUVOpacity: vec2f;uniform opacityMatrix: mat4x4f;
22
+ #endif
23
+ #ifdef EMISSIVE
24
+ varying vUVEmissive: vec2f;uniform emissiveMatrix: mat4x4f;
25
+ #endif
26
+ #ifdef VERTEXALPHA
27
+ attribute color: vec4f;varying vColor: vec4f;
28
+ #endif
29
+ #define CUSTOM_VERTEX_DEFINITIONS
30
+ @vertex
31
+ fn main(input : VertexInputs)->FragmentInputs {var positionUpdated: vec3f=vertexInputs.position;
32
+ #ifdef UV1
33
+ var uvUpdated: vec2f=vertexInputs.uv;
34
+ #endif
35
+ #ifdef UV2
36
+ var uv2Updated: vec2f=vertexInputs.uv2;
37
+ #endif
38
+ #include<morphTargetsVertexGlobal>
39
+ #include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]
40
+ #include<instancesVertex>
41
+ #include<bonesVertex>
42
+ #include<bakedVertexAnimation>
43
+ var worldPos: vec4f=finalWorld* vec4f(positionUpdated,1.0);
44
+ #ifdef CUBEMAP
45
+ vertexOutputs.vPosition=worldPos;vertexOutputs.position=uniforms.viewProjection*finalWorld* vec4f(vertexInputs.position,1.0);
46
+ #else
47
+ vertexOutputs.vPosition=uniforms.viewProjection*worldPos;vertexOutputs.position=vertexOutputs.vPosition;
48
+ #endif
49
+ #ifdef DIFFUSE
50
+ #ifdef DIFFUSEUV1
51
+ vertexOutputs.vUVDiffuse= (uniforms.diffuseMatrix* vec4f(uvUpdated,1.0,0.0)).xy;
52
+ #endif
53
+ #ifdef DIFFUSEUV2
54
+ vertexOutputs.vUVDiffuse= (uniforms.diffuseMatrix* vec4f(uv2Updated,1.0,0.0)).xy;
55
+ #endif
56
+ #endif
57
+ #ifdef OPACITY
58
+ #ifdef OPACITYUV1
59
+ vertexOutputs.vUVOpacity= (uniforms.opacityMatrix* vec4f(uvUpdated,1.0,0.0)).xy;
60
+ #endif
61
+ #ifdef OPACITYUV2
62
+ vertexOutputs.vUVOpacity= (uniforms.opacityMatrix* vec4f(uv2Updated,1.0,0.0)).xy;
63
+ #endif
64
+ #endif
65
+ #ifdef EMISSIVE
66
+ #ifdef EMISSIVEUV1
67
+ vertexOutputs.vUVEmissive= (uniforms.emissiveMatrix* vec4f(uvUpdated,1.0,0.0)).xy;
68
+ #endif
69
+ #ifdef EMISSIVEUV2
70
+ vertexOutputs.vUVEmissive= (uniforms.emissiveMatrix* vec4f(uv2Updated,1.0,0.0)).xy;
71
+ #endif
72
+ #endif
73
+ #ifdef VERTEXALPHA
74
+ vertexOutputs.vColor=vertexInputs.color;
75
+ #endif
76
+ #include<clipPlaneVertex>
77
+ }`;
78
+ e.ShadersStoreWGSL[t] || (e.ShadersStoreWGSL[t] = r);
79
+ const V = [a, n, f, o, s, d, u, v, c, x, p, l];
80
+ for (const i of V)
81
+ e.IncludesShadersStoreWGSL[i.name] || (e.IncludesShadersStoreWGSL[i.name] = i.shader);
82
+ const U = { name: t, shader: r };
83
+ export {
84
+ U as glowMapGenerationVertexShaderWGSL
85
+ };
@@ -0,0 +1,14 @@
1
+ import { S as t } from "./index-CmNnQLDH.js";
2
+ const e = "glowMapMergeVertexShader", r = `attribute position: vec2f;varying vUV: vec2f;
3
+ #define CUSTOM_VERTEX_DEFINITIONS
4
+ @vertex
5
+ fn main(input : VertexInputs)->FragmentInputs {const madd: vec2f= vec2f(0.5,0.5);
6
+ #define CUSTOM_VERTEX_MAIN_BEGIN
7
+ vertexOutputs.vUV=vertexInputs.position*madd+madd;vertexOutputs.position= vec4f(vertexInputs.position,0.0,1.0);
8
+ #define CUSTOM_VERTEX_MAIN_END
9
+ }`;
10
+ t.ShadersStoreWGSL[e] || (t.ShadersStoreWGSL[e] = r);
11
+ const o = { name: e, shader: r };
12
+ export {
13
+ o as glowMapMergeVertexShaderWGSL
14
+ };
@@ -0,0 +1,13 @@
1
+ import { S as o } from "./index-CmNnQLDH.js";
2
+ const e = "glowMapMergeVertexShader", i = `attribute vec2 position;varying vec2 vUV;const vec2 madd=vec2(0.5,0.5);
3
+ #define CUSTOM_VERTEX_DEFINITIONS
4
+ void main(void) {
5
+ #define CUSTOM_VERTEX_MAIN_BEGIN
6
+ vUV=position*madd+madd;gl_Position=vec4(position,0.0,1.0);
7
+ #define CUSTOM_VERTEX_MAIN_END
8
+ }`;
9
+ o.ShadersStore[e] || (o.ShadersStore[e] = i);
10
+ const t = { name: e, shader: i };
11
+ export {
12
+ t as glowMapMergeVertexShader
13
+ };