@vived/component-abb-6700 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (203) hide show
  1. package/.todo.md +13 -0
  2. package/README.md +122 -0
  3. package/dist/.gitkeep +0 -0
  4. package/dist/Adapters/aBB6700PMAdapter.d.ts +10 -0
  5. package/dist/Adapters/aBB6700PMAdapter.d.ts.map +1 -0
  6. package/dist/Controllers/createABB6700.d.ts +12 -0
  7. package/dist/Controllers/createABB6700.d.ts.map +1 -0
  8. package/dist/Controllers/getPose.d.ts +11 -0
  9. package/dist/Controllers/getPose.d.ts.map +1 -0
  10. package/dist/Controllers/setJointAngle.d.ts +12 -0
  11. package/dist/Controllers/setJointAngle.d.ts.map +1 -0
  12. package/dist/Controllers/setPose.d.ts +11 -0
  13. package/dist/Controllers/setPose.d.ts.map +1 -0
  14. package/dist/Entities/ABB6700Entity.d.ts +35 -0
  15. package/dist/Entities/ABB6700Entity.d.ts.map +1 -0
  16. package/dist/Entities/ABB6700Repo.d.ts +32 -0
  17. package/dist/Entities/ABB6700Repo.d.ts.map +1 -0
  18. package/dist/Factory/ABB6700FeatureFactory.d.ts +26 -0
  19. package/dist/Factory/ABB6700FeatureFactory.d.ts.map +1 -0
  20. package/dist/Mocks/MockABB6700PM.d.ts +11 -0
  21. package/dist/Mocks/MockABB6700PM.d.ts.map +1 -0
  22. package/dist/Mocks/MockSetJointAngleUC.d.ts +7 -0
  23. package/dist/Mocks/MockSetJointAngleUC.d.ts.map +1 -0
  24. package/dist/Mocks/MockSetPoseUC.d.ts +7 -0
  25. package/dist/Mocks/MockSetPoseUC.d.ts.map +1 -0
  26. package/dist/PMs/ABB6700PM.d.ts +32 -0
  27. package/dist/PMs/ABB6700PM.d.ts.map +1 -0
  28. package/dist/UCs/CalcStabilizerUC.d.ts +7 -0
  29. package/dist/UCs/CalcStabilizerUC.d.ts.map +1 -0
  30. package/dist/UCs/SetJointAngleUC.d.ts +15 -0
  31. package/dist/UCs/SetJointAngleUC.d.ts.map +1 -0
  32. package/dist/UCs/SetPoseUC.d.ts +22 -0
  33. package/dist/UCs/SetPoseUC.d.ts.map +1 -0
  34. package/dist/Views/ABB6700BabylonView.d.ts +27 -0
  35. package/dist/Views/ABB6700BabylonView.d.ts.map +1 -0
  36. package/dist/abb_6700.glb +0 -0
  37. package/dist/abstractAudioBus-CyBWsmuN.js +14 -0
  38. package/dist/animationGroup-BhNThqQe.js +1454 -0
  39. package/dist/basisTextureLoader-BT391BsV.js +310 -0
  40. package/dist/brdfTextureTools-DUyKBAXf.js +79 -0
  41. package/dist/bumpFragment-Dd-ojPA1.js +134 -0
  42. package/dist/bumpFragment-KE1_PuMl.js +287 -0
  43. package/dist/bumpVertex-BcdvVFVx.js +8 -0
  44. package/dist/bumpVertexDeclaration-B5Uvs-RS.js +8 -0
  45. package/dist/bumpVertexDeclaration-ixSg-yGI.js +8 -0
  46. package/dist/clipPlaneFragment-DJwQynjA.js +136 -0
  47. package/dist/clipPlaneVertex-D4Wk50XG.js +376 -0
  48. package/dist/clipPlaneVertex-eQ147Tn2.js +350 -0
  49. package/dist/component.config.d.ts +17 -0
  50. package/dist/component.config.d.ts.map +1 -0
  51. package/dist/ddsTextureLoader-DeoF3iGO.js +331 -0
  52. package/dist/default.fragment-DKnTR9nY.js +548 -0
  53. package/dist/default.fragment-rIGWrUS5.js +486 -0
  54. package/dist/default.vertex-Bt5y1VyA.js +212 -0
  55. package/dist/default.vertex-Dext1liJ.js +224 -0
  56. package/dist/defaultUboDeclaration-BwslQZX8.js +11 -0
  57. package/dist/defaultUboDeclaration-DSXACgip.js +9 -0
  58. package/dist/easing-BAt0SO-B.js +163 -0
  59. package/dist/envTextureLoader-CBiW_Q-U.js +40 -0
  60. package/dist/exrTextureLoader-5SC6PKIA.js +740 -0
  61. package/dist/flowGraphApplyForceBlock-6e8-wcaw.js +32 -0
  62. package/dist/flowGraphApplyImpulseBlock-B27EZQow.js +32 -0
  63. package/dist/flowGraphArrayIndexBlock-DIUn5e4i.js +31 -0
  64. package/dist/flowGraphBezierCurveEasingBlock-BJmiHk40.js +25 -0
  65. package/dist/flowGraphBinaryOperationBlock-Bj7TANCc.js +25 -0
  66. package/dist/flowGraphBranchBlock-7CRvIKWc.js +19 -0
  67. package/dist/flowGraphCachedOperationBlock-CP1ZiuIB.js +26 -0
  68. package/dist/flowGraphCancelDelayBlock-DqtgzBGm.js +20 -0
  69. package/dist/flowGraphCodeExecutionBlock-CaYXCGqo.js +23 -0
  70. package/dist/flowGraphConditionalDataBlock-DJ7evX8_.js +28 -0
  71. package/dist/flowGraphConsoleLogBlock-cMkpqLzO.js +68 -0
  72. package/dist/flowGraphConstantBlock-JWybwT0A.js +28 -0
  73. package/dist/flowGraphContextBlock-CFDXHcbn.js +19 -0
  74. package/dist/flowGraphCounterBlock-B0uPkgw9.js +24 -0
  75. package/dist/flowGraphDataSwitchBlock-B0GSifvJ.js +27 -0
  76. package/dist/flowGraphDebounceBlock-CSw8zKym.js +24 -0
  77. package/dist/flowGraphDebugBlock-DiSR6Ahn.js +65 -0
  78. package/dist/flowGraphDoNBlock-C-48oQ2H.js +24 -0
  79. package/dist/flowGraphEasingBlock-DKUaE7Rp.js +50 -0
  80. package/dist/flowGraphFlipFlopBlock-DX5BGhMV.js +20 -0
  81. package/dist/flowGraphForLoopBlock-Di-Qwg23.js +27 -0
  82. package/dist/flowGraphFunctionReferenceBlock-D8X5TFsO.js +20 -0
  83. package/dist/flowGraphGLTFDataProvider-C4j7nPQv.js +16 -0
  84. package/dist/flowGraphGetAngularVelocityBlock-Cq-yTQ4D.js +31 -0
  85. package/dist/flowGraphGetAssetBlock-B36eioor.js +21 -0
  86. package/dist/flowGraphGetLinearVelocityBlock-MdrV0eUD.js +31 -0
  87. package/dist/flowGraphGetPhysicsMassPropertiesBlock-wXDZP1wM.js +30 -0
  88. package/dist/flowGraphGetPropertyBlock-eP0badwf.js +46 -0
  89. package/dist/flowGraphGetSoundVolumeBlock-D3gXGHXa.js +29 -0
  90. package/dist/flowGraphGetVariableBlock-C7-qZAec.js +31 -0
  91. package/dist/flowGraphIndexOfBlock-CC5l9n9P.js +31 -0
  92. package/dist/flowGraphInterpolationBlock-B6922jzt.js +50 -0
  93. package/dist/flowGraphIsKeyPressedBlock-X_iuiUOX.js +31 -0
  94. package/dist/flowGraphIsSoundPlayingBlock-DONQX8N8.js +29 -0
  95. package/dist/flowGraphJsonPointerParserBlock-DBH_gN8I.js +95 -0
  96. package/dist/flowGraphKeyDownEventBlock-D5T1Uyfv.js +26 -0
  97. package/dist/flowGraphKeyUpEventBlock-BPY_Kgkm.js +21 -0
  98. package/dist/flowGraphKeyboardEventBlock-C49fx3TC.js +20 -0
  99. package/dist/flowGraphMathBlocks-CkvrN3VJ.js +864 -0
  100. package/dist/flowGraphMathCombineExtractBlocks-QSjGlnoz.js +248 -0
  101. package/dist/flowGraphMatrixMathBlocks-B3D7Cz9p.js +117 -0
  102. package/dist/flowGraphMeshPickEventBlock-BBTz-taa.js +35 -0
  103. package/dist/flowGraphMultiGateBlock-BhY1y5BG.js +50 -0
  104. package/dist/flowGraphPauseAnimationBlock-CHZZXMbg.js +19 -0
  105. package/dist/flowGraphPauseSoundBlock-B7hMmJ0c.js +31 -0
  106. package/dist/flowGraphPhysicsCollisionEventBlock-CxoPpT-q.js +56 -0
  107. package/dist/flowGraphPlayAnimationBlock-DVAvIFux.js +99 -0
  108. package/dist/flowGraphPlaySoundBlock-DjHGrqbC.js +32 -0
  109. package/dist/flowGraphPointerDownEventBlock-qI-H0JST.js +31 -0
  110. package/dist/flowGraphPointerMoveEventBlock-DAi4VUyy.js +31 -0
  111. package/dist/flowGraphPointerOutEventBlock-CFtj68aC.js +21 -0
  112. package/dist/flowGraphPointerOverEventBlock-VxdHhFuu.js +23 -0
  113. package/dist/flowGraphPointerUpEventBlock-DRR1f07q.js +31 -0
  114. package/dist/flowGraphReceiveCustomEventBlock-B3bwdB66.js +52 -0
  115. package/dist/flowGraphSceneReadyEventBlock-Dy6lDT3j.js +23 -0
  116. package/dist/flowGraphSceneTickEventBlock-Bl9BF_Xw.js +32 -0
  117. package/dist/flowGraphSendCustomEventBlock-BAR4PGFq.js +35 -0
  118. package/dist/flowGraphSequenceBlock-veqU32ZZ.js +32 -0
  119. package/dist/flowGraphSetAngularVelocityBlock-Dj9b-zu6.js +31 -0
  120. package/dist/flowGraphSetDelayBlock-CMjudtvk.js +131 -0
  121. package/dist/flowGraphSetLinearVelocityBlock-DVDhhJBd.js +31 -0
  122. package/dist/flowGraphSetPhysicsMotionTypeBlock-CL3cxNCO.js +36 -0
  123. package/dist/flowGraphSetPropertyBlock-D3sWL3Ss.js +47 -0
  124. package/dist/flowGraphSetSoundVolumeBlock-CxVk45yR.js +32 -0
  125. package/dist/flowGraphSetVariableBlock-D1oJiwLj.js +47 -0
  126. package/dist/flowGraphSoundEndedEventBlock-CubEwii0.js +47 -0
  127. package/dist/flowGraphStopAnimationBlock-B9inwIQx.js +48 -0
  128. package/dist/flowGraphStopSoundBlock-BijIX2jC.js +31 -0
  129. package/dist/flowGraphSwitchBlock-BMhPb4OX.js +54 -0
  130. package/dist/flowGraphThrottleBlock-C7vrnkb1.js +37 -0
  131. package/dist/flowGraphTransformCoordinatesSystemBlock-DoISqaUG.js +29 -0
  132. package/dist/flowGraphTypeToTypeBlocks-CSML6QWx.js +57 -0
  133. package/dist/flowGraphUnaryOperationBlock-B0Shf-lJ.js +24 -0
  134. package/dist/flowGraphVectorMathBlocks-DoTRR_E0.js +178 -0
  135. package/dist/flowGraphWaitAllBlock-BvmDMc24.js +54 -0
  136. package/dist/flowGraphWhileLoopBlock-BaIq4-K2.js +27 -0
  137. package/dist/geometry.fragment-Bsis3UG2.js +275 -0
  138. package/dist/geometry.vertex-DskQ5b8j.js +222 -0
  139. package/dist/harmonicsFunctions-CtNrRfir.js +193 -0
  140. package/dist/harmonicsFunctions-PEz6APC7.js +18 -0
  141. package/dist/hdrTextureLoader-D9rYxJ9q.js +112 -0
  142. package/dist/helperFunctions-Bt7Zfkrp.js +89 -0
  143. package/dist/helperFunctions-CPmRxd37.js +121 -0
  144. package/dist/iesTextureLoader-BGUFjVhI.js +93 -0
  145. package/dist/index-CS3Icp_r.js +67657 -0
  146. package/dist/index.d.ts +23 -0
  147. package/dist/index.d.ts.map +1 -0
  148. package/dist/index.js +27 -0
  149. package/dist/ktxTextureLoader-cUaGg9_L.js +459 -0
  150. package/dist/lightFragment-BRDibDKG.js +404 -0
  151. package/dist/lightFragment-DCqtGMp_.js +402 -0
  152. package/dist/logDepthDeclaration-Bwm-3KyB.js +16 -0
  153. package/dist/logDepthDeclaration-gUfeSnXX.js +20 -0
  154. package/dist/logDepthVertex-CKeuJ6ae.js +213 -0
  155. package/dist/logDepthVertex-CXkmZels.js +459 -0
  156. package/dist/mesh.vertexData.functions-Bc9lJlrU.js +74 -0
  157. package/dist/oitFragment-B8zuQigp.js +792 -0
  158. package/dist/oitFragment-DH3h3T6x.js +657 -0
  159. package/dist/openpbr.fragment-BglYS6LA.js +1405 -0
  160. package/dist/openpbr.fragment-DrOTZs4m.js +1553 -0
  161. package/dist/openpbr.vertex-B-PaLFOR.js +384 -0
  162. package/dist/openpbr.vertex-DMdFRTnX.js +268 -0
  163. package/dist/openpbrMaterial-HCU0aOca.js +2880 -0
  164. package/dist/openpbrMaterialLoadingAdapter-CWRAa-7S.js +1122 -0
  165. package/dist/openpbrTransmissionLayerData-CfDVObj5.js +352 -0
  166. package/dist/openpbrUboDeclaration-CA2pvSbt.js +9 -0
  167. package/dist/openpbrUboDeclaration-xU8VOaib.js +10 -0
  168. package/dist/pass.fragment-1mMP54bb.js +10 -0
  169. package/dist/pass.fragment-DzaUp_jk.js +10 -0
  170. package/dist/passCube.fragment-CQaXS7g3.js +29 -0
  171. package/dist/passCube.fragment-QJGPwAXI.js +29 -0
  172. package/dist/pbr.fragment-BnaAAGxb.js +2775 -0
  173. package/dist/pbr.fragment-CYZk_EGU.js +2619 -0
  174. package/dist/pbr.vertex-CyvdCw91.js +372 -0
  175. package/dist/pbr.vertex-DJMAkDxs.js +270 -0
  176. package/dist/pbrBRDFFunctions-EugoWm6O.js +175 -0
  177. package/dist/pbrDebug-Bk3sPoEG.js +719 -0
  178. package/dist/pbrDebug-Cdalzb1I.js +614 -0
  179. package/dist/pbrIBLFunctions-B0bVAXCF.js +47 -0
  180. package/dist/pbrIBLFunctions-C06z-ouZ.js +51 -0
  181. package/dist/pbrMaterial-C4FCKBZQ.js +1660 -0
  182. package/dist/pbrMaterialLoadingAdapter-BGHlS_ZN.js +1032 -0
  183. package/dist/pbrUboDeclaration-1lN5_-Bw.js +9 -0
  184. package/dist/pbrUboDeclaration-BJOUUOZ2.js +10 -0
  185. package/dist/procedural.vertex-CFPKczKj.js +14 -0
  186. package/dist/procedural.vertex-DUW7bYZt.js +13 -0
  187. package/dist/rgbdDecode.fragment-CEGgE4tL.js +8 -0
  188. package/dist/rgbdDecode.fragment-FT0wkgah.js +8 -0
  189. package/dist/rgbdEncode.fragment-CLnJJf6E.js +8 -0
  190. package/dist/rgbdEncode.fragment-CaAcMsY9.js +8 -0
  191. package/dist/sceneUboDeclaration-B6oxsfcj.js +8 -0
  192. package/dist/sceneUboDeclaration-JByfVKik.js +13 -0
  193. package/dist/setupABB6700InstanceFactory.d.ts +7 -0
  194. package/dist/setupABB6700InstanceFactory.d.ts.map +1 -0
  195. package/dist/studio.env +0 -0
  196. package/dist/textureProcessor.fragment-BYPw6SMQ.js +152 -0
  197. package/dist/textureProcessor.fragment-Ciw9-F3w.js +157 -0
  198. package/dist/textureTools-Cct_bGgp.js +40 -0
  199. package/dist/tgaTextureLoader-BJOIdnFr.js +198 -0
  200. package/dist/thinEngine-Bt9FW4dD.js +2425 -0
  201. package/dist/webAudioBus-BUzRHSxr.js +88 -0
  202. package/dist/webAudioMainBus-Dds1TgJG.js +49 -0
  203. package/package.json +49 -0
@@ -0,0 +1,459 @@
1
+ import { b0 as e } from "./index-CS3Icp_r.js";
2
+ const t = "uvAttributeDeclaration", _ = `#if defined(UV{X}) && !defined(USE_VERTEX_PULLING)
3
+ attribute uv{X}: vec2f;
4
+ #endif
5
+ `;
6
+ e.IncludesShadersStoreWGSL[t] || (e.IncludesShadersStoreWGSL[t] = _);
7
+ const i = "prePassVertexDeclaration", x = `#ifdef PREPASS
8
+ #ifdef PREPASS_LOCAL_POSITION
9
+ varying vPosition : vec3f;
10
+ #endif
11
+ #ifdef PREPASS_DEPTH
12
+ varying vViewPos: vec3f;
13
+ #endif
14
+ #ifdef PREPASS_NORMALIZED_VIEW_DEPTH
15
+ varying vNormViewDepth: f32;
16
+ #endif
17
+ #if defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)
18
+ uniform previousViewProjection: mat4x4f;varying vCurrentPosition: vec4f;varying vPreviousPosition: vec4f;
19
+ #endif
20
+ #endif
21
+ `;
22
+ e.IncludesShadersStoreWGSL[i] || (e.IncludesShadersStoreWGSL[i] = x);
23
+ const f = "samplerVertexDeclaration", m = `#if defined(_DEFINENAME_) && _DEFINENAME_DIRECTUV==0
24
+ varying v_VARYINGNAME_UV: vec2f;
25
+ #endif
26
+ `;
27
+ e.IncludesShadersStoreWGSL[f] || (e.IncludesShadersStoreWGSL[f] = m);
28
+ const r = "fogVertexDeclaration", E = `#ifdef FOG
29
+ varying vFogDistance: vec3f;
30
+ #endif
31
+ `;
32
+ e.IncludesShadersStoreWGSL[r] || (e.IncludesShadersStoreWGSL[r] = E);
33
+ const a = "lightVxUboDeclaration", V = `#ifdef LIGHT{X}
34
+ struct Light{X}
35
+ {vLightData: vec4f,
36
+ vLightDiffuse: vec4f,
37
+ vLightSpecular: vec4f,
38
+ #ifdef SPOTLIGHT{X}
39
+ vLightDirection: vec4f,
40
+ vLightFalloff: vec4f,
41
+ #elif defined(POINTLIGHT{X})
42
+ vLightFalloff: vec4f,
43
+ #elif defined(HEMILIGHT{X})
44
+ vLightGround: vec3f,
45
+ #elif defined(CLUSTLIGHT{X})
46
+ vSliceData: vec2f,
47
+ vSliceRanges: array<vec4f,CLUSTLIGHT_SLICES>,
48
+ #endif
49
+ #if defined(AREALIGHT{X}) && defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED)
50
+ vLightWidth: vec4f,
51
+ vLightHeight: vec4f,
52
+ #endif
53
+ shadowsInfo: vec4f,
54
+ depthValues: vec2f} ;var<uniform> light{X} : Light{X};
55
+ #ifdef SHADOW{X}
56
+ #ifdef SHADOWCSM{X}
57
+ uniform 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;
58
+ #elif defined(SHADOWCUBE{X})
59
+ #else
60
+ varying vPositionFromLight{X}: vec4f;varying vDepthMetric{X}: f32;uniform lightMatrix{X}: mat4x4f;
61
+ #endif
62
+ #endif
63
+ #endif
64
+ `;
65
+ e.IncludesShadersStoreWGSL[a] || (e.IncludesShadersStoreWGSL[a] = V);
66
+ const n = "vertexPullingDeclaration", I = `#ifdef USE_VERTEX_PULLING
67
+ #ifdef VERTEX_PULLING_USE_INDEX_BUFFER
68
+ var<storage,read> indices : array<u32>;
69
+ #endif
70
+ var<storage,read> position : array<f32>;uniform vp_position_info : vec4f;
71
+ #ifdef NORMAL
72
+ var<storage,read> normal : array<f32>;uniform vp_normal_info : vec4f;
73
+ #endif
74
+ #ifdef TANGENT
75
+ var<storage,read> tangent : array<f32>;uniform vp_tangent_info : vec4f;
76
+ #endif
77
+ #ifdef UV1
78
+ var<storage,read> uv : array<f32>;uniform vp_uv_info : vec4f;
79
+ #define VP_UV1_SUPPORTED
80
+ #endif
81
+ #ifdef UV2
82
+ var<storage,read> uv2 : array<f32>;uniform vp_uv2_info : vec4f;
83
+ #define VP_UV2_SUPPORTED
84
+ #endif
85
+ #ifdef UV3
86
+ var<storage,read> uv3 : array<f32>;uniform vp_uv3_info : vec4f;
87
+ #define VP_UV3_SUPPORTED
88
+ #endif
89
+ #ifdef UV4
90
+ var<storage,read> uv4 : array<f32>;uniform vp_uv4_info : vec4f;
91
+ #define VP_UV4_SUPPORTED
92
+ #endif
93
+ #ifdef UV5
94
+ var<storage,read> uv5 : array<f32>;uniform vp_uv5_info : vec4f;
95
+ #define VP_UV5_SUPPORTED
96
+ #endif
97
+ #ifdef UV6
98
+ var<storage,read> uv6 : array<f32>;uniform vp_uv6_info : vec4f;
99
+ #define VP_UV6_SUPPORTED
100
+ #endif
101
+ #ifdef VERTEXCOLOR
102
+ var<storage,read> color : array<f32>;uniform vp_color_info : vec4f;
103
+ #endif
104
+ #if NUM_BONE_INFLUENCERS>0
105
+ var<storage,read> matricesIndices : array<u32>;var<storage,read> matricesWeights : array<f32>;uniform vp_matricesIndices_info : vec4f;uniform vp_matricesWeights_info : vec4f;
106
+ #if NUM_BONE_INFLUENCERS>4
107
+ var<storage,read> matricesIndicesExtra : array<u32>;var<storage,read> matricesWeightsExtra : array<f32>;uniform vp_matricesIndicesExtra_info : vec4f;uniform vp_matricesWeightsExtra_info : vec4f;
108
+ #endif
109
+ #endif
110
+ fn vp_convertToFloat(word : u32,byteInWord : u32,dataType : u32,normalized : bool)->f32 {switch (dataType) {case 5120u: {
111
+ let shift=byteInWord*8u;let value=(word>>shift) & 0xFFu;let signedValue=f32(i32(value<<24u)>>24u);if (normalized) { return signedValue/127.0; }
112
+ return signedValue;}
113
+ case 5121u: {
114
+ let shift=byteInWord*8u;let value=(word>>shift) & 0xFFu;if (normalized) { return f32(value)/255.0; }
115
+ return f32(value);}
116
+ case 5122u: {
117
+ let shift=(byteInWord & 0xFFFFFFFEu)*8u;let value=(word>>shift) & 0xFFFFu;let signedValue=f32(i32(value<<16u)>>16u);if (normalized) { return signedValue/32767.0; }
118
+ return signedValue;}
119
+ case 5123u: {
120
+ let shift=(byteInWord & 0xFFFFFFFEu)*8u;let value=(word>>shift) & 0xFFFFu;if (normalized) { return f32(value)/65535.0; }
121
+ return f32(value);}
122
+ case 5126u: {
123
+ return bitcast<f32>(word);}
124
+ default: { return 0.0; }}}
125
+ fn vp_componentSize(dataType : u32)->u32 {return select(select(2u,1u,dataType==5120u || dataType==5121u),4u,dataType==5126u);}
126
+ fn vp_readVertexIndex(index : u32)->u32 {
127
+ #ifndef VERTEX_PULLING_USE_INDEX_BUFFER
128
+ return index;
129
+ #else
130
+ #ifdef VERTEX_PULLING_INDEX_BUFFER_32BITS
131
+ return indices[index];
132
+ #else
133
+ let u32_index=index/2u;let bit_offset=(index & 1u)*16u;return (indices[u32_index]>>bit_offset) & 0xFFFFu;
134
+ #endif
135
+ #endif
136
+ }
137
+ fn vp_readPositionValue(byteOffset : u32,dataType : u32,normalized : bool)->f32 {return vp_convertToFloat(bitcast<u32>(position[byteOffset/4u]),byteOffset % 4u,dataType,normalized);}
138
+ fn 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(
139
+ vp_readPositionValue(offset,dataType,normalized),
140
+ vp_readPositionValue(offset+cs,dataType,normalized),
141
+ vp_readPositionValue(offset+cs*2u,dataType,normalized)
142
+ );}
143
+ #ifdef NORMAL
144
+ fn vp_readNormalValue(byteOffset : u32,dataType : u32,normalized : bool)->f32 {return vp_convertToFloat(bitcast<u32>(normal[byteOffset/4u]),byteOffset % 4u,dataType,normalized);}
145
+ fn 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(
146
+ vp_readNormalValue(offset,dataType,normalized),
147
+ vp_readNormalValue(offset+cs,dataType,normalized),
148
+ vp_readNormalValue(offset+cs*2u,dataType,normalized)
149
+ );}
150
+ #endif
151
+ #ifdef TANGENT
152
+ fn vp_readTangentValue(byteOffset : u32,dataType : u32,normalized : bool)->f32 {return vp_convertToFloat(bitcast<u32>(tangent[byteOffset/4u]),byteOffset % 4u,dataType,normalized);}
153
+ fn 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(
154
+ vp_readTangentValue(offset,dataType,normalized),
155
+ vp_readTangentValue(offset+cs,dataType,normalized),
156
+ vp_readTangentValue(offset+cs*2u,dataType,normalized),
157
+ vp_readTangentValue(offset+cs*3u,dataType,normalized)
158
+ );}
159
+ #endif
160
+ #ifdef UV1
161
+ fn vp_readUVValue(byteOffset : u32,dataType : u32,normalized : bool)->f32 {return vp_convertToFloat(bitcast<u32>(uv[byteOffset/4u]),byteOffset % 4u,dataType,normalized);}
162
+ fn 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(
163
+ vp_readUVValue(offset,dataType,normalized),
164
+ vp_readUVValue(offset+cs,dataType,normalized)
165
+ );}
166
+ #endif
167
+ #ifdef UV2
168
+ fn vp_readUV2Value(byteOffset : u32,dataType : u32,normalized : bool)->f32 {return vp_convertToFloat(bitcast<u32>(uv2[byteOffset/4u]),byteOffset % 4u,dataType,normalized);}
169
+ fn 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(
170
+ vp_readUV2Value(offset,dataType,normalized),
171
+ vp_readUV2Value(offset+cs,dataType,normalized)
172
+ );}
173
+ #endif
174
+ #ifdef UV3
175
+ fn vp_readUV3Value(byteOffset : u32,dataType : u32,normalized : bool)->f32 {return vp_convertToFloat(bitcast<u32>(uv3[byteOffset/4u]),byteOffset % 4u,dataType,normalized);}
176
+ fn 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(
177
+ vp_readUV3Value(offset,dataType,normalized),
178
+ vp_readUV3Value(offset+cs,dataType,normalized)
179
+ );}
180
+ #endif
181
+ #ifdef UV4
182
+ fn vp_readUV4Value(byteOffset : u32,dataType : u32,normalized : bool)->f32 {return vp_convertToFloat(bitcast<u32>(uv4[byteOffset/4u]),byteOffset % 4u,dataType,normalized);}
183
+ fn 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(
184
+ vp_readUV4Value(offset,dataType,normalized),
185
+ vp_readUV4Value(offset+cs,dataType,normalized)
186
+ );}
187
+ #endif
188
+ #ifdef UV5
189
+ fn vp_readUV5Value(byteOffset : u32,dataType : u32,normalized : bool)->f32 {return vp_convertToFloat(bitcast<u32>(uv5[byteOffset/4u]),byteOffset % 4u,dataType,normalized);}
190
+ fn 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(
191
+ vp_readUV5Value(offset,dataType,normalized),
192
+ vp_readUV5Value(offset+cs,dataType,normalized)
193
+ );}
194
+ #endif
195
+ #ifdef UV6
196
+ fn vp_readUV6Value(byteOffset : u32,dataType : u32,normalized : bool)->f32 {return vp_convertToFloat(bitcast<u32>(uv6[byteOffset/4u]),byteOffset % 4u,dataType,normalized);}
197
+ fn 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(
198
+ vp_readUV6Value(offset,dataType,normalized),
199
+ vp_readUV6Value(offset+cs,dataType,normalized)
200
+ );}
201
+ #endif
202
+ #ifdef VERTEXCOLOR
203
+ fn vp_readColorValue(byteOffset : u32,dataType : u32,normalized : bool)->f32 {return vp_convertToFloat(bitcast<u32>(color[byteOffset/4u]),byteOffset % 4u,dataType,normalized);}
204
+ fn 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(
205
+ vp_readColorValue(offset,dataType,normalized),
206
+ vp_readColorValue(offset+cs,dataType,normalized),
207
+ vp_readColorValue(offset+cs*2u,dataType,normalized),
208
+ vp_readColorValue(offset+cs*3u,dataType,normalized)
209
+ );}
210
+ #endif
211
+ #if NUM_BONE_INFLUENCERS>0
212
+ fn vp_readMatrixIndexValue(byteOffset : u32,dataType : u32,normalized : bool)->f32 {return vp_convertToFloat(matricesIndices[byteOffset/4u],byteOffset % 4u,dataType,normalized);}
213
+ fn 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(
214
+ vp_readMatrixIndexValue(offset,dataType,normalized),
215
+ vp_readMatrixIndexValue(offset+cs,dataType,normalized),
216
+ vp_readMatrixIndexValue(offset+cs*2u,dataType,normalized),
217
+ vp_readMatrixIndexValue(offset+cs*3u,dataType,normalized)
218
+ );}
219
+ fn vp_readMatrixWeightValue(byteOffset : u32,dataType : u32,normalized : bool)->f32 {return vp_convertToFloat(bitcast<u32>(matricesWeights[byteOffset/4u]),byteOffset % 4u,dataType,normalized);}
220
+ fn 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(
221
+ vp_readMatrixWeightValue(offset,dataType,normalized),
222
+ vp_readMatrixWeightValue(offset+cs,dataType,normalized),
223
+ vp_readMatrixWeightValue(offset+cs*2u,dataType,normalized),
224
+ vp_readMatrixWeightValue(offset+cs*3u,dataType,normalized)
225
+ );}
226
+ #if NUM_BONE_INFLUENCERS>4
227
+ fn vp_readMatrixIndexExtraValue(byteOffset : u32,dataType : u32,normalized : bool)->f32 {return vp_convertToFloat(matricesIndicesExtra[byteOffset/4u],byteOffset % 4u,dataType,normalized);}
228
+ fn 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(
229
+ vp_readMatrixIndexExtraValue(offset,dataType,normalized),
230
+ vp_readMatrixIndexExtraValue(offset+cs,dataType,normalized),
231
+ vp_readMatrixIndexExtraValue(offset+cs*2u,dataType,normalized),
232
+ vp_readMatrixIndexExtraValue(offset+cs*3u,dataType,normalized)
233
+ );}
234
+ fn vp_readMatrixWeightExtraValue(byteOffset : u32,dataType : u32,normalized : bool)->f32 {return vp_convertToFloat(bitcast<u32>(matricesWeightsExtra[byteOffset/4u]),byteOffset % 4u,dataType,normalized);}
235
+ fn 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(
236
+ vp_readMatrixWeightExtraValue(offset,dataType,normalized),
237
+ vp_readMatrixWeightExtraValue(offset+cs,dataType,normalized),
238
+ vp_readMatrixWeightExtraValue(offset+cs*2u,dataType,normalized),
239
+ vp_readMatrixWeightExtraValue(offset+cs*3u,dataType,normalized)
240
+ );}
241
+ #endif
242
+ #endif
243
+ #endif
244
+ `;
245
+ e.IncludesShadersStoreWGSL[n] || (e.IncludesShadersStoreWGSL[n] = I);
246
+ const d = "vertexPullingVertex", y = `#ifdef USE_VERTEX_PULLING
247
+ let vpVertexIndex: u32=vp_readVertexIndex(vertexInputs.vertexIndex);positionUpdated=vp_readPosition(uniforms.vp_position_info,vpVertexIndex);
248
+ #ifdef NORMAL
249
+ normalUpdated=vp_readNormal(uniforms.vp_normal_info,vpVertexIndex);
250
+ #endif
251
+ #ifdef TANGENT
252
+ tangentUpdated=vp_readTangent(uniforms.vp_tangent_info,vpVertexIndex);
253
+ #endif
254
+ #ifdef UV1
255
+ uvUpdated=vp_readUV(uniforms.vp_uv_info,vpVertexIndex);
256
+ #endif
257
+ #ifdef UV2
258
+ uv2Updated=vp_readUV2(uniforms.vp_uv2_info,vpVertexIndex);
259
+ #endif
260
+ #ifdef UV3
261
+ var uv3Updated: vec2f=vp_readUV3(uniforms.vp_uv3_info,vpVertexIndex);
262
+ #endif
263
+ #ifdef UV4
264
+ var uv4Updated: vec2f=vp_readUV4(uniforms.vp_uv4_info,vpVertexIndex);
265
+ #endif
266
+ #ifdef UV5
267
+ var uv5Updated: vec2f=vp_readUV5(uniforms.vp_uv5_info,vpVertexIndex);
268
+ #endif
269
+ #ifdef UV6
270
+ var uv6Updated: vec2f=vp_readUV6(uniforms.vp_uv6_info,vpVertexIndex);
271
+ #endif
272
+ #ifdef VERTEXCOLOR
273
+ colorUpdated=vp_readColor(uniforms.vp_color_info,vpVertexIndex);
274
+ #endif
275
+ #ifdef MORPHTARGETS
276
+ let vp_basePosition: vec3f=positionUpdated;
277
+ #ifdef NORMAL
278
+ let vp_baseNormal: vec3f=normalUpdated;
279
+ #endif
280
+ #ifdef TANGENT
281
+ let vp_baseTangent: vec4f=tangentUpdated;
282
+ #endif
283
+ #ifdef UV1
284
+ let vp_baseUV: vec2f=uvUpdated;
285
+ #endif
286
+ #ifdef UV2
287
+ let vp_baseUV2: vec2f=uv2Updated;
288
+ #endif
289
+ #ifdef VERTEXCOLOR
290
+ let vp_baseColor: vec4f=colorUpdated;
291
+ #endif
292
+ #endif
293
+ #if NUM_BONE_INFLUENCERS>0
294
+ var vp_matricesIndices: vec4f=vp_readBoneIndices(uniforms.vp_matricesIndices_info,vpVertexIndex);var vp_matricesWeights: vec4f=vp_readBoneWeights(uniforms.vp_matricesWeights_info,vpVertexIndex);
295
+ #if NUM_BONE_INFLUENCERS>4
296
+ var vp_matricesIndicesExtra: vec4f=vp_readBoneIndicesExtra(uniforms.vp_matricesIndicesExtra_info,vpVertexIndex);var vp_matricesWeightsExtra: vec4f=vp_readBoneWeightsExtra(uniforms.vp_matricesWeightsExtra_info,vpVertexIndex);
297
+ #endif
298
+ #endif
299
+ #endif
300
+ `;
301
+ e.IncludesShadersStoreWGSL[d] || (e.IncludesShadersStoreWGSL[d] = y);
302
+ const o = "prePassVertex", S = `#ifdef PREPASS_DEPTH
303
+ vertexOutputs.vViewPos=(scene.view*worldPos).rgb;
304
+ #endif
305
+ #ifdef PREPASS_NORMALIZED_VIEW_DEPTH
306
+ vertexOutputs.vNormViewDepth=((scene.view*worldPos).z-uniforms.cameraInfo.x)/(uniforms.cameraInfo.y-uniforms.cameraInfo.x);
307
+ #endif
308
+ #ifdef PREPASS_LOCAL_POSITION
309
+ vertexOutputs.vPosition=positionUpdated.xyz;
310
+ #endif
311
+ #if (defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)) && defined(BONES_VELOCITY_ENABLED)
312
+ vertexOutputs.vCurrentPosition=scene.viewProjection*worldPos;
313
+ #if NUM_BONE_INFLUENCERS>0
314
+ var previousInfluence: mat4x4f;previousInfluence=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndices[0])]*vertexInputs.matricesWeights[0];
315
+ #if NUM_BONE_INFLUENCERS>1
316
+ previousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndices[1])]*vertexInputs.matricesWeights[1];
317
+ #endif
318
+ #if NUM_BONE_INFLUENCERS>2
319
+ previousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndices[2])]*vertexInputs.matricesWeights[2];
320
+ #endif
321
+ #if NUM_BONE_INFLUENCERS>3
322
+ previousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndices[3])]*vertexInputs.matricesWeights[3];
323
+ #endif
324
+ #if NUM_BONE_INFLUENCERS>4
325
+ previousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndicesExtra[0])]*vertexInputs.matricesWeightsExtra[0];
326
+ #endif
327
+ #if NUM_BONE_INFLUENCERS>5
328
+ previousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndicesExtra[1])]*vertexInputs.matricesWeightsExtra[1];
329
+ #endif
330
+ #if NUM_BONE_INFLUENCERS>6
331
+ previousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndicesExtra[2])]*vertexInputs.matricesWeightsExtra[2];
332
+ #endif
333
+ #if NUM_BONE_INFLUENCERS>7
334
+ previousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndicesExtra[3])]*vertexInputs.matricesWeightsExtra[3];
335
+ #endif
336
+ vertexOutputs.vPreviousPosition=uniforms.previousViewProjection*finalPreviousWorld*previousInfluence* vec4f(positionUpdated,1.0);
337
+ #else
338
+ vertexOutputs.vPreviousPosition=uniforms.previousViewProjection*finalPreviousWorld* vec4f(positionUpdated,1.0);
339
+ #endif
340
+ #endif
341
+ `;
342
+ e.IncludesShadersStoreWGSL[o] || (e.IncludesShadersStoreWGSL[o] = S);
343
+ const s = "uvVariableDeclaration", O = `#ifdef MAINUV{X}
344
+ #if !defined(UV{X})
345
+ var uv{X}: vec2f=vec2f(0.,0.);
346
+ #elif defined(USE_VERTEX_PULLING)
347
+ var uv{X}: vec2f=uv{X}Updated;
348
+ #else
349
+ var uv{X}: vec2f=vertexInputs.uv{X};
350
+ #endif
351
+ vertexOutputs.vMainUV{X}=uv{X};
352
+ #endif
353
+ `;
354
+ e.IncludesShadersStoreWGSL[s] || (e.IncludesShadersStoreWGSL[s] = O);
355
+ const u = "samplerVertexImplementation", T = `#if defined(_DEFINENAME_) && _DEFINENAME_DIRECTUV==0
356
+ if (uniforms.v_INFONAME_==0.)
357
+ {vertexOutputs.v_VARYINGNAME_UV= (uniforms._MATRIXNAME_Matrix* vec4f(uvUpdated,1.0,0.0)).xy;}
358
+ #ifdef UV2
359
+ else if (uniforms.v_INFONAME_==1.)
360
+ {vertexOutputs.v_VARYINGNAME_UV= (uniforms._MATRIXNAME_Matrix* vec4f(uv2Updated,1.0,0.0)).xy;}
361
+ #endif
362
+ #ifdef UV3
363
+ else if (uniforms.v_INFONAME_==2.)
364
+ {vertexOutputs.v_VARYINGNAME_UV= (uniforms._MATRIXNAME_Matrix* vec4f(vertexInputs.uv3,1.0,0.0)).xy;}
365
+ #endif
366
+ #ifdef UV4
367
+ else if (uniforms.v_INFONAME_==3.)
368
+ {vertexOutputs.v_VARYINGNAME_UV= (uniforms._MATRIXNAME_Matrix* vec4f(vertexInputs.uv4,1.0,0.0)).xy;}
369
+ #endif
370
+ #ifdef UV5
371
+ else if (uniforms.v_INFONAME_==4.)
372
+ {vertexOutputs.v_VARYINGNAME_UV= (uniforms._MATRIXNAME_Matrix* vec4f(vertexInputs.uv5,1.0,0.0)).xy;}
373
+ #endif
374
+ #ifdef UV6
375
+ else if (uniforms.v_INFONAME_==5.)
376
+ {vertexOutputs.v_VARYINGNAME_UV= (uniforms._MATRIXNAME_Matrix* vec4f(vertexInputs.uv6,1.0,0.0)).xy;}
377
+ #endif
378
+ #endif
379
+ `;
380
+ e.IncludesShadersStoreWGSL[u] || (e.IncludesShadersStoreWGSL[u] = T);
381
+ const v = "fogVertex", h = `#ifdef FOG
382
+ #ifdef SCENE_UBO
383
+ vertexOutputs.vFogDistance=(scene.view*worldPos).xyz;
384
+ #else
385
+ vertexOutputs.vFogDistance=(uniforms.view*worldPos).xyz;
386
+ #endif
387
+ #endif
388
+ `;
389
+ e.IncludesShadersStoreWGSL[v] || (e.IncludesShadersStoreWGSL[v] = h);
390
+ const l = "shadowsVertex", U = `#ifdef SHADOWS
391
+ #if defined(SHADOWCSM{X})
392
+ #ifdef SCENE_UBO
393
+ vertexOutputs.vPositionFromCamera{X}=scene.view*worldPos;
394
+ #else
395
+ vertexOutputs.vPositionFromCamera{X}=uniforms.view*worldPos;
396
+ #endif
397
+ #if SHADOWCSMNUM_CASCADES{X}>0
398
+ vertexOutputs.vPositionFromLight{X}_0=uniforms.lightMatrix{X}[0]*worldPos;
399
+ #ifdef USE_REVERSE_DEPTHBUFFER
400
+ vertexOutputs.vDepthMetric{X}_0=(-vertexOutputs.vPositionFromLight{X}_0.z+light{X}.depthValues.x)/light{X}.depthValues.y;
401
+ #else
402
+ vertexOutputs.vDepthMetric{X}_0= (vertexOutputs.vPositionFromLight{X}_0.z+light{X}.depthValues.x)/light{X}.depthValues.y;
403
+ #endif
404
+ #endif
405
+ #if SHADOWCSMNUM_CASCADES{X}>1
406
+ vertexOutputs.vPositionFromLight{X}_1=uniforms.lightMatrix{X}[1]*worldPos;
407
+ #ifdef USE_REVERSE_DEPTHBUFFER
408
+ vertexOutputs.vDepthMetric{X}_1=(-vertexOutputs.vPositionFromLight{X}_1.z+light{X}.depthValues.x)/light{X}.depthValues.y;
409
+ #else
410
+ vertexOutputs.vDepthMetric{X}_1= (vertexOutputs.vPositionFromLight{X}_1.z+light{X}.depthValues.x)/light{X}.depthValues.y;
411
+ #endif
412
+ #endif
413
+ #if SHADOWCSMNUM_CASCADES{X}>2
414
+ vertexOutputs.vPositionFromLight{X}_2=uniforms.lightMatrix{X}[2]*worldPos;
415
+ #ifdef USE_REVERSE_DEPTHBUFFER
416
+ vertexOutputs.vDepthMetric{X}_2=(-vertexOutputs.vPositionFromLight{X}_2.z+light{X}.depthValues.x)/light{X}.depthValues.y;
417
+ #else
418
+ vertexOutputs.vDepthMetric{X}_2= (vertexOutputs.vPositionFromLight{X}_2.z+light{X}.depthValues.x)/light{X}.depthValues.y;
419
+ #endif
420
+ #endif
421
+ #if SHADOWCSMNUM_CASCADES{X}>3
422
+ vertexOutputs.vPositionFromLight{X}_3=uniforms.lightMatrix{X}[3]*worldPos;
423
+ #ifdef USE_REVERSE_DEPTHBUFFER
424
+ vertexOutputs.vDepthMetric{X}_3=(-vertexOutputs.vPositionFromLight{X}_3.z+light{X}.depthValues.x)/light{X}.depthValues.y;
425
+ #else
426
+ vertexOutputs.vDepthMetric{X}_3= (vertexOutputs.vPositionFromLight{X}_3.z+light{X}.depthValues.x)/light{X}.depthValues.y;
427
+ #endif
428
+ #endif
429
+ #elif defined(SHADOW{X}) && !defined(SHADOWCUBE{X})
430
+ vertexOutputs.vPositionFromLight{X}=uniforms.lightMatrix{X}*worldPos;
431
+ #ifdef USE_REVERSE_DEPTHBUFFER
432
+ vertexOutputs.vDepthMetric{X}=(-vertexOutputs.vPositionFromLight{X}.z+light{X}.depthValues.x)/light{X}.depthValues.y;
433
+ #else
434
+ vertexOutputs.vDepthMetric{X}=(vertexOutputs.vPositionFromLight{X}.z+light{X}.depthValues.x)/light{X}.depthValues.y;
435
+ #endif
436
+ #endif
437
+ #endif
438
+ `;
439
+ e.IncludesShadersStoreWGSL[l] || (e.IncludesShadersStoreWGSL[l] = U);
440
+ const p = "vertexColorMixing", g = `#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)
441
+ vertexOutputs.vColor=vec4f(1.0);
442
+ #ifdef VERTEXCOLOR
443
+ #ifdef VERTEXALPHA
444
+ vertexOutputs.vColor*=colorUpdated;
445
+ #else
446
+ vertexOutputs.vColor=vec4f(vertexOutputs.vColor.rgb*colorUpdated.rgb,vertexOutputs.vColor.a);
447
+ #endif
448
+ #endif
449
+ #ifdef INSTANCESCOLOR
450
+ vertexOutputs.vColor*=vertexInputs.instanceColor;
451
+ #endif
452
+ #endif
453
+ `;
454
+ e.IncludesShadersStoreWGSL[p] || (e.IncludesShadersStoreWGSL[p] = g);
455
+ const c = "logDepthVertex", N = `#ifdef LOGARITHMICDEPTH
456
+ vertexOutputs.vFragmentDepth=1.0+vertexOutputs.position.w;vertexOutputs.position.z=log2(max(0.000001,vertexOutputs.vFragmentDepth))*uniforms.logarithmicDepthConstant;
457
+ #endif
458
+ `;
459
+ e.IncludesShadersStoreWGSL[c] || (e.IncludesShadersStoreWGSL[c] = N);
@@ -0,0 +1,74 @@
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
+ };