PageSourceSearch

https://conquistas-cpjq7vbv.manus.space/assets/default.vertex-ClOjFUGi.js

js conquistas-cpjq7vbv.manus.space collected 2026-10-03 05:01:15 UTC 38,088 bytes, 777 lines download raw bytes

1import{u as e}from"./index-DDBsTPp3.js";import{s as z,m as C,d as H,a as w,l as B}from"./logDepthDeclaration-BKv9Ro-s.js";import{h as Y}from"./helperFunctions-DJiNSHwP.js";import{b as $,a as j,i as k,c as Q,f as K,d as Z,e as q,g as J,h as ee,j as te,v as ie}from"./vertexColorMixing-BiZfKGQg.js";const i="uvAttributeDeclaration",S=`#if defined(UV{X}) && !defined(USE_VERTEX_PULLING)
2attribute uv{X}: vec2f;
3#endif
4`;e.IncludesShadersStoreWGSL[i]||(e.IncludesShadersStoreWGSL[i]=S);const re={name:i,shader:S},r="prePassVertexDeclaration",V=`#ifdef PREPASS
5#ifdef PREPASS_LOCAL_POSITION
6varying vPosition : vec3f;
7#endif
8#ifdef PREPASS_DEPTH
9varying vViewPos: vec3f;
10#endif
11#ifdef PREPASS_NORMALIZED_VIEW_DEPTH
12varying vNormViewDepth: f32;
13#endif
14#if defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)
15uniform previousViewProjection: mat4x4f;varying vCurrentPosition: vec4f;varying vPreviousPosition: vec4f;
16#endif
17#endif
18`;e.IncludesShadersStoreWGSL[r]||(e.IncludesShadersStoreWGSL[r]=V);const ne={name:r,shader:V},n="samplerVertexDeclaration",U=`#if defined(_DEFINENAME_) && _DEFINENAME_DIRECTUV==0
19varying v_VARYINGNAME_UV: vec2f;
20#endif
21`;e.IncludesShadersStoreWGSL[n]||(e.IncludesShadersStoreWGSL[n]=U);const ae={name:n,shader:U},a="bumpVertexDeclaration",N=`#if defined(BUMP) || defined(PARALLAX) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC)
22#if defined(TANGENT) && defined(NORMAL) 
23varying vTBN0: vec3f;varying vTBN1: vec3f;varying vTBN2: vec3f;
24#endif
25#endif
26`;e.IncludesShadersStoreWGSL[a]||(e.IncludesShadersStoreWGSL[a]=N);const fe={name:a,shader:N},f="lightVxFragmentDeclaration",h=`#ifdef LIGHT{X}
27uniform vLightData{X}: vec4f;uniform vLightDiffuse{X}: vec4f;
28#ifdef SPECULARTERM
29uniform vLightSpecular{X}: vec4f;
30#else
31var vLightSpecular{X}: vec4f= vec4f(0.);
32#endif
33#ifdef SHADOW{X}
34#ifdef SHADOWCSM{X}
35uniform lightMatrix{X}: mat4x4f[SHADOWCSMNUM_CASCADES{X}];varying var vPositionFromLight{X}: vec4f[SHADOWCSMNUM_CASCADES{X}];varying var vDepthMetric{X}: f32[SHADOWCSMNUM_CASCADES{X}];varying var vPositionFromCamera{X}: vec4f;
36#elif defined(SHADOWCUBE{X})
37#else
38varying var vPositionFromLight{X}: vec4f;varying var vDepthMetric{X}: f32;uniform lightMatrix{X}: mat4x4f;
39#endif
40uniform shadowsInfo{X}: vec4f;uniform depthValues{X}: vec2f;
41#endif
42#ifdef SPOTLIGHT{X}
43uniform vLightDirection{X}: vec4f;uniform vLightFalloff{X}: vec4f;
44#elif defined(POINTLIGHT{X})
45uniform vLightFalloff{X}: vec4f;
46#elif defined(HEMILIGHT{X})
47uniform vLightGround{X}: vec3f;
48#endif
49#if defined(AREALIGHT{X}) && defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED)
50uniform vLightWidth{X}: vec4f;uniform vLightHeight{X}: vec4f;
51#endif
52#endif
53`;e.IncludesShadersStoreWGSL[f]||(e.IncludesShadersStoreWGSL[f]=h);const de={name:f,shader:h},d="lightVxUboDeclaration",O=`#ifdef LIGHT{X}
54struct Light{X}
55{vLightData: vec4f,
56vLightDiffuse: vec4f,
57vLightSpecular: vec4f,
58#ifdef SPOTLIGHT{X}
59vLightDirection: vec4f,
60vLightFalloff: vec4f,
61#elif defined(POINTLIGHT{X})
62vLightFalloff: vec4f,
63#elif defined(HEMILIGHT{X})
64vLightGround: vec3f,
65#elif defined(CLUSTLIGHT{X})
66vSliceData: vec2f,
67vSliceRanges: array<vec4f,CLUSTLIGHT_SLICES>,
68#endif
69#if defined(AREALIGHT{X}) && defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED)
70vLightWidth: vec4f,
71vLightHeight: vec4f,
72#endif
73shadowsInfo: vec4f,
74depthValues: vec2f} ;var<uniform> light{X} : Light{X};
75#ifdef SHADOW{X}
76#ifdef SHADOWCSM{X}
77uniform lightMatrix{X}: array<mat4x4f,SHADOWCSMNUM_CASCADES{X}>;varying vPositionFromLight{X}_0: vec4f;varying vDepthMetric{X}_0: f32;varying vPositionFromLight{X}_1: vec4f;varying vDepthMetric{X}_1: f32;varying vPositionFromLight{X}_2: vec4f;varying vDepthMetric{X}_2: f32;varying vPositionFromLight{X}_3: vec4f;varying vDepthMetric{X}_3: f32;varying vPositionFromCamera{X}: vec4f;
78#elif defined(SHADOWCUBE{X})
79#else
80varying vPositionFromLight{X}: vec4f;varying vDepthMetric{X}: f32;uniform lightMatrix{X}: mat4x4f;
81#endif
82#endif
83#endif
84`;e.IncludesShadersStoreWGSL[d]||(e.IncludesShadersStoreWGSL[d]=O);const oe={name:d,shader:O},o="morphTargetsVertexGlobalDeclaration",A=`#ifdef MORPHTARGETS
85uniform morphTargetInfluences : array<f32,NUM_MORPH_INFLUENCERS>;
86#ifdef MORPHTARGETS_TEXTURE 
87uniform morphTargetTextureIndices : array<f32,NUM_MORPH_INFLUENCERS>;uniform morphTargetTextureInfo : vec3<f32>;var morphTargets : texture_2d_array<f32>;fn readVector3FromRawSampler(targetIndex : i32,vertexIndex : f32)->vec3<f32>
88{ 
89let 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;}
90fn readVector4FromRawSampler(targetIndex : i32,vertexIndex : f32)->vec4<f32>
91{ 
92let textureWidth: i32=i32(uniforms.morphTargetTextureInfo.y); 
93let y: i32=i32(vertexIndex)/textureWidth;let x: i32=i32(vertexIndex) % textureWidth;return textureLoad(morphTargets,vec2i(x,y),i32(uniforms.morphTargetTextureIndices[targetIndex]),0);}
94#endif
95#endif
96`;e.IncludesShadersStoreWGSL[o]||(e.IncludesShadersStoreWGSL[o]=A);const se={name:o,shader:A},s="morphTargetsVertexDeclaration",g=`#ifdef MORPHTARGETS
97#ifndef MORPHTARGETS_TEXTURE
98#ifdef MORPHTARGETS_POSITION
99attribute position{X} : vec3<f32>;
100#endif
101#ifdef MORPHTARGETS_NORMAL
102attribute normal{X} : vec3<f32>;
103#endif
104#ifdef MORPHTARGETS_TANGENT
105attribute tangent{X} : vec3<f32>;
106#endif
107#ifdef MORPHTARGETS_UV
108attribute uv_{X} : vec2<f32>;
109#endif
110#ifdef MORPHTARGETS_UV2
111attribute uv2_{X} : vec2<f32>;
112#endif
113#ifdef MORPHTARGETS_COLOR
114attribute color{X} : vec4<f32>;
115#endif
116#elif {X}==0
117uniform morphTargetCount: f32;
118#endif
119#endif
120`;e.IncludesShadersStoreWGSL[s]||(e.IncludesShadersStoreWGSL[s]=g);const ue={name:s,shader:g},u="vertexPullingDeclaration",R=`#ifdef USE_VERTEX_PULLING
121#ifdef VERTEX_PULLING_USE_INDEX_BUFFER
122var<storage,read> indices : array<u32>;
123#endif
124var<storage,read> position : array<f32>;uniform vp_position_info : vec4f;
125#ifdef NORMAL
126var<storage,read> normal : array<f32>;uniform vp_normal_info : vec4f;
127#endif
128#ifdef TANGENT
129var<storage,read> tangent : array<f32>;uniform vp_tangent_info : vec4f;
130#endif
131#ifdef UV1
132var<storage,read> uv : array<f32>;uniform vp_uv_info : vec4f;
133#define VP_UV1_SUPPORTED
134#endif
135#ifdef UV2
136var<storage,read> uv2 : array<f32>;uniform vp_uv2_info : vec4f;
137#define VP_UV2_SUPPORTED
138#endif
139#ifdef UV3
140var<storage,read> uv3 : array<f32>;uniform vp_uv3_info : vec4f;
141#define VP_UV3_SUPPORTED
142#endif
143#ifdef UV4
144var<storage,read> uv4 : array<f32>;uniform vp_uv4_info : vec4f;
145#define VP_UV4_SUPPORTED
146#endif
147#ifdef UV5
148var<storage,read> uv5 : array<f32>;uniform vp_uv5_info : vec4f;
149#define VP_UV5_SUPPORTED
150#endif
151#ifdef UV6
152var<storage,read> uv6 : array<f32>;uniform vp_uv6_info : vec4f;
153#define VP_UV6_SUPPORTED
154#endif
155#ifdef VERTEXCOLOR
156var<storage,read> color : array<f32>;uniform vp_color_info : vec4f;
157#endif
158#if NUM_BONE_INFLUENCERS>0
159var<storage,read> matricesIndices : array<u32>;var<storage,read> matricesWeights : array<f32>;uniform vp_matricesIndices_info : vec4f;uniform vp_matricesWeights_info : vec4f;
160#if NUM_BONE_INFLUENCERS>4
161var<storage,read> matricesIndicesExtra : array<u32>;var<storage,read> matricesWeightsExtra : array<f32>;uniform vp_matricesIndicesExtra_info : vec4f;uniform vp_matricesWeightsExtra_info : vec4f;
162#endif
163#endif
164fn vp_convertToFloat(word : u32,byteInWord : u32,dataType : u32,normalized : bool)->f32 {switch (dataType) {case 5120u: { 
165let shift=byteInWord*8u;let value=(word>>shift) & 0xFFu;let signedValue=f32(i32(value<<24u)>>24u);if (normalized) { return signedValue/127.0; }
166return signedValue;}
167case 5121u: { 
168let shift=byteInWord*8u;let value=(word>>shift) & 0xFFu;if (normalized) { return f32(value)/255.0; }
169return f32(value);}
170case 5122u: { 
171let shift=(byteInWord & 0xFFFFFFFEu)*8u;let value=(word>>shift) & 0xFFFFu;let signedValue=f32(i32(value<<16u)>>16u);if (normalized) { return signedValue/32767.0; }
172return signedValue;}
173case 5123u: { 
174let shift=(byteInWord & 0xFFFFFFFEu)*8u;let value=(word>>shift) & 0xFFFFu;if (normalized) { return f32(value)/65535.0; }
175return f32(value);}
176case 5126u: { 
177return bitcast<f32>(word);}
178default: { return 0.0; }}}
179fn vp_componentSize(dataType : u32)->u32 {return select(select(2u,1u,dataType==5120u || dataType==5121u),4u,dataType==5126u);}
180fn vp_readVertexIndex(index : u32)->u32 {
181#ifndef VERTEX_PULLING_USE_INDEX_BUFFER
182return index;
183#else
184#ifdef VERTEX_PULLING_INDEX_BUFFER_32BITS
185return indices[index];
186#else
187let u32_index=index/2u;let bit_offset=(index & 1u)*16u;return (indices[u32_index]>>bit_offset) & 0xFFFFu;
188#endif
189#endif
190}
191fn vp_readPositionValue(byteOffset : u32,dataType : u32,normalized : bool)->f32 {return vp_convertToFloat(bitcast<u32>(position[byteOffset/4u]),byteOffset % 4u,dataType,normalized);}
192fn vp_readPosition(info : vec4f,vertexIndex : u32)->vec3f {let baseOffset=u32(info.x);let stride=u32(info.y);let dataType=u32(info.z);let normalized=info.w != 0.0;let offset=baseOffset+vertexIndex*stride;let cs=vp_componentSize(dataType);return vec3f(
193vp_readPositionValue(offset,dataType,normalized),
194vp_readPositionValue(offset+cs,dataType,normalized),
195vp_readPositionValue(offset+cs*2u,dataType,normalized)
196);}
197#ifdef NORMAL
198fn vp_readNormalValue(byteOffset : u32,dataType : u32,normalized : bool)->f32 {return vp_convertToFloat(bitcast<u32>(normal[byteOffset/4u]),byteOffset % 4u,dataType,normalized);}
199fn vp_readNormal(info : vec4f,vertexIndex : u32)->vec3f {let baseOffset=u32(info.x);let stride=u32(info.y);let dataType=u32(info.z);let normalized=info.w != 0.0;let offset=baseOffset+vertexIndex*stride;let cs=vp_componentSize(dataType);return vec3f(
200vp_readNormalValue(offset,dataType,normalized),
201vp_readNormalValue(offset+cs,dataType,normalized),
202vp_readNormalValue(offset+cs*2u,dataType,normalized)
203);}
204#endif
205#ifdef TANGENT
206fn vp_readTangentValue(byteOffset : u32,dataType : u32,normalized : bool)->f32 {return vp_convertToFloat(bitcast<u32>(tangent[byteOffset/4u]),byteOffset % 4u,dataType,normalized);}
207fn vp_readTangent(info : vec4f,vertexIndex : u32)->vec4f {let baseOffset=u32(info.x);let stride=u32(info.y);let dataType=u32(info.z);let normalized=info.w != 0.0;let offset=baseOffset+vertexIndex*stride;let cs=vp_componentSize(dataType);return vec4f(
208vp_readTangentValue(offset,dataType,normalized),
209vp_readTangentValue(offset+cs,dataType,normalized),
210vp_readTangentValue(offset+cs*2u,dataType,normalized),
211vp_readTangentValue(offset+cs*3u,dataType,normalized)
212);}
213#endif
214#ifdef UV1
215fn vp_readUVValue(byteOffset : u32,dataType : u32,normalized : bool)->f32 {return vp_convertToFloat(bitcast<u32>(uv[byteOffset/4u]),byteOffset % 4u,dataType,normalized);}
216fn vp_readUV(info : vec4f,vertexIndex : u32)->vec2f {let baseOffset=u32(info.x);let stride=u32(info.y);let dataType=u32(info.z);let normalized=info.w != 0.0;let offset=baseOffset+vertexIndex*stride;let cs=vp_componentSize(dataType);return vec2f(
217vp_readUVValue(offset,dataType,normalized),
218vp_readUVValue(offset+cs,dataType,normalized)
219);}
220#endif
221#ifdef UV2
222fn vp_readUV2Value(byteOffset : u32,dataType : u32,normalized : bool)->f32 {return vp_convertToFloat(bitcast<u32>(uv2[byteOffset/4u]),byteOffset % 4u,dataType,normalized);}
223fn vp_readUV2(info : vec4f,vertexIndex : u32)->vec2f {let baseOffset=u32(info.x);let stride=u32(info.y);let dataType=u32(info.z);let normalized=info.w != 0.0;let offset=baseOffset+vertexIndex*stride;let cs=vp_componentSize(dataType);return vec2f(
224vp_readUV2Value(offset,dataType,normalized),
225vp_readUV2Value(offset+cs,dataType,normalized)
226);}
227#endif
228#ifdef UV3
229fn vp_readUV3Value(byteOffset : u32,dataType : u32,normalized : bool)->f32 {return vp_convertToFloat(bitcast<u32>(uv3[byteOffset/4u]),byteOffset % 4u,dataType,normalized);}
230fn vp_readUV3(info : vec4f,vertexIndex : u32)->vec2f {let baseOffset=u32(info.x);let stride=u32(info.y);let dataType=u32(info.z);let normalized=info.w != 0.0;let offset=baseOffset+vertexIndex*stride;let cs=vp_componentSize(dataType);return vec2f(
231vp_readUV3Value(offset,dataType,normalized),
232vp_readUV3Value(offset+cs,dataType,normalized)
233);}
234#endif
235#ifdef UV4
236fn vp_readUV4Value(byteOffset : u32,dataType : u32,normalized : bool)->f32 {return vp_convertToFloat(bitcast<u32>(uv4[byteOffset/4u]),byteOffset % 4u,dataType,normalized);}
237fn vp_readUV4(info : vec4f,vertexIndex : u32)->vec2f {let baseOffset=u32(info.x);let stride=u32(info.y);let dataType=u32(info.z);let normalized=info.w != 0.0;let offset=baseOffset+vertexIndex*stride;let cs=vp_componentSize(dataType);return vec2f(
238vp_readUV4Value(offset,dataType,normalized),
239vp_readUV4Value(offset+cs,dataType,normalized)
240);}
241#endif
242#ifdef UV5
243fn vp_readUV5Value(byteOffset : u32,dataType : u32,normalized : bool)->f32 {return vp_convertToFloat(bitcast<u32>(uv5[byteOffset/4u]),byteOffset % 4u,dataType,normalized);}
244fn vp_readUV5(info : vec4f,vertexIndex : u32)->vec2f {let baseOffset=u32(info.x);let stride=u32(info.y);let dataType=u32(info.z);let normalized=info.w != 0.0;let offset=baseOffset+vertexIndex*stride;let cs=vp_componentSize(dataType);return vec2f(
245vp_readUV5Value(offset,dataType,normalized),
246vp_readUV5Value(offset+cs,dataType,normalized)
247);}
248#endif
249#ifdef UV6
250fn vp_readUV6Value(byteOffset : u32,dataType : u32,normalized : bool)->f32 {return vp_convertToFloat(bitcast<u32>(uv6[byteOffset/4u]),byteOffset % 4u,dataType,normalized);}
251fn vp_readUV6(info : vec4f,vertexIndex : u32)->vec2f {let baseOffset=u32(info.x);let stride=u32(info.y);let dataType=u32(info.z);let normalized=info.w != 0.0;let offset=baseOffset+vertexIndex*stride;let cs=vp_componentSize(dataType);return vec2f(
252vp_readUV6Value(offset,dataType,normalized),
253vp_readUV6Value(offset+cs,dataType,normalized)
254);}
255#endif
256#ifdef VERTEXCOLOR
257fn vp_readColorValue(byteOffset : u32,dataType : u32,normalized : bool)->f32 {return vp_convertToFloat(bitcast<u32>(color[byteOffset/4u]),byteOffset % 4u,dataType,normalized);}
258fn vp_readColor(info : vec4f,vertexIndex : u32)->vec4f {let baseOffset=u32(info.x);let stride=u32(info.y);let dataType=u32(info.z);let normalized=info.w != 0.0;let offset=baseOffset+vertexIndex*stride;let cs=vp_componentSize(dataType);return vec4f(
259vp_readColorValue(offset,dataType,normalized),
260vp_readColorValue(offset+cs,dataType,normalized),
261vp_readColorValue(offset+cs*2u,dataType,normalized),
262vp_readColorValue(offset+cs*3u,dataType,normalized)
263);}
264#endif
265#if NUM_BONE_INFLUENCERS>0
266fn vp_readMatrixIndexValue(byteOffset : u32,dataType : u32,normalized : bool)->f32 {return vp_convertToFloat(matricesIndices[byteOffset/4u],byteOffset % 4u,dataType,normalized);}
267fn vp_readBoneIndices(info : vec4f,vertexIndex : u32)->vec4f {let baseOffset=u32(info.x);let stride=u32(info.y);let dataType=u32(info.z);let normalized=info.w != 0.0;let offset=baseOffset+vertexIndex*stride;let cs=vp_componentSize(dataType);return vec4f(
268vp_readMatrixIndexValue(offset,dataType,normalized),
269vp_readMatrixIndexValue(offset+cs,dataType,normalized),
270vp_readMatrixIndexValue(offset+cs*2u,dataType,normalized),
271vp_readMatrixIndexValue(offset+cs*3u,dataType,normalized)
272);}
273fn vp_readMatrixWeightValue(byteOffset : u32,dataType : u32,normalized : bool)->f32 {return vp_convertToFloat(bitcast<u32>(matricesWeights[byteOffset/4u]),byteOffset % 4u,dataType,normalized);}
274fn vp_readBoneWeights(info : vec4f,vertexIndex : u32)->vec4f {let baseOffset=u32(info.x);let stride=u32(info.y);let dataType=u32(info.z);let normalized=info.w != 0.0;let offset=baseOffset+vertexIndex*stride;let cs=vp_componentSize(dataType);return vec4f(
275vp_readMatrixWeightValue(offset,dataType,normalized),
276vp_readMatrixWeightValue(offset+cs,dataType,normalized),
277vp_readMatrixWeightValue(offset+cs*2u,dataType,normalized),
278vp_readMatrixWeightValue(offset+cs*3u,dataType,normalized)
279);}
280#if NUM_BONE_INFLUENCERS>4
281fn vp_readMatrixIndexExtraValue(byteOffset : u32,dataType : u32,normalized : bool)->f32 {return vp_convertToFloat(matricesIndicesExtra[byteOffset/4u],byteOffset % 4u,dataType,normalized);}
282fn vp_readBoneIndicesExtra(info : vec4f,vertexIndex : u32)->vec4f {let baseOffset=u32(info.x);let stride=u32(info.y);let dataType=u32(info.z);let normalized=info.w != 0.0;let offset=baseOffset+vertexIndex*stride;let cs=vp_componentSize(dataType);return vec4f(
283vp_readMatrixIndexExtraValue(offset,dataType,normalized),
284vp_readMatrixIndexExtraValue(offset+cs,dataType,normalized),
285vp_readMatrixIndexExtraValue(offset+cs*2u,dataType,normalized),
286vp_readMatrixIndexExtraValue(offset+cs*3u,dataType,normalized)
287);}
288fn vp_readMatrixWeightExtraValue(byteOffset : u32,dataType : u32,normalized : bool)->f32 {return vp_convertToFloat(bitcast<u32>(matricesWeightsExtra[byteOffset/4u]),byteOffset % 4u,dataType,normalized);}
289fn vp_readBoneWeightsExtra(info : vec4f,vertexIndex : u32)->vec4f {let baseOffset=u32(info.x);let stride=u32(info.y);let dataType=u32(info.z);let normalized=info.w != 0.0;let offset=baseOffset+vertexIndex*stride;let cs=vp_componentSize(dataType);return vec4f(
290vp_readMatrixWeightExtraValue(offset,dataType,normalized),
291vp_readMatrixWeightExtraValue(offset+cs,dataType,normalized),
292vp_readMatrixWeightExtraValue(offset+cs*2u,dataType,normalized),
293vp_readMatrixWeightExtraValue(offset+cs*3u,dataType,normalized)
294);}
295#endif
296#endif
297#endif
298`;e.IncludesShadersStoreWGSL[u]||(e.IncludesShadersStoreWGSL[u]=R);const ve={name:u,shader:R},v="vertexPullingVertex",L=`#ifdef USE_VERTEX_PULLING
299let vpVertexIndex: u32=vp_readVertexIndex(vertexInputs.vertexIndex);positionUpdated=vp_readPosition(uniforms.vp_position_info,vpVertexIndex);
300#ifdef NORMAL
301normalUpdated=vp_readNormal(uniforms.vp_normal_info,vpVertexIndex);
302#endif
303#ifdef TANGENT
304tangentUpdated=vp_readTangent(uniforms.vp_tangent_info,vpVertexIndex);
305#endif
306#ifdef UV1
307uvUpdated=vp_readUV(uniforms.vp_uv_info,vpVertexIndex);
308#endif
309#ifdef UV2
310uv2Updated=vp_readUV2(uniforms.vp_uv2_info,vpVertexIndex);
311#endif
312#ifdef UV3
313var uv3Updated: vec2f=vp_readUV3(uniforms.vp_uv3_info,vpVertexIndex);
314#endif
315#ifdef UV4
316var uv4Updated: vec2f=vp_readUV4(uniforms.vp_uv4_info,vpVertexIndex);
317#endif
318#ifdef UV5
319var uv5Updated: vec2f=vp_readUV5(uniforms.vp_uv5_info,vpVertexIndex);
320#endif
321#ifdef UV6
322var uv6Updated: vec2f=vp_readUV6(uniforms.vp_uv6_info,vpVertexIndex);
323#endif
324#ifdef VERTEXCOLOR
325colorUpdated=vp_readColor(uniforms.vp_color_info,vpVertexIndex);
326#endif
327#ifdef MORPHTARGETS
328let vp_basePosition: vec3f=positionUpdated;
329#ifdef NORMAL
330let vp_baseNormal: vec3f=normalUpdated;
331#endif
332#ifdef TANGENT
333let vp_baseTangent: vec4f=tangentUpdated;
334#endif
335#ifdef UV1
336let vp_baseUV: vec2f=uvUpdated;
337#endif
338#ifdef UV2
339let vp_baseUV2: vec2f=uv2Updated;
340#endif
341#ifdef VERTEXCOLOR
342let vp_baseColor: vec4f=colorUpdated;
343#endif
344#endif
345#if NUM_BONE_INFLUENCERS>0
346var vp_matricesIndices: vec4f=vp_readBoneIndices(uniforms.vp_matricesIndices_info,vpVertexIndex);var vp_matricesWeights: vec4f=vp_readBoneWeights(uniforms.vp_matricesWeights_info,vpVertexIndex);
347#if NUM_BONE_INFLUENCERS>4
348var vp_matricesIndicesExtra: vec4f=vp_readBoneIndicesExtra(uniforms.vp_matricesIndicesExtra_info,vpVertexIndex);var vp_matricesWeightsExtra: vec4f=vp_readBoneWeightsExtra(uniforms.vp_matricesWeightsExtra_info,vpVertexIndex);
349#endif
350#endif
351#endif
352`;e.IncludesShadersStoreWGSL[v]||(e.IncludesShadersStoreWGSL[v]=L);const le={name:v,shader:L},l="morphTargetsVertexGlobal",M=`#ifdef MORPHTARGETS
353#ifdef MORPHTARGETS_TEXTURE
354var vertexID : f32;
355#endif
356#endif
357`;e.IncludesShadersStoreWGSL[l]||(e.IncludesShadersStoreWGSL[l]=M);const pe={name:l,shader:M},p="morphTargetsVertex",y=`#ifdef MORPHTARGETS
358#ifdef MORPHTARGETS_TEXTURE
359#if {X}==0
360for (var i=0; i<NUM_MORPH_INFLUENCERS; i=i+1) {if (f32(i)>=uniforms.morphTargetCount) {break;}
361#ifdef USE_VERTEX_PULLING
362vertexID=f32(vpVertexIndex)*uniforms.morphTargetTextureInfo.x;
363#else
364vertexID=f32(vertexInputs.vertexIndex)*uniforms.morphTargetTextureInfo.x;
365#endif
366#ifdef MORPHTARGETS_POSITION
367#ifdef USE_VERTEX_PULLING
368positionUpdated=positionUpdated+(readVector3FromRawSampler(i,vertexID)-vp_basePosition)*uniforms.morphTargetInfluences[i];
369#else
370positionUpdated=positionUpdated+(readVector3FromRawSampler(i,vertexID)-vertexInputs.position)*uniforms.morphTargetInfluences[i];
371#endif
372#endif
373#ifdef MORPHTARGETTEXTURE_HASPOSITIONS
374vertexID=vertexID+1.0;
375#endif
376#ifdef MORPHTARGETS_NORMAL
377#ifdef USE_VERTEX_PULLING
378normalUpdated=normalUpdated+(readVector3FromRawSampler(i,vertexID) -vp_baseNormal)*uniforms.morphTargetInfluences[i];
379#else
380normalUpdated=normalUpdated+(readVector3FromRawSampler(i,vertexID) -vertexInputs.normal)*uniforms.morphTargetInfluences[i];
381#endif
382#endif
383#ifdef MORPHTARGETTEXTURE_HASNORMALS
384vertexID=vertexID+1.0;
385#endif
386#ifdef MORPHTARGETS_UV
387#ifdef USE_VERTEX_PULLING
388uvUpdated=uvUpdated+(readVector3FromRawSampler(i,vertexID).xy-vp_baseUV)*uniforms.morphTargetInfluences[i];
389#else
390uvUpdated=uvUpdated+(readVector3FromRawSampler(i,vertexID).xy-vertexInputs.uv)*uniforms.morphTargetInfluences[i];
391#endif
392#endif
393#ifdef MORPHTARGETTEXTURE_HASUVS
394vertexID=vertexID+1.0;
395#endif
396#ifdef MORPHTARGETS_TANGENT
397#ifdef USE_VERTEX_PULLING
398tangentUpdated=vec4f(tangentUpdated.xyz+(readVector3FromRawSampler(i,vertexID) -vp_baseTangent.xyz)*uniforms.morphTargetInfluences[i],tangentUpdated.a);
399#else
400tangentUpdated=vec4f(tangentUpdated.xyz+(readVector3FromRawSampler(i,vertexID) -vertexInputs.tangent.xyz)*uniforms.morphTargetInfluences[i],tangentUpdated.a);
401#endif
402#endif
403#ifdef MORPHTARGETTEXTURE_HASTANGENTS
404vertexID=vertexID+1.0;
405#endif
406#ifdef MORPHTARGETS_UV2
407#ifdef USE_VERTEX_PULLING
408uv2Updated=uv2Updated+(readVector3FromRawSampler(i,vertexID).xy-vp_baseUV2)*uniforms.morphTargetInfluences[i];
409#else
410uv2Updated=uv2Updated+(readVector3FromRawSampler(i,vertexID).xy-vertexInputs.uv2)*uniforms.morphTargetInfluences[i];
411#endif
412#endif
413#ifdef MORPHTARGETS_COLOR
414#ifdef USE_VERTEX_PULLING
415colorUpdated=colorUpdated+(readVector4FromRawSampler(i,vertexID)-vp_baseColor)*uniforms.morphTargetInfluences[i];
416#else
417colorUpdated=colorUpdated+(readVector4FromRawSampler(i,vertexID)-vertexInputs.color)*uniforms.morphTargetInfluences[i];
418#endif
419#endif
420}
421#endif
422#else
423#ifdef MORPHTARGETS_POSITION
424#ifdef USE_VERTEX_PULLING
425positionUpdated=positionUpdated+(vertexInputs.position{X}-vp_basePosition)*uniforms.morphTargetInfluences[{X}];
426#else
427positionUpdated=positionUpdated+(vertexInputs.position{X}-vertexInputs.position)*uniforms.morphTargetInfluences[{X}];
428#endif
429#endif
430#ifdef MORPHTARGETS_NORMAL
431#ifdef USE_VERTEX_PULLING
432normalUpdated=normalUpdated+(vertexInputs.normal{X}-vp_baseNormal)*uniforms.morphTargetInfluences[{X}];
433#else
434normalUpdated=normalUpdated+(vertexInputs.normal{X}-vertexInputs.normal)*uniforms.morphTargetInfluences[{X}];
435#endif
436#endif
437#ifdef MORPHTARGETS_TANGENT
438#ifdef USE_VERTEX_PULLING
439tangentUpdated=vec4f(tangentUpdated.xyz+(vertexInputs.tangent{X}-vp_baseTangent.xyz)*uniforms.morphTargetInfluences[{X}],tangentUpdated.a);
440#else
441tangentUpdated=vec4f(tangentUpdated.xyz+(vertexInputs.tangent{X}-vertexInputs.tangent.xyz)*uniforms.morphTargetInfluences[{X}],tangentUpdated.a);
442#endif
443#endif
444#ifdef MORPHTARGETS_UV
445#ifdef USE_VERTEX_PULLING
446uvUpdated=uvUpdated+(vertexInputs.uv_{X}-vp_baseUV)*uniforms.morphTargetInfluences[{X}];
447#else
448uvUpdated=uvUpdated+(vertexInputs.uv_{X}-vertexInputs.uv)*uniforms.morphTargetInfluences[{X}];
449#endif
450#endif
451#ifdef MORPHTARGETS_UV2
452#ifdef USE_VERTEX_PULLING
453uv2Updated=uv2Updated+(vertexInputs.uv2_{X}-vp_baseUV2)*uniforms.morphTargetInfluences[{X}];
454#else
455uv2Updated=uv2Updated+(vertexInputs.uv2_{X}-vertexInputs.uv2)*uniforms.morphTargetInfluences[{X}];
456#endif
457#endif
458#ifdef MORPHTARGETS_COLOR
459#ifdef USE_VERTEX_PULLING
460colorUpdated=colorUpdated+(vertexInputs.color{X}-vp_baseColor)*uniforms.morphTargetInfluences[{X}];
461#else
462colorUpdated=colorUpdated+(vertexInputs.color{X}-vertexInputs.color)*uniforms.morphTargetInfluences[{X}];
463#endif
464#endif
465#endif
466#endif
467`;e.IncludesShadersStoreWGSL[p]||(e.IncludesShadersStoreWGSL[p]=y);const ce={name:p,shader:y},c="prePassVertex",P=`#ifdef PREPASS_DEPTH
468vertexOutputs.vViewPos=(scene.view*worldPos).rgb;
469#endif
470#ifdef PREPASS_NORMALIZED_VIEW_DEPTH
471vertexOutputs.vNormViewDepth=((scene.view*worldPos).z-uniforms.cameraInfo.x)/(uniforms.cameraInfo.y-uniforms.cameraInfo.x);
472#endif
473#ifdef PREPASS_LOCAL_POSITION
474vertexOutputs.vPosition=positionUpdated.xyz;
475#endif
476#if (defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)) && defined(BONES_VELOCITY_ENABLED)
477vertexOutputs.vCurrentPosition=scene.viewProjection*worldPos;
478#if NUM_BONE_INFLUENCERS>0
479var previousInfluence: mat4x4f;previousInfluence=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndices[0])]*vertexInputs.matricesWeights[0];
480#if NUM_BONE_INFLUENCERS>1
481previousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndices[1])]*vertexInputs.matricesWeights[1];
482#endif 
483#if NUM_BONE_INFLUENCERS>2
484previousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndices[2])]*vertexInputs.matricesWeights[2];
485#endif 
486#if NUM_BONE_INFLUENCERS>3
487previousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndices[3])]*vertexInputs.matricesWeights[3];
488#endif
489#if NUM_BONE_INFLUENCERS>4
490previousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndicesExtra[0])]*vertexInputs.matricesWeightsExtra[0];
491#endif 
492#if NUM_BONE_INFLUENCERS>5
493previousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndicesExtra[1])]*vertexInputs.matricesWeightsExtra[1];
494#endif 
495#if NUM_BONE_INFLUENCERS>6
496previousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndicesExtra[2])]*vertexInputs.matricesWeightsExtra[2];
497#endif 
498#if NUM_BONE_INFLUENCERS>7
499previousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndicesExtra[3])]*vertexInputs.matricesWeightsExtra[3];
500#endif
501vertexOutputs.vPreviousPosition=uniforms.previousViewProjection*finalPreviousWorld*previousInfluence* vec4f(positionUpdated,
5011.0);
502#else
503vertexOutputs.vPreviousPosition=uniforms.previousViewProjection*finalPreviousWorld* vec4f(positionUpdated,1.0);
504#endif
505#endif
506`;e.IncludesShadersStoreWGSL[c]||(e.IncludesShadersStoreWGSL[c]=P);const _e={name:c,shader:P},_="uvVariableDeclaration",X=`#ifdef MAINUV{X}
507#if !defined(UV{X})
508var uv{X}: vec2f=vec2f(0.,0.);
509#elif defined(USE_VERTEX_PULLING)
510var uv{X}: vec2f=uv{X}Updated;
511#else
512var uv{X}: vec2f=vertexInputs.uv{X};
513#endif
514vertexOutputs.vMainUV{X}=uv{X};
515#endif
516`;e.IncludesShadersStoreWGSL[_]||(e.IncludesShadersStoreWGSL[_]=X);const me={name:_,shader:X},m="samplerVertexImplementation",D=`#if defined(_DEFINENAME_) && _DEFINENAME_DIRECTUV==0
517if (uniforms.v_INFONAME_==0.)
518{vertexOutputs.v_VARYINGNAME_UV= (uniforms._MATRIXNAME_Matrix* vec4f(uvUpdated,1.0,0.0)).xy;}
519#ifdef UV2
520else if (uniforms.v_INFONAME_==1.)
521{vertexOutputs.v_VARYINGNAME_UV= (uniforms._MATRIXNAME_Matrix* vec4f(uv2Updated,1.0,0.0)).xy;}
522#endif
523#ifdef UV3
524else if (uniforms.v_INFONAME_==2.)
525{vertexOutputs.v_VARYINGNAME_UV= (uniforms._MATRIXNAME_Matrix* vec4f(vertexInputs.uv3,1.0,0.0)).xy;}
526#endif
527#ifdef UV4
528else if (uniforms.v_INFONAME_==3.)
529{vertexOutputs.v_VARYINGNAME_UV= (uniforms._MATRIXNAME_Matrix* vec4f(vertexInputs.uv4,1.0,0.0)).xy;}
530#endif
531#ifdef UV5
532else if (uniforms.v_INFONAME_==4.)
533{vertexOutputs.v_VARYINGNAME_UV= (uniforms._MATRIXNAME_Matrix* vec4f(vertexInputs.uv5,1.0,0.0)).xy;}
534#endif
535#ifdef UV6
536else if (uniforms.v_INFONAME_==5.)
537{vertexOutputs.v_VARYINGNAME_UV= (uniforms._MATRIXNAME_Matrix* vec4f(vertexInputs.uv6,1.0,0.0)).xy;}
538#endif
539#endif
540`;e.IncludesShadersStoreWGSL[m]||(e.IncludesShadersStoreWGSL[m]=D);const xe={name:m,shader:D},x="bumpVertex",G=`#if defined(BUMP) || defined(PARALLAX) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC)
541#if defined(TANGENT) && defined(NORMAL)
542var tbnNormal: vec3f=normalize(normalUpdated);var tbnTangent: vec3f=normalize(tangentUpdated.xyz);var tbnBitangent: vec3f=cross(tbnNormal,tbnTangent)*tangentUpdated.w;var matTemp= mat3x3f(finalWorld[0].xyz,finalWorld[1].xyz,finalWorld[2].xyz)* mat3x3f(tbnTangent,tbnBitangent,tbnNormal);vertexOutputs.vTBN0=matTemp[0];vertexOutputs.vTBN1=matTemp[1];vertexOutputs.vTBN2=matTemp[2];
543#endif
544#endif
545`;e.IncludesShadersStoreWGSL[x]||(e.IncludesShadersStoreWGSL[x]=G);const Ee={name:x,shader:G},E="shadowsVertex",b=`#ifdef SHADOWS
546#if defined(SHADOWCSM{X})
547#ifdef SCENE_UBO
548vertexOutputs.vPositionFromCamera{X}=scene.view*worldPos;
549#else
550vertexOutputs.vPositionFromCamera{X}=uniforms.view*worldPos;
551#endif
552#if SHADOWCSMNUM_CASCADES{X}>0
553vertexOutputs.vPositionFromLight{X}_0=uniforms.lightMatrix{X}[0]*worldPos;
554#ifdef USE_REVERSE_DEPTHBUFFER
555vertexOutputs.vDepthMetric{X}_0=(-vertexOutputs.vPositionFromLight{X}_0.z+light{X}.depthValues.x)/light{X}.depthValues.y;
556#else
557vertexOutputs.vDepthMetric{X}_0= (vertexOutputs.vPositionFromLight{X}_0.z+light{X}.depthValues.x)/light{X}.depthValues.y;
558#endif
559#endif
560#if SHADOWCSMNUM_CASCADES{X}>1
561vertexOutputs.vPositionFromLight{X}_1=uniforms.lightMatrix{X}[1]*worldPos;
562#ifdef USE_REVERSE_DEPTHBUFFER
563vertexOutputs.vDepthMetric{X}_1=(-vertexOutputs.vPositionFromLight{X}_1.z+light{X}.depthValues.x)/light{X}.depthValues.y;
564#else
565vertexOutputs.vDepthMetric{X}_1= (vertexOutputs.vPositionFromLight{X}_1.z+light{X}.depthValues.x)/light{X}.depthValues.y;
566#endif
567#endif 
568#if SHADOWCSMNUM_CASCADES{X}>2
569vertexOutputs.vPositionFromLight{X}_2=uniforms.lightMatrix{X}[2]*worldPos;
570#ifdef USE_REVERSE_DEPTHBUFFER
571vertexOutputs.vDepthMetric{X}_2=(-vertexOutputs.vPositionFromLight{X}_2.z+light{X}.depthValues.x)/light{X}.depthValues.y;
572#else
573vertexOutputs.vDepthMetric{X}_2= (vertexOutputs.vPositionFromLight{X}_2.z+light{X}.depthValues.x)/light{X}.depthValues.y;
574#endif
575#endif 
576#if SHADOWCSMNUM_CASCADES{X}>3
577vertexOutputs.vPositionFromLight{X}_3=uniforms.lightMatrix{X}[3]*worldPos;
578#ifdef USE_REVERSE_DEPTHBUFFER
579vertexOutputs.vDepthMetric{X}_3=(-vertexOutputs.vPositionFromLight{X}_3.z+light{X}.depthValues.x)/light{X}.depthValues.y;
580#else
581vertexOutputs.vDepthMetric{X}_3= (vertexOutputs.vPositionFromLight{X}_3.z+light{X}.depthValues.x)/light{X}.depthValues.y;
582#endif
583#endif 
584#elif defined(SHADOW{X}) && !defined(SHADOWCUBE{X})
585vertexOutputs.vPositionFromLight{X}=uniforms.lightMatrix{X}*worldPos;
586#ifdef USE_REVERSE_DEPTHBUFFER
587vertexOutputs.vDepthMetric{X}=(-vertexOutputs.vPositionFromLight{X}.z+light{X}.depthValues.x)/light{X}.depthValues.y;
588#else
589vertexOutputs.vDepthMetric{X}=(vertexOutputs.vPositionFromLight{X}.z+light{X}.depthValues.x)/light{X}.depthValues.y;
590#endif
591#endif
592#endif
593`;e.IncludesShadersStoreWGSL[E]||(e.IncludesShadersStoreWGSL[E]=b);const Ie={name:E,shader:b},I="logDepthVertex",W=`#ifdef LOGARITHMICDEPTH
594vertexOutputs.vFragmentDepth=1.0+vertexOutputs.position.w;vertexOutputs.position.z=log2(max(0.000001,vertexOutputs.vFragmentDepth))*uniforms.logarithmicDepthConstant;
595#endif
596`;e.IncludesShadersStoreWGSL[I]||(e.IncludesShadersStoreWGSL[I]=W);const Te={name:I,shader:W},T="defaultVertexShader",F=`#include<defaultUboDeclaration>
597#define CUSTOM_VERTEX_BEGIN
598#ifndef USE_VERTEX_PULLING
599attribute position: vec3f;
600#ifdef NORMAL
601attribute normal: vec3f;
602#endif
603#ifdef TANGENT
604attribute tangent: vec4f;
605#endif
606#ifdef UV1
607attribute uv: vec2f;
608#endif
609#include<uvAttributeDeclaration>[2..7]
610#ifdef VERTEXCOLOR
611attribute color: vec4f;
612#endif
613#endif
614#include<helperFunctions>
615#include<bonesDeclaration>
616#include<bakedVertexAnimationDeclaration>
617#include<instancesDeclaration>
618#include<prePassVertexDeclaration>
619#include<mainUVVaryingDeclaration>
619[1..7]
620#include<samplerVertexDeclaration>(_DEFINENAME_,DIFFUSE,_VARYINGNAME_,Diffuse)
621#include<samplerVertexDeclaration>(_DEFINENAME_,DETAIL,_VARYINGNAME_,Detail)
622#include<samplerVertexDeclaration>(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient)
623#include<samplerVertexDeclaration>(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity)
624#include<samplerVertexDeclaration>(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive)
625#include<samplerVertexDeclaration>(_DEFINENAME_,LIGHTMAP,_VARYINGNAME_,Lightmap)
626#if defined(SPECULARTERM)
627#include<samplerVertexDeclaration>(_DEFINENAME_,SPECULAR,_VARYINGNAME_,Specular)
628#endif
629#include<samplerVertexDeclaration>(_DEFINENAME_,BUMP,_VARYINGNAME_,Bump)
630#include<samplerVertexDeclaration>(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal)
631varying vPositionW: vec3f;
632#ifdef NORMAL
633varying vNormalW: vec3f;
634#endif
635#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)
636varying vColor: vec4f;
637#endif
638#include<bumpVertexDeclaration>
639#include<clipPlaneVertexDeclaration>
640#include<fogVertexDeclaration>
641#include<__decl__lightVxFragment>[0..maxSimultaneousLights]
642#include<morphTargetsVertexGlobalDeclaration>
643#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]
644#ifdef REFLECTIONMAP_SKYBOX
645varying vPositionUVW: vec3f;
646#endif
647#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)
648varying vDirectionW: vec3f;
649#endif
650#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0
651varying vViewDepth: f32;
652#endif
653#include<logDepthDeclaration>
654#include<vertexPullingDeclaration>
655#define CUSTOM_VERTEX_DEFINITIONS
656@vertex
657fn main(input : VertexInputs)->FragmentInputs {
658#define CUSTOM_VERTEX_MAIN_BEGIN
659#ifdef USE_VERTEX_PULLING
660var positionUpdated: vec3f=vec3f(0.0);
661#ifdef NORMAL
662var normalUpdated: vec3f=vec3f(0.0);
663#endif
664#ifdef TANGENT
665var tangentUpdated: vec4f=vec4f(0.0);
666#endif
667#ifdef UV1
668var uvUpdated: vec2f=vec2f(0.0);
669#endif
670#ifdef UV2
671var uv2Updated: vec2f=vec2f(0.0);
672#endif
673#ifdef VERTEXCOLOR
674var colorUpdated: vec4f=vec4f(0.0);
675#endif
676#else
677var positionUpdated: vec3f=vertexInputs.position;
678#ifdef NORMAL
679var normalUpdated: vec3f=vertexInputs.normal;
680#endif
681#ifdef TANGENT
682var tangentUpdated: vec4f=vertexInputs.tangent;
683#endif
684#ifdef UV1
685var uvUpdated: vec2f=vertexInputs.uv;
686#endif
687#ifdef UV2
688var uv2Updated: vec2f=vertexInputs.uv2;
689#endif
690#ifdef VERTEXCOLOR
691var colorUpdated: vec4f=vertexInputs.color;
692#endif
693#endif
694#include<vertexPullingVertex>
695#include<morphTargetsVertexGlobal>
696#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]
697#ifdef REFLECTIONMAP_SKYBOX
698vertexOutputs.vPositionUVW=positionUpdated;
699#endif
700#define CUSTOM_VERTEX_UPDATE_POSITION
701#define CUSTOM_VERTEX_UPDATE_NORMAL
702#include<instancesVertex>
703#if defined(PREPASS) && ((defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)) && !defined(BONES_VELOCITY_ENABLED)
704vertexOutputs.vCurrentPosition=scene.viewProjection*finalWorld*vec4f(positionUpdated,1.0);vertexOutputs.vPreviousPosition=uniforms.previousViewProjection*finalPreviousWorld*vec4f(positionUpdated,1.0);
705#endif
706#ifdef USE_VERTEX_PULLING
707#include<bonesVertex>(vertexInputs.matricesIndices,vp_matricesIndices,vertexInputs.matricesWeights,vp_matricesWeights,vertexInputs.matricesIndicesExtra,vp_matricesIndicesExtra,vertexInputs.matricesWeightsExtra,vp_matricesWeightsExtra)
708#include<bakedVertexAnimation>(vertexInputs.matricesIndices,vp_matricesIndices,vertexInputs.matricesWeights,vp_matricesWeights,vertexInputs.matricesIndicesExtra,vp_matricesIndicesExtra,vertexInputs.matricesWeightsExtra,vp_matricesWeightsExtra)
709#else
710#include<bonesVertex>
711#include<bakedVertexAnimation>
712#endif
713var worldPos: vec4f=finalWorld*vec4f(positionUpdated,1.0);
714#ifdef NORMAL
715var normalWorld: mat3x3f= mat3x3f(finalWorld[0].xyz,finalWorld[1].xyz,finalWorld[2].xyz);
716#if defined(INSTANCES) && defined(THIN_INSTANCES)
717vertexOutputs.vNormalW=normalUpdated/ vec3f(dot(normalWorld[0],normalWorld[0]),dot(normalWorld[1],normalWorld[1]),dot(normalWorld[2],normalWorld[2]));vertexOutputs.vNormalW=normalize(normalWorld*vertexOutputs.vNormalW);
718#else
719#ifdef NONUNIFORMSCALING
720normalWorld=transposeMat3(inverseMat3(normalWorld));
721#endif
722vertexOutputs.vNormalW=normalize(normalWorld*normalUpdated);
723#endif
724#endif
725#define CUSTOM_VERTEX_UPDATE_WORLDPOS
726#ifdef MULTIVIEW
727if (gl_ViewID_OVR==0u) {vertexOutputs.position=scene.viewProjection*worldPos;} else {vertexOutputs.position=scene.viewProjectionR*worldPos;}
728#else
729vertexOutputs.position=scene.viewProjection*worldPos;
730#endif
731vertexOutputs.vPositionW= worldPos.xyz;
732#ifdef PREPASS
733#include<prePassVertex>
734#endif
735#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)
736vertexOutputs.vDirectionW=normalize((finalWorld* vec4f(positionUpdated,0.0)).xyz);
737#endif
738#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0
739#ifdef RIGHT_HANDED
740vertexOutputs.vViewDepth=-(scene.view*worldPos).z;
741#else
742vertexOutputs.vViewDepth=(scene.view*worldPos).z;
743#endif
744#endif
745#ifndef UV1
746var uvUpdated: vec2f=vec2f(0.,0.);
747#endif
748#ifdef MAINUV1
749vertexOutputs.vMainUV1=uvUpdated;
750#endif
751#ifndef UV2
752var uv2Updated: vec2f=vec2f(0.,0.);
753#endif
754#ifdef MAINUV2
755vertexOutputs.vMainUV2=uv2Updated;
756#endif
757#include<uvVariableDeclaration>[3..7]
758#include<samplerVertexImplementation>(_DEFINENAME_,DIFFUSE,_VARYINGNAME_,Diffuse,_MATRIXNAME_,diffuse,_INFONAME_,DiffuseInfos.x)
759#include<samplerVertexImplementation>(_DEFINENAME_,DETAIL,_VARYINGNAME_,Detail,_MATRIXNAME_,detail,_INFONAME_,DetailInfos.x)
760#include<samplerVertexImplementation>(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient,_MATRIXNAME_,ambient,_INFONAME_,AmbientInfos.x)
761#include<samplerVertexImplementation>(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity,_MATRIXNAME_,opacity,_INFONAME_,OpacityInfos.x)
762#include<samplerVertexImplementation>(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive,_MATRIXNAME_,emissive,_INFONAME_,EmissiveInfos.x)
763#include<samplerVertexImplementation>(_DEFINENAME_,LIGHTMAP,_VARYINGNAME_,Lightmap,_MATRIXNAME_,lightmap,_INFONAME_,LightmapInfos.x)
764#if defined(SPECULARTERM)
765#include<samplerVertexImplementation>(_DEFINENAME_,SPECULAR,_VARYINGNAME_,Specular,_MATRIXNAME_,specular,_INFONAME_,SpecularInfos.x)
766#endif
767#include<samplerVertexImplementation>(_DEFINENAME_,BUMP,_VARYINGNAME_,Bump,_MATRIXNAME_,bump,_INFONAME_,BumpInfos.x)
768#include<samplerVertexImplementation>(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal,_MATRIXNAME_,decal,_INFONAME_,DecalInfos.x)
769#include<bumpVertex>
770#include<clipPlaneVertex>
771#include<fogVertex>
772#include<shadowsVertex>[0..maxSimultaneousLights]
773#include<vertexColorMixing>
774#include<logDepthVertex>
775#define CUSTOM_VERTEX_MAIN_END
776}
777`;e.ShadersStoreWGSL[T]||(e.ShadersStoreWGSL[T]=F);const Se=[z,C,H,re,Y,$,j,k,ne,w,ae,fe,Q,K,de,oe,se,ue,B,ve,le,pe,ce,Z,q,J,_e,me,xe,Ee,ee,te,Ie,ie,Te];for(const t of Se)e.IncludesShadersStoreWGSL[t.name]||(e.IncludesShadersStoreWGSL[t.name]=t.shader);const Oe={name:T,shader:F};export{Oe as defaultVertexShaderWGSL};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.