@vived/component-pneumatic-panel 1.2.0 → 3.0.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.
- package/CHANGELOG.md +212 -0
- package/COMPONENT_KNOWLEDGE.md +642 -0
- package/LICENSE +15 -0
- package/README.md +62 -23
- package/dist/Domain/Adapters/pneumaticPanelPMAdapter.d.ts.map +1 -1
- package/dist/Domain/Controllers/applyPanelState.d.ts.map +1 -1
- package/dist/Domain/Controllers/getPanelState.d.ts.map +1 -1
- package/dist/Domain/Controllers/panelStateDefaults.d.ts +0 -1
- package/dist/Domain/Controllers/panelStateDefaults.d.ts.map +1 -1
- package/dist/Domain/Entities/PneumaticPanelEntity.d.ts +0 -4
- package/dist/Domain/Entities/PneumaticPanelEntity.d.ts.map +1 -1
- package/dist/Domain/Mocks/MockPneumaticPanelSelectUC.d.ts +0 -4
- package/dist/Domain/Mocks/MockPneumaticPanelSelectUC.d.ts.map +1 -1
- package/dist/Domain/PMs/PneumaticPanelPM.d.ts +0 -3
- package/dist/Domain/PMs/PneumaticPanelPM.d.ts.map +1 -1
- package/dist/Domain/UCs/PneumaticPanelCheckPressureUC.d.ts +4 -3
- package/dist/Domain/UCs/PneumaticPanelCheckPressureUC.d.ts.map +1 -1
- package/dist/Domain/UCs/PneumaticPanelSelectUC.d.ts +0 -14
- package/dist/Domain/UCs/PneumaticPanelSelectUC.d.ts.map +1 -1
- package/dist/Frameworks/Babylon/PneumaticPanelBabylonView.d.ts +9 -12
- package/dist/Frameworks/Babylon/PneumaticPanelBabylonView.d.ts.map +1 -1
- package/dist/Frameworks/Babylon/PneumaticPanelExhaustView.d.ts +2 -2
- package/dist/Frameworks/Babylon/PneumaticPanelExhaustView.d.ts.map +1 -1
- package/dist/Frameworks/Babylon/PneumaticPanelGaugeView.d.ts +2 -2
- package/dist/Frameworks/Babylon/PneumaticPanelGaugeView.d.ts.map +1 -1
- package/dist/Frameworks/Babylon/PneumaticPanelHitboxView.d.ts +5 -7
- package/dist/Frameworks/Babylon/PneumaticPanelHitboxView.d.ts.map +1 -1
- package/dist/Frameworks/Babylon/PneumaticPanelLockView.d.ts +2 -2
- package/dist/Frameworks/Babylon/PneumaticPanelLockView.d.ts.map +1 -1
- package/dist/PneumaticPanelFacade.d.ts +1 -13
- package/dist/PneumaticPanelFacade.d.ts.map +1 -1
- package/dist/index.d.ts +1 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1257 -51
- package/package.json +9 -2
- package/dist/.gitkeep +0 -0
- package/dist/Domain/Controllers/clearAllHighlights.d.ts +0 -9
- package/dist/Domain/Controllers/clearAllHighlights.d.ts.map +0 -1
- package/dist/Domain/Controllers/onPanelHoverEnter.d.ts +0 -7
- package/dist/Domain/Controllers/onPanelHoverEnter.d.ts.map +0 -1
- package/dist/Domain/Controllers/onPanelHoverExit.d.ts +0 -7
- package/dist/Domain/Controllers/onPanelHoverExit.d.ts.map +0 -1
- package/dist/Domain/Controllers/panelHitboxHoverEnter.d.ts +0 -7
- package/dist/Domain/Controllers/panelHitboxHoverEnter.d.ts.map +0 -1
- package/dist/Domain/Controllers/panelHitboxHoverExit.d.ts +0 -7
- package/dist/Domain/Controllers/panelHitboxHoverExit.d.ts.map +0 -1
- package/dist/Domain/Controllers/setHighlightedObject.d.ts +0 -11
- package/dist/Domain/Controllers/setHighlightedObject.d.ts.map +0 -1
- package/dist/Frameworks/Babylon/OutlinePulseController.d.ts +0 -18
- package/dist/Frameworks/Babylon/OutlinePulseController.d.ts.map +0 -1
- package/dist/Frameworks/Babylon/OverlayPulseController.d.ts +0 -17
- package/dist/Frameworks/Babylon/OverlayPulseController.d.ts.map +0 -1
- package/dist/Frameworks/Babylon/PanelOutlineController.d.ts +0 -32
- package/dist/Frameworks/Babylon/PanelOutlineController.d.ts.map +0 -1
- package/dist/Frameworks/Babylon/ScreenSpaceOutlinePulseController.d.ts +0 -17
- package/dist/Frameworks/Babylon/ScreenSpaceOutlinePulseController.d.ts.map +0 -1
- package/dist/clipPlaneFragment-BRmzi2tV.js +0 -55
- package/dist/clipPlaneFragment-CDdVuU0n.js +0 -55
- package/dist/clipPlaneVertex-CIEg9nQi.js +0 -358
- package/dist/clipPlaneVertex-CIarPzTc.js +0 -391
- package/dist/dumpTools-BUC-AUZt.js +0 -110
- package/dist/glowBlurPostProcess.fragment-DDhSDO38.js +0 -13
- package/dist/glowBlurPostProcess.fragment-fpk0xJVe.js +0 -13
- package/dist/glowMapGeneration.fragment-BBSNxu8K.js +0 -193
- package/dist/glowMapGeneration.fragment-Cl-xwsZp.js +0 -161
- package/dist/glowMapGeneration.vertex-CzQHgJdT.js +0 -85
- package/dist/glowMapGeneration.vertex-DErxE57o.js +0 -85
- package/dist/glowMapMerge.vertex-BQosy0g5.js +0 -14
- package/dist/glowMapMerge.vertex-tVYqLRGm.js +0 -13
- package/dist/index-CmNnQLDH.js +0 -36863
- package/dist/pass.fragment-D3pYn4R1.js +0 -10
- package/dist/pneumaticPanel.glb +0 -0
- package/dist/selection.fragment-CGZK1kVt.js +0 -45
- package/dist/selection.fragment-DjWRsu7R.js +0 -45
- package/dist/selection.vertex-DY_1B2lX.js +0 -84
- package/dist/selection.vertex-PhS5tOTA.js +0 -83
- package/dist/selectionOutline.fragment-Bp__J_pC.js +0 -53
- package/dist/selectionOutline.fragment-DmyQJACa.js +0 -54
- package/dist/studio.env +0 -0
- package/dist/thinEngine-dZnz-Owz.js +0 -4
|
@@ -1,391 +0,0 @@
|
|
|
1
|
-
import { S as e } from "./index-CmNnQLDH.js";
|
|
2
|
-
const t = "bonesDeclaration", I = `#if NUM_BONE_INFLUENCERS>0
|
|
3
|
-
#ifndef USE_VERTEX_PULLING
|
|
4
|
-
attribute matricesIndices : vec4f;attribute matricesWeights : vec4f;
|
|
5
|
-
#if NUM_BONE_INFLUENCERS>4
|
|
6
|
-
attribute matricesIndicesExtra : vec4f;attribute matricesWeightsExtra : vec4f;
|
|
7
|
-
#endif
|
|
8
|
-
#endif
|
|
9
|
-
#ifndef BAKED_VERTEX_ANIMATION_TEXTURE
|
|
10
|
-
#ifdef BONETEXTURE
|
|
11
|
-
var boneSampler : texture_2d<f32>;uniform boneTextureInfo : vec2f;
|
|
12
|
-
#else
|
|
13
|
-
uniform mBones : array<mat4x4f,BonesPerMesh>;
|
|
14
|
-
#endif
|
|
15
|
-
#ifdef BONES_VELOCITY_ENABLED
|
|
16
|
-
uniform mPreviousBones : array<mat4x4f,BonesPerMesh>;
|
|
17
|
-
#endif
|
|
18
|
-
#ifdef BONETEXTURE
|
|
19
|
-
fn readMatrixFromRawSampler(smp : texture_2d<f32>,index : f32)->mat4x4f
|
|
20
|
-
{let offset=i32(index)*4;
|
|
21
|
-
let textureWidth=i32(uniforms.boneTextureInfo.x);let y=offset/textureWidth;let x=offset % textureWidth;let m0=textureLoad(smp,vec2<i32>(x+0,y),0);let m1=textureLoad(smp,vec2<i32>(x+1,y),0);let m2=textureLoad(smp,vec2<i32>(x+2,y),0);let m3=textureLoad(smp,vec2<i32>(x+3,y),0);return mat4x4f(m0,m1,m2,m3);}
|
|
22
|
-
#endif
|
|
23
|
-
#endif
|
|
24
|
-
#endif
|
|
25
|
-
`;
|
|
26
|
-
e.IncludesShadersStoreWGSL[t] || (e.IncludesShadersStoreWGSL[t] = I);
|
|
27
|
-
const U = { name: t, shader: I }, r = "bakedVertexAnimationDeclaration", c = `#ifdef BAKED_VERTEX_ANIMATION_TEXTURE
|
|
28
|
-
uniform bakedVertexAnimationTime: f32;uniform bakedVertexAnimationSettings: vec4<f32>;var bakedVertexAnimationTexture : texture_2d<f32>;
|
|
29
|
-
#ifdef INSTANCES
|
|
30
|
-
attribute bakedVertexAnimationSettingsInstanced : vec4<f32>;
|
|
31
|
-
#endif
|
|
32
|
-
fn readMatrixFromRawSamplerVAT(smp : texture_2d<f32>,index : f32,frame : f32)->mat4x4<f32>
|
|
33
|
-
{let offset=i32(index)*4;let frameUV=i32(frame);let m0=textureLoad(smp,vec2<i32>(offset+0,frameUV),0);let m1=textureLoad(smp,vec2<i32>(offset+1,frameUV),0);let m2=textureLoad(smp,vec2<i32>(offset+2,frameUV),0);let m3=textureLoad(smp,vec2<i32>(offset+3,frameUV),0);return mat4x4<f32>(m0,m1,m2,m3);}
|
|
34
|
-
#endif
|
|
35
|
-
`;
|
|
36
|
-
e.IncludesShadersStoreWGSL[r] || (e.IncludesShadersStoreWGSL[r] = c);
|
|
37
|
-
const V = { name: r, shader: c }, n = "morphTargetsVertexGlobalDeclaration", p = `#ifdef MORPHTARGETS
|
|
38
|
-
uniform morphTargetInfluences : array<f32,NUM_MORPH_INFLUENCERS>;
|
|
39
|
-
#ifdef MORPHTARGETS_TEXTURE
|
|
40
|
-
uniform morphTargetTextureIndices : array<f32,NUM_MORPH_INFLUENCERS>;uniform morphTargetTextureInfo : vec3<f32>;var morphTargets : texture_2d_array<f32>;fn readVector3FromRawSampler(targetIndex : i32,vertexIndex : f32)->vec3<f32>
|
|
41
|
-
{
|
|
42
|
-
let textureWidth: i32=i32(uniforms.morphTargetTextureInfo.y);let y: i32=i32(vertexIndex)/textureWidth;let x: i32=i32(vertexIndex) % textureWidth;return textureLoad(morphTargets,vec2i(x,y),i32(uniforms.morphTargetTextureIndices[targetIndex]),0).xyz;}
|
|
43
|
-
fn readVector4FromRawSampler(targetIndex : i32,vertexIndex : f32)->vec4<f32>
|
|
44
|
-
{
|
|
45
|
-
let textureWidth: i32=i32(uniforms.morphTargetTextureInfo.y);
|
|
46
|
-
let y: i32=i32(vertexIndex)/textureWidth;let x: i32=i32(vertexIndex) % textureWidth;return textureLoad(morphTargets,vec2i(x,y),i32(uniforms.morphTargetTextureIndices[targetIndex]),0);}
|
|
47
|
-
#endif
|
|
48
|
-
#endif
|
|
49
|
-
`;
|
|
50
|
-
e.IncludesShadersStoreWGSL[n] || (e.IncludesShadersStoreWGSL[n] = p);
|
|
51
|
-
const h = { name: n, shader: p }, i = "morphTargetsVertexDeclaration", x = `#ifdef MORPHTARGETS
|
|
52
|
-
#ifndef MORPHTARGETS_TEXTURE
|
|
53
|
-
#ifdef MORPHTARGETS_POSITION
|
|
54
|
-
attribute position{X} : vec3<f32>;
|
|
55
|
-
#endif
|
|
56
|
-
#ifdef MORPHTARGETS_NORMAL
|
|
57
|
-
attribute normal{X} : vec3<f32>;
|
|
58
|
-
#endif
|
|
59
|
-
#ifdef MORPHTARGETS_TANGENT
|
|
60
|
-
attribute tangent{X} : vec3<f32>;
|
|
61
|
-
#endif
|
|
62
|
-
#ifdef MORPHTARGETS_UV
|
|
63
|
-
attribute uv_{X} : vec2<f32>;
|
|
64
|
-
#endif
|
|
65
|
-
#ifdef MORPHTARGETS_UV2
|
|
66
|
-
attribute uv2_{X} : vec2<f32>;
|
|
67
|
-
#endif
|
|
68
|
-
#ifdef MORPHTARGETS_COLOR
|
|
69
|
-
attribute color{X} : vec4<f32>;
|
|
70
|
-
#endif
|
|
71
|
-
#elif {X}==0
|
|
72
|
-
uniform morphTargetCount: f32;
|
|
73
|
-
#endif
|
|
74
|
-
#endif
|
|
75
|
-
`;
|
|
76
|
-
e.IncludesShadersStoreWGSL[i] || (e.IncludesShadersStoreWGSL[i] = x);
|
|
77
|
-
const O = { name: i, shader: x }, a = "clipPlaneVertexDeclaration", E = `#ifdef CLIPPLANE
|
|
78
|
-
uniform vClipPlane: vec4<f32>;varying fClipDistance: f32;
|
|
79
|
-
#endif
|
|
80
|
-
#ifdef CLIPPLANE2
|
|
81
|
-
uniform vClipPlane2: vec4<f32>;varying fClipDistance2: f32;
|
|
82
|
-
#endif
|
|
83
|
-
#ifdef CLIPPLANE3
|
|
84
|
-
uniform vClipPlane3: vec4<f32>;varying fClipDistance3: f32;
|
|
85
|
-
#endif
|
|
86
|
-
#ifdef CLIPPLANE4
|
|
87
|
-
uniform vClipPlane4: vec4<f32>;varying fClipDistance4: f32;
|
|
88
|
-
#endif
|
|
89
|
-
#ifdef CLIPPLANE5
|
|
90
|
-
uniform vClipPlane5: vec4<f32>;varying fClipDistance5: f32;
|
|
91
|
-
#endif
|
|
92
|
-
#ifdef CLIPPLANE6
|
|
93
|
-
uniform vClipPlane6: vec4<f32>;varying fClipDistance6: f32;
|
|
94
|
-
#endif
|
|
95
|
-
`;
|
|
96
|
-
e.IncludesShadersStoreWGSL[a] || (e.IncludesShadersStoreWGSL[a] = E);
|
|
97
|
-
const P = { name: a, shader: E }, f = "instancesDeclaration", T = `#ifdef INSTANCES
|
|
98
|
-
attribute world0 : vec4<f32>;attribute world1 : vec4<f32>;attribute world2 : vec4<f32>;attribute world3 : vec4<f32>;
|
|
99
|
-
#ifdef INSTANCESCOLOR
|
|
100
|
-
attribute instanceColor : vec4<f32>;
|
|
101
|
-
#endif
|
|
102
|
-
#if defined(THIN_INSTANCES) && !defined(WORLD_UBO)
|
|
103
|
-
uniform world : mat4x4<f32>;
|
|
104
|
-
#endif
|
|
105
|
-
#if defined(VELOCITY) || defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR) || defined(VELOCITY_LINEAR)
|
|
106
|
-
attribute previousWorld0 : vec4<f32>;attribute previousWorld1 : vec4<f32>;attribute previousWorld2 : vec4<f32>;attribute previousWorld3 : vec4<f32>;
|
|
107
|
-
#ifdef THIN_INSTANCES
|
|
108
|
-
uniform previousWorld : mat4x4<f32>;
|
|
109
|
-
#endif
|
|
110
|
-
#endif
|
|
111
|
-
#else
|
|
112
|
-
#if !defined(WORLD_UBO)
|
|
113
|
-
uniform world : mat4x4<f32>;
|
|
114
|
-
#endif
|
|
115
|
-
#if defined(VELOCITY) || defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR) || defined(VELOCITY_LINEAR)
|
|
116
|
-
uniform previousWorld : mat4x4<f32>;
|
|
117
|
-
#endif
|
|
118
|
-
#endif
|
|
119
|
-
`;
|
|
120
|
-
e.IncludesShadersStoreWGSL[f] || (e.IncludesShadersStoreWGSL[f] = T);
|
|
121
|
-
const g = { name: f, shader: T }, d = "morphTargetsVertexGlobal", S = `#ifdef MORPHTARGETS
|
|
122
|
-
#ifdef MORPHTARGETS_TEXTURE
|
|
123
|
-
var vertexID : f32;
|
|
124
|
-
#endif
|
|
125
|
-
#endif
|
|
126
|
-
`;
|
|
127
|
-
e.IncludesShadersStoreWGSL[d] || (e.IncludesShadersStoreWGSL[d] = S);
|
|
128
|
-
const C = { name: d, shader: S }, s = "morphTargetsVertex", v = `#ifdef MORPHTARGETS
|
|
129
|
-
#ifdef MORPHTARGETS_TEXTURE
|
|
130
|
-
#if {X}==0
|
|
131
|
-
for (var i=0; i<NUM_MORPH_INFLUENCERS; i=i+1) {if (f32(i)>=uniforms.morphTargetCount) {break;}
|
|
132
|
-
#ifdef USE_VERTEX_PULLING
|
|
133
|
-
vertexID=f32(vpVertexIndex)*uniforms.morphTargetTextureInfo.x;
|
|
134
|
-
#else
|
|
135
|
-
vertexID=f32(vertexInputs.vertexIndex)*uniforms.morphTargetTextureInfo.x;
|
|
136
|
-
#endif
|
|
137
|
-
#ifdef MORPHTARGETS_POSITION
|
|
138
|
-
#ifdef USE_VERTEX_PULLING
|
|
139
|
-
positionUpdated=positionUpdated+(readVector3FromRawSampler(i,vertexID)-vp_basePosition)*uniforms.morphTargetInfluences[i];
|
|
140
|
-
#else
|
|
141
|
-
positionUpdated=positionUpdated+(readVector3FromRawSampler(i,vertexID)-vertexInputs.position)*uniforms.morphTargetInfluences[i];
|
|
142
|
-
#endif
|
|
143
|
-
#endif
|
|
144
|
-
#ifdef MORPHTARGETTEXTURE_HASPOSITIONS
|
|
145
|
-
vertexID=vertexID+1.0;
|
|
146
|
-
#endif
|
|
147
|
-
#ifdef MORPHTARGETS_NORMAL
|
|
148
|
-
#ifdef USE_VERTEX_PULLING
|
|
149
|
-
normalUpdated=normalUpdated+(readVector3FromRawSampler(i,vertexID) -vp_baseNormal)*uniforms.morphTargetInfluences[i];
|
|
150
|
-
#else
|
|
151
|
-
normalUpdated=normalUpdated+(readVector3FromRawSampler(i,vertexID) -vertexInputs.normal)*uniforms.morphTargetInfluences[i];
|
|
152
|
-
#endif
|
|
153
|
-
#endif
|
|
154
|
-
#ifdef MORPHTARGETTEXTURE_HASNORMALS
|
|
155
|
-
vertexID=vertexID+1.0;
|
|
156
|
-
#endif
|
|
157
|
-
#ifdef MORPHTARGETS_UV
|
|
158
|
-
#ifdef USE_VERTEX_PULLING
|
|
159
|
-
uvUpdated=uvUpdated+(readVector3FromRawSampler(i,vertexID).xy-vp_baseUV)*uniforms.morphTargetInfluences[i];
|
|
160
|
-
#else
|
|
161
|
-
uvUpdated=uvUpdated+(readVector3FromRawSampler(i,vertexID).xy-vertexInputs.uv)*uniforms.morphTargetInfluences[i];
|
|
162
|
-
#endif
|
|
163
|
-
#endif
|
|
164
|
-
#ifdef MORPHTARGETTEXTURE_HASUVS
|
|
165
|
-
vertexID=vertexID+1.0;
|
|
166
|
-
#endif
|
|
167
|
-
#ifdef MORPHTARGETS_TANGENT
|
|
168
|
-
#ifdef USE_VERTEX_PULLING
|
|
169
|
-
tangentUpdated=vec4f(tangentUpdated.xyz+(readVector3FromRawSampler(i,vertexID) -vp_baseTangent.xyz)*uniforms.morphTargetInfluences[i],tangentUpdated.a);
|
|
170
|
-
#else
|
|
171
|
-
tangentUpdated=vec4f(tangentUpdated.xyz+(readVector3FromRawSampler(i,vertexID) -vertexInputs.tangent.xyz)*uniforms.morphTargetInfluences[i],tangentUpdated.a);
|
|
172
|
-
#endif
|
|
173
|
-
#endif
|
|
174
|
-
#ifdef MORPHTARGETTEXTURE_HASTANGENTS
|
|
175
|
-
vertexID=vertexID+1.0;
|
|
176
|
-
#endif
|
|
177
|
-
#ifdef MORPHTARGETS_UV2
|
|
178
|
-
#ifdef USE_VERTEX_PULLING
|
|
179
|
-
uv2Updated=uv2Updated+(readVector3FromRawSampler(i,vertexID).xy-vp_baseUV2)*uniforms.morphTargetInfluences[i];
|
|
180
|
-
#else
|
|
181
|
-
uv2Updated=uv2Updated+(readVector3FromRawSampler(i,vertexID).xy-vertexInputs.uv2)*uniforms.morphTargetInfluences[i];
|
|
182
|
-
#endif
|
|
183
|
-
#endif
|
|
184
|
-
#ifdef MORPHTARGETS_COLOR
|
|
185
|
-
#ifdef USE_VERTEX_PULLING
|
|
186
|
-
colorUpdated=colorUpdated+(readVector4FromRawSampler(i,vertexID)-vp_baseColor)*uniforms.morphTargetInfluences[i];
|
|
187
|
-
#else
|
|
188
|
-
colorUpdated=colorUpdated+(readVector4FromRawSampler(i,vertexID)-vertexInputs.color)*uniforms.morphTargetInfluences[i];
|
|
189
|
-
#endif
|
|
190
|
-
#endif
|
|
191
|
-
}
|
|
192
|
-
#endif
|
|
193
|
-
#else
|
|
194
|
-
#ifdef MORPHTARGETS_POSITION
|
|
195
|
-
#ifdef USE_VERTEX_PULLING
|
|
196
|
-
positionUpdated=positionUpdated+(vertexInputs.position{X}-vp_basePosition)*uniforms.morphTargetInfluences[{X}];
|
|
197
|
-
#else
|
|
198
|
-
positionUpdated=positionUpdated+(vertexInputs.position{X}-vertexInputs.position)*uniforms.morphTargetInfluences[{X}];
|
|
199
|
-
#endif
|
|
200
|
-
#endif
|
|
201
|
-
#ifdef MORPHTARGETS_NORMAL
|
|
202
|
-
#ifdef USE_VERTEX_PULLING
|
|
203
|
-
normalUpdated=normalUpdated+(vertexInputs.normal{X}-vp_baseNormal)*uniforms.morphTargetInfluences[{X}];
|
|
204
|
-
#else
|
|
205
|
-
normalUpdated=normalUpdated+(vertexInputs.normal{X}-vertexInputs.normal)*uniforms.morphTargetInfluences[{X}];
|
|
206
|
-
#endif
|
|
207
|
-
#endif
|
|
208
|
-
#ifdef MORPHTARGETS_TANGENT
|
|
209
|
-
#ifdef USE_VERTEX_PULLING
|
|
210
|
-
tangentUpdated=vec4f(tangentUpdated.xyz+(vertexInputs.tangent{X}-vp_baseTangent.xyz)*uniforms.morphTargetInfluences[{X}],tangentUpdated.a);
|
|
211
|
-
#else
|
|
212
|
-
tangentUpdated=vec4f(tangentUpdated.xyz+(vertexInputs.tangent{X}-vertexInputs.tangent.xyz)*uniforms.morphTargetInfluences[{X}],tangentUpdated.a);
|
|
213
|
-
#endif
|
|
214
|
-
#endif
|
|
215
|
-
#ifdef MORPHTARGETS_UV
|
|
216
|
-
#ifdef USE_VERTEX_PULLING
|
|
217
|
-
uvUpdated=uvUpdated+(vertexInputs.uv_{X}-vp_baseUV)*uniforms.morphTargetInfluences[{X}];
|
|
218
|
-
#else
|
|
219
|
-
uvUpdated=uvUpdated+(vertexInputs.uv_{X}-vertexInputs.uv)*uniforms.morphTargetInfluences[{X}];
|
|
220
|
-
#endif
|
|
221
|
-
#endif
|
|
222
|
-
#ifdef MORPHTARGETS_UV2
|
|
223
|
-
#ifdef USE_VERTEX_PULLING
|
|
224
|
-
uv2Updated=uv2Updated+(vertexInputs.uv2_{X}-vp_baseUV2)*uniforms.morphTargetInfluences[{X}];
|
|
225
|
-
#else
|
|
226
|
-
uv2Updated=uv2Updated+(vertexInputs.uv2_{X}-vertexInputs.uv2)*uniforms.morphTargetInfluences[{X}];
|
|
227
|
-
#endif
|
|
228
|
-
#endif
|
|
229
|
-
#ifdef MORPHTARGETS_COLOR
|
|
230
|
-
#ifdef USE_VERTEX_PULLING
|
|
231
|
-
colorUpdated=colorUpdated+(vertexInputs.color{X}-vp_baseColor)*uniforms.morphTargetInfluences[{X}];
|
|
232
|
-
#else
|
|
233
|
-
colorUpdated=colorUpdated+(vertexInputs.color{X}-vertexInputs.color)*uniforms.morphTargetInfluences[{X}];
|
|
234
|
-
#endif
|
|
235
|
-
#endif
|
|
236
|
-
#endif
|
|
237
|
-
#endif
|
|
238
|
-
`;
|
|
239
|
-
e.IncludesShadersStoreWGSL[s] || (e.IncludesShadersStoreWGSL[s] = v);
|
|
240
|
-
const W = { name: s, shader: v }, o = "instancesVertex", N = `#ifdef INSTANCES
|
|
241
|
-
var finalWorld=mat4x4<f32>(vertexInputs.world0,vertexInputs.world1,vertexInputs.world2,vertexInputs.world3);
|
|
242
|
-
#if defined(PREPASS_VELOCITY) || defined(VELOCITY) || defined(PREPASS_VELOCITY_LINEAR) || defined(VELOCITY_LINEAR)
|
|
243
|
-
var finalPreviousWorld=mat4x4<f32>(
|
|
244
|
-
vertexInputs.previousWorld0,vertexInputs.previousWorld1,
|
|
245
|
-
vertexInputs.previousWorld2,vertexInputs.previousWorld3);
|
|
246
|
-
#endif
|
|
247
|
-
#ifdef THIN_INSTANCES
|
|
248
|
-
#if !defined(WORLD_UBO)
|
|
249
|
-
finalWorld=uniforms.world*finalWorld;
|
|
250
|
-
#else
|
|
251
|
-
finalWorld=mesh.world*finalWorld;
|
|
252
|
-
#endif
|
|
253
|
-
#if defined(PREPASS_VELOCITY) || defined(VELOCITY) || defined(PREPASS_VELOCITY_LINEAR) || defined(VELOCITY_LINEAR)
|
|
254
|
-
finalPreviousWorld=uniforms.previousWorld*finalPreviousWorld;
|
|
255
|
-
#endif
|
|
256
|
-
#endif
|
|
257
|
-
#else
|
|
258
|
-
#if !defined(WORLD_UBO)
|
|
259
|
-
var finalWorld=uniforms.world;
|
|
260
|
-
#else
|
|
261
|
-
var finalWorld=mesh.world;
|
|
262
|
-
#endif
|
|
263
|
-
#if defined(PREPASS_VELOCITY) || defined(VELOCITY) || defined(PREPASS_VELOCITY_LINEAR) || defined(VELOCITY_LINEAR)
|
|
264
|
-
var finalPreviousWorld=uniforms.previousWorld;
|
|
265
|
-
#endif
|
|
266
|
-
#endif
|
|
267
|
-
`;
|
|
268
|
-
e.IncludesShadersStoreWGSL[o] || (e.IncludesShadersStoreWGSL[o] = N);
|
|
269
|
-
const F = { name: o, shader: N }, m = "bonesVertex", R = `#ifndef BAKED_VERTEX_ANIMATION_TEXTURE
|
|
270
|
-
#if NUM_BONE_INFLUENCERS>0
|
|
271
|
-
var influence : mat4x4<f32>;
|
|
272
|
-
#ifdef BONETEXTURE
|
|
273
|
-
influence=readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndices[0])*vertexInputs.matricesWeights[0];
|
|
274
|
-
#if NUM_BONE_INFLUENCERS>1
|
|
275
|
-
influence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndices[1])*vertexInputs.matricesWeights[1];
|
|
276
|
-
#endif
|
|
277
|
-
#if NUM_BONE_INFLUENCERS>2
|
|
278
|
-
influence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndices[2])*vertexInputs.matricesWeights[2];
|
|
279
|
-
#endif
|
|
280
|
-
#if NUM_BONE_INFLUENCERS>3
|
|
281
|
-
influence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndices[3])*vertexInputs.matricesWeights[3];
|
|
282
|
-
#endif
|
|
283
|
-
#if NUM_BONE_INFLUENCERS>4
|
|
284
|
-
influence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndicesExtra[0])*vertexInputs.matricesWeightsExtra[0];
|
|
285
|
-
#endif
|
|
286
|
-
#if NUM_BONE_INFLUENCERS>5
|
|
287
|
-
influence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndicesExtra[1])*vertexInputs.matricesWeightsExtra[1];
|
|
288
|
-
#endif
|
|
289
|
-
#if NUM_BONE_INFLUENCERS>6
|
|
290
|
-
influence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndicesExtra[2])*vertexInputs.matricesWeightsExtra[2];
|
|
291
|
-
#endif
|
|
292
|
-
#if NUM_BONE_INFLUENCERS>7
|
|
293
|
-
influence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndicesExtra[3])*vertexInputs.matricesWeightsExtra[3];
|
|
294
|
-
#endif
|
|
295
|
-
#else
|
|
296
|
-
influence=uniforms.mBones[i32(vertexInputs.matricesIndices[0])]*vertexInputs.matricesWeights[0];
|
|
297
|
-
#if NUM_BONE_INFLUENCERS>1
|
|
298
|
-
influence=influence+uniforms.mBones[i32(vertexInputs.matricesIndices[1])]*vertexInputs.matricesWeights[1];
|
|
299
|
-
#endif
|
|
300
|
-
#if NUM_BONE_INFLUENCERS>2
|
|
301
|
-
influence=influence+uniforms.mBones[i32(vertexInputs.matricesIndices[2])]*vertexInputs.matricesWeights[2];
|
|
302
|
-
#endif
|
|
303
|
-
#if NUM_BONE_INFLUENCERS>3
|
|
304
|
-
influence=influence+uniforms.mBones[i32(vertexInputs.matricesIndices[3])]*vertexInputs.matricesWeights[3];
|
|
305
|
-
#endif
|
|
306
|
-
#if NUM_BONE_INFLUENCERS>4
|
|
307
|
-
influence=influence+uniforms.mBones[i32(vertexInputs.matricesIndicesExtra[0])]*vertexInputs.matricesWeightsExtra[0];
|
|
308
|
-
#endif
|
|
309
|
-
#if NUM_BONE_INFLUENCERS>5
|
|
310
|
-
influence=influence+uniforms.mBones[i32(vertexInputs.matricesIndicesExtra[1])]*vertexInputs.matricesWeightsExtra[1];
|
|
311
|
-
#endif
|
|
312
|
-
#if NUM_BONE_INFLUENCERS>6
|
|
313
|
-
influence=influence+uniforms.mBones[i32(vertexInputs.matricesIndicesExtra[2])]*vertexInputs.matricesWeightsExtra[2];
|
|
314
|
-
#endif
|
|
315
|
-
#if NUM_BONE_INFLUENCERS>7
|
|
316
|
-
influence=influence+uniforms.mBones[i32(vertexInputs.matricesIndicesExtra[3])]*vertexInputs.matricesWeightsExtra[3];
|
|
317
|
-
#endif
|
|
318
|
-
#endif
|
|
319
|
-
finalWorld=finalWorld*influence;
|
|
320
|
-
#endif
|
|
321
|
-
#endif
|
|
322
|
-
`;
|
|
323
|
-
e.IncludesShadersStoreWGSL[m] || (e.IncludesShadersStoreWGSL[m] = R);
|
|
324
|
-
const G = { name: m, shader: R }, u = "bakedVertexAnimation", A = `#ifdef BAKED_VERTEX_ANIMATION_TEXTURE
|
|
325
|
-
{
|
|
326
|
-
#ifdef INSTANCES
|
|
327
|
-
let VATStartFrame: f32=vertexInputs.bakedVertexAnimationSettingsInstanced.x;let VATEndFrame: f32=vertexInputs.bakedVertexAnimationSettingsInstanced.y;let VATOffsetFrame: f32=vertexInputs.bakedVertexAnimationSettingsInstanced.z;let VATSpeed: f32=vertexInputs.bakedVertexAnimationSettingsInstanced.w;
|
|
328
|
-
#else
|
|
329
|
-
let VATStartFrame: f32=uniforms.bakedVertexAnimationSettings.x;let VATEndFrame: f32=uniforms.bakedVertexAnimationSettings.y;let VATOffsetFrame: f32=uniforms.bakedVertexAnimationSettings.z;let VATSpeed: f32=uniforms.bakedVertexAnimationSettings.w;
|
|
330
|
-
#endif
|
|
331
|
-
let totalFrames: f32=VATEndFrame-VATStartFrame+1.0;let time: f32=uniforms.bakedVertexAnimationTime*VATSpeed/totalFrames;let frameCorrection: f32=select(1.0,0.0,time<1.0);let numOfFrames: f32=totalFrames-frameCorrection;var VATFrameNum: f32=fract(time)*numOfFrames;VATFrameNum=(VATFrameNum+VATOffsetFrame) % numOfFrames;VATFrameNum=floor(VATFrameNum);VATFrameNum=VATFrameNum+VATStartFrame+frameCorrection;var VATInfluence : mat4x4<f32>;VATInfluence=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndices[0],VATFrameNum)*vertexInputs.matricesWeights[0];
|
|
332
|
-
#if NUM_BONE_INFLUENCERS>1
|
|
333
|
-
VATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndices[1],VATFrameNum)*vertexInputs.matricesWeights[1];
|
|
334
|
-
#endif
|
|
335
|
-
#if NUM_BONE_INFLUENCERS>2
|
|
336
|
-
VATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndices[2],VATFrameNum)*vertexInputs.matricesWeights[2];
|
|
337
|
-
#endif
|
|
338
|
-
#if NUM_BONE_INFLUENCERS>3
|
|
339
|
-
VATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndices[3],VATFrameNum)*vertexInputs.matricesWeights[3];
|
|
340
|
-
#endif
|
|
341
|
-
#if NUM_BONE_INFLUENCERS>4
|
|
342
|
-
VATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndicesExtra[0],VATFrameNum)*vertexInputs.matricesWeightsExtra[0];
|
|
343
|
-
#endif
|
|
344
|
-
#if NUM_BONE_INFLUENCERS>5
|
|
345
|
-
VATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndicesExtra[1],VATFrameNum)*vertexInputs.matricesWeightsExtra[1];
|
|
346
|
-
#endif
|
|
347
|
-
#if NUM_BONE_INFLUENCERS>6
|
|
348
|
-
VATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndicesExtra[2],VATFrameNum)*vertexInputs.matricesWeightsExtra[2];
|
|
349
|
-
#endif
|
|
350
|
-
#if NUM_BONE_INFLUENCERS>7
|
|
351
|
-
VATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndicesExtra[3],VATFrameNum)*vertexInputs.matricesWeightsExtra[3];
|
|
352
|
-
#endif
|
|
353
|
-
finalWorld=finalWorld*VATInfluence;}
|
|
354
|
-
#endif
|
|
355
|
-
`;
|
|
356
|
-
e.IncludesShadersStoreWGSL[u] || (e.IncludesShadersStoreWGSL[u] = A);
|
|
357
|
-
const M = { name: u, shader: A }, l = "clipPlaneVertex", _ = `#ifdef CLIPPLANE
|
|
358
|
-
vertexOutputs.fClipDistance=dot(worldPos,uniforms.vClipPlane);
|
|
359
|
-
#endif
|
|
360
|
-
#ifdef CLIPPLANE2
|
|
361
|
-
vertexOutputs.fClipDistance2=dot(worldPos,uniforms.vClipPlane2);
|
|
362
|
-
#endif
|
|
363
|
-
#ifdef CLIPPLANE3
|
|
364
|
-
vertexOutputs.fClipDistance3=dot(worldPos,uniforms.vClipPlane3);
|
|
365
|
-
#endif
|
|
366
|
-
#ifdef CLIPPLANE4
|
|
367
|
-
vertexOutputs.fClipDistance4=dot(worldPos,uniforms.vClipPlane4);
|
|
368
|
-
#endif
|
|
369
|
-
#ifdef CLIPPLANE5
|
|
370
|
-
vertexOutputs.fClipDistance5=dot(worldPos,uniforms.vClipPlane5);
|
|
371
|
-
#endif
|
|
372
|
-
#ifdef CLIPPLANE6
|
|
373
|
-
vertexOutputs.fClipDistance6=dot(worldPos,uniforms.vClipPlane6);
|
|
374
|
-
#endif
|
|
375
|
-
`;
|
|
376
|
-
e.IncludesShadersStoreWGSL[l] || (e.IncludesShadersStoreWGSL[l] = _);
|
|
377
|
-
const b = { name: l, shader: _ };
|
|
378
|
-
export {
|
|
379
|
-
M as a,
|
|
380
|
-
V as b,
|
|
381
|
-
U as c,
|
|
382
|
-
G as d,
|
|
383
|
-
P as e,
|
|
384
|
-
b as f,
|
|
385
|
-
F as g,
|
|
386
|
-
h,
|
|
387
|
-
g as i,
|
|
388
|
-
C as j,
|
|
389
|
-
W as k,
|
|
390
|
-
O as m
|
|
391
|
-
};
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import { C as A, r as d, L as v, b as C, c as g, E as I, a as T, _ as S, N as x } from "./index-CmNnQLDH.js";
|
|
2
|
-
let c = null;
|
|
3
|
-
async function R() {
|
|
4
|
-
const n = g.LastCreatedEngine?.createCanvas(100, 100) ?? new OffscreenCanvas(100, 100);
|
|
5
|
-
n instanceof OffscreenCanvas && v.Warn("DumpData: OffscreenCanvas will be used for dumping data. This may result in lossy alpha values.");
|
|
6
|
-
const { ThinEngine: t } = await import("./thinEngine-dZnz-Owz.js");
|
|
7
|
-
if (!t.IsSupported)
|
|
8
|
-
throw new Error("DumpData: No WebGL context available. Cannot dump data.");
|
|
9
|
-
const r = {
|
|
10
|
-
preserveDrawingBuffer: !0,
|
|
11
|
-
depth: !1,
|
|
12
|
-
stencil: !1,
|
|
13
|
-
alpha: !0,
|
|
14
|
-
premultipliedAlpha: !1,
|
|
15
|
-
antialias: !1,
|
|
16
|
-
failIfMajorPerformanceCaveat: !1
|
|
17
|
-
}, e = new t(n, !1, r);
|
|
18
|
-
g.Instances.pop(), g.OnEnginesDisposedObservable.add((o) => {
|
|
19
|
-
e && o !== e && !e.isDisposed && g.Instances.length === 0 && b();
|
|
20
|
-
}), e.getCaps().parallelShaderCompile = void 0;
|
|
21
|
-
const i = new I(e), { passPixelShader: s } = await import("./pass.fragment-D3pYn4R1.js"), f = new T({
|
|
22
|
-
engine: e,
|
|
23
|
-
name: s.name,
|
|
24
|
-
fragmentShader: s.shader,
|
|
25
|
-
samplerNames: ["textureSampler"]
|
|
26
|
-
});
|
|
27
|
-
return {
|
|
28
|
-
canvas: n,
|
|
29
|
-
dumpEngine: { engine: e, renderer: i, wrapper: f }
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
async function _() {
|
|
33
|
-
return c || (c = R()), await c;
|
|
34
|
-
}
|
|
35
|
-
class E {
|
|
36
|
-
/**
|
|
37
|
-
* Encodes image data to the given mime type.
|
|
38
|
-
* This is put into a helper class so we can apply the nativeOverride decorator to it.
|
|
39
|
-
* @internal
|
|
40
|
-
*/
|
|
41
|
-
static async EncodeImageAsync(t, r, e, i, s, f) {
|
|
42
|
-
const o = await _(), a = o.dumpEngine;
|
|
43
|
-
a.engine.setSize(r, e, !0);
|
|
44
|
-
const p = a.engine.createRawTexture(t, r, e, 5, !1, !s, 1);
|
|
45
|
-
return a.renderer.setViewport(), a.renderer.applyEffectWrapper(a.wrapper), a.wrapper.effect._bindTexture("textureSampler", p), a.renderer.draw(), p.dispose(), await new Promise((l, u) => {
|
|
46
|
-
d.ToBlob(o.canvas, (m) => {
|
|
47
|
-
m ? l(m) : u(new Error("EncodeImageAsync: Failed to convert canvas to blob."));
|
|
48
|
-
}, i, f);
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
S([
|
|
53
|
-
x
|
|
54
|
-
], E, "EncodeImageAsync", null);
|
|
55
|
-
const L = E.EncodeImageAsync;
|
|
56
|
-
async function h(n, t, r, e, i = "image/png", s, f) {
|
|
57
|
-
const o = await r.readPixels(0, 0, n, t), a = new Uint8Array(o.buffer);
|
|
58
|
-
D(n, t, a, e, i, s, !0, void 0, f);
|
|
59
|
-
}
|
|
60
|
-
async function w(n, t, r, e = "image/png", i, s = !1, f = !1, o) {
|
|
61
|
-
if (r instanceof Float32Array) {
|
|
62
|
-
const l = new Uint8Array(r.length);
|
|
63
|
-
let u = r.length;
|
|
64
|
-
for (; u--; ) {
|
|
65
|
-
const m = r[u];
|
|
66
|
-
l[u] = Math.round(A(m) * 255);
|
|
67
|
-
}
|
|
68
|
-
r = l;
|
|
69
|
-
}
|
|
70
|
-
const a = await E.EncodeImageAsync(r, n, t, e, s, o);
|
|
71
|
-
i !== void 0 && d.DownloadBlob(a, i), a.type !== e && v.Warn(`DumpData: The requested mimeType '${e}' is not supported. The result has mimeType '${a.type}' instead.`);
|
|
72
|
-
const p = await a.arrayBuffer();
|
|
73
|
-
return f ? p : `data:${e};base64,${C(p)}`;
|
|
74
|
-
}
|
|
75
|
-
function D(n, t, r, e, i = "image/png", s, f = !1, o = !1, a) {
|
|
76
|
-
s === void 0 && !e && (s = ""), w(n, t, r, i, s, f, o, a).then((p) => {
|
|
77
|
-
e && e(p);
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
function b() {
|
|
81
|
-
c && (c?.then((n) => {
|
|
82
|
-
n.canvas instanceof HTMLCanvasElement && n.canvas.remove(), n.dumpEngine && (n.dumpEngine.engine.dispose(), n.dumpEngine.renderer.dispose(), n.dumpEngine.wrapper.dispose());
|
|
83
|
-
}), c = null);
|
|
84
|
-
}
|
|
85
|
-
const P = {
|
|
86
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
87
|
-
DumpData: D,
|
|
88
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
89
|
-
DumpDataAsync: w,
|
|
90
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
91
|
-
DumpFramebuffer: h,
|
|
92
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
93
|
-
Dispose: b
|
|
94
|
-
};
|
|
95
|
-
let y = !1;
|
|
96
|
-
function B() {
|
|
97
|
-
if (y)
|
|
98
|
-
return;
|
|
99
|
-
y = !0, d.DumpData = D, d.DumpDataAsync = w, d.DumpFramebuffer = h;
|
|
100
|
-
}
|
|
101
|
-
B();
|
|
102
|
-
export {
|
|
103
|
-
b as Dispose,
|
|
104
|
-
D as DumpData,
|
|
105
|
-
w as DumpDataAsync,
|
|
106
|
-
h as DumpFramebuffer,
|
|
107
|
-
P as DumpTools,
|
|
108
|
-
L as EncodeImageAsync,
|
|
109
|
-
B as RegisterDumpTools
|
|
110
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { S as t } from "./index-CmNnQLDH.js";
|
|
2
|
-
const e = "glowBlurPostProcessPixelShader", r = `varying vec2 vUV;uniform sampler2D textureSampler;uniform vec2 screenSize;uniform vec2 direction;uniform float blurWidth;float getLuminance(vec3 color)
|
|
3
|
-
{return dot(color,vec3(0.2126,0.7152,0.0722));}
|
|
4
|
-
#define CUSTOM_FRAGMENT_DEFINITIONS
|
|
5
|
-
void main(void)
|
|
6
|
-
{float weights[7];weights[0]=0.05;weights[1]=0.1;weights[2]=0.2;weights[3]=0.3;weights[4]=0.2;weights[5]=0.1;weights[6]=0.05;vec2 texelSize=vec2(1.0/screenSize.x,1.0/screenSize.y);vec2 texelStep=texelSize*direction*blurWidth;vec2 start=vUV-3.0*texelStep;vec4 baseColor=vec4(0.,0.,0.,0.);vec2 texelOffset=vec2(0.,0.);for (int i=0; i<7; i++)
|
|
7
|
-
{vec4 texel=texture2D(textureSampler,start+texelOffset);baseColor.a+=texel.a*weights[i];float luminance=getLuminance(baseColor.rgb);float luminanceTexel=getLuminance(texel.rgb);float choice=step(luminanceTexel,luminance);baseColor.rgb=choice*baseColor.rgb+(1.0-choice)*texel.rgb;texelOffset+=texelStep;}
|
|
8
|
-
gl_FragColor=baseColor;}`;
|
|
9
|
-
t.ShadersStore[e] || (t.ShadersStore[e] = r);
|
|
10
|
-
const i = { name: e, shader: r };
|
|
11
|
-
export {
|
|
12
|
-
i as glowBlurPostProcessPixelShader
|
|
13
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { S as r } from "./index-CmNnQLDH.js";
|
|
2
|
-
const e = "glowBlurPostProcessPixelShader", t = `varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;uniform screenSize: vec2f;uniform direction: vec2f;uniform blurWidth: f32;fn getLuminance(color: vec3f)->f32
|
|
3
|
-
{return dot(color, vec3f(0.2126,0.7152,0.0722));}
|
|
4
|
-
#define CUSTOM_FRAGMENT_DEFINITIONS
|
|
5
|
-
@fragment
|
|
6
|
-
fn main(input: FragmentInputs)->FragmentOutputs {var weights: array<f32 ,7>;weights[0]=0.05;weights[1]=0.1;weights[2]=0.2;weights[3]=0.3;weights[4]=0.2;weights[5]=0.1;weights[6]=0.05;var texelSize: vec2f= vec2f(1.0/uniforms.screenSize.x,1.0/uniforms.screenSize.y);var texelStep: vec2f=texelSize*uniforms.direction*uniforms.blurWidth;var start: vec2f=input.vUV-3.0*texelStep;var baseColor: vec4f= vec4f(0.,0.,0.,0.);var texelOffset: vec2f= vec2f(0.,0.);for (var i: i32=0; i<7; i++)
|
|
7
|
-
{var texel: vec4f=textureSample(textureSampler,textureSamplerSampler,start+texelOffset);baseColor=vec4f(baseColor.rgb,baseColor.a+texel.a*weights[i]);var luminance: f32=getLuminance(baseColor.rgb);var luminanceTexel: f32=getLuminance(texel.rgb);var choice: f32=step(luminanceTexel,luminance);baseColor=vec4f(choice*baseColor.rgb+(1.0-choice)*texel.rgb,baseColor.a);texelOffset+=texelStep;}
|
|
8
|
-
fragmentOutputs.color=baseColor;}`;
|
|
9
|
-
r.ShadersStoreWGSL[e] || (r.ShadersStoreWGSL[e] = t);
|
|
10
|
-
const o = { name: e, shader: t };
|
|
11
|
-
export {
|
|
12
|
-
o as glowBlurPostProcessPixelShaderWGSL
|
|
13
|
-
};
|