@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,496 @@
|
|
|
1
|
+
import { S as e } from "./index-ChGTkj2q.js";
|
|
2
|
+
const i = "decalVertexDeclaration", g = `#ifdef DECAL
|
|
3
|
+
uniform vec4 vDecalInfos;uniform mat4 decalMatrix;
|
|
4
|
+
#endif
|
|
5
|
+
`;
|
|
6
|
+
e.IncludesShadersStore[i] || (e.IncludesShadersStore[i] = g);
|
|
7
|
+
const t = "uvAttributeDeclaration", P = `#ifdef UV{X}
|
|
8
|
+
attribute vec2 uv{X};
|
|
9
|
+
#endif
|
|
10
|
+
`;
|
|
11
|
+
e.IncludesShadersStore[t] || (e.IncludesShadersStore[t] = P);
|
|
12
|
+
const r = "bonesDeclaration", V = `#if NUM_BONE_INFLUENCERS>0
|
|
13
|
+
attribute vec4 matricesIndices;attribute vec4 matricesWeights;
|
|
14
|
+
#if NUM_BONE_INFLUENCERS>4
|
|
15
|
+
attribute vec4 matricesIndicesExtra;attribute vec4 matricesWeightsExtra;
|
|
16
|
+
#endif
|
|
17
|
+
#ifndef BAKED_VERTEX_ANIMATION_TEXTURE
|
|
18
|
+
#ifdef BONETEXTURE
|
|
19
|
+
uniform highp sampler2D boneSampler;uniform float boneTextureWidth;
|
|
20
|
+
#else
|
|
21
|
+
uniform mat4 mBones[BonesPerMesh];
|
|
22
|
+
#endif
|
|
23
|
+
#ifdef BONES_VELOCITY_ENABLED
|
|
24
|
+
uniform mat4 mPreviousBones[BonesPerMesh];
|
|
25
|
+
#endif
|
|
26
|
+
#ifdef BONETEXTURE
|
|
27
|
+
#define inline
|
|
28
|
+
mat4 readMatrixFromRawSampler(sampler2D smp,float index)
|
|
29
|
+
{float offset=index *4.0;float dx=1.0/boneTextureWidth;vec4 m0=texture2D(smp,vec2(dx*(offset+0.5),0.));vec4 m1=texture2D(smp,vec2(dx*(offset+1.5),0.));vec4 m2=texture2D(smp,vec2(dx*(offset+2.5),0.));vec4 m3=texture2D(smp,vec2(dx*(offset+3.5),0.));return mat4(m0,m1,m2,m3);}
|
|
30
|
+
#endif
|
|
31
|
+
#endif
|
|
32
|
+
#endif
|
|
33
|
+
`;
|
|
34
|
+
e.IncludesShadersStore[r] || (e.IncludesShadersStore[r] = V);
|
|
35
|
+
const n = "bakedVertexAnimationDeclaration", U = `#ifdef BAKED_VERTEX_ANIMATION_TEXTURE
|
|
36
|
+
uniform float bakedVertexAnimationTime;uniform vec2 bakedVertexAnimationTextureSizeInverted;uniform vec4 bakedVertexAnimationSettings;uniform sampler2D bakedVertexAnimationTexture;
|
|
37
|
+
#ifdef INSTANCES
|
|
38
|
+
attribute vec4 bakedVertexAnimationSettingsInstanced;
|
|
39
|
+
#endif
|
|
40
|
+
#define inline
|
|
41
|
+
mat4 readMatrixFromRawSamplerVAT(sampler2D smp,float index,float frame)
|
|
42
|
+
{float offset=index*4.0;float frameUV=(frame+0.5)*bakedVertexAnimationTextureSizeInverted.y;float dx=bakedVertexAnimationTextureSizeInverted.x;vec4 m0=texture2D(smp,vec2(dx*(offset+0.5),frameUV));vec4 m1=texture2D(smp,vec2(dx*(offset+1.5),frameUV));vec4 m2=texture2D(smp,vec2(dx*(offset+2.5),frameUV));vec4 m3=texture2D(smp,vec2(dx*(offset+3.5),frameUV));return mat4(m0,m1,m2,m3);}
|
|
43
|
+
#endif
|
|
44
|
+
`;
|
|
45
|
+
e.IncludesShadersStore[n] || (e.IncludesShadersStore[n] = U);
|
|
46
|
+
const a = "prePassVertexDeclaration", O = `#ifdef PREPASS
|
|
47
|
+
#ifdef PREPASS_LOCAL_POSITION
|
|
48
|
+
varying vec3 vPosition;
|
|
49
|
+
#endif
|
|
50
|
+
#ifdef PREPASS_DEPTH
|
|
51
|
+
varying vec3 vViewPos;
|
|
52
|
+
#endif
|
|
53
|
+
#ifdef PREPASS_NORMALIZED_VIEW_DEPTH
|
|
54
|
+
varying float vNormViewDepth;
|
|
55
|
+
#endif
|
|
56
|
+
#if defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)
|
|
57
|
+
uniform mat4 previousViewProjection;varying vec4 vCurrentPosition;varying vec4 vPreviousPosition;
|
|
58
|
+
#endif
|
|
59
|
+
#endif
|
|
60
|
+
`;
|
|
61
|
+
e.IncludesShadersStore[a] || (e.IncludesShadersStore[a] = O);
|
|
62
|
+
const f = "samplerVertexDeclaration", C = `#if defined(_DEFINENAME_) && _DEFINENAME_DIRECTUV==0
|
|
63
|
+
varying vec2 v_VARYINGNAME_UV;
|
|
64
|
+
#endif
|
|
65
|
+
`;
|
|
66
|
+
e.IncludesShadersStore[f] || (e.IncludesShadersStore[f] = C);
|
|
67
|
+
const d = "bumpVertexDeclaration", L = `#if defined(BUMP) || defined(PARALLAX) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC)
|
|
68
|
+
#if defined(TANGENT) && defined(NORMAL)
|
|
69
|
+
varying mat3 vTBN;
|
|
70
|
+
#endif
|
|
71
|
+
#endif
|
|
72
|
+
`;
|
|
73
|
+
e.IncludesShadersStore[d] || (e.IncludesShadersStore[d] = L);
|
|
74
|
+
const o = "clipPlaneVertexDeclaration", X = `#ifdef CLIPPLANE
|
|
75
|
+
uniform vec4 vClipPlane;varying float fClipDistance;
|
|
76
|
+
#endif
|
|
77
|
+
#ifdef CLIPPLANE2
|
|
78
|
+
uniform vec4 vClipPlane2;varying float fClipDistance2;
|
|
79
|
+
#endif
|
|
80
|
+
#ifdef CLIPPLANE3
|
|
81
|
+
uniform vec4 vClipPlane3;varying float fClipDistance3;
|
|
82
|
+
#endif
|
|
83
|
+
#ifdef CLIPPLANE4
|
|
84
|
+
uniform vec4 vClipPlane4;varying float fClipDistance4;
|
|
85
|
+
#endif
|
|
86
|
+
#ifdef CLIPPLANE5
|
|
87
|
+
uniform vec4 vClipPlane5;varying float fClipDistance5;
|
|
88
|
+
#endif
|
|
89
|
+
#ifdef CLIPPLANE6
|
|
90
|
+
uniform vec4 vClipPlane6;varying float fClipDistance6;
|
|
91
|
+
#endif
|
|
92
|
+
`;
|
|
93
|
+
e.IncludesShadersStore[o] || (e.IncludesShadersStore[o] = X);
|
|
94
|
+
const s = "fogVertexDeclaration", F = `#ifdef FOG
|
|
95
|
+
varying vec3 vFogDistance;
|
|
96
|
+
#endif
|
|
97
|
+
`;
|
|
98
|
+
e.IncludesShadersStore[s] || (e.IncludesShadersStore[s] = F);
|
|
99
|
+
const c = "lightVxFragmentDeclaration", D = `#ifdef LIGHT{X}
|
|
100
|
+
uniform vec4 vLightData{X};uniform vec4 vLightDiffuse{X};
|
|
101
|
+
#ifdef SPECULARTERM
|
|
102
|
+
uniform vec4 vLightSpecular{X};
|
|
103
|
+
#else
|
|
104
|
+
vec4 vLightSpecular{X}=vec4(0.);
|
|
105
|
+
#endif
|
|
106
|
+
#ifdef SHADOW{X}
|
|
107
|
+
#ifdef SHADOWCSM{X}
|
|
108
|
+
uniform mat4 lightMatrix{X}[SHADOWCSMNUM_CASCADES{X}];varying vec4 vPositionFromLight{X}[SHADOWCSMNUM_CASCADES{X}];varying float vDepthMetric{X}[SHADOWCSMNUM_CASCADES{X}];varying vec4 vPositionFromCamera{X};
|
|
109
|
+
#elif defined(SHADOWCUBE{X})
|
|
110
|
+
#else
|
|
111
|
+
varying vec4 vPositionFromLight{X};varying float vDepthMetric{X};uniform mat4 lightMatrix{X};
|
|
112
|
+
#endif
|
|
113
|
+
uniform vec4 shadowsInfo{X};uniform vec2 depthValues{X};
|
|
114
|
+
#endif
|
|
115
|
+
#ifdef SPOTLIGHT{X}
|
|
116
|
+
uniform vec4 vLightDirection{X};uniform vec4 vLightFalloff{X};
|
|
117
|
+
#elif defined(POINTLIGHT{X})
|
|
118
|
+
uniform vec4 vLightFalloff{X};
|
|
119
|
+
#elif defined(HEMILIGHT{X})
|
|
120
|
+
uniform vec3 vLightGround{X};
|
|
121
|
+
#endif
|
|
122
|
+
#if defined(AREALIGHT{X})
|
|
123
|
+
uniform vec4 vLightWidth{X};uniform vec4 vLightHeight{X};
|
|
124
|
+
#endif
|
|
125
|
+
#endif
|
|
126
|
+
`;
|
|
127
|
+
e.IncludesShadersStore[c] || (e.IncludesShadersStore[c] = D);
|
|
128
|
+
const m = "lightVxUboDeclaration", B = `#ifdef LIGHT{X}
|
|
129
|
+
uniform Light{X}
|
|
130
|
+
{vec4 vLightData;vec4 vLightDiffuse;vec4 vLightSpecular;
|
|
131
|
+
#ifdef SPOTLIGHT{X}
|
|
132
|
+
vec4 vLightDirection;vec4 vLightFalloff;
|
|
133
|
+
#elif defined(POINTLIGHT{X})
|
|
134
|
+
vec4 vLightFalloff;
|
|
135
|
+
#elif defined(HEMILIGHT{X})
|
|
136
|
+
vec3 vLightGround;
|
|
137
|
+
#endif
|
|
138
|
+
#if defined(AREALIGHT{X})
|
|
139
|
+
vec4 vLightWidth;vec4 vLightHeight;
|
|
140
|
+
#endif
|
|
141
|
+
vec4 shadowsInfo;vec2 depthValues;} light{X};
|
|
142
|
+
#ifdef SHADOW{X}
|
|
143
|
+
#ifdef SHADOWCSM{X}
|
|
144
|
+
uniform mat4 lightMatrix{X}[SHADOWCSMNUM_CASCADES{X}];varying vec4 vPositionFromLight{X}[SHADOWCSMNUM_CASCADES{X}];varying float vDepthMetric{X}[SHADOWCSMNUM_CASCADES{X}];varying vec4 vPositionFromCamera{X};
|
|
145
|
+
#elif defined(SHADOWCUBE{X})
|
|
146
|
+
#else
|
|
147
|
+
varying vec4 vPositionFromLight{X};varying float vDepthMetric{X};uniform mat4 lightMatrix{X};
|
|
148
|
+
#endif
|
|
149
|
+
#endif
|
|
150
|
+
#endif
|
|
151
|
+
`;
|
|
152
|
+
e.IncludesShadersStore[m] || (e.IncludesShadersStore[m] = B);
|
|
153
|
+
const l = "morphTargetsVertexGlobalDeclaration", H = `#ifdef MORPHTARGETS
|
|
154
|
+
uniform float morphTargetInfluences[NUM_MORPH_INFLUENCERS];
|
|
155
|
+
#ifdef MORPHTARGETS_TEXTURE
|
|
156
|
+
uniform float morphTargetTextureIndices[NUM_MORPH_INFLUENCERS];uniform vec3 morphTargetTextureInfo;uniform highp sampler2DArray morphTargets;vec3 readVector3FromRawSampler(int targetIndex,float vertexIndex)
|
|
157
|
+
{
|
|
158
|
+
float y=floor(vertexIndex/morphTargetTextureInfo.y);float x=vertexIndex-y*morphTargetTextureInfo.y;vec3 textureUV=vec3((x+0.5)/morphTargetTextureInfo.y,(y+0.5)/morphTargetTextureInfo.z,morphTargetTextureIndices[targetIndex]);return texture(morphTargets,textureUV).xyz;}
|
|
159
|
+
vec4 readVector4FromRawSampler(int targetIndex,float vertexIndex)
|
|
160
|
+
{
|
|
161
|
+
float y=floor(vertexIndex/morphTargetTextureInfo.y);float x=vertexIndex-y*morphTargetTextureInfo.y;vec3 textureUV=vec3((x+0.5)/morphTargetTextureInfo.y,(y+0.5)/morphTargetTextureInfo.z,morphTargetTextureIndices[targetIndex]);return texture(morphTargets,textureUV);}
|
|
162
|
+
#endif
|
|
163
|
+
#endif
|
|
164
|
+
`;
|
|
165
|
+
e.IncludesShadersStore[l] || (e.IncludesShadersStore[l] = H);
|
|
166
|
+
const E = "morphTargetsVertexDeclaration", b = `#ifdef MORPHTARGETS
|
|
167
|
+
#ifndef MORPHTARGETS_TEXTURE
|
|
168
|
+
#ifdef MORPHTARGETS_POSITION
|
|
169
|
+
attribute vec3 position{X};
|
|
170
|
+
#endif
|
|
171
|
+
#ifdef MORPHTARGETS_NORMAL
|
|
172
|
+
attribute vec3 normal{X};
|
|
173
|
+
#endif
|
|
174
|
+
#ifdef MORPHTARGETS_TANGENT
|
|
175
|
+
attribute vec3 tangent{X};
|
|
176
|
+
#endif
|
|
177
|
+
#ifdef MORPHTARGETS_UV
|
|
178
|
+
attribute vec2 uv_{X};
|
|
179
|
+
#endif
|
|
180
|
+
#ifdef MORPHTARGETS_UV2
|
|
181
|
+
attribute vec2 uv2_{X};
|
|
182
|
+
#endif
|
|
183
|
+
#ifdef MORPHTARGETS_COLOR
|
|
184
|
+
attribute vec4 color{X};
|
|
185
|
+
#endif
|
|
186
|
+
#elif {X}==0
|
|
187
|
+
uniform int morphTargetCount;
|
|
188
|
+
#endif
|
|
189
|
+
#endif
|
|
190
|
+
`;
|
|
191
|
+
e.IncludesShadersStore[E] || (e.IncludesShadersStore[E] = b);
|
|
192
|
+
const S = "morphTargetsVertexGlobal", W = `#ifdef MORPHTARGETS
|
|
193
|
+
#ifdef MORPHTARGETS_TEXTURE
|
|
194
|
+
float vertexID;
|
|
195
|
+
#endif
|
|
196
|
+
#endif
|
|
197
|
+
`;
|
|
198
|
+
e.IncludesShadersStore[S] || (e.IncludesShadersStore[S] = W);
|
|
199
|
+
const I = "morphTargetsVertex", G = `#ifdef MORPHTARGETS
|
|
200
|
+
#ifdef MORPHTARGETS_TEXTURE
|
|
201
|
+
#if {X}==0
|
|
202
|
+
for (int i=0; i<NUM_MORPH_INFLUENCERS; i++) {if (i>=morphTargetCount) break;vertexID=float(gl_VertexID)*morphTargetTextureInfo.x;
|
|
203
|
+
#ifdef MORPHTARGETS_POSITION
|
|
204
|
+
positionUpdated+=(readVector3FromRawSampler(i,vertexID)-position)*morphTargetInfluences[i];
|
|
205
|
+
#endif
|
|
206
|
+
#ifdef MORPHTARGETTEXTURE_HASPOSITIONS
|
|
207
|
+
vertexID+=1.0;
|
|
208
|
+
#endif
|
|
209
|
+
#ifdef MORPHTARGETS_NORMAL
|
|
210
|
+
normalUpdated+=(readVector3FromRawSampler(i,vertexID) -normal)*morphTargetInfluences[i];
|
|
211
|
+
#endif
|
|
212
|
+
#ifdef MORPHTARGETTEXTURE_HASNORMALS
|
|
213
|
+
vertexID+=1.0;
|
|
214
|
+
#endif
|
|
215
|
+
#ifdef MORPHTARGETS_UV
|
|
216
|
+
uvUpdated+=(readVector3FromRawSampler(i,vertexID).xy-uv)*morphTargetInfluences[i];
|
|
217
|
+
#endif
|
|
218
|
+
#ifdef MORPHTARGETTEXTURE_HASUVS
|
|
219
|
+
vertexID+=1.0;
|
|
220
|
+
#endif
|
|
221
|
+
#ifdef MORPHTARGETS_TANGENT
|
|
222
|
+
tangentUpdated.xyz+=(readVector3FromRawSampler(i,vertexID) -tangent.xyz)*morphTargetInfluences[i];
|
|
223
|
+
#endif
|
|
224
|
+
#ifdef MORPHTARGETTEXTURE_HASTANGENTS
|
|
225
|
+
vertexID+=1.0;
|
|
226
|
+
#endif
|
|
227
|
+
#ifdef MORPHTARGETS_UV2
|
|
228
|
+
uv2Updated+=(readVector3FromRawSampler(i,vertexID).xy-uv2)*morphTargetInfluences[i];
|
|
229
|
+
#endif
|
|
230
|
+
#ifdef MORPHTARGETTEXTURE_HASUV2S
|
|
231
|
+
vertexID+=1.0;
|
|
232
|
+
#endif
|
|
233
|
+
#ifdef MORPHTARGETS_COLOR
|
|
234
|
+
colorUpdated+=(readVector4FromRawSampler(i,vertexID)-color)*morphTargetInfluences[i];
|
|
235
|
+
#endif
|
|
236
|
+
}
|
|
237
|
+
#endif
|
|
238
|
+
#else
|
|
239
|
+
#ifdef MORPHTARGETS_POSITION
|
|
240
|
+
positionUpdated+=(position{X}-position)*morphTargetInfluences[{X}];
|
|
241
|
+
#endif
|
|
242
|
+
#ifdef MORPHTARGETS_NORMAL
|
|
243
|
+
normalUpdated+=(normal{X}-normal)*morphTargetInfluences[{X}];
|
|
244
|
+
#endif
|
|
245
|
+
#ifdef MORPHTARGETS_TANGENT
|
|
246
|
+
tangentUpdated.xyz+=(tangent{X}-tangent.xyz)*morphTargetInfluences[{X}];
|
|
247
|
+
#endif
|
|
248
|
+
#ifdef MORPHTARGETS_UV
|
|
249
|
+
uvUpdated+=(uv_{X}-uv)*morphTargetInfluences[{X}];
|
|
250
|
+
#endif
|
|
251
|
+
#ifdef MORPHTARGETS_UV2
|
|
252
|
+
uv2Updated+=(uv2_{X}-uv2)*morphTargetInfluences[{X}];
|
|
253
|
+
#endif
|
|
254
|
+
#ifdef MORPHTARGETS_COLOR
|
|
255
|
+
colorUpdated+=(color{X}-color)*morphTargetInfluences[{X}];
|
|
256
|
+
#endif
|
|
257
|
+
#endif
|
|
258
|
+
#endif
|
|
259
|
+
`;
|
|
260
|
+
e.IncludesShadersStore[I] || (e.IncludesShadersStore[I] = G);
|
|
261
|
+
const v = "bonesVertex", w = `#ifndef BAKED_VERTEX_ANIMATION_TEXTURE
|
|
262
|
+
#if NUM_BONE_INFLUENCERS>0
|
|
263
|
+
mat4 influence;
|
|
264
|
+
#ifdef BONETEXTURE
|
|
265
|
+
influence=readMatrixFromRawSampler(boneSampler,matricesIndices[0])*matricesWeights[0];
|
|
266
|
+
#if NUM_BONE_INFLUENCERS>1
|
|
267
|
+
influence+=readMatrixFromRawSampler(boneSampler,matricesIndices[1])*matricesWeights[1];
|
|
268
|
+
#endif
|
|
269
|
+
#if NUM_BONE_INFLUENCERS>2
|
|
270
|
+
influence+=readMatrixFromRawSampler(boneSampler,matricesIndices[2])*matricesWeights[2];
|
|
271
|
+
#endif
|
|
272
|
+
#if NUM_BONE_INFLUENCERS>3
|
|
273
|
+
influence+=readMatrixFromRawSampler(boneSampler,matricesIndices[3])*matricesWeights[3];
|
|
274
|
+
#endif
|
|
275
|
+
#if NUM_BONE_INFLUENCERS>4
|
|
276
|
+
influence+=readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[0])*matricesWeightsExtra[0];
|
|
277
|
+
#endif
|
|
278
|
+
#if NUM_BONE_INFLUENCERS>5
|
|
279
|
+
influence+=readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[1])*matricesWeightsExtra[1];
|
|
280
|
+
#endif
|
|
281
|
+
#if NUM_BONE_INFLUENCERS>6
|
|
282
|
+
influence+=readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[2])*matricesWeightsExtra[2];
|
|
283
|
+
#endif
|
|
284
|
+
#if NUM_BONE_INFLUENCERS>7
|
|
285
|
+
influence+=readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[3])*matricesWeightsExtra[3];
|
|
286
|
+
#endif
|
|
287
|
+
#else
|
|
288
|
+
influence=mBones[int(matricesIndices[0])]*matricesWeights[0];
|
|
289
|
+
#if NUM_BONE_INFLUENCERS>1
|
|
290
|
+
influence+=mBones[int(matricesIndices[1])]*matricesWeights[1];
|
|
291
|
+
#endif
|
|
292
|
+
#if NUM_BONE_INFLUENCERS>2
|
|
293
|
+
influence+=mBones[int(matricesIndices[2])]*matricesWeights[2];
|
|
294
|
+
#endif
|
|
295
|
+
#if NUM_BONE_INFLUENCERS>3
|
|
296
|
+
influence+=mBones[int(matricesIndices[3])]*matricesWeights[3];
|
|
297
|
+
#endif
|
|
298
|
+
#if NUM_BONE_INFLUENCERS>4
|
|
299
|
+
influence+=mBones[int(matricesIndicesExtra[0])]*matricesWeightsExtra[0];
|
|
300
|
+
#endif
|
|
301
|
+
#if NUM_BONE_INFLUENCERS>5
|
|
302
|
+
influence+=mBones[int(matricesIndicesExtra[1])]*matricesWeightsExtra[1];
|
|
303
|
+
#endif
|
|
304
|
+
#if NUM_BONE_INFLUENCERS>6
|
|
305
|
+
influence+=mBones[int(matricesIndicesExtra[2])]*matricesWeightsExtra[2];
|
|
306
|
+
#endif
|
|
307
|
+
#if NUM_BONE_INFLUENCERS>7
|
|
308
|
+
influence+=mBones[int(matricesIndicesExtra[3])]*matricesWeightsExtra[3];
|
|
309
|
+
#endif
|
|
310
|
+
#endif
|
|
311
|
+
finalWorld=finalWorld*influence;
|
|
312
|
+
#endif
|
|
313
|
+
#endif
|
|
314
|
+
`;
|
|
315
|
+
e.IncludesShadersStore[v] || (e.IncludesShadersStore[v] = w);
|
|
316
|
+
const u = "bakedVertexAnimation", y = `#ifdef BAKED_VERTEX_ANIMATION_TEXTURE
|
|
317
|
+
{
|
|
318
|
+
#ifdef INSTANCES
|
|
319
|
+
#define BVASNAME bakedVertexAnimationSettingsInstanced
|
|
320
|
+
#else
|
|
321
|
+
#define BVASNAME bakedVertexAnimationSettings
|
|
322
|
+
#endif
|
|
323
|
+
float VATStartFrame=BVASNAME.x;float VATEndFrame=BVASNAME.y;float VATOffsetFrame=BVASNAME.z;float VATSpeed=BVASNAME.w;float totalFrames=VATEndFrame-VATStartFrame+1.0;float time=bakedVertexAnimationTime*VATSpeed/totalFrames;float frameCorrection=time<1.0 ? 0.0 : 1.0;float numOfFrames=totalFrames-frameCorrection;float VATFrameNum=fract(time)*numOfFrames;VATFrameNum=mod(VATFrameNum+VATOffsetFrame,numOfFrames);VATFrameNum=floor(VATFrameNum);VATFrameNum+=VATStartFrame+frameCorrection;mat4 VATInfluence;VATInfluence=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndices[0],VATFrameNum)*matricesWeights[0];
|
|
324
|
+
#if NUM_BONE_INFLUENCERS>1
|
|
325
|
+
VATInfluence+=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndices[1],VATFrameNum)*matricesWeights[1];
|
|
326
|
+
#endif
|
|
327
|
+
#if NUM_BONE_INFLUENCERS>2
|
|
328
|
+
VATInfluence+=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndices[2],VATFrameNum)*matricesWeights[2];
|
|
329
|
+
#endif
|
|
330
|
+
#if NUM_BONE_INFLUENCERS>3
|
|
331
|
+
VATInfluence+=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndices[3],VATFrameNum)*matricesWeights[3];
|
|
332
|
+
#endif
|
|
333
|
+
#if NUM_BONE_INFLUENCERS>4
|
|
334
|
+
VATInfluence+=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndicesExtra[0],VATFrameNum)*matricesWeightsExtra[0];
|
|
335
|
+
#endif
|
|
336
|
+
#if NUM_BONE_INFLUENCERS>5
|
|
337
|
+
VATInfluence+=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndicesExtra[1],VATFrameNum)*matricesWeightsExtra[1];
|
|
338
|
+
#endif
|
|
339
|
+
#if NUM_BONE_INFLUENCERS>6
|
|
340
|
+
VATInfluence+=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndicesExtra[2],VATFrameNum)*matricesWeightsExtra[2];
|
|
341
|
+
#endif
|
|
342
|
+
#if NUM_BONE_INFLUENCERS>7
|
|
343
|
+
VATInfluence+=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndicesExtra[3],VATFrameNum)*matricesWeightsExtra[3];
|
|
344
|
+
#endif
|
|
345
|
+
finalWorld=finalWorld*VATInfluence;}
|
|
346
|
+
#endif
|
|
347
|
+
`;
|
|
348
|
+
e.IncludesShadersStore[u] || (e.IncludesShadersStore[u] = y);
|
|
349
|
+
const N = "prePassVertex", $ = `#ifdef PREPASS_DEPTH
|
|
350
|
+
vViewPos=(view*worldPos).rgb;
|
|
351
|
+
#endif
|
|
352
|
+
#ifdef PREPASS_NORMALIZED_VIEW_DEPTH
|
|
353
|
+
vNormViewDepth=((view*worldPos).z-cameraInfo.x)/(cameraInfo.y-cameraInfo.x);
|
|
354
|
+
#endif
|
|
355
|
+
#ifdef PREPASS_LOCAL_POSITION
|
|
356
|
+
vPosition=positionUpdated.xyz;
|
|
357
|
+
#endif
|
|
358
|
+
#if (defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)) && defined(BONES_VELOCITY_ENABLED)
|
|
359
|
+
vCurrentPosition=viewProjection*worldPos;
|
|
360
|
+
#if NUM_BONE_INFLUENCERS>0
|
|
361
|
+
mat4 previousInfluence;previousInfluence=mPreviousBones[int(matricesIndices[0])]*matricesWeights[0];
|
|
362
|
+
#if NUM_BONE_INFLUENCERS>1
|
|
363
|
+
previousInfluence+=mPreviousBones[int(matricesIndices[1])]*matricesWeights[1];
|
|
364
|
+
#endif
|
|
365
|
+
#if NUM_BONE_INFLUENCERS>2
|
|
366
|
+
previousInfluence+=mPreviousBones[int(matricesIndices[2])]*matricesWeights[2];
|
|
367
|
+
#endif
|
|
368
|
+
#if NUM_BONE_INFLUENCERS>3
|
|
369
|
+
previousInfluence+=mPreviousBones[int(matricesIndices[3])]*matricesWeights[3];
|
|
370
|
+
#endif
|
|
371
|
+
#if NUM_BONE_INFLUENCERS>4
|
|
372
|
+
previousInfluence+=mPreviousBones[int(matricesIndicesExtra[0])]*matricesWeightsExtra[0];
|
|
373
|
+
#endif
|
|
374
|
+
#if NUM_BONE_INFLUENCERS>5
|
|
375
|
+
previousInfluence+=mPreviousBones[int(matricesIndicesExtra[1])]*matricesWeightsExtra[1];
|
|
376
|
+
#endif
|
|
377
|
+
#if NUM_BONE_INFLUENCERS>6
|
|
378
|
+
previousInfluence+=mPreviousBones[int(matricesIndicesExtra[2])]*matricesWeightsExtra[2];
|
|
379
|
+
#endif
|
|
380
|
+
#if NUM_BONE_INFLUENCERS>7
|
|
381
|
+
previousInfluence+=mPreviousBones[int(matricesIndicesExtra[3])]*matricesWeightsExtra[3];
|
|
382
|
+
#endif
|
|
383
|
+
vPreviousPosition=previousViewProjection*finalPreviousWorld*previousInfluence*vec4(positionUpdated,1.0);
|
|
384
|
+
#else
|
|
385
|
+
vPreviousPosition=previousViewProjection*finalPreviousWorld*vec4(positionUpdated,1.0);
|
|
386
|
+
#endif
|
|
387
|
+
#endif
|
|
388
|
+
`;
|
|
389
|
+
e.IncludesShadersStore[N] || (e.IncludesShadersStore[N] = $);
|
|
390
|
+
const T = "uvVariableDeclaration", k = `#if !defined(UV{X}) && defined(MAINUV{X})
|
|
391
|
+
vec2 uv{X}=vec2(0.,0.);
|
|
392
|
+
#endif
|
|
393
|
+
#ifdef MAINUV{X}
|
|
394
|
+
vMainUV{X}=uv{X};
|
|
395
|
+
#endif
|
|
396
|
+
`;
|
|
397
|
+
e.IncludesShadersStore[T] || (e.IncludesShadersStore[T] = k);
|
|
398
|
+
const A = "samplerVertexImplementation", z = `#if defined(_DEFINENAME_) && _DEFINENAME_DIRECTUV==0
|
|
399
|
+
if (v_INFONAME_==0.)
|
|
400
|
+
{v_VARYINGNAME_UV=vec2(_MATRIXNAME_Matrix*vec4(uvUpdated,1.0,0.0));}
|
|
401
|
+
#ifdef UV2
|
|
402
|
+
else if (v_INFONAME_==1.)
|
|
403
|
+
{v_VARYINGNAME_UV=vec2(_MATRIXNAME_Matrix*vec4(uv2Updated,1.0,0.0));}
|
|
404
|
+
#endif
|
|
405
|
+
#ifdef UV3
|
|
406
|
+
else if (v_INFONAME_==2.)
|
|
407
|
+
{v_VARYINGNAME_UV=vec2(_MATRIXNAME_Matrix*vec4(uv3,1.0,0.0));}
|
|
408
|
+
#endif
|
|
409
|
+
#ifdef UV4
|
|
410
|
+
else if (v_INFONAME_==3.)
|
|
411
|
+
{v_VARYINGNAME_UV=vec2(_MATRIXNAME_Matrix*vec4(uv4,1.0,0.0));}
|
|
412
|
+
#endif
|
|
413
|
+
#ifdef UV5
|
|
414
|
+
else if (v_INFONAME_==4.)
|
|
415
|
+
{v_VARYINGNAME_UV=vec2(_MATRIXNAME_Matrix*vec4(uv5,1.0,0.0));}
|
|
416
|
+
#endif
|
|
417
|
+
#ifdef UV6
|
|
418
|
+
else if (v_INFONAME_==5.)
|
|
419
|
+
{v_VARYINGNAME_UV=vec2(_MATRIXNAME_Matrix*vec4(uv6,1.0,0.0));}
|
|
420
|
+
#endif
|
|
421
|
+
#endif
|
|
422
|
+
`;
|
|
423
|
+
e.IncludesShadersStore[A] || (e.IncludesShadersStore[A] = z);
|
|
424
|
+
const h = "bumpVertex", Y = `#if defined(BUMP) || defined(PARALLAX) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC)
|
|
425
|
+
#if defined(TANGENT) && defined(NORMAL)
|
|
426
|
+
vec3 tbnNormal=normalize(normalUpdated);vec3 tbnTangent=normalize(tangentUpdated.xyz);vec3 tbnBitangent=cross(tbnNormal,tbnTangent)*tangentUpdated.w;vTBN=mat3(finalWorld)*mat3(tbnTangent,tbnBitangent,tbnNormal);
|
|
427
|
+
#endif
|
|
428
|
+
#endif
|
|
429
|
+
`;
|
|
430
|
+
e.IncludesShadersStore[h] || (e.IncludesShadersStore[h] = Y);
|
|
431
|
+
const x = "clipPlaneVertex", j = `#ifdef CLIPPLANE
|
|
432
|
+
fClipDistance=dot(worldPos,vClipPlane);
|
|
433
|
+
#endif
|
|
434
|
+
#ifdef CLIPPLANE2
|
|
435
|
+
fClipDistance2=dot(worldPos,vClipPlane2);
|
|
436
|
+
#endif
|
|
437
|
+
#ifdef CLIPPLANE3
|
|
438
|
+
fClipDistance3=dot(worldPos,vClipPlane3);
|
|
439
|
+
#endif
|
|
440
|
+
#ifdef CLIPPLANE4
|
|
441
|
+
fClipDistance4=dot(worldPos,vClipPlane4);
|
|
442
|
+
#endif
|
|
443
|
+
#ifdef CLIPPLANE5
|
|
444
|
+
fClipDistance5=dot(worldPos,vClipPlane5);
|
|
445
|
+
#endif
|
|
446
|
+
#ifdef CLIPPLANE6
|
|
447
|
+
fClipDistance6=dot(worldPos,vClipPlane6);
|
|
448
|
+
#endif
|
|
449
|
+
`;
|
|
450
|
+
e.IncludesShadersStore[x] || (e.IncludesShadersStore[x] = j);
|
|
451
|
+
const R = "fogVertex", K = `#ifdef FOG
|
|
452
|
+
vFogDistance=(view*worldPos).xyz;
|
|
453
|
+
#endif
|
|
454
|
+
`;
|
|
455
|
+
e.IncludesShadersStore[R] || (e.IncludesShadersStore[R] = K);
|
|
456
|
+
const _ = "shadowsVertex", Z = `#ifdef SHADOWS
|
|
457
|
+
#if defined(SHADOWCSM{X})
|
|
458
|
+
vPositionFromCamera{X}=view*worldPos;for (int i=0; i<SHADOWCSMNUM_CASCADES{X}; i++) {vPositionFromLight{X}[i]=lightMatrix{X}[i]*worldPos;
|
|
459
|
+
#ifdef USE_REVERSE_DEPTHBUFFER
|
|
460
|
+
vDepthMetric{X}[i]=(-vPositionFromLight{X}[i].z+light{X}.depthValues.x)/light{X}.depthValues.y;
|
|
461
|
+
#else
|
|
462
|
+
vDepthMetric{X}[i]=(vPositionFromLight{X}[i].z+light{X}.depthValues.x)/light{X}.depthValues.y;
|
|
463
|
+
#endif
|
|
464
|
+
}
|
|
465
|
+
#elif defined(SHADOW{X}) && !defined(SHADOWCUBE{X})
|
|
466
|
+
vPositionFromLight{X}=lightMatrix{X}*worldPos;
|
|
467
|
+
#ifdef USE_REVERSE_DEPTHBUFFER
|
|
468
|
+
vDepthMetric{X}=(-vPositionFromLight{X}.z+light{X}.depthValues.x)/light{X}.depthValues.y;
|
|
469
|
+
#else
|
|
470
|
+
vDepthMetric{X}=(vPositionFromLight{X}.z+light{X}.depthValues.x)/light{X}.depthValues.y;
|
|
471
|
+
#endif
|
|
472
|
+
#endif
|
|
473
|
+
#endif
|
|
474
|
+
`;
|
|
475
|
+
e.IncludesShadersStore[_] || (e.IncludesShadersStore[_] = Z);
|
|
476
|
+
const p = "vertexColorMixing", q = `#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)
|
|
477
|
+
vColor=vec4(1.0);
|
|
478
|
+
#ifdef VERTEXCOLOR
|
|
479
|
+
#ifdef VERTEXALPHA
|
|
480
|
+
vColor*=colorUpdated;
|
|
481
|
+
#else
|
|
482
|
+
vColor.rgb*=colorUpdated.rgb;
|
|
483
|
+
#endif
|
|
484
|
+
#endif
|
|
485
|
+
#ifdef INSTANCESCOLOR
|
|
486
|
+
vColor*=instanceColor;
|
|
487
|
+
#endif
|
|
488
|
+
#endif
|
|
489
|
+
`;
|
|
490
|
+
e.IncludesShadersStore[p] || (e.IncludesShadersStore[p] = q);
|
|
491
|
+
const M = "logDepthVertex", J = `#ifdef LOGARITHMICDEPTH
|
|
492
|
+
vFragmentDepth=1.0+gl_Position.w;gl_Position.z=log2(max(0.000001,vFragmentDepth))*logarithmicDepthConstant;
|
|
493
|
+
#endif
|
|
494
|
+
`;
|
|
495
|
+
e.IncludesShadersStore[M] || (e.IncludesShadersStore[M] = J);
|
|
496
|
+
//# sourceMappingURL=logDepthVertex-r_niddz9.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logDepthVertex-r_niddz9.js","sources":["../node_modules/@babylonjs/core/Shaders/ShadersInclude/decalVertexDeclaration.js","../node_modules/@babylonjs/core/Shaders/ShadersInclude/uvAttributeDeclaration.js","../node_modules/@babylonjs/core/Shaders/ShadersInclude/bonesDeclaration.js","../node_modules/@babylonjs/core/Shaders/ShadersInclude/bakedVertexAnimationDeclaration.js","../node_modules/@babylonjs/core/Shaders/ShadersInclude/prePassVertexDeclaration.js","../node_modules/@babylonjs/core/Shaders/ShadersInclude/samplerVertexDeclaration.js","../node_modules/@babylonjs/core/Shaders/ShadersInclude/bumpVertexDeclaration.js","../node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneVertexDeclaration.js","../node_modules/@babylonjs/core/Shaders/ShadersInclude/fogVertexDeclaration.js","../node_modules/@babylonjs/core/Shaders/ShadersInclude/lightVxFragmentDeclaration.js","../node_modules/@babylonjs/core/Shaders/ShadersInclude/lightVxUboDeclaration.js","../node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertexGlobalDeclaration.js","../node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertexDeclaration.js","../node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertexGlobal.js","../node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertex.js","../node_modules/@babylonjs/core/Shaders/ShadersInclude/bonesVertex.js","../node_modules/@babylonjs/core/Shaders/ShadersInclude/bakedVertexAnimation.js","../node_modules/@babylonjs/core/Shaders/ShadersInclude/prePassVertex.js","../node_modules/@babylonjs/core/Shaders/ShadersInclude/uvVariableDeclaration.js","../node_modules/@babylonjs/core/Shaders/ShadersInclude/samplerVertexImplementation.js","../node_modules/@babylonjs/core/Shaders/ShadersInclude/bumpVertex.js","../node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneVertex.js","../node_modules/@babylonjs/core/Shaders/ShadersInclude/fogVertex.js","../node_modules/@babylonjs/core/Shaders/ShadersInclude/shadowsVertex.js","../node_modules/@babylonjs/core/Shaders/ShadersInclude/vertexColorMixing.js","../node_modules/@babylonjs/core/Shaders/ShadersInclude/logDepthVertex.js"],"sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore.js\";\nconst name = \"decalVertexDeclaration\";\nconst shader = `#ifdef DECAL\nuniform vec4 vDecalInfos;uniform mat4 decalMatrix;\n#endif\n`;\n// Sideeffect\nif (!ShaderStore.IncludesShadersStore[name]) {\n ShaderStore.IncludesShadersStore[name] = shader;\n}\n/** @internal */\nexport const decalVertexDeclaration = { name, shader };\n//# sourceMappingURL=decalVertexDeclaration.js.map","// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore.js\";\nconst name = \"uvAttributeDeclaration\";\nconst shader = `#ifdef UV{X}\nattribute vec2 uv{X};\n#endif\n`;\n// Sideeffect\nif (!ShaderStore.IncludesShadersStore[name]) {\n ShaderStore.IncludesShadersStore[name] = shader;\n}\n/** @internal */\nexport const uvAttributeDeclaration = { name, shader };\n//# sourceMappingURL=uvAttributeDeclaration.js.map","// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore.js\";\nconst name = \"bonesDeclaration\";\nconst shader = `#if NUM_BONE_INFLUENCERS>0\nattribute vec4 matricesIndices;attribute vec4 matricesWeights;\n#if NUM_BONE_INFLUENCERS>4\nattribute vec4 matricesIndicesExtra;attribute vec4 matricesWeightsExtra;\n#endif\n#ifndef BAKED_VERTEX_ANIMATION_TEXTURE\n#ifdef BONETEXTURE\nuniform highp sampler2D boneSampler;uniform float boneTextureWidth;\n#else\nuniform mat4 mBones[BonesPerMesh];\n#endif\n#ifdef BONES_VELOCITY_ENABLED\nuniform mat4 mPreviousBones[BonesPerMesh];\n#endif\n#ifdef BONETEXTURE\n#define inline\nmat4 readMatrixFromRawSampler(sampler2D smp,float index)\n{float offset=index *4.0;float dx=1.0/boneTextureWidth;vec4 m0=texture2D(smp,vec2(dx*(offset+0.5),0.));vec4 m1=texture2D(smp,vec2(dx*(offset+1.5),0.));vec4 m2=texture2D(smp,vec2(dx*(offset+2.5),0.));vec4 m3=texture2D(smp,vec2(dx*(offset+3.5),0.));return mat4(m0,m1,m2,m3);}\n#endif\n#endif\n#endif\n`;\n// Sideeffect\nif (!ShaderStore.IncludesShadersStore[name]) {\n ShaderStore.IncludesShadersStore[name] = shader;\n}\n/** @internal */\nexport const bonesDeclaration = { name, shader };\n//# sourceMappingURL=bonesDeclaration.js.map","// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore.js\";\nconst name = \"bakedVertexAnimationDeclaration\";\nconst shader = `#ifdef BAKED_VERTEX_ANIMATION_TEXTURE\nuniform float bakedVertexAnimationTime;uniform vec2 bakedVertexAnimationTextureSizeInverted;uniform vec4 bakedVertexAnimationSettings;uniform sampler2D bakedVertexAnimationTexture;\n#ifdef INSTANCES\nattribute vec4 bakedVertexAnimationSettingsInstanced;\n#endif\n#define inline\nmat4 readMatrixFromRawSamplerVAT(sampler2D smp,float index,float frame)\n{float offset=index*4.0;float frameUV=(frame+0.5)*bakedVertexAnimationTextureSizeInverted.y;float dx=bakedVertexAnimationTextureSizeInverted.x;vec4 m0=texture2D(smp,vec2(dx*(offset+0.5),frameUV));vec4 m1=texture2D(smp,vec2(dx*(offset+1.5),frameUV));vec4 m2=texture2D(smp,vec2(dx*(offset+2.5),frameUV));vec4 m3=texture2D(smp,vec2(dx*(offset+3.5),frameUV));return mat4(m0,m1,m2,m3);}\n#endif\n`;\n// Sideeffect\nif (!ShaderStore.IncludesShadersStore[name]) {\n ShaderStore.IncludesShadersStore[name] = shader;\n}\n/** @internal */\nexport const bakedVertexAnimationDeclaration = { name, shader };\n//# sourceMappingURL=bakedVertexAnimationDeclaration.js.map","// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore.js\";\nconst name = \"prePassVertexDeclaration\";\nconst shader = `#ifdef PREPASS\n#ifdef PREPASS_LOCAL_POSITION\nvarying vec3 vPosition;\n#endif\n#ifdef PREPASS_DEPTH\nvarying vec3 vViewPos;\n#endif\n#ifdef PREPASS_NORMALIZED_VIEW_DEPTH\nvarying float vNormViewDepth;\n#endif\n#if defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)\nuniform mat4 previousViewProjection;varying vec4 vCurrentPosition;varying vec4 vPreviousPosition;\n#endif\n#endif\n`;\n// Sideeffect\nif (!ShaderStore.IncludesShadersStore[name]) {\n ShaderStore.IncludesShadersStore[name] = shader;\n}\n/** @internal */\nexport const prePassVertexDeclaration = { name, shader };\n//# sourceMappingURL=prePassVertexDeclaration.js.map","// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore.js\";\nconst name = \"samplerVertexDeclaration\";\nconst shader = `#if defined(_DEFINENAME_) && _DEFINENAME_DIRECTUV==0\nvarying vec2 v_VARYINGNAME_UV;\n#endif\n`;\n// Sideeffect\nif (!ShaderStore.IncludesShadersStore[name]) {\n ShaderStore.IncludesShadersStore[name] = shader;\n}\n/** @internal */\nexport const samplerVertexDeclaration = { name, shader };\n//# sourceMappingURL=samplerVertexDeclaration.js.map","// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore.js\";\nconst name = \"bumpVertexDeclaration\";\nconst shader = `#if defined(BUMP) || defined(PARALLAX) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC)\n#if defined(TANGENT) && defined(NORMAL) \nvarying mat3 vTBN;\n#endif\n#endif\n`;\n// Sideeffect\nif (!ShaderStore.IncludesShadersStore[name]) {\n ShaderStore.IncludesShadersStore[name] = shader;\n}\n/** @internal */\nexport const bumpVertexDeclaration = { name, shader };\n//# sourceMappingURL=bumpVertexDeclaration.js.map","// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore.js\";\nconst name = \"clipPlaneVertexDeclaration\";\nconst shader = `#ifdef CLIPPLANE\nuniform vec4 vClipPlane;varying float fClipDistance;\n#endif\n#ifdef CLIPPLANE2\nuniform vec4 vClipPlane2;varying float fClipDistance2;\n#endif\n#ifdef CLIPPLANE3\nuniform vec4 vClipPlane3;varying float fClipDistance3;\n#endif\n#ifdef CLIPPLANE4\nuniform vec4 vClipPlane4;varying float fClipDistance4;\n#endif\n#ifdef CLIPPLANE5\nuniform vec4 vClipPlane5;varying float fClipDistance5;\n#endif\n#ifdef CLIPPLANE6\nuniform vec4 vClipPlane6;varying float fClipDistance6;\n#endif\n`;\n// Sideeffect\nif (!ShaderStore.IncludesShadersStore[name]) {\n ShaderStore.IncludesShadersStore[name] = shader;\n}\n/** @internal */\nexport const clipPlaneVertexDeclaration = { name, shader };\n//# sourceMappingURL=clipPlaneVertexDeclaration.js.map","// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore.js\";\nconst name = \"fogVertexDeclaration\";\nconst shader = `#ifdef FOG\nvarying vec3 vFogDistance;\n#endif\n`;\n// Sideeffect\nif (!ShaderStore.IncludesShadersStore[name]) {\n ShaderStore.IncludesShadersStore[name] = shader;\n}\n/** @internal */\nexport const fogVertexDeclaration = { name, shader };\n//# sourceMappingURL=fogVertexDeclaration.js.map","// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore.js\";\nconst name = \"lightVxFragmentDeclaration\";\nconst shader = `#ifdef LIGHT{X}\nuniform vec4 vLightData{X};uniform vec4 vLightDiffuse{X};\n#ifdef SPECULARTERM\nuniform vec4 vLightSpecular{X};\n#else\nvec4 vLightSpecular{X}=vec4(0.);\n#endif\n#ifdef SHADOW{X}\n#ifdef SHADOWCSM{X}\nuniform mat4 lightMatrix{X}[SHADOWCSMNUM_CASCADES{X}];varying vec4 vPositionFromLight{X}[SHADOWCSMNUM_CASCADES{X}];varying float vDepthMetric{X}[SHADOWCSMNUM_CASCADES{X}];varying vec4 vPositionFromCamera{X};\n#elif defined(SHADOWCUBE{X})\n#else\nvarying vec4 vPositionFromLight{X};varying float vDepthMetric{X};uniform mat4 lightMatrix{X};\n#endif\nuniform vec4 shadowsInfo{X};uniform vec2 depthValues{X};\n#endif\n#ifdef SPOTLIGHT{X}\nuniform vec4 vLightDirection{X};uniform vec4 vLightFalloff{X};\n#elif defined(POINTLIGHT{X})\nuniform vec4 vLightFalloff{X};\n#elif defined(HEMILIGHT{X})\nuniform vec3 vLightGround{X};\n#endif\n#if defined(AREALIGHT{X})\nuniform vec4 vLightWidth{X};uniform vec4 vLightHeight{X};\n#endif\n#endif\n`;\n// Sideeffect\nif (!ShaderStore.IncludesShadersStore[name]) {\n ShaderStore.IncludesShadersStore[name] = shader;\n}\n/** @internal */\nexport const lightVxFragmentDeclaration = { name, shader };\n//# sourceMappingURL=lightVxFragmentDeclaration.js.map","// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore.js\";\nconst name = \"lightVxUboDeclaration\";\nconst shader = `#ifdef LIGHT{X}\nuniform Light{X}\n{vec4 vLightData;vec4 vLightDiffuse;vec4 vLightSpecular;\n#ifdef SPOTLIGHT{X}\nvec4 vLightDirection;vec4 vLightFalloff;\n#elif defined(POINTLIGHT{X})\nvec4 vLightFalloff;\n#elif defined(HEMILIGHT{X})\nvec3 vLightGround;\n#endif\n#if defined(AREALIGHT{X})\nvec4 vLightWidth;vec4 vLightHeight;\n#endif\nvec4 shadowsInfo;vec2 depthValues;} light{X};\n#ifdef SHADOW{X}\n#ifdef SHADOWCSM{X}\nuniform mat4 lightMatrix{X}[SHADOWCSMNUM_CASCADES{X}];varying vec4 vPositionFromLight{X}[SHADOWCSMNUM_CASCADES{X}];varying float vDepthMetric{X}[SHADOWCSMNUM_CASCADES{X}];varying vec4 vPositionFromCamera{X};\n#elif defined(SHADOWCUBE{X})\n#else\nvarying vec4 vPositionFromLight{X};varying float vDepthMetric{X};uniform mat4 lightMatrix{X};\n#endif\n#endif\n#endif\n`;\n// Sideeffect\nif (!ShaderStore.IncludesShadersStore[name]) {\n ShaderStore.IncludesShadersStore[name] = shader;\n}\n/** @internal */\nexport const lightVxUboDeclaration = { name, shader };\n//# sourceMappingURL=lightVxUboDeclaration.js.map","// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore.js\";\nconst name = \"morphTargetsVertexGlobalDeclaration\";\nconst shader = `#ifdef MORPHTARGETS\nuniform float morphTargetInfluences[NUM_MORPH_INFLUENCERS];\n#ifdef MORPHTARGETS_TEXTURE \nuniform float morphTargetTextureIndices[NUM_MORPH_INFLUENCERS];uniform vec3 morphTargetTextureInfo;uniform highp sampler2DArray morphTargets;vec3 readVector3FromRawSampler(int targetIndex,float vertexIndex)\n{ \nfloat y=floor(vertexIndex/morphTargetTextureInfo.y);float x=vertexIndex-y*morphTargetTextureInfo.y;vec3 textureUV=vec3((x+0.5)/morphTargetTextureInfo.y,(y+0.5)/morphTargetTextureInfo.z,morphTargetTextureIndices[targetIndex]);return texture(morphTargets,textureUV).xyz;}\nvec4 readVector4FromRawSampler(int targetIndex,float vertexIndex)\n{ \nfloat y=floor(vertexIndex/morphTargetTextureInfo.y);float x=vertexIndex-y*morphTargetTextureInfo.y;vec3 textureUV=vec3((x+0.5)/morphTargetTextureInfo.y,(y+0.5)/morphTargetTextureInfo.z,morphTargetTextureIndices[targetIndex]);return texture(morphTargets,textureUV);}\n#endif\n#endif\n`;\n// Sideeffect\nif (!ShaderStore.IncludesShadersStore[name]) {\n ShaderStore.IncludesShadersStore[name] = shader;\n}\n/** @internal */\nexport const morphTargetsVertexGlobalDeclaration = { name, shader };\n//# sourceMappingURL=morphTargetsVertexGlobalDeclaration.js.map","// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore.js\";\nconst name = \"morphTargetsVertexDeclaration\";\nconst shader = `#ifdef MORPHTARGETS\n#ifndef MORPHTARGETS_TEXTURE\n#ifdef MORPHTARGETS_POSITION\nattribute vec3 position{X};\n#endif\n#ifdef MORPHTARGETS_NORMAL\nattribute vec3 normal{X};\n#endif\n#ifdef MORPHTARGETS_TANGENT\nattribute vec3 tangent{X};\n#endif\n#ifdef MORPHTARGETS_UV\nattribute vec2 uv_{X};\n#endif\n#ifdef MORPHTARGETS_UV2\nattribute vec2 uv2_{X};\n#endif\n#ifdef MORPHTARGETS_COLOR\nattribute vec4 color{X};\n#endif\n#elif {X}==0\nuniform int morphTargetCount;\n#endif\n#endif\n`;\n// Sideeffect\nif (!ShaderStore.IncludesShadersStore[name]) {\n ShaderStore.IncludesShadersStore[name] = shader;\n}\n/** @internal */\nexport const morphTargetsVertexDeclaration = { name, shader };\n//# sourceMappingURL=morphTargetsVertexDeclaration.js.map","// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore.js\";\nconst name = \"morphTargetsVertexGlobal\";\nconst shader = `#ifdef MORPHTARGETS\n#ifdef MORPHTARGETS_TEXTURE\nfloat vertexID;\n#endif\n#endif\n`;\n// Sideeffect\nif (!ShaderStore.IncludesShadersStore[name]) {\n ShaderStore.IncludesShadersStore[name] = shader;\n}\n/** @internal */\nexport const morphTargetsVertexGlobal = { name, shader };\n//# sourceMappingURL=morphTargetsVertexGlobal.js.map","// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore.js\";\nconst name = \"morphTargetsVertex\";\nconst shader = `#ifdef MORPHTARGETS\n#ifdef MORPHTARGETS_TEXTURE\n#if {X}==0\nfor (int i=0; i<NUM_MORPH_INFLUENCERS; i++) {if (i>=morphTargetCount) break;vertexID=float(gl_VertexID)*morphTargetTextureInfo.x;\n#ifdef MORPHTARGETS_POSITION\npositionUpdated+=(readVector3FromRawSampler(i,vertexID)-position)*morphTargetInfluences[i];\n#endif\n#ifdef MORPHTARGETTEXTURE_HASPOSITIONS\nvertexID+=1.0;\n#endif\n#ifdef MORPHTARGETS_NORMAL\nnormalUpdated+=(readVector3FromRawSampler(i,vertexID) -normal)*morphTargetInfluences[i];\n#endif\n#ifdef MORPHTARGETTEXTURE_HASNORMALS\nvertexID+=1.0;\n#endif\n#ifdef MORPHTARGETS_UV\nuvUpdated+=(readVector3FromRawSampler(i,vertexID).xy-uv)*morphTargetInfluences[i];\n#endif\n#ifdef MORPHTARGETTEXTURE_HASUVS\nvertexID+=1.0;\n#endif\n#ifdef MORPHTARGETS_TANGENT\ntangentUpdated.xyz+=(readVector3FromRawSampler(i,vertexID) -tangent.xyz)*morphTargetInfluences[i];\n#endif\n#ifdef MORPHTARGETTEXTURE_HASTANGENTS\nvertexID+=1.0;\n#endif\n#ifdef MORPHTARGETS_UV2\nuv2Updated+=(readVector3FromRawSampler(i,vertexID).xy-uv2)*morphTargetInfluences[i];\n#endif\n#ifdef MORPHTARGETTEXTURE_HASUV2S\nvertexID+=1.0;\n#endif\n#ifdef MORPHTARGETS_COLOR\ncolorUpdated+=(readVector4FromRawSampler(i,vertexID)-color)*morphTargetInfluences[i];\n#endif\n}\n#endif\n#else\n#ifdef MORPHTARGETS_POSITION\npositionUpdated+=(position{X}-position)*morphTargetInfluences[{X}];\n#endif\n#ifdef MORPHTARGETS_NORMAL\nnormalUpdated+=(normal{X}-normal)*morphTargetInfluences[{X}];\n#endif\n#ifdef MORPHTARGETS_TANGENT\ntangentUpdated.xyz+=(tangent{X}-tangent.xyz)*morphTargetInfluences[{X}];\n#endif\n#ifdef MORPHTARGETS_UV\nuvUpdated+=(uv_{X}-uv)*morphTargetInfluences[{X}];\n#endif\n#ifdef MORPHTARGETS_UV2\nuv2Updated+=(uv2_{X}-uv2)*morphTargetInfluences[{X}];\n#endif\n#ifdef MORPHTARGETS_COLOR\ncolorUpdated+=(color{X}-color)*morphTargetInfluences[{X}];\n#endif\n#endif\n#endif\n`;\n// Sideeffect\nif (!ShaderStore.IncludesShadersStore[name]) {\n ShaderStore.IncludesShadersStore[name] = shader;\n}\n/** @internal */\nexport const morphTargetsVertex = { name, shader };\n//# sourceMappingURL=morphTargetsVertex.js.map","// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore.js\";\nconst name = \"bonesVertex\";\nconst shader = `#ifndef BAKED_VERTEX_ANIMATION_TEXTURE\n#if NUM_BONE_INFLUENCERS>0\nmat4 influence;\n#ifdef BONETEXTURE\ninfluence=readMatrixFromRawSampler(boneSampler,matricesIndices[0])*matricesWeights[0];\n#if NUM_BONE_INFLUENCERS>1\ninfluence+=readMatrixFromRawSampler(boneSampler,matricesIndices[1])*matricesWeights[1];\n#endif\n#if NUM_BONE_INFLUENCERS>2\ninfluence+=readMatrixFromRawSampler(boneSampler,matricesIndices[2])*matricesWeights[2];\n#endif\n#if NUM_BONE_INFLUENCERS>3\ninfluence+=readMatrixFromRawSampler(boneSampler,matricesIndices[3])*matricesWeights[3];\n#endif\n#if NUM_BONE_INFLUENCERS>4\ninfluence+=readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[0])*matricesWeightsExtra[0];\n#endif\n#if NUM_BONE_INFLUENCERS>5\ninfluence+=readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[1])*matricesWeightsExtra[1];\n#endif\n#if NUM_BONE_INFLUENCERS>6\ninfluence+=readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[2])*matricesWeightsExtra[2];\n#endif\n#if NUM_BONE_INFLUENCERS>7\ninfluence+=readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[3])*matricesWeightsExtra[3];\n#endif\n#else\ninfluence=mBones[int(matricesIndices[0])]*matricesWeights[0];\n#if NUM_BONE_INFLUENCERS>1\ninfluence+=mBones[int(matricesIndices[1])]*matricesWeights[1];\n#endif\n#if NUM_BONE_INFLUENCERS>2\ninfluence+=mBones[int(matricesIndices[2])]*matricesWeights[2];\n#endif\n#if NUM_BONE_INFLUENCERS>3\ninfluence+=mBones[int(matricesIndices[3])]*matricesWeights[3];\n#endif\n#if NUM_BONE_INFLUENCERS>4\ninfluence+=mBones[int(matricesIndicesExtra[0])]*matricesWeightsExtra[0];\n#endif\n#if NUM_BONE_INFLUENCERS>5\ninfluence+=mBones[int(matricesIndicesExtra[1])]*matricesWeightsExtra[1];\n#endif\n#if NUM_BONE_INFLUENCERS>6\ninfluence+=mBones[int(matricesIndicesExtra[2])]*matricesWeightsExtra[2];\n#endif\n#if NUM_BONE_INFLUENCERS>7\ninfluence+=mBones[int(matricesIndicesExtra[3])]*matricesWeightsExtra[3];\n#endif\n#endif\nfinalWorld=finalWorld*influence;\n#endif\n#endif\n`;\n// Sideeffect\nif (!ShaderStore.IncludesShadersStore[name]) {\n ShaderStore.IncludesShadersStore[name] = shader;\n}\n/** @internal */\nexport const bonesVertex = { name, shader };\n//# sourceMappingURL=bonesVertex.js.map","// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore.js\";\nconst name = \"bakedVertexAnimation\";\nconst shader = `#ifdef BAKED_VERTEX_ANIMATION_TEXTURE\n{\n#ifdef INSTANCES\n#define BVASNAME bakedVertexAnimationSettingsInstanced\n#else\n#define BVASNAME bakedVertexAnimationSettings\n#endif\nfloat VATStartFrame=BVASNAME.x;float VATEndFrame=BVASNAME.y;float VATOffsetFrame=BVASNAME.z;float VATSpeed=BVASNAME.w;float totalFrames=VATEndFrame-VATStartFrame+1.0;float time=bakedVertexAnimationTime*VATSpeed/totalFrames;float frameCorrection=time<1.0 ? 0.0 : 1.0;float numOfFrames=totalFrames-frameCorrection;float VATFrameNum=fract(time)*numOfFrames;VATFrameNum=mod(VATFrameNum+VATOffsetFrame,numOfFrames);VATFrameNum=floor(VATFrameNum);VATFrameNum+=VATStartFrame+frameCorrection;mat4 VATInfluence;VATInfluence=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndices[0],VATFrameNum)*matricesWeights[0];\n#if NUM_BONE_INFLUENCERS>1\nVATInfluence+=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndices[1],VATFrameNum)*matricesWeights[1];\n#endif\n#if NUM_BONE_INFLUENCERS>2\nVATInfluence+=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndices[2],VATFrameNum)*matricesWeights[2];\n#endif\n#if NUM_BONE_INFLUENCERS>3\nVATInfluence+=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndices[3],VATFrameNum)*matricesWeights[3];\n#endif\n#if NUM_BONE_INFLUENCERS>4\nVATInfluence+=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndicesExtra[0],VATFrameNum)*matricesWeightsExtra[0];\n#endif\n#if NUM_BONE_INFLUENCERS>5\nVATInfluence+=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndicesExtra[1],VATFrameNum)*matricesWeightsExtra[1];\n#endif\n#if NUM_BONE_INFLUENCERS>6\nVATInfluence+=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndicesExtra[2],VATFrameNum)*matricesWeightsExtra[2];\n#endif\n#if NUM_BONE_INFLUENCERS>7\nVATInfluence+=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndicesExtra[3],VATFrameNum)*matricesWeightsExtra[3];\n#endif\nfinalWorld=finalWorld*VATInfluence;}\n#endif\n`;\n// Sideeffect\nif (!ShaderStore.IncludesShadersStore[name]) {\n ShaderStore.IncludesShadersStore[name] = shader;\n}\n/** @internal */\nexport const bakedVertexAnimation = { name, shader };\n//# sourceMappingURL=bakedVertexAnimation.js.map","// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore.js\";\nconst name = \"prePassVertex\";\nconst shader = `#ifdef PREPASS_DEPTH\nvViewPos=(view*worldPos).rgb;\n#endif\n#ifdef PREPASS_NORMALIZED_VIEW_DEPTH\nvNormViewDepth=((view*worldPos).z-cameraInfo.x)/(cameraInfo.y-cameraInfo.x);\n#endif\n#ifdef PREPASS_LOCAL_POSITION\nvPosition=positionUpdated.xyz;\n#endif\n#if (defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)) && defined(BONES_VELOCITY_ENABLED)\nvCurrentPosition=viewProjection*worldPos;\n#if NUM_BONE_INFLUENCERS>0\nmat4 previousInfluence;previousInfluence=mPreviousBones[int(matricesIndices[0])]*matricesWeights[0];\n#if NUM_BONE_INFLUENCERS>1\npreviousInfluence+=mPreviousBones[int(matricesIndices[1])]*matricesWeights[1];\n#endif \n#if NUM_BONE_INFLUENCERS>2\npreviousInfluence+=mPreviousBones[int(matricesIndices[2])]*matricesWeights[2];\n#endif \n#if NUM_BONE_INFLUENCERS>3\npreviousInfluence+=mPreviousBones[int(matricesIndices[3])]*matricesWeights[3];\n#endif\n#if NUM_BONE_INFLUENCERS>4\npreviousInfluence+=mPreviousBones[int(matricesIndicesExtra[0])]*matricesWeightsExtra[0];\n#endif \n#if NUM_BONE_INFLUENCERS>5\npreviousInfluence+=mPreviousBones[int(matricesIndicesExtra[1])]*matricesWeightsExtra[1];\n#endif \n#if NUM_BONE_INFLUENCERS>6\npreviousInfluence+=mPreviousBones[int(matricesIndicesExtra[2])]*matricesWeightsExtra[2];\n#endif \n#if NUM_BONE_INFLUENCERS>7\npreviousInfluence+=mPreviousBones[int(matricesIndicesExtra[3])]*matricesWeightsExtra[3];\n#endif\nvPreviousPosition=previousViewProjection*finalPreviousWorld*previousInfluence*vec4(positionUpdated,1.0);\n#else\nvPreviousPosition=previousViewProjection*finalPreviousWorld*vec4(positionUpdated,1.0);\n#endif\n#endif\n`;\n// Sideeffect\nif (!ShaderStore.IncludesShadersStore[name]) {\n ShaderStore.IncludesShadersStore[name] = shader;\n}\n/** @internal */\nexport const prePassVertex = { name, shader };\n//# sourceMappingURL=prePassVertex.js.map","// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore.js\";\nconst name = \"uvVariableDeclaration\";\nconst shader = `#if !defined(UV{X}) && defined(MAINUV{X})\nvec2 uv{X}=vec2(0.,0.);\n#endif\n#ifdef MAINUV{X}\nvMainUV{X}=uv{X};\n#endif\n`;\n// Sideeffect\nif (!ShaderStore.IncludesShadersStore[name]) {\n ShaderStore.IncludesShadersStore[name] = shader;\n}\n/** @internal */\nexport const uvVariableDeclaration = { name, shader };\n//# sourceMappingURL=uvVariableDeclaration.js.map","// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore.js\";\nconst name = \"samplerVertexImplementation\";\nconst shader = `#if defined(_DEFINENAME_) && _DEFINENAME_DIRECTUV==0\nif (v_INFONAME_==0.)\n{v_VARYINGNAME_UV=vec2(_MATRIXNAME_Matrix*vec4(uvUpdated,1.0,0.0));}\n#ifdef UV2\nelse if (v_INFONAME_==1.)\n{v_VARYINGNAME_UV=vec2(_MATRIXNAME_Matrix*vec4(uv2Updated,1.0,0.0));}\n#endif\n#ifdef UV3\nelse if (v_INFONAME_==2.)\n{v_VARYINGNAME_UV=vec2(_MATRIXNAME_Matrix*vec4(uv3,1.0,0.0));}\n#endif\n#ifdef UV4\nelse if (v_INFONAME_==3.)\n{v_VARYINGNAME_UV=vec2(_MATRIXNAME_Matrix*vec4(uv4,1.0,0.0));}\n#endif\n#ifdef UV5\nelse if (v_INFONAME_==4.)\n{v_VARYINGNAME_UV=vec2(_MATRIXNAME_Matrix*vec4(uv5,1.0,0.0));}\n#endif\n#ifdef UV6\nelse if (v_INFONAME_==5.)\n{v_VARYINGNAME_UV=vec2(_MATRIXNAME_Matrix*vec4(uv6,1.0,0.0));}\n#endif\n#endif\n`;\n// Sideeffect\nif (!ShaderStore.IncludesShadersStore[name]) {\n ShaderStore.IncludesShadersStore[name] = shader;\n}\n/** @internal */\nexport const samplerVertexImplementation = { name, shader };\n//# sourceMappingURL=samplerVertexImplementation.js.map","// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore.js\";\nconst name = \"bumpVertex\";\nconst shader = `#if defined(BUMP) || defined(PARALLAX) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC)\n#if defined(TANGENT) && defined(NORMAL)\nvec3 tbnNormal=normalize(normalUpdated);vec3 tbnTangent=normalize(tangentUpdated.xyz);vec3 tbnBitangent=cross(tbnNormal,tbnTangent)*tangentUpdated.w;vTBN=mat3(finalWorld)*mat3(tbnTangent,tbnBitangent,tbnNormal);\n#endif\n#endif\n`;\n// Sideeffect\nif (!ShaderStore.IncludesShadersStore[name]) {\n ShaderStore.IncludesShadersStore[name] = shader;\n}\n/** @internal */\nexport const bumpVertex = { name, shader };\n//# sourceMappingURL=bumpVertex.js.map","// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore.js\";\nconst name = \"clipPlaneVertex\";\nconst shader = `#ifdef CLIPPLANE\nfClipDistance=dot(worldPos,vClipPlane);\n#endif\n#ifdef CLIPPLANE2\nfClipDistance2=dot(worldPos,vClipPlane2);\n#endif\n#ifdef CLIPPLANE3\nfClipDistance3=dot(worldPos,vClipPlane3);\n#endif\n#ifdef CLIPPLANE4\nfClipDistance4=dot(worldPos,vClipPlane4);\n#endif\n#ifdef CLIPPLANE5\nfClipDistance5=dot(worldPos,vClipPlane5);\n#endif\n#ifdef CLIPPLANE6\nfClipDistance6=dot(worldPos,vClipPlane6);\n#endif\n`;\n// Sideeffect\nif (!ShaderStore.IncludesShadersStore[name]) {\n ShaderStore.IncludesShadersStore[name] = shader;\n}\n/** @internal */\nexport const clipPlaneVertex = { name, shader };\n//# sourceMappingURL=clipPlaneVertex.js.map","// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore.js\";\nconst name = \"fogVertex\";\nconst shader = `#ifdef FOG\nvFogDistance=(view*worldPos).xyz;\n#endif\n`;\n// Sideeffect\nif (!ShaderStore.IncludesShadersStore[name]) {\n ShaderStore.IncludesShadersStore[name] = shader;\n}\n/** @internal */\nexport const fogVertex = { name, shader };\n//# sourceMappingURL=fogVertex.js.map","// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore.js\";\nconst name = \"shadowsVertex\";\nconst shader = `#ifdef SHADOWS\n#if defined(SHADOWCSM{X})\nvPositionFromCamera{X}=view*worldPos;for (int i=0; i<SHADOWCSMNUM_CASCADES{X}; i++) {vPositionFromLight{X}[i]=lightMatrix{X}[i]*worldPos;\n#ifdef USE_REVERSE_DEPTHBUFFER\nvDepthMetric{X}[i]=(-vPositionFromLight{X}[i].z+light{X}.depthValues.x)/light{X}.depthValues.y;\n#else\nvDepthMetric{X}[i]=(vPositionFromLight{X}[i].z+light{X}.depthValues.x)/light{X}.depthValues.y;\n#endif\n}\n#elif defined(SHADOW{X}) && !defined(SHADOWCUBE{X})\nvPositionFromLight{X}=lightMatrix{X}*worldPos;\n#ifdef USE_REVERSE_DEPTHBUFFER\nvDepthMetric{X}=(-vPositionFromLight{X}.z+light{X}.depthValues.x)/light{X}.depthValues.y;\n#else\nvDepthMetric{X}=(vPositionFromLight{X}.z+light{X}.depthValues.x)/light{X}.depthValues.y;\n#endif\n#endif\n#endif\n`;\n// Sideeffect\nif (!ShaderStore.IncludesShadersStore[name]) {\n ShaderStore.IncludesShadersStore[name] = shader;\n}\n/** @internal */\nexport const shadowsVertex = { name, shader };\n//# sourceMappingURL=shadowsVertex.js.map","// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore.js\";\nconst name = \"vertexColorMixing\";\nconst shader = `#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvColor=vec4(1.0);\n#ifdef VERTEXCOLOR\n#ifdef VERTEXALPHA\nvColor*=colorUpdated;\n#else\nvColor.rgb*=colorUpdated.rgb;\n#endif\n#endif\n#ifdef INSTANCESCOLOR\nvColor*=instanceColor;\n#endif\n#endif\n`;\n// Sideeffect\nif (!ShaderStore.IncludesShadersStore[name]) {\n ShaderStore.IncludesShadersStore[name] = shader;\n}\n/** @internal */\nexport const vertexColorMixing = { name, shader };\n//# sourceMappingURL=vertexColorMixing.js.map","// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore.js\";\nconst name = \"logDepthVertex\";\nconst shader = `#ifdef LOGARITHMICDEPTH\nvFragmentDepth=1.0+gl_Position.w;gl_Position.z=log2(max(0.000001,vFragmentDepth))*logarithmicDepthConstant;\n#endif\n`;\n// Sideeffect\nif (!ShaderStore.IncludesShadersStore[name]) {\n ShaderStore.IncludesShadersStore[name] = shader;\n}\n/** @internal */\nexport const logDepthVertex = { name, shader };\n//# sourceMappingURL=logDepthVertex.js.map"],"names":["name","shader","ShaderStore"],"mappings":";AAEA,MAAMA,IAAO,0BACPC,IAAS;AAAA;AAAA;AAAA;AAKVC,EAAY,qBAAqB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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAeVC,EAAY,qBAAqBF,CAAI,MACtCE,EAAY,qBAAqBF,CAAI,IAAIC;ACjB7C,MAAMD,IAAO,kBACPC,IAAS;AAAA;AAAA;AAAA;AAKVC,EAAY,qBAAqBF,CAAI,MACtCE,EAAY,qBAAqBF,CAAI,IAAIC;","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
function l(o) {
|
|
2
|
+
return Math.floor(o / 8);
|
|
3
|
+
}
|
|
4
|
+
function y(o) {
|
|
5
|
+
return 1 << o % 8;
|
|
6
|
+
}
|
|
7
|
+
class x {
|
|
8
|
+
/**
|
|
9
|
+
* Creates a new bit array with a fixed size.
|
|
10
|
+
* @param size The number of bits to store.
|
|
11
|
+
*/
|
|
12
|
+
constructor(e) {
|
|
13
|
+
this.size = e, this._byteArray = new Uint8Array(Math.ceil(this.size / 8));
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Gets the current value at the specified index.
|
|
17
|
+
* @param bitIndex The index to get the value from.
|
|
18
|
+
* @returns The value at the specified index.
|
|
19
|
+
*/
|
|
20
|
+
get(e) {
|
|
21
|
+
if (e >= this.size)
|
|
22
|
+
throw new RangeError("Bit index out of range");
|
|
23
|
+
const n = l(e), r = y(e);
|
|
24
|
+
return (this._byteArray[n] & r) !== 0;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Sets the value at the specified index.
|
|
28
|
+
* @param bitIndex The index to set the value at.
|
|
29
|
+
* @param value The value to set.
|
|
30
|
+
*/
|
|
31
|
+
set(e, n) {
|
|
32
|
+
if (e >= this.size)
|
|
33
|
+
throw new RangeError("Bit index out of range");
|
|
34
|
+
const r = l(e), s = y(e);
|
|
35
|
+
n ? this._byteArray[r] |= s : this._byteArray[r] &= ~s;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
function w(o) {
|
|
39
|
+
const e = [], n = o.length / 3;
|
|
40
|
+
for (let t = 0; t < n; t++)
|
|
41
|
+
e.push([o[t * 3], o[t * 3 + 1], o[t * 3 + 2]]);
|
|
42
|
+
const r = /* @__PURE__ */ new Map();
|
|
43
|
+
for (let t = 0; t < e.length; t++) {
|
|
44
|
+
const a = e[t];
|
|
45
|
+
for (const c of a) {
|
|
46
|
+
let f = r.get(c);
|
|
47
|
+
f || r.set(c, f = []), f.push(t);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
const s = new x(n), h = [], p = (t) => {
|
|
51
|
+
const a = [t];
|
|
52
|
+
for (; a.length > 0; ) {
|
|
53
|
+
const c = a.pop();
|
|
54
|
+
if (!s.get(c)) {
|
|
55
|
+
s.set(c, !0), h.push(e[c]);
|
|
56
|
+
for (const f of e[c]) {
|
|
57
|
+
const u = r.get(f);
|
|
58
|
+
if (!u)
|
|
59
|
+
return;
|
|
60
|
+
for (const g of u)
|
|
61
|
+
s.get(g) || a.push(g);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
for (let t = 0; t < n; t++)
|
|
67
|
+
s.get(t) || p(t);
|
|
68
|
+
let i = 0;
|
|
69
|
+
for (const t of h)
|
|
70
|
+
o[i++] = t[0], o[i++] = t[1], o[i++] = t[2];
|
|
71
|
+
}
|
|
72
|
+
export {
|
|
73
|
+
w as OptimizeIndices
|
|
74
|
+
};
|
|
75
|
+
//# sourceMappingURL=mesh.vertexData.functions-Bc9lJlrU.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mesh.vertexData.functions-Bc9lJlrU.js","sources":["../node_modules/@babylonjs/core/Misc/bitArray.js","../node_modules/@babylonjs/core/Meshes/mesh.vertexData.functions.js"],"sourcesContent":["function GetByteIndex(bitIndex) {\n return Math.floor(bitIndex / 8);\n}\nfunction GetBitMask(bitIndex) {\n return 1 << bitIndex % 8;\n}\n/**\n * An fixed size array that effectively stores boolean values where each value is a single bit of backing data.\n * @remarks\n * All bits are initialized to false.\n */\nexport class BitArray {\n /**\n * Creates a new bit array with a fixed size.\n * @param size The number of bits to store.\n */\n constructor(size) {\n this.size = size;\n this._byteArray = new Uint8Array(Math.ceil(this.size / 8));\n }\n /**\n * Gets the current value at the specified index.\n * @param bitIndex The index to get the value from.\n * @returns The value at the specified index.\n */\n get(bitIndex) {\n if (bitIndex >= this.size) {\n throw new RangeError(\"Bit index out of range\");\n }\n const byteIndex = GetByteIndex(bitIndex);\n const bitMask = GetBitMask(bitIndex);\n return (this._byteArray[byteIndex] & bitMask) !== 0;\n }\n /**\n * Sets the value at the specified index.\n * @param bitIndex The index to set the value at.\n * @param value The value to set.\n */\n set(bitIndex, value) {\n if (bitIndex >= this.size) {\n throw new RangeError(\"Bit index out of range\");\n }\n const byteIndex = GetByteIndex(bitIndex);\n const bitMask = GetBitMask(bitIndex);\n if (value) {\n this._byteArray[byteIndex] |= bitMask;\n }\n else {\n this._byteArray[byteIndex] &= ~bitMask;\n }\n }\n}\n//# sourceMappingURL=bitArray.js.map","import { BitArray } from \"../Misc/bitArray.js\";\n/**\n * Sort (in place) the index array so that faces with common indices are close\n * @param indices the array of indices to sort\n */\nexport function OptimizeIndices(indices) {\n const faces = [];\n const faceCount = indices.length / 3;\n // Step 1: Break the indices array into faces\n for (let i = 0; i < faceCount; i++) {\n faces.push([indices[i * 3], indices[i * 3 + 1], indices[i * 3 + 2]]);\n }\n // Step 2: Build a graph connecting faces sharing a vertex\n const vertexToFaceMap = new Map();\n for (let faceIndex = 0; faceIndex < faces.length; faceIndex++) {\n const face = faces[faceIndex];\n for (const vertex of face) {\n let face = vertexToFaceMap.get(vertex);\n if (!face) {\n vertexToFaceMap.set(vertex, (face = []));\n }\n face.push(faceIndex);\n }\n }\n // Step 3: Traverse faces using DFS to ensure connected faces are close\n const visited = new BitArray(faceCount);\n const sortedFaces = [];\n // Using a stack and not a recursive version to avoid call stack overflow\n const deepFirstSearchStack = (startFaceIndex) => {\n const stack = [startFaceIndex];\n while (stack.length > 0) {\n const currentFaceIndex = stack.pop();\n if (visited.get(currentFaceIndex)) {\n continue;\n }\n visited.set(currentFaceIndex, true);\n sortedFaces.push(faces[currentFaceIndex]);\n // Push unvisited neighbors (faces sharing a vertex) onto the stack\n for (const vertex of faces[currentFaceIndex]) {\n const neighbors = vertexToFaceMap.get(vertex);\n if (!neighbors) {\n return;\n }\n for (const neighborFaceIndex of neighbors) {\n if (!visited.get(neighborFaceIndex)) {\n stack.push(neighborFaceIndex);\n }\n }\n }\n }\n };\n // Start DFS from the first face\n for (let i = 0; i < faceCount; i++) {\n if (!visited.get(i)) {\n deepFirstSearchStack(i);\n }\n }\n // Step 4: Flatten the sorted faces back into an array\n let index = 0;\n for (const face of sortedFaces) {\n indices[index++] = face[0];\n indices[index++] = face[1];\n indices[index++] = face[2];\n }\n}\n//# sourceMappingURL=mesh.vertexData.functions.js.map"],"names":["GetByteIndex","bitIndex","GetBitMask","BitArray","size","byteIndex","bitMask","value","OptimizeIndices","indices","faces","faceCount","i","vertexToFaceMap","faceIndex","face","vertex","visited","sortedFaces","deepFirstSearchStack","startFaceIndex","stack","currentFaceIndex","neighbors","neighborFaceIndex","index"],"mappings":"AAAA,SAASA,EAAaC,GAAU;AAC5B,SAAO,KAAK,MAAMA,IAAW,CAAC;AAClC;AACA,SAASC,EAAWD,GAAU;AAC1B,SAAO,KAAKA,IAAW;AAC3B;AAMO,MAAME,EAAS;AAAA;AAAA;AAAA;AAAA;AAAA,EAKlB,YAAYC,GAAM;AACd,SAAK,OAAOA,GACZ,KAAK,aAAa,IAAI,WAAW,KAAK,KAAK,KAAK,OAAO,CAAC,CAAC;AAAA,EACjE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMI,IAAIH,GAAU;AACV,QAAIA,KAAY,KAAK;AACjB,YAAM,IAAI,WAAW,wBAAwB;AAEjD,UAAMI,I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