@driftengine/core 4.8.1 → 4.8.3

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 (159) hide show
  1. package/CHANGELOG.json +142 -0
  2. package/README.md +1 -1
  3. package/dist/index.d.ts +3 -1
  4. package/dist/index.js +8 -0
  5. package/dist/input/actionMap.d.ts +6 -1
  6. package/dist/input/actionMap.js +20 -7
  7. package/dist/input/input.d.ts +28 -0
  8. package/dist/input/input.js +71 -9
  9. package/dist/input/inputHarness.d.ts +9 -0
  10. package/dist/input/inputHarness.js +34 -2
  11. package/dist/render/backend/materialChanges.d.ts +7 -2
  12. package/dist/render/backend/materialChanges.js +8 -3
  13. package/dist/render/backend/webgl2/renderer.d.ts +75 -3
  14. package/dist/render/backend/webgl2/renderer.js +209 -22
  15. package/dist/render/backend/webgpu/buffers.d.ts +2 -0
  16. package/dist/render/backend/webgpu/buffers.js +2 -0
  17. package/dist/render/backend/webgpu/causticsPass.js +2 -1
  18. package/dist/render/backend/webgpu/depthPass.d.ts +13 -3
  19. package/dist/render/backend/webgpu/depthPass.js +4 -3
  20. package/dist/render/backend/webgpu/filmPass.js +2 -1
  21. package/dist/render/backend/webgpu/flatPass.d.ts +5 -0
  22. package/dist/render/backend/webgpu/flatPass.js +18 -8
  23. package/dist/render/backend/webgpu/linePass.js +2 -1
  24. package/dist/render/backend/webgpu/panelPass.js +2 -1
  25. package/dist/render/backend/webgpu/particlePass.js +2 -1
  26. package/dist/render/backend/webgpu/pipelineCache.d.ts +40 -8
  27. package/dist/render/backend/webgpu/pipelineCache.js +76 -9
  28. package/dist/render/backend/webgpu/plumePass.js +2 -1
  29. package/dist/render/backend/webgpu/postPass.d.ts +12 -2
  30. package/dist/render/backend/webgpu/postPass.js +19 -5
  31. package/dist/render/backend/webgpu/renderer.d.ts +66 -2
  32. package/dist/render/backend/webgpu/renderer.js +189 -38
  33. package/dist/render/backend/webgpu/sdfTextPass.js +2 -1
  34. package/dist/render/backend/webgpu/textPass.js +2 -1
  35. package/dist/render/backend/webgpu/waterPass.js +2 -1
  36. package/dist/render/backend/webgpu/windStreakPass.js +2 -1
  37. package/dist/render/boltBatch.js +2 -1
  38. package/dist/render/causticsRenderer.js +2 -1
  39. package/dist/render/cutoutCaster.d.ts +3 -1
  40. package/dist/render/cutoutCaster.js +4 -0
  41. package/dist/render/decalPass.js +2 -1
  42. package/dist/render/globalMediumPass.js +3 -2
  43. package/dist/render/lineBatch.js +5 -1
  44. package/dist/render/mapsWithoutUvs.d.ts +24 -0
  45. package/dist/render/mapsWithoutUvs.js +24 -0
  46. package/dist/render/mesh.d.ts +2 -0
  47. package/dist/render/mesh.js +3 -0
  48. package/dist/render/oitPass.js +2 -1
  49. package/dist/render/particleBatch.js +3 -2
  50. package/dist/render/particlePool.d.ts +21 -2
  51. package/dist/render/particlePool.js +72 -37
  52. package/dist/render/pass.d.ts +12 -0
  53. package/dist/render/plumeRenderer.js +3 -2
  54. package/dist/render/renderQuality.d.ts +16 -8
  55. package/dist/render/sceneCoverage.d.ts +54 -0
  56. package/dist/render/sceneCoverage.js +72 -0
  57. package/dist/render/sdfTextRenderer.js +2 -1
  58. package/dist/render/shaders/depth.js +3 -2
  59. package/dist/render/shaders/flat/glassTint.d.ts +28 -0
  60. package/dist/render/shaders/flat/glassTint.js +31 -0
  61. package/dist/render/shaders/flat/index.d.ts +12 -0
  62. package/dist/render/shaders/flat/index.js +13 -2
  63. package/dist/render/shaders/flat/main.d.ts +1 -1
  64. package/dist/render/shaders/flat/main.js +60 -25
  65. package/dist/render/shaders/flat/surfaceEffects.d.ts +1 -1
  66. package/dist/render/shaders/flat/surfaceEffects.js +6 -2
  67. package/dist/render/shaders/generated/depth.wgsl.d.ts +32 -12
  68. package/dist/render/shaders/generated/depth.wgsl.js +32 -12
  69. package/dist/render/shaders/generated/flat.wgsl.d.ts +89 -0
  70. package/dist/render/shaders/generated/flat.wgsl.js +127 -38
  71. package/dist/render/shaders/generated/line.wgsl.d.ts +1 -1
  72. package/dist/render/shaders/generated/line.wgsl.js +1 -1
  73. package/dist/render/shaders/generated/particle.wgsl.d.ts +3 -3
  74. package/dist/render/shaders/generated/particle.wgsl.js +3 -3
  75. package/dist/render/shaders/generated/rush.wgsl.d.ts +1 -1
  76. package/dist/render/shaders/generated/rush.wgsl.js +1 -1
  77. package/dist/render/shaders/generated/sdfText.wgsl.d.ts +1 -1
  78. package/dist/render/shaders/generated/sdfText.wgsl.js +1 -1
  79. package/dist/render/shaders/generated/temporalResolve.wgsl.d.ts +1 -1
  80. package/dist/render/shaders/generated/temporalResolve.wgsl.js +1 -1
  81. package/dist/render/shaders/line.d.ts +1 -1
  82. package/dist/render/shaders/outputTransform.d.ts +14 -1
  83. package/dist/render/shaders/outputTransform.js +23 -1
  84. package/dist/render/shaders/particle.d.ts +3 -3
  85. package/dist/render/shaders/recon/resolve.wgsl.js +15 -1
  86. package/dist/render/shaders/rush.js +13 -2
  87. package/dist/render/shaders/sdfText.d.ts +1 -1
  88. package/dist/render/shaders/temporalResolve.js +12 -5
  89. package/dist/render/ssrPass.js +2 -1
  90. package/dist/render/surfaceTexture.d.ts +13 -0
  91. package/dist/render/surfaceTexture.js +4 -0
  92. package/dist/render/textRenderer.js +2 -1
  93. package/dist/render/vertexDefaults.js +1 -0
  94. package/dist/render/viewModel.d.ts +29 -0
  95. package/dist/render/viewModel.js +35 -0
  96. package/dist/render/waterRenderer.js +2 -1
  97. package/dist/render/windStreakRenderer.js +2 -1
  98. package/package.json +6 -6
  99. package/src/index.ts +22 -1
  100. package/src/input/actionMap.ts +23 -8
  101. package/src/input/input.ts +79 -9
  102. package/src/input/inputHarness.ts +27 -2
  103. package/src/render/backend/materialChanges.ts +8 -3
  104. package/src/render/backend/webgl2/renderer.ts +223 -29
  105. package/src/render/backend/webgpu/buffers.ts +5 -0
  106. package/src/render/backend/webgpu/causticsPass.ts +2 -1
  107. package/src/render/backend/webgpu/depthPass.ts +4 -3
  108. package/src/render/backend/webgpu/filmPass.ts +2 -1
  109. package/src/render/backend/webgpu/flatPass.ts +43 -26
  110. package/src/render/backend/webgpu/linePass.ts +2 -1
  111. package/src/render/backend/webgpu/panelPass.ts +2 -1
  112. package/src/render/backend/webgpu/particlePass.ts +2 -1
  113. package/src/render/backend/webgpu/pipelineCache.ts +82 -8
  114. package/src/render/backend/webgpu/plumePass.ts +2 -1
  115. package/src/render/backend/webgpu/postPass.ts +20 -5
  116. package/src/render/backend/webgpu/renderer.ts +191 -37
  117. package/src/render/backend/webgpu/sdfTextPass.ts +2 -1
  118. package/src/render/backend/webgpu/textPass.ts +2 -1
  119. package/src/render/backend/webgpu/waterPass.ts +2 -1
  120. package/src/render/backend/webgpu/windStreakPass.ts +2 -1
  121. package/src/render/boltBatch.ts +2 -1
  122. package/src/render/causticsRenderer.ts +2 -1
  123. package/src/render/cutoutCaster.ts +15 -2
  124. package/src/render/decalPass.ts +2 -1
  125. package/src/render/globalMediumPass.ts +3 -2
  126. package/src/render/lineBatch.ts +3 -1
  127. package/src/render/mapsWithoutUvs.ts +43 -0
  128. package/src/render/mesh.ts +3 -0
  129. package/src/render/oitPass.ts +2 -1
  130. package/src/render/particleBatch.ts +3 -2
  131. package/src/render/particlePool.ts +107 -56
  132. package/src/render/pass.ts +12 -0
  133. package/src/render/plumeRenderer.ts +3 -2
  134. package/src/render/renderQuality.ts +16 -8
  135. package/src/render/sceneCoverage.ts +78 -0
  136. package/src/render/sdfTextRenderer.ts +2 -1
  137. package/src/render/shaders/depth.ts +3 -2
  138. package/src/render/shaders/flat/glassTint.ts +48 -0
  139. package/src/render/shaders/flat/index.ts +25 -2
  140. package/src/render/shaders/flat/main.ts +60 -25
  141. package/src/render/shaders/flat/surfaceEffects.ts +6 -2
  142. package/src/render/shaders/generated/depth.wgsl.ts +32 -12
  143. package/src/render/shaders/generated/flat.wgsl.ts +127 -38
  144. package/src/render/shaders/generated/line.wgsl.ts +1 -1
  145. package/src/render/shaders/generated/particle.wgsl.ts +3 -3
  146. package/src/render/shaders/generated/rush.wgsl.ts +1 -1
  147. package/src/render/shaders/generated/sdfText.wgsl.ts +1 -1
  148. package/src/render/shaders/generated/temporalResolve.wgsl.ts +1 -1
  149. package/src/render/shaders/outputTransform.ts +24 -1
  150. package/src/render/shaders/recon/resolve.wgsl.ts +15 -1
  151. package/src/render/shaders/rush.ts +13 -2
  152. package/src/render/shaders/temporalResolve.ts +12 -5
  153. package/src/render/ssrPass.ts +2 -1
  154. package/src/render/surfaceTexture.ts +16 -0
  155. package/src/render/textRenderer.ts +2 -1
  156. package/src/render/vertexDefaults.ts +1 -0
  157. package/src/render/viewModel.ts +41 -0
  158. package/src/render/waterRenderer.ts +2 -1
  159. package/src/render/windStreakRenderer.ts +2 -1
@@ -13,8 +13,13 @@ export const MAIN_GLSL = `void main() {
13
13
  * the material moves together. The gradients are taken here, outside every branch, for the room
14
14
  * a window samples through textureGrad further down.
15
15
  */
16
- fxLoad(int(surfaceAt.z));
17
- surfaceAt = fxAnimate(surfaceAt);
16
+ /* Zero rows unless a material has carried a table: \`SURFACE_EFFECTS\` is off until one does, and
17
+ every effect below reads exactly nothing from zero rows, which the device folds away. */
18
+ fxClear();
19
+ if (SURFACE_EFFECTS) {
20
+ fxLoad(int(surfaceAt.z));
21
+ surfaceAt = fxAnimate(surfaceAt);
22
+ }
18
23
  vec2 fxDx = dFdx(surfaceAt.xy);
19
24
  vec2 fxDy = dFdy(surfaceAt.xy);
20
25
  if (uWriteMode.y != 0.0 && !ditherKeeps(uWriteMode.y)) discard;
@@ -907,7 +912,12 @@ export const MAIN_GLSL = `void main() {
907
912
  */
908
913
  vec3 lampOpen = vec3(0.0);
909
914
  vec3 lampShadowed = vec3(0.0);
910
- float driftShare = driftLightShare(vWorldPos);
915
+ /* \`DRIFT_LIGHT\` is off until a consumer gives the renderer a DriftLight volume, and the device
916
+ compiles the volume's reads away with it. */
917
+ float driftShare = 0.0;
918
+ if (DRIFT_LIGHT) {
919
+ driftShare = driftLightShare(vWorldPos);
920
+ }
911
921
 
912
922
  /*
913
923
  * Which froxel this fragment is in.
@@ -920,28 +930,53 @@ export const MAIN_GLSL = `void main() {
920
930
  * same order and with the same clamps, because a fragment reading a froxel the binner filled
921
931
  * differently is a fragment lit by somebody else's lights.
922
932
  */
923
- vec3 clusterView = (uView * vec4(vWorldPos, 1.0)).xyz;
924
- float clusterDepth = -clusterView.z;
925
- float clusterHalfH = max(clusterDepth, 1e-4) * uClusterFrustum.z;
926
- float clusterHalfW = clusterHalfH * uClusterFrustum.w;
927
- int clusterTileX = clamp(
928
- int(floor((clusterView.x / clusterHalfW + 1.0) * 0.5 * float(CLUSTER_X))), 0, CLUSTER_X - 1);
929
- int clusterTileY = clamp(
930
- int(floor((clusterView.y / clusterHalfH + 1.0) * 0.5 * float(CLUSTER_Y))), 0, CLUSTER_Y - 1);
931
- int clusterSlice = 0;
932
- if (clusterDepth > uClusterFrustum.x) {
933
- clusterSlice = clamp(
934
- int(floor(log(clusterDepth / uClusterFrustum.x)
935
- / log(uClusterFrustum.y / uClusterFrustum.x) * float(CLUSTER_Z))),
936
- 0, CLUSTER_Z - 1);
933
+ /*
934
+ * **Only in a build that clusters, and there only in a frame that does.** \`CLUSTERED_LIGHTS\` is
935
+ * the profile's \`clusteredLights\`, a pipeline constant the device compiles this whole arm away
936
+ * on: the view transform, two logarithms and the froxel fetch below ran on every lit pixel of
937
+ * every scene, clustered or not, and the arm's records held their registers through the loop.
938
+ */
939
+ int clusterBaseTexel = 0;
940
+ int clusterLights = 0;
941
+ bool clusteredArm = false;
942
+ if (CLUSTERED_LIGHTS) {
943
+ if (uClustered != 0) {
944
+ vec3 clusterView = (uView * vec4(vWorldPos, 1.0)).xyz;
945
+ float clusterDepth = -clusterView.z;
946
+ float clusterHalfH = max(clusterDepth, 1e-4) * uClusterFrustum.z;
947
+ float clusterHalfW = clusterHalfH * uClusterFrustum.w;
948
+ int clusterTileX = clamp(
949
+ int(floor((clusterView.x / clusterHalfW + 1.0) * 0.5 * float(CLUSTER_X))), 0, CLUSTER_X - 1);
950
+ int clusterTileY = clamp(
951
+ int(floor((clusterView.y / clusterHalfH + 1.0) * 0.5 * float(CLUSTER_Y))), 0, CLUSTER_Y - 1);
952
+ int clusterSlice = 0;
953
+ if (clusterDepth > uClusterFrustum.x) {
954
+ clusterSlice = clamp(
955
+ int(floor(log(clusterDepth / uClusterFrustum.x)
956
+ / log(uClusterFrustum.y / uClusterFrustum.x) * float(CLUSTER_Z))),
957
+ 0, CLUSTER_Z - 1);
958
+ }
959
+ clusterBaseTexel = LIGHT_REGION_TEXELS
960
+ + (clusterTileX + clusterTileY * CLUSTER_X + clusterSlice * CLUSTER_X * CLUSTER_Y)
961
+ * CLUSTER_TEXELS;
962
+ clusterLights = int(clusterTexel(clusterBaseTexel).x);
963
+ clusteredArm = true;
964
+ }
937
965
  }
938
- int clusterBaseTexel = LIGHT_REGION_TEXELS
939
- + (clusterTileX + clusterTileY * CLUSTER_X + clusterSlice * CLUSTER_X * CLUSTER_Y)
940
- * CLUSTER_TEXELS;
941
- int clusterLights = uClustered != 0 ? int(clusterTexel(clusterBaseTexel).x) : 0;
942
966
 
943
967
  /* The fixture atlas's size, asked once: its cookie band and its profile rows are found from it. */
944
968
  vec2 fixtureSize = vec2(textureSize(uFixtureAtlas, 0));
969
+ /*
970
+ * Whether any light can carry a measured profile or a cookie, decided once rather than per
971
+ * light. \`LIGHT_FIXTURES\` is off until a consumer loads one, and the device compiles the
972
+ * fixture lookups away with it, which they hold their registers for in every scene otherwise.
973
+ */
974
+ bool fixtureProfiles = false;
975
+ bool fixtureShapes = false;
976
+ if (LIGHT_FIXTURES) {
977
+ fixtureProfiles = uIesAtlasRows > 1.0;
978
+ fixtureShapes = uIesPlaneCount > 1.0 || uCookieTiles > 0.0;
979
+ }
945
980
 
946
981
  // Point lights. Inverse-square-ish falloff clipped to a finite radius, so a
947
982
  // light can be culled without a visible seam.
@@ -967,7 +1002,7 @@ export const MAIN_GLSL = `void main() {
967
1002
  float iesProfile;
968
1003
  vec3 iesAxis;
969
1004
  float cookie;
970
- if (uClustered != 0) {
1005
+ if (clusteredArm) {
971
1006
  if (slot >= clusterLights) break;
972
1007
  /*
973
1008
  * Four indices to a texel. Selected with compares rather than by indexing the vector,
@@ -1272,7 +1307,7 @@ export const MAIN_GLSL = `void main() {
1272
1307
  vec3 iesRay = -toLight / max(dist, 1e-4);
1273
1308
  /* The angle from the fixture's axis, as a fraction of the 0-to-180 arc every row spans. */
1274
1309
  float iesU = 0.0;
1275
- if (uIesAtlasRows > 1.0) {
1310
+ if (fixtureProfiles) {
1276
1311
  float iesAngle = acos(clamp(dot(iesRay, lightDir), -1.0, 1.0));
1277
1312
  /* Clamped to the row's first and last texel centres, which is what the edge clamp of a
1278
1313
  texture exactly one row wide gave; the atlas can be wider now, with cookies beside it. */
@@ -1296,7 +1331,7 @@ export const MAIN_GLSL = `void main() {
1296
1331
  * \`uLightIesAxis\` to answer it. Behind a branch on two uniforms, so a scene using neither
1297
1332
  * builds no frame at all.
1298
1333
  */
1299
- if (uIesPlaneCount > 1.0 || uCookieTiles > 0.0) {
1334
+ if (fixtureShapes) {
1300
1335
  vec3 iesRef = iesAxis - lightDir * dot(iesAxis, lightDir);
1301
1336
  float iesRefLen = length(iesRef);
1302
1337
  if (iesRefLen > 1e-5) {
@@ -1353,7 +1388,7 @@ export const MAIN_GLSL = `void main() {
1353
1388
  * bytes on \`core-only\`** across the sixteen fragment permutations.
1354
1389
  */
1355
1390
  float photometric = 1.0;
1356
- if (uIesAtlasRows > 1.0) {
1391
+ if (fixtureProfiles) {
1357
1392
  float iesBase = iesRow * (uIesPlaneCount + 1.0);
1358
1393
  /* The profiles are the atlas's bottom rows, below any cookies. */
1359
1394
  float iesTop = fixtureSize.y - uIesAtlasRows;
@@ -26,4 +26,4 @@
26
26
  * lit or dark; and a room's box assumes a window as wide as it is tall, so a very tall cell
27
27
  * stretches its room.
28
28
  */
29
- export declare const SURFACE_EFFECTS_GLSL = "\n/*\n * The layer's six rows, and what every effect reads beside them, filled once at the top of main.\n * Globals rather than arguments, because naga passes every argument through a pointer and a copy,\n * and in sixteen permutations that traffic was most of what the effects cost in bytes.\n */\nvec4 fx0;\nvec4 fx1;\nvec4 fx2;\nvec4 fx3;\nvec4 fx4;\nvec4 fx5;\nvec3 fxNormal;\nfloat fxDistance;\n\n/** Fill the rows for this layer, or leave them zero where the array carries no table. */\nvoid fxLoad(int layer) {\n fx0 = vec4(0.0);\n fx1 = vec4(0.0);\n fx2 = vec4(0.0);\n fx3 = vec4(0.0);\n fx4 = vec4(0.0);\n fx5 = vec4(0.0);\n ivec2 size = textureSize(uSurfaceEffects, 0);\n if (size.x < 6 || layer < 0 || layer >= size.y) return;\n fx0 = texelFetch(uSurfaceEffects, ivec2(0, layer), 0);\n fx1 = texelFetch(uSurfaceEffects, ivec2(1, layer), 0);\n fx2 = texelFetch(uSurfaceEffects, ivec2(2, layer), 0);\n fx3 = texelFetch(uSurfaceEffects, ivec2(3, layer), 0);\n fx4 = texelFetch(uSurfaceEffects, ivec2(4, layer), 0);\n fx5 = texelFetch(uSurfaceEffects, ivec2(5, layer), 0);\n}\n\n/** A cell and a seed to 0..1, the same on every device. */\nfloat fxHash(vec2 cell, float seed) {\n uvec2 q = uvec2(ivec2(cell)) + uvec2(uint(seed) * 7919u, uint(seed) * 104729u);\n uint h = (q.x * 1597334677u) ^ (q.y * 3812015801u);\n h = (h ^ (h >> 16)) * 2246822519u;\n h ^= h >> 13;\n return float(h & 16777215u) / 16777216.0;\n}\n\nfloat fxNoise(vec2 p) {\n vec2 i = floor(p);\n vec2 u = smoothstep(0.0, 1.0, fract(p));\n return mix(\n mix(fxHash(i, 0.0), fxHash(i + vec2(1.0, 0.0), 0.0), u.x),\n mix(fxHash(i + vec2(0.0, 1.0), 0.0), fxHash(i + vec2(1.0, 1.0), 0.0), u.x),\n u.y);\n}\n\n/** Scroll and flipbook, on the caller's clock. `fract` keeps a long clock from eating precision. */\nvec3 fxAnimate(vec3 at) {\n float time = uSurfaceScene.x;\n at.xy += fract(fx4.xy * time);\n if (fx5.y > 0.0) at.z += mod(floor(time * fx5.z), fx5.y);\n return at;\n}\n\n/** Pulse, flicker and fade with distance, as a factor on the emission. */\nfloat fxEmission(float layer) {\n float time = uSurfaceScene.x;\n float e = 1.0 - fx4.w * (0.5 + 0.5 * sin(6.2831853 * fract(fx4.z * time)));\n e *= 1.0 - fx5.x * step(0.7, fxHash(vec2(floor(time * 14.0), layer), 3.0));\n if (fx5.w > 0.0) e *= 1.0 - smoothstep(fx5.w * 0.7, fx5.w, fxDistance);\n return e;\n}\n\n/** Dust, grime and streaks, then the scene's rain: the colour in xyz, the roughness in w. */\nvec4 fxWeather(vec3 world, vec3 albedo, float roughness) {\n float fade = fx3.w > 0.0 ? 1.0 - smoothstep(fx3.w * 0.5, fx3.w, fxDistance) : 1.0;\n if (fx3.x + fx3.y + fx3.z > 0.0) {\n float blotch = fxNoise(world.xz * 0.35 + world.y * 0.2);\n float dust = fx3.x * smoothstep(0.35, 0.9, fxNormal.y) * (0.5 + 0.5 * blotch) * fade;\n float grime = fx3.y * (0.55 - 0.55 * smoothstep(0.0, 2.5, world.y) + 0.45 * blotch) * fade;\n float streak = fx3.z * (1.0 - abs(fxNormal.y))\n * fxNoise(vec2((world.x + world.z) * 2.5, world.y * 0.15)) * fade;\n albedo = mix(albedo, vec3(0.56, 0.53, 0.48), dust * 0.6) * (1.0 - 0.5 * grime - 0.35 * streak);\n roughness = mix(roughness, 1.0, clamp(0.5 * (dust + grime), 0.0, 1.0));\n }\n float wet = uSurfaceScene.y * (1.0 - fx2.w) * mix(0.35, 1.0, smoothstep(0.2, 0.8, fxNormal.y));\n return vec4(albedo * (1.0 - 0.45 * wet), mix(roughness, 0.08, wet));\n}\n\n/**\n * Windows and the rooms behind them: the glow a lit window adds to the emission in xyz, and in w\n * how much of the surface is glass, which the caller mixes toward the room's dim colour. The room\n * itself is returned through `fxRoom`. `mask` is the albedo's alpha, and a window is a hole in the\n * wall's picture: glass where it is 0. The other way round would lose the wall's colour, which does\n * not survive an upload at alpha 0.\n *\n * **A building's own light, where its vertices name one.** The table is per layer, and every\n * facade of one style shares a layer, so a light that differs from building to building \u2014 its\n * colour and its strength \u2014 cannot live there. A window layer's vertex emissive is otherwise unused\n * (its windows glow here, not through the emissive term), so the vertex's emissive colour, strength\n * folded in, is that light: the window's colour where there is no room, a tint on the room where\n * there is. An absent colour reads negative and leaves both exactly as the table says.\n */\nvec3 fxRoom;\nvec4 fxWindows(vec3 at, vec2 dx, vec2 dy, float mask) {\n float glass = fx0.z > 0.0 ? 1.0 - mask : 1.0;\n vec2 g = at.xy * fx0.xy;\n vec2 local = fract(g);\n float share = floor(max(uSurfaceScene.z, uSurfaceScene.w) * 10.0 + 0.5) / 10.0;\n float lit = fxHash(floor(g), fx0.w) < share * (fx1.x > 0.0 ? fx1.z : 1.0) ? 1.0 : 0.0;\n fxRoom = fx2.rgb;\n bool own = vEmissiveColor.r >= 0.0;\n vec3 glow = own ? vEmissiveColor : fx2.rgb;\n float tangentLength = length(vTangent.xyz);\n if (fx1.x > 0.0 && tangentLength > 1e-4) {\n vec3 t = vTangent.xyz / tangentLength;\n vec3 v = normalize(vWorldPos - uCameraPos);\n vec3 d = vec3(dot(v, t), dot(v, cross(fxNormal, t)) * sign(vTangent.w + 0.5),\n min(dot(v, fxNormal), -1e-3) / max(fx1.y, 0.05));\n vec2 across = (step(0.0, d.xy) - local) / (sign(d.xy + 1e-9) * max(abs(d.xy), 1e-5));\n float travel = min(min(across.x, across.y), -1.0 / d.z);\n float depth = min(-d.z * travel, 1.0);\n vec2 picture = 0.5 + (local + d.xy * travel - 0.5) / (1.0 + depth);\n fxRoom = textureGrad(uAlbedo, vec3(picture, fx1.x - 1.0), dx * fx0.xy * 0.5, dy * fx0.xy * 0.5).rgb;\n glow = own ? fxRoom * vEmissiveColor : fxRoom;\n }\n return vec4(glow * (lit * fx1.w * glass), glass);\n}\n";
29
+ export declare const SURFACE_EFFECTS_GLSL = "\n/*\n * The layer's six rows, and what every effect reads beside them, filled once at the top of main.\n * Globals rather than arguments, because naga passes every argument through a pointer and a copy,\n * and in sixteen permutations that traffic was most of what the effects cost in bytes.\n */\nvec4 fx0;\nvec4 fx1;\nvec4 fx2;\nvec4 fx3;\nvec4 fx4;\nvec4 fx5;\nvec3 fxNormal;\nfloat fxDistance;\n\n/** Every row zero: the layer carries no effect. */\nvoid fxClear() {\n fx0 = vec4(0.0);\n fx1 = vec4(0.0);\n fx2 = vec4(0.0);\n fx3 = vec4(0.0);\n fx4 = vec4(0.0);\n fx5 = vec4(0.0);\n}\n\n/** Fill the rows for this layer, or leave them zero where the array carries no table. */\nvoid fxLoad(int layer) {\n ivec2 size = textureSize(uSurfaceEffects, 0);\n if (size.x < 6 || layer < 0 || layer >= size.y) return;\n fx0 = texelFetch(uSurfaceEffects, ivec2(0, layer), 0);\n fx1 = texelFetch(uSurfaceEffects, ivec2(1, layer), 0);\n fx2 = texelFetch(uSurfaceEffects, ivec2(2, layer), 0);\n fx3 = texelFetch(uSurfaceEffects, ivec2(3, layer), 0);\n fx4 = texelFetch(uSurfaceEffects, ivec2(4, layer), 0);\n fx5 = texelFetch(uSurfaceEffects, ivec2(5, layer), 0);\n}\n\n/** A cell and a seed to 0..1, the same on every device. */\nfloat fxHash(vec2 cell, float seed) {\n uvec2 q = uvec2(ivec2(cell)) + uvec2(uint(seed) * 7919u, uint(seed) * 104729u);\n uint h = (q.x * 1597334677u) ^ (q.y * 3812015801u);\n h = (h ^ (h >> 16)) * 2246822519u;\n h ^= h >> 13;\n return float(h & 16777215u) / 16777216.0;\n}\n\nfloat fxNoise(vec2 p) {\n vec2 i = floor(p);\n vec2 u = smoothstep(0.0, 1.0, fract(p));\n return mix(\n mix(fxHash(i, 0.0), fxHash(i + vec2(1.0, 0.0), 0.0), u.x),\n mix(fxHash(i + vec2(0.0, 1.0), 0.0), fxHash(i + vec2(1.0, 1.0), 0.0), u.x),\n u.y);\n}\n\n/** Scroll and flipbook, on the caller's clock. `fract` keeps a long clock from eating precision. */\nvec3 fxAnimate(vec3 at) {\n float time = uSurfaceScene.x;\n at.xy += fract(fx4.xy * time);\n if (fx5.y > 0.0) at.z += mod(floor(time * fx5.z), fx5.y);\n return at;\n}\n\n/** Pulse, flicker and fade with distance, as a factor on the emission. */\nfloat fxEmission(float layer) {\n float time = uSurfaceScene.x;\n float e = 1.0 - fx4.w * (0.5 + 0.5 * sin(6.2831853 * fract(fx4.z * time)));\n e *= 1.0 - fx5.x * step(0.7, fxHash(vec2(floor(time * 14.0), layer), 3.0));\n if (fx5.w > 0.0) e *= 1.0 - smoothstep(fx5.w * 0.7, fx5.w, fxDistance);\n return e;\n}\n\n/** Dust, grime and streaks, then the scene's rain: the colour in xyz, the roughness in w. */\nvec4 fxWeather(vec3 world, vec3 albedo, float roughness) {\n float fade = fx3.w > 0.0 ? 1.0 - smoothstep(fx3.w * 0.5, fx3.w, fxDistance) : 1.0;\n if (fx3.x + fx3.y + fx3.z > 0.0) {\n float blotch = fxNoise(world.xz * 0.35 + world.y * 0.2);\n float dust = fx3.x * smoothstep(0.35, 0.9, fxNormal.y) * (0.5 + 0.5 * blotch) * fade;\n float grime = fx3.y * (0.55 - 0.55 * smoothstep(0.0, 2.5, world.y) + 0.45 * blotch) * fade;\n float streak = fx3.z * (1.0 - abs(fxNormal.y))\n * fxNoise(vec2((world.x + world.z) * 2.5, world.y * 0.15)) * fade;\n albedo = mix(albedo, vec3(0.56, 0.53, 0.48), dust * 0.6) * (1.0 - 0.5 * grime - 0.35 * streak);\n roughness = mix(roughness, 1.0, clamp(0.5 * (dust + grime), 0.0, 1.0));\n }\n float wet = uSurfaceScene.y * (1.0 - fx2.w) * mix(0.35, 1.0, smoothstep(0.2, 0.8, fxNormal.y));\n return vec4(albedo * (1.0 - 0.45 * wet), mix(roughness, 0.08, wet));\n}\n\n/**\n * Windows and the rooms behind them: the glow a lit window adds to the emission in xyz, and in w\n * how much of the surface is glass, which the caller mixes toward the room's dim colour. The room\n * itself is returned through `fxRoom`. `mask` is the albedo's alpha, and a window is a hole in the\n * wall's picture: glass where it is 0. The other way round would lose the wall's colour, which does\n * not survive an upload at alpha 0.\n *\n * **A building's own light, where its vertices name one.** The table is per layer, and every\n * facade of one style shares a layer, so a light that differs from building to building \u2014 its\n * colour and its strength \u2014 cannot live there. A window layer's vertex emissive is otherwise unused\n * (its windows glow here, not through the emissive term), so the vertex's emissive colour, strength\n * folded in, is that light: the window's colour where there is no room, a tint on the room where\n * there is. An absent colour reads negative and leaves both exactly as the table says.\n */\nvec3 fxRoom;\nvec4 fxWindows(vec3 at, vec2 dx, vec2 dy, float mask) {\n float glass = fx0.z > 0.0 ? 1.0 - mask : 1.0;\n vec2 g = at.xy * fx0.xy;\n vec2 local = fract(g);\n float share = floor(max(uSurfaceScene.z, uSurfaceScene.w) * 10.0 + 0.5) / 10.0;\n float lit = fxHash(floor(g), fx0.w) < share * (fx1.x > 0.0 ? fx1.z : 1.0) ? 1.0 : 0.0;\n fxRoom = fx2.rgb;\n bool own = vEmissiveColor.r >= 0.0;\n vec3 glow = own ? vEmissiveColor : fx2.rgb;\n float tangentLength = length(vTangent.xyz);\n if (fx1.x > 0.0 && tangentLength > 1e-4) {\n vec3 t = vTangent.xyz / tangentLength;\n vec3 v = normalize(vWorldPos - uCameraPos);\n vec3 d = vec3(dot(v, t), dot(v, cross(fxNormal, t)) * sign(vTangent.w + 0.5),\n min(dot(v, fxNormal), -1e-3) / max(fx1.y, 0.05));\n vec2 across = (step(0.0, d.xy) - local) / (sign(d.xy + 1e-9) * max(abs(d.xy), 1e-5));\n float travel = min(min(across.x, across.y), -1.0 / d.z);\n float depth = min(-d.z * travel, 1.0);\n vec2 picture = 0.5 + (local + d.xy * travel - 0.5) / (1.0 + depth);\n fxRoom = textureGrad(uAlbedo, vec3(picture, fx1.x - 1.0), dx * fx0.xy * 0.5, dy * fx0.xy * 0.5).rgb;\n glow = own ? fxRoom * vEmissiveColor : fxRoom;\n }\n return vec4(glow * (lit * fx1.w * glass), glass);\n}\n";
@@ -41,14 +41,18 @@ vec4 fx5;
41
41
  vec3 fxNormal;
42
42
  float fxDistance;
43
43
 
44
- /** Fill the rows for this layer, or leave them zero where the array carries no table. */
45
- void fxLoad(int layer) {
44
+ /** Every row zero: the layer carries no effect. */
45
+ void fxClear() {
46
46
  fx0 = vec4(0.0);
47
47
  fx1 = vec4(0.0);
48
48
  fx2 = vec4(0.0);
49
49
  fx3 = vec4(0.0);
50
50
  fx4 = vec4(0.0);
51
51
  fx5 = vec4(0.0);
52
+ }
53
+
54
+ /** Fill the rows for this layer, or leave them zero where the array carries no table. */
55
+ void fxLoad(int layer) {
52
56
  ivec2 size = textureSize(uSurfaceEffects, 0);
53
57
  if (size.x < 6 || layer < 0 || layer >= size.y) return;
54
58
  fx0 = texelFetch(uSurfaceEffects, ivec2(0, layer), 0);
@@ -1,14 +1,14 @@
1
1
  export declare const DEPTH_CUTOUT_FRAG_WGSL = "struct Uniforms {\n uPeelShadowLayer: i32,\n}\n\nvar<private> vUv_1: vec3<f32>;\n@group(0) @binding(34) \nvar uCutoutMap_t: texture_2d_array<f32>;\n@group(0) @binding(35) \nvar uCutoutMap_s: sampler;\n@group(0) @binding(1) \nvar<uniform> unnamed: Uniforms;\nvar<private> vLightPosition_1: vec4<f32>;\n@group(0) @binding(32) \nvar uPreviousShadowMap_t: texture_2d_array<f32>;\n@group(0) @binding(33) \nvar uPreviousShadowMap_s: sampler;\nvar<private> gl_FragCoord_1: vec4<f32>;\nvar<private> vAlphaCutout_1: f32;\n\nfn cutoutAlpha_u0028_f1_u003b_vf2_u003b(alpha: ptr<function, f32>, texels: ptr<function, vec2<f32>>) -> f32 {\n var dx: vec2<f32>;\n var dy: vec2<f32>;\n var level: f32;\n\n let _e23 = (*texels);\n let _e24 = dpdx(_e23);\n dx = _e24;\n let _e25 = (*texels);\n let _e26 = dpdy(_e25);\n dy = _e26;\n let _e27 = dx;\n let _e28 = dx;\n let _e30 = dy;\n let _e31 = dy;\n level = max(0f, (0.5f * log2(max(dot(_e27, _e28), dot(_e30, _e31)))));\n let _e37 = (*alpha);\n let _e38 = level;\n return (_e37 * (1f + (_e38 * 0.25f)));\n}\n\nfn main_1() {\n var at: vec3<f32>;\n var alpha_1: f32;\n var param: f32;\n var param_1: vec2<f32>;\n var p: vec3<f32>;\n var uv: vec2<f32>;\n var previousDepth: f32;\n\n let _e25 = vUv_1;\n let _e26 = _e25.xy;\n let _e28 = vUv_1[2u];\n at = vec3<f32>(_e26.x, _e26.y, floor((_e28 + 0.5f)));\n let _e34 = at;\n let _e40 = textureSample(uCutoutMap_t, uCutoutMap_s, vec2<f32>(_e34.x, _e34.y), i32(_e34.z));\n let _e41 = vUv_1;\n let _e43 = textureDimensions(uCutoutMap_t, 0i);\n param = _e40.w;\n param_1 = (_e41.xy * vec2<f32>(vec2<i32>(_e43).xy));\n let _e49 = cutoutAlpha_u0028_f1_u003b_vf2_u003b((&param), (&param_1));\n alpha_1 = _e49;\n let _e51 = unnamed.uPeelShadowLayer;\n if (_e51 != 0i) {\n let _e53 = vLightPosition_1;\n let _e56 = vLightPosition_1[3u];\n p = (_e53.xyz / vec3(_e56));\n let _e59 = p;\n uv = ((_e59.xy * 0.5f) + vec2(0.5f));\n let _e64 = uv;\n let _e67 = vec3<f32>(_e64.x, _e64.y, 0f);\n let _e73 = textureSampleLevel(uPreviousShadowMap_t, uPreviousShadowMap_s, vec2<f32>(_e67.x, _e67.y), i32(_e67.z), 0f);\n previousDepth = _e73.x;\n let _e76 = gl_FragCoord_1[2u];\n let _e77 = previousDepth;\n if (_e76 <= (_e77 + 0.00001f)) {\n discard;\n }\n }\n let _e80 = alpha_1;\n let _e81 = vAlphaCutout_1;\n if (_e80 < _e81) {\n discard;\n }\n return;\n}\n\n@fragment \nfn main(@location(1) vUv: vec3<f32>, @location(0) vLightPosition: vec4<f32>, @builtin(position) gl_FragCoord: vec4<f32>, @location(2) @interpolate(flat) vAlphaCutout: f32) {\n vUv_1 = vUv;\n vLightPosition_1 = vLightPosition;\n gl_FragCoord_1 = gl_FragCoord;\n vAlphaCutout_1 = vAlphaCutout;\n main_1();\n}\n";
2
- export declare const DEPTH_CUTOUT_VERT_WGSL = "struct Uniforms {\n uLightViewProj: mat4x4<f32>,\n uModel: mat4x4<f32>,\n uWindDirection: vec2<f32>,\n uWindSpeed: f32,\n uWindGust: f32,\n uWindTime: f32,\n uWindSpatialPhase: vec2<f32>,\n uUvScale: vec2<f32>,\n uAlphaCutout: f32,\n}\n\nstruct gl_PerVertex {\n @builtin(position) gl_Position: vec4<f32>,\n gl_PointSize: f32,\n}\n\nstruct VertexOutput {\n @location(0) member: vec4<f32>,\n @builtin(position) gl_Position: vec4<f32>,\n @location(1) member_1: vec3<f32>,\n @location(2) @interpolate(flat) member_2: f32,\n}\n\n@group(0) @binding(0) \nvar<uniform> unnamed: Uniforms;\nvar<private> aPosition_1: vec3<f32>;\nvar<private> aChannel_1: vec4<f32>;\nvar<private> vLightPosition: vec4<f32>;\nvar<private> unnamed_1: gl_PerVertex = gl_PerVertex(vec4<f32>(0f, 0f, 0f, 1f), 1f);\nvar<private> vUv: vec3<f32>;\nvar<private> aUv_1: vec3<f32>;\nvar<private> vAlphaCutout: f32;\n\nfn channelBend_u0028_vf3_u003b_f1_u003b(worldPos: ptr<function, vec3<f32>>, sway: ptr<function, f32>) -> vec3<f32> {\n var phase: f32;\n var bend: f32;\n\n let _e27 = (*sway);\n if (_e27 <= 0f) {\n let _e29 = (*worldPos);\n return _e29;\n }\n let _e30 = (*worldPos);\n let _e33 = unnamed.uWindSpatialPhase;\n let _e36 = unnamed.uWindTime;\n phase = (dot(_e30.xz, _e33) + _e36);\n let _e39 = unnamed.uWindSpeed;\n let _e41 = unnamed.uWindGust;\n let _e43 = phase;\n let _e46 = (*sway);\n bend = (((_e39 + _e41) * sin(_e43)) * _e46);\n let _e49 = (*worldPos)[0u];\n let _e52 = unnamed.uWindDirection[0u];\n let _e53 = bend;\n let _e57 = (*worldPos)[1u];\n let _e59 = (*worldPos)[2u];\n let _e62 = unnamed.uWindDirection[1u];\n let _e63 = bend;\n return vec3<f32>((_e49 + (_e52 * _e53)), _e57, (_e59 + (_e62 * _e63)));\n}\n\nfn main_1() {\n var local: vec4<f32>;\n var model: mat4x4<f32>;\n var world: vec4<f32>;\n var bent: vec3<f32>;\n var param: vec3<f32>;\n var param_1: f32;\n\n let _e29 = aPosition_1;\n local = vec4<f32>(_e29.x, _e29.y, _e29.z, 1f);\n let _e35 = unnamed.uModel;\n model = _e35;\n let _e36 = model;\n let _e37 = local;\n world = (_e36 * _e37);\n let _e39 = world;\n param = _e39.xyz;\n let _e42 = aChannel_1[0u];\n param_1 = _e42;\n let _e43 = channelBend_u0028_vf3_u003b_f1_u003b((&param), (&param_1));\n bent = _e43;\n let _e45 = unnamed.uLightViewProj;\n let _e46 = bent;\n let _e48 = world[3u];\n vLightPosition = (_e45 * vec4<f32>(_e46.x, _e46.y, _e46.z, _e48));\n let _e54 = vLightPosition;\n unnamed_1.gl_Position = _e54;\n let _e56 = aUv_1;\n let _e59 = unnamed.uUvScale;\n let _e60 = (_e56.xy * _e59);\n let _e62 = aUv_1[2u];\n vUv = vec3<f32>(_e60.x, _e60.y, _e62);\n let _e67 = unnamed.uAlphaCutout;\n vAlphaCutout = _e67;\n return;\n}\n\n@vertex \nfn main(@location(0) aPosition: vec3<f32>, @location(13) aChannel: vec4<f32>, @location(5) aUv: vec3<f32>) -> VertexOutput {\n aPosition_1 = aPosition;\n aChannel_1 = aChannel;\n aUv_1 = aUv;\n main_1();\n let _e12 = unnamed_1.gl_Position.y;\n unnamed_1.gl_Position.y = -(_e12);\n let _e14 = vLightPosition;\n let _e15 = unnamed_1.gl_Position;\n let _e16 = vUv;\n let _e17 = vAlphaCutout;\n return VertexOutput(_e14, _e15, _e16, _e17);\n}\n";
2
+ export declare const DEPTH_CUTOUT_VERT_WGSL = "struct Uniforms {\n uLightViewProj: mat4x4<f32>,\n uModel: mat4x4<f32>,\n uWindDirection: vec2<f32>,\n uWindSpeed: f32,\n uWindGust: f32,\n uWindTime: f32,\n uWindSpatialPhase: vec2<f32>,\n uUvScale: vec2<f32>,\n uUvOffset: vec2<f32>,\n uAlphaCutout: f32,\n}\n\nstruct gl_PerVertex {\n @builtin(position) gl_Position: vec4<f32>,\n gl_PointSize: f32,\n}\n\nstruct VertexOutput {\n @location(0) member: vec4<f32>,\n @builtin(position) gl_Position: vec4<f32>,\n @location(1) member_1: vec3<f32>,\n @location(2) @interpolate(flat) member_2: f32,\n}\n\n@group(0) @binding(0) \nvar<uniform> unnamed: Uniforms;\nvar<private> aPosition_1: vec3<f32>;\nvar<private> aChannel_1: vec4<f32>;\nvar<private> vLightPosition: vec4<f32>;\nvar<private> unnamed_1: gl_PerVertex = gl_PerVertex(vec4<f32>(0f, 0f, 0f, 1f), 1f);\nvar<private> vUv: vec3<f32>;\nvar<private> aUv_1: vec3<f32>;\nvar<private> vAlphaCutout: f32;\n\nfn channelBend_u0028_vf3_u003b_f1_u003b(worldPos: ptr<function, vec3<f32>>, sway: ptr<function, f32>) -> vec3<f32> {\n var phase: f32;\n var bend: f32;\n\n let _e28 = (*sway);\n if (_e28 <= 0f) {\n let _e30 = (*worldPos);\n return _e30;\n }\n let _e31 = (*worldPos);\n let _e34 = unnamed.uWindSpatialPhase;\n let _e37 = unnamed.uWindTime;\n phase = (dot(_e31.xz, _e34) + _e37);\n let _e40 = unnamed.uWindSpeed;\n let _e42 = unnamed.uWindGust;\n let _e44 = phase;\n let _e47 = (*sway);\n bend = (((_e40 + _e42) * sin(_e44)) * _e47);\n let _e50 = (*worldPos)[0u];\n let _e53 = unnamed.uWindDirection[0u];\n let _e54 = bend;\n let _e58 = (*worldPos)[1u];\n let _e60 = (*worldPos)[2u];\n let _e63 = unnamed.uWindDirection[1u];\n let _e64 = bend;\n return vec3<f32>((_e50 + (_e53 * _e54)), _e58, (_e60 + (_e63 * _e64)));\n}\n\nfn main_1() {\n var local: vec4<f32>;\n var model: mat4x4<f32>;\n var world: vec4<f32>;\n var bent: vec3<f32>;\n var param: vec3<f32>;\n var param_1: f32;\n\n let _e30 = aPosition_1;\n local = vec4<f32>(_e30.x, _e30.y, _e30.z, 1f);\n let _e36 = unnamed.uModel;\n model = _e36;\n let _e37 = model;\n let _e38 = local;\n world = (_e37 * _e38);\n let _e40 = world;\n param = _e40.xyz;\n let _e43 = aChannel_1[0u];\n param_1 = _e43;\n let _e44 = channelBend_u0028_vf3_u003b_f1_u003b((&param), (&param_1));\n bent = _e44;\n let _e46 = unnamed.uLightViewProj;\n let _e47 = bent;\n let _e49 = world[3u];\n vLightPosition = (_e46 * vec4<f32>(_e47.x, _e47.y, _e47.z, _e49));\n let _e55 = vLightPosition;\n unnamed_1.gl_Position = _e55;\n let _e57 = aUv_1;\n let _e60 = unnamed.uUvScale;\n let _e63 = unnamed.uUvOffset;\n let _e64 = ((_e57.xy * _e60) + _e63);\n let _e66 = aUv_1[2u];\n vUv = vec3<f32>(_e64.x, _e64.y, _e66);\n let _e71 = unnamed.uAlphaCutout;\n vAlphaCutout = _e71;\n return;\n}\n\n@vertex \nfn main(@location(0) aPosition: vec3<f32>, @location(13) aChannel: vec4<f32>, @location(5) aUv: vec3<f32>) -> VertexOutput {\n aPosition_1 = aPosition;\n aChannel_1 = aChannel;\n aUv_1 = aUv;\n main_1();\n let _e12 = unnamed_1.gl_Position.y;\n unnamed_1.gl_Position.y = -(_e12);\n let _e14 = vLightPosition;\n let _e15 = unnamed_1.gl_Position;\n let _e16 = vUv;\n let _e17 = vAlphaCutout;\n return VertexOutput(_e14, _e15, _e16, _e17);\n}\n";
3
3
  export declare const DEPTH_FRAG_WGSL = "struct Uniforms {\n uPeelShadowLayer: i32,\n}\n\n@group(0) @binding(1) \nvar<uniform> unnamed: Uniforms;\nvar<private> vLightPosition_1: vec4<f32>;\n@group(0) @binding(32) \nvar uPreviousShadowMap_t: texture_2d_array<f32>;\n@group(0) @binding(33) \nvar uPreviousShadowMap_s: sampler;\nvar<private> gl_FragCoord_1: vec4<f32>;\n\nfn main_1() {\n var p: vec3<f32>;\n var uv: vec2<f32>;\n var previousDepth: f32;\n\n let _e16 = unnamed.uPeelShadowLayer;\n if (_e16 != 0i) {\n let _e18 = vLightPosition_1;\n let _e21 = vLightPosition_1[3u];\n p = (_e18.xyz / vec3(_e21));\n let _e24 = p;\n uv = ((_e24.xy * 0.5f) + vec2(0.5f));\n let _e29 = uv;\n let _e32 = vec3<f32>(_e29.x, _e29.y, 0f);\n let _e38 = textureSample(uPreviousShadowMap_t, uPreviousShadowMap_s, vec2<f32>(_e32.x, _e32.y), i32(_e32.z));\n previousDepth = _e38.x;\n let _e41 = gl_FragCoord_1[2u];\n let _e42 = previousDepth;\n if (_e41 <= (_e42 + 0.00001f)) {\n discard;\n }\n }\n return;\n}\n\n@fragment \nfn main(@location(0) vLightPosition: vec4<f32>, @builtin(position) gl_FragCoord: vec4<f32>) {\n vLightPosition_1 = vLightPosition;\n gl_FragCoord_1 = gl_FragCoord;\n main_1();\n}\n";
4
- export declare const DEPTH_INSTANCED_CUTOUT_VERT_WGSL = "struct Uniforms {\n uLightViewProj: mat4x4<f32>,\n uUvScale: vec2<f32>,\n uAlphaCutout: f32,\n}\n\nstruct gl_PerVertex {\n @builtin(position) gl_Position: vec4<f32>,\n gl_PointSize: f32,\n}\n\nstruct VertexOutput {\n @location(0) member: vec4<f32>,\n @builtin(position) gl_Position: vec4<f32>,\n @location(1) member_1: vec3<f32>,\n @location(2) @interpolate(flat) member_2: f32,\n}\n\nvar<private> aPosition_1: vec3<f32>;\nvar<private> aInstanceModel0_1: vec4<f32>;\nvar<private> aInstanceModel1_1: vec4<f32>;\nvar<private> aInstanceModel2_1: vec4<f32>;\nvar<private> aInstanceModel3_1: vec4<f32>;\nvar<private> vLightPosition: vec4<f32>;\n@group(0) @binding(0) \nvar<uniform> unnamed: Uniforms;\nvar<private> unnamed_1: gl_PerVertex = gl_PerVertex(vec4<f32>(0f, 0f, 0f, 1f), 1f);\nvar<private> vUv: vec3<f32>;\nvar<private> aUv_1: vec3<f32>;\nvar<private> vAlphaCutout: f32;\n\nfn main_1() {\n var local: vec4<f32>;\n var model: mat4x4<f32>;\n var world: vec4<f32>;\n var bent: vec3<f32>;\n\n let _e22 = aPosition_1;\n local = vec4<f32>(_e22.x, _e22.y, _e22.z, 1f);\n let _e27 = aInstanceModel0_1;\n let _e28 = aInstanceModel1_1;\n let _e29 = aInstanceModel2_1;\n let _e30 = aInstanceModel3_1;\n model = mat4x4<f32>(vec4<f32>(_e27.x, _e27.y, _e27.z, _e27.w), vec4<f32>(_e28.x, _e28.y, _e28.z, _e28.w), vec4<f32>(_e29.x, _e29.y, _e29.z, _e29.w), vec4<f32>(_e30.x, _e30.y, _e30.z, _e30.w));\n let _e52 = model;\n let _e53 = local;\n world = (_e52 * _e53);\n let _e55 = world;\n bent = _e55.xyz;\n let _e58 = unnamed.uLightViewProj;\n let _e59 = bent;\n let _e61 = world[3u];\n vLightPosition = (_e58 * vec4<f32>(_e59.x, _e59.y, _e59.z, _e61));\n let _e67 = vLightPosition;\n unnamed_1.gl_Position = _e67;\n let _e69 = aUv_1;\n let _e72 = unnamed.uUvScale;\n let _e73 = (_e69.xy * _e72);\n let _e75 = aUv_1[2u];\n vUv = vec3<f32>(_e73.x, _e73.y, _e75);\n let _e80 = unnamed.uAlphaCutout;\n vAlphaCutout = _e80;\n return;\n}\n\n@vertex \nfn main(@location(0) aPosition: vec3<f32>, @location(11) aInstanceModel0_: vec4<f32>, @location(12) aInstanceModel1_: vec4<f32>, @location(13) aInstanceModel2_: vec4<f32>, @location(14) aInstanceModel3_: vec4<f32>, @location(5) aUv: vec3<f32>) -> VertexOutput {\n aPosition_1 = aPosition;\n aInstanceModel0_1 = aInstanceModel0_;\n aInstanceModel1_1 = aInstanceModel1_;\n aInstanceModel2_1 = aInstanceModel2_;\n aInstanceModel3_1 = aInstanceModel3_;\n aUv_1 = aUv;\n main_1();\n let _e18 = unnamed_1.gl_Position.y;\n unnamed_1.gl_Position.y = -(_e18);\n let _e20 = vLightPosition;\n let _e21 = unnamed_1.gl_Position;\n let _e22 = vUv;\n let _e23 = vAlphaCutout;\n return VertexOutput(_e20, _e21, _e22, _e23);\n}\n";
4
+ export declare const DEPTH_INSTANCED_CUTOUT_VERT_WGSL = "struct Uniforms {\n uLightViewProj: mat4x4<f32>,\n uUvScale: vec2<f32>,\n uUvOffset: vec2<f32>,\n uAlphaCutout: f32,\n}\n\nstruct gl_PerVertex {\n @builtin(position) gl_Position: vec4<f32>,\n gl_PointSize: f32,\n}\n\nstruct VertexOutput {\n @location(0) member: vec4<f32>,\n @builtin(position) gl_Position: vec4<f32>,\n @location(1) member_1: vec3<f32>,\n @location(2) @interpolate(flat) member_2: f32,\n}\n\nvar<private> aPosition_1: vec3<f32>;\nvar<private> aInstanceModel0_1: vec4<f32>;\nvar<private> aInstanceModel1_1: vec4<f32>;\nvar<private> aInstanceModel2_1: vec4<f32>;\nvar<private> aInstanceModel3_1: vec4<f32>;\nvar<private> vLightPosition: vec4<f32>;\n@group(0) @binding(0) \nvar<uniform> unnamed: Uniforms;\nvar<private> unnamed_1: gl_PerVertex = gl_PerVertex(vec4<f32>(0f, 0f, 0f, 1f), 1f);\nvar<private> vUv: vec3<f32>;\nvar<private> aUv_1: vec3<f32>;\nvar<private> vAlphaCutout: f32;\n\nfn main_1() {\n var local: vec4<f32>;\n var model: mat4x4<f32>;\n var world: vec4<f32>;\n var bent: vec3<f32>;\n\n let _e23 = aPosition_1;\n local = vec4<f32>(_e23.x, _e23.y, _e23.z, 1f);\n let _e28 = aInstanceModel0_1;\n let _e29 = aInstanceModel1_1;\n let _e30 = aInstanceModel2_1;\n let _e31 = aInstanceModel3_1;\n model = mat4x4<f32>(vec4<f32>(_e28.x, _e28.y, _e28.z, _e28.w), vec4<f32>(_e29.x, _e29.y, _e29.z, _e29.w), vec4<f32>(_e30.x, _e30.y, _e30.z, _e30.w), vec4<f32>(_e31.x, _e31.y, _e31.z, _e31.w));\n let _e53 = model;\n let _e54 = local;\n world = (_e53 * _e54);\n let _e56 = world;\n bent = _e56.xyz;\n let _e59 = unnamed.uLightViewProj;\n let _e60 = bent;\n let _e62 = world[3u];\n vLightPosition = (_e59 * vec4<f32>(_e60.x, _e60.y, _e60.z, _e62));\n let _e68 = vLightPosition;\n unnamed_1.gl_Position = _e68;\n let _e70 = aUv_1;\n let _e73 = unnamed.uUvScale;\n let _e76 = unnamed.uUvOffset;\n let _e77 = ((_e70.xy * _e73) + _e76);\n let _e79 = aUv_1[2u];\n vUv = vec3<f32>(_e77.x, _e77.y, _e79);\n let _e84 = unnamed.uAlphaCutout;\n vAlphaCutout = _e84;\n return;\n}\n\n@vertex \nfn main(@location(0) aPosition: vec3<f32>, @location(11) aInstanceModel0_: vec4<f32>, @location(12) aInstanceModel1_: vec4<f32>, @location(13) aInstanceModel2_: vec4<f32>, @location(14) aInstanceModel3_: vec4<f32>, @location(5) aUv: vec3<f32>) -> VertexOutput {\n aPosition_1 = aPosition;\n aInstanceModel0_1 = aInstanceModel0_;\n aInstanceModel1_1 = aInstanceModel1_;\n aInstanceModel2_1 = aInstanceModel2_;\n aInstanceModel3_1 = aInstanceModel3_;\n aUv_1 = aUv;\n main_1();\n let _e18 = unnamed_1.gl_Position.y;\n unnamed_1.gl_Position.y = -(_e18);\n let _e20 = vLightPosition;\n let _e21 = unnamed_1.gl_Position;\n let _e22 = vUv;\n let _e23 = vAlphaCutout;\n return VertexOutput(_e20, _e21, _e22, _e23);\n}\n";
5
5
  export declare const DEPTH_INSTANCED_VERT_WGSL = "struct Uniforms {\n uLightViewProj: mat4x4<f32>,\n}\n\nstruct gl_PerVertex {\n @builtin(position) gl_Position: vec4<f32>,\n gl_PointSize: f32,\n}\n\nstruct VertexOutput {\n @location(0) member: vec4<f32>,\n @builtin(position) gl_Position: vec4<f32>,\n}\n\nvar<private> aPosition_1: vec3<f32>;\nvar<private> aInstanceModel0_1: vec4<f32>;\nvar<private> aInstanceModel1_1: vec4<f32>;\nvar<private> aInstanceModel2_1: vec4<f32>;\nvar<private> aInstanceModel3_1: vec4<f32>;\nvar<private> vLightPosition: vec4<f32>;\n@group(0) @binding(0) \nvar<uniform> unnamed: Uniforms;\nvar<private> unnamed_1: gl_PerVertex = gl_PerVertex(vec4<f32>(0f, 0f, 0f, 1f), 1f);\n\nfn main_1() {\n var local: vec4<f32>;\n var model: mat4x4<f32>;\n var world: vec4<f32>;\n var bent: vec3<f32>;\n\n let _e16 = aPosition_1;\n local = vec4<f32>(_e16.x, _e16.y, _e16.z, 1f);\n let _e21 = aInstanceModel0_1;\n let _e22 = aInstanceModel1_1;\n let _e23 = aInstanceModel2_1;\n let _e24 = aInstanceModel3_1;\n model = mat4x4<f32>(vec4<f32>(_e21.x, _e21.y, _e21.z, _e21.w), vec4<f32>(_e22.x, _e22.y, _e22.z, _e22.w), vec4<f32>(_e23.x, _e23.y, _e23.z, _e23.w), vec4<f32>(_e24.x, _e24.y, _e24.z, _e24.w));\n let _e46 = model;\n let _e47 = local;\n world = (_e46 * _e47);\n let _e49 = world;\n bent = _e49.xyz;\n let _e52 = unnamed.uLightViewProj;\n let _e53 = bent;\n let _e55 = world[3u];\n vLightPosition = (_e52 * vec4<f32>(_e53.x, _e53.y, _e53.z, _e55));\n let _e61 = vLightPosition;\n unnamed_1.gl_Position = _e61;\n return;\n}\n\n@vertex \nfn main(@location(0) aPosition: vec3<f32>, @location(11) aInstanceModel0_: vec4<f32>, @location(12) aInstanceModel1_: vec4<f32>, @location(13) aInstanceModel2_: vec4<f32>, @location(14) aInstanceModel3_: vec4<f32>) -> VertexOutput {\n aPosition_1 = aPosition;\n aInstanceModel0_1 = aInstanceModel0_;\n aInstanceModel1_1 = aInstanceModel1_;\n aInstanceModel2_1 = aInstanceModel2_;\n aInstanceModel3_1 = aInstanceModel3_;\n main_1();\n let _e14 = unnamed_1.gl_Position.y;\n unnamed_1.gl_Position.y = -(_e14);\n let _e16 = vLightPosition;\n let _e17 = unnamed_1.gl_Position;\n return VertexOutput(_e16, _e17);\n}\n";
6
6
  export declare const DEPTH_SKINNED_VERT_WGSL = "struct Uniforms {\n uLightViewProj: mat4x4<f32>,\n uModel: mat4x4<f32>,\n uWindDirection: vec2<f32>,\n uWindSpeed: f32,\n uWindGust: f32,\n uWindTime: f32,\n uWindSpatialPhase: vec2<f32>,\n}\n\nstruct gl_PerVertex {\n @builtin(position) gl_Position: vec4<f32>,\n gl_PointSize: f32,\n}\n\nstruct VertexOutput {\n @location(0) member: vec4<f32>,\n @builtin(position) gl_Position: vec4<f32>,\n}\n\n@group(0) @binding(16) \nvar uJointPalette_t: texture_2d<f32>;\nvar<private> aJoints_1: vec4<f32>;\nvar<private> aWeights_1: vec4<f32>;\n@group(0) @binding(0) \nvar<uniform> unnamed: Uniforms;\nvar<private> aPosition_1: vec3<f32>;\nvar<private> aChannel_1: vec4<f32>;\nvar<private> vLightPosition: vec4<f32>;\nvar<private> unnamed_1: gl_PerVertex = gl_PerVertex(vec4<f32>(0f, 0f, 0f, 1f), 1f);\n@group(0) @binding(17) \nvar uJointPalette_s: sampler;\n\nfn channelBend_u0028_vf3_u003b_f1_u003b(worldPos: ptr<function, vec3<f32>>, sway: ptr<function, f32>) -> vec3<f32> {\n var phase: f32;\n var bend: f32;\n\n let _e26 = (*sway);\n if (_e26 <= 0f) {\n let _e28 = (*worldPos);\n return _e28;\n }\n let _e29 = (*worldPos);\n let _e32 = unnamed.uWindSpatialPhase;\n let _e35 = unnamed.uWindTime;\n phase = (dot(_e29.xz, _e32) + _e35);\n let _e38 = unnamed.uWindSpeed;\n let _e40 = unnamed.uWindGust;\n let _e42 = phase;\n let _e45 = (*sway);\n bend = (((_e38 + _e40) * sin(_e42)) * _e45);\n let _e48 = (*worldPos)[0u];\n let _e51 = unnamed.uWindDirection[0u];\n let _e52 = bend;\n let _e56 = (*worldPos)[1u];\n let _e58 = (*worldPos)[2u];\n let _e61 = unnamed.uWindDirection[1u];\n let _e62 = bend;\n return vec3<f32>((_e48 + (_e51 * _e52)), _e56, (_e58 + (_e61 * _e62)));\n}\n\nfn jointMatrix_u0028_i1_u003b(index: ptr<function, i32>) -> mat4x4<f32> {\n var x: i32;\n\n let _e24 = (*index);\n x = (_e24 * 4i);\n let _e26 = x;\n let _e28 = textureLoad(uJointPalette_t, vec2<i32>(_e26, 0i), 0i);\n let _e29 = x;\n let _e32 = textureLoad(uJointPalette_t, vec2<i32>((_e29 + 1i), 0i), 0i);\n let _e33 = x;\n let _e36 = textureLoad(uJointPalette_t, vec2<i32>((_e33 + 2i), 0i), 0i);\n let _e37 = x;\n let _e40 = textureLoad(uJointPalette_t, vec2<i32>((_e37 + 3i), 0i), 0i);\n return mat4x4<f32>(vec4<f32>(_e28.x, _e28.y, _e28.z, _e28.w), vec4<f32>(_e32.x, _e32.y, _e32.z, _e32.w), vec4<f32>(_e36.x, _e36.y, _e36.z, _e36.w), vec4<f32>(_e40.x, _e40.y, _e40.z, _e40.w));\n}\n\nfn skinMatrix_u0028_() -> mat4x4<f32> {\n var param: i32;\n var param_1: i32;\n var param_2: i32;\n var param_3: i32;\n\n let _e27 = aJoints_1[0u];\n param = i32(_e27);\n let _e29 = jointMatrix_u0028_i1_u003b((&param));\n let _e31 = aWeights_1[0u];\n let _e32 = (_e29 * _e31);\n let _e34 = aJoints_1[1u];\n param_1 = i32(_e34);\n let _e36 = jointMatrix_u0028_i1_u003b((&param_1));\n let _e38 = aWeights_1[1u];\n let _e39 = (_e36 * _e38);\n let _e52 = mat4x4<f32>((_e32[0] + _e39[0]), (_e32[1] + _e39[1]), (_e32[2] + _e39[2]), (_e32[3] + _e39[3]));\n let _e54 = aJoints_1[2u];\n param_2 = i32(_e54);\n let _e56 = jointMatrix_u0028_i1_u003b((&param_2));\n let _e58 = aWeights_1[2u];\n let _e59 = (_e56 * _e58);\n let _e72 = mat4x4<f32>((_e52[0] + _e59[0]), (_e52[1] + _e59[1]), (_e52[2] + _e59[2]), (_e52[3] + _e59[3]));\n let _e74 = aJoints_1[3u];\n param_3 = i32(_e74);\n let _e76 = jointMatrix_u0028_i1_u003b((&param_3));\n let _e78 = aWeights_1[3u];\n let _e79 = (_e76 * _e78);\n return mat4x4<f32>((_e72[0] + _e79[0]), (_e72[1] + _e79[1]), (_e72[2] + _e79[2]), (_e72[3] + _e79[3]));\n}\n\nfn main_1() {\n var local: vec4<f32>;\n var model: mat4x4<f32>;\n var world: vec4<f32>;\n var bent: vec3<f32>;\n var param_4: vec3<f32>;\n var param_5: f32;\n\n let _e28 = skinMatrix_u0028_();\n let _e29 = aPosition_1;\n local = (_e28 * vec4<f32>(_e29.x, _e29.y, _e29.z, 1f));\n let _e36 = unnamed.uModel;\n model = _e36;\n let _e37 = model;\n let _e38 = local;\n world = (_e37 * _e38);\n let _e40 = world;\n param_4 = _e40.xyz;\n let _e43 = aChannel_1[0u];\n param_5 = _e43;\n let _e44 = channelBend_u0028_vf3_u003b_f1_u003b((&param_4), (&param_5));\n bent = _e44;\n let _e46 = unnamed.uLightViewProj;\n let _e47 = bent;\n let _e49 = world[3u];\n vLightPosition = (_e46 * vec4<f32>(_e47.x, _e47.y, _e47.z, _e49));\n let _e55 = vLightPosition;\n unnamed_1.gl_Position = _e55;\n return;\n}\n\n@vertex \nfn main(@location(11) aJoints: vec4<f32>, @location(12) aWeights: vec4<f32>, @location(0) aPosition: vec3<f32>, @location(13) aChannel: vec4<f32>) -> VertexOutput {\n aJoints_1 = aJoints;\n aWeights_1 = aWeights;\n aPosition_1 = aPosition;\n aChannel_1 = aChannel;\n main_1();\n let _e12 = unnamed_1.gl_Position.y;\n unnamed_1.gl_Position.y = -(_e12);\n let _e14 = vLightPosition;\n let _e15 = unnamed_1.gl_Position;\n return VertexOutput(_e14, _e15);\n}\n";
7
7
  export declare const DEPTH_VERT_WGSL = "struct Uniforms {\n uLightViewProj: mat4x4<f32>,\n uModel: mat4x4<f32>,\n uWindDirection: vec2<f32>,\n uWindSpeed: f32,\n uWindGust: f32,\n uWindTime: f32,\n uWindSpatialPhase: vec2<f32>,\n}\n\nstruct gl_PerVertex {\n @builtin(position) gl_Position: vec4<f32>,\n gl_PointSize: f32,\n}\n\nstruct VertexOutput {\n @location(0) member: vec4<f32>,\n @builtin(position) gl_Position: vec4<f32>,\n}\n\n@group(0) @binding(0) \nvar<uniform> unnamed: Uniforms;\nvar<private> aPosition_1: vec3<f32>;\nvar<private> aChannel_1: vec4<f32>;\nvar<private> vLightPosition: vec4<f32>;\nvar<private> unnamed_1: gl_PerVertex = gl_PerVertex(vec4<f32>(0f, 0f, 0f, 1f), 1f);\n\nfn channelBend_u0028_vf3_u003b_f1_u003b(worldPos: ptr<function, vec3<f32>>, sway: ptr<function, f32>) -> vec3<f32> {\n var phase: f32;\n var bend: f32;\n\n let _e22 = (*sway);\n if (_e22 <= 0f) {\n let _e24 = (*worldPos);\n return _e24;\n }\n let _e25 = (*worldPos);\n let _e28 = unnamed.uWindSpatialPhase;\n let _e31 = unnamed.uWindTime;\n phase = (dot(_e25.xz, _e28) + _e31);\n let _e34 = unnamed.uWindSpeed;\n let _e36 = unnamed.uWindGust;\n let _e38 = phase;\n let _e41 = (*sway);\n bend = (((_e34 + _e36) * sin(_e38)) * _e41);\n let _e44 = (*worldPos)[0u];\n let _e47 = unnamed.uWindDirection[0u];\n let _e48 = bend;\n let _e52 = (*worldPos)[1u];\n let _e54 = (*worldPos)[2u];\n let _e57 = unnamed.uWindDirection[1u];\n let _e58 = bend;\n return vec3<f32>((_e44 + (_e47 * _e48)), _e52, (_e54 + (_e57 * _e58)));\n}\n\nfn main_1() {\n var local: vec4<f32>;\n var model: mat4x4<f32>;\n var world: vec4<f32>;\n var bent: vec3<f32>;\n var param: vec3<f32>;\n var param_1: f32;\n\n let _e24 = aPosition_1;\n local = vec4<f32>(_e24.x, _e24.y, _e24.z, 1f);\n let _e30 = unnamed.uModel;\n model = _e30;\n let _e31 = model;\n let _e32 = local;\n world = (_e31 * _e32);\n let _e34 = world;\n param = _e34.xyz;\n let _e37 = aChannel_1[0u];\n param_1 = _e37;\n let _e38 = channelBend_u0028_vf3_u003b_f1_u003b((&param), (&param_1));\n bent = _e38;\n let _e40 = unnamed.uLightViewProj;\n let _e41 = bent;\n let _e43 = world[3u];\n vLightPosition = (_e40 * vec4<f32>(_e41.x, _e41.y, _e41.z, _e43));\n let _e49 = vLightPosition;\n unnamed_1.gl_Position = _e49;\n return;\n}\n\n@vertex \nfn main(@location(0) aPosition: vec3<f32>, @location(13) aChannel: vec4<f32>) -> VertexOutput {\n aPosition_1 = aPosition;\n aChannel_1 = aChannel;\n main_1();\n let _e8 = unnamed_1.gl_Position.y;\n unnamed_1.gl_Position.y = -(_e8);\n let _e10 = vLightPosition;\n let _e11 = unnamed_1.gl_Position;\n return VertexOutput(_e10, _e11);\n}\n";
8
8
  export declare const GLASS_TINT_CUTOUT_FRAG_WGSL = "struct Uniforms {\n uGlassPane: vec4<f32>,\n uGlassLight: vec4<f32>,\n}\n\nvar<private> vUv_1: vec3<f32>;\n@group(0) @binding(32) \nvar uCutoutMap_t: texture_2d_array<f32>;\n@group(0) @binding(33) \nvar uCutoutMap_s: sampler;\nvar<private> vGlassWorld_1: vec3<f32>;\n@group(0) @binding(1) \nvar<uniform> unnamed: Uniforms;\nvar<private> outTint: vec4<f32>;\nvar<private> vAlphaCutout_1: f32;\nvar<private> vLightPosition_1: vec4<f32>;\n\nfn cutoutAlpha_u0028_f1_u003b_vf2_u003b(alpha: ptr<function, f32>, texels: ptr<function, vec2<f32>>) -> f32 {\n var dx: vec2<f32>;\n var dy: vec2<f32>;\n var level: f32;\n\n let _e24 = (*texels);\n let _e25 = dpdx(_e24);\n dx = _e25;\n let _e26 = (*texels);\n let _e27 = dpdy(_e26);\n dy = _e27;\n let _e28 = dx;\n let _e29 = dx;\n let _e31 = dy;\n let _e32 = dy;\n level = max(0f, (0.5f * log2(max(dot(_e28, _e29), dot(_e31, _e32)))));\n let _e38 = (*alpha);\n let _e39 = level;\n return (_e38 * (1f + (_e39 * 0.25f)));\n}\n\nfn main_1() {\n var at: vec3<f32>;\n var alpha_1: f32;\n var param: f32;\n var param_1: vec2<f32>;\n var n: vec3<f32>;\n var toLight: vec3<f32>;\n var local: vec3<f32>;\n var cosLight: f32;\n var reflected: f32;\n\n let _e28 = vUv_1;\n let _e29 = _e28.xy;\n let _e31 = vUv_1[2u];\n at = vec3<f32>(_e29.x, _e29.y, floor((_e31 + 0.5f)));\n let _e37 = at;\n let _e43 = textureSample(uCutoutMap_t, uCutoutMap_s, vec2<f32>(_e37.x, _e37.y), i32(_e37.z));\n let _e44 = vUv_1;\n let _e46 = textureDimensions(uCutoutMap_t, 0i);\n param = _e43.w;\n param_1 = (_e44.xy * vec2<f32>(vec2<i32>(_e46).xy));\n let _e52 = cutoutAlpha_u0028_f1_u003b_vf2_u003b((&param), (&param_1));\n alpha_1 = _e52;\n let _e53 = vGlassWorld_1;\n let _e54 = dpdx(_e53);\n let _e55 = vGlassWorld_1;\n let _e56 = dpdy(_e55);\n n = normalize(cross(_e54, _e56));\n let _e61 = unnamed.uGlassLight[3u];\n if (_e61 > 0.5f) {\n let _e64 = unnamed.uGlassLight;\n let _e66 = vGlassWorld_1;\n local = normalize((_e64.xyz - _e66));\n } else {\n let _e70 = unnamed.uGlassLight;\n local = _e70.xyz;\n }\n let _e72 = local;\n toLight = _e72;\n let _e73 = n;\n let _e74 = toLight;\n cosLight = abs(dot(_e73, _e74));\n let _e77 = cosLight;\n reflected = (0.04f + (0.96f * pow((1f - _e77), 5f)));\n let _e83 = unnamed.uGlassPane;\n let _e85 = reflected;\n let _e87 = (_e83.xyz * (1f - _e85));\n let _e90 = unnamed.uGlassPane[3u];\n outTint = vec4<f32>(_e87.x, _e87.y, _e87.z, _e90);\n let _e95 = alpha_1;\n let _e96 = vAlphaCutout_1;\n if (_e95 < _e96) {\n discard;\n }\n return;\n}\n\n@fragment \nfn main(@location(1) vUv: vec3<f32>, @location(3) vGlassWorld: vec3<f32>, @location(2) @interpolate(flat) vAlphaCutout: f32, @location(0) vLightPosition: vec4<f32>) -> @location(0) vec4<f32> {\n vUv_1 = vUv;\n vGlassWorld_1 = vGlassWorld;\n vAlphaCutout_1 = vAlphaCutout;\n vLightPosition_1 = vLightPosition;\n main_1();\n let _e9 = outTint;\n return _e9;\n}\n";
9
- export declare const GLASS_TINT_CUTOUT_VERT_WGSL = "struct Uniforms {\n uLightViewProj: mat4x4<f32>,\n uModel: mat4x4<f32>,\n uWindDirection: vec2<f32>,\n uWindSpeed: f32,\n uWindGust: f32,\n uWindTime: f32,\n uWindSpatialPhase: vec2<f32>,\n uUvScale: vec2<f32>,\n uAlphaCutout: f32,\n}\n\nstruct gl_PerVertex {\n @builtin(position) gl_Position: vec4<f32>,\n gl_PointSize: f32,\n}\n\nstruct VertexOutput {\n @location(0) member: vec4<f32>,\n @builtin(position) gl_Position: vec4<f32>,\n @location(1) member_1: vec3<f32>,\n @location(2) @interpolate(flat) member_2: f32,\n @location(3) member_3: vec3<f32>,\n}\n\n@group(0) @binding(0) \nvar<uniform> unnamed: Uniforms;\nvar<private> aPosition_1: vec3<f32>;\nvar<private> aChannel_1: vec4<f32>;\nvar<private> vLightPosition: vec4<f32>;\nvar<private> unnamed_1: gl_PerVertex = gl_PerVertex(vec4<f32>(0f, 0f, 0f, 1f), 1f);\nvar<private> vUv: vec3<f32>;\nvar<private> aUv_1: vec3<f32>;\nvar<private> vAlphaCutout: f32;\nvar<private> vGlassWorld: vec3<f32>;\n\nfn channelBend_u0028_vf3_u003b_f1_u003b(worldPos: ptr<function, vec3<f32>>, sway: ptr<function, f32>) -> vec3<f32> {\n var phase: f32;\n var bend: f32;\n\n let _e28 = (*sway);\n if (_e28 <= 0f) {\n let _e30 = (*worldPos);\n return _e30;\n }\n let _e31 = (*worldPos);\n let _e34 = unnamed.uWindSpatialPhase;\n let _e37 = unnamed.uWindTime;\n phase = (dot(_e31.xz, _e34) + _e37);\n let _e40 = unnamed.uWindSpeed;\n let _e42 = unnamed.uWindGust;\n let _e44 = phase;\n let _e47 = (*sway);\n bend = (((_e40 + _e42) * sin(_e44)) * _e47);\n let _e50 = (*worldPos)[0u];\n let _e53 = unnamed.uWindDirection[0u];\n let _e54 = bend;\n let _e58 = (*worldPos)[1u];\n let _e60 = (*worldPos)[2u];\n let _e63 = unnamed.uWindDirection[1u];\n let _e64 = bend;\n return vec3<f32>((_e50 + (_e53 * _e54)), _e58, (_e60 + (_e63 * _e64)));\n}\n\nfn main_1() {\n var local: vec4<f32>;\n var model: mat4x4<f32>;\n var world: vec4<f32>;\n var bent: vec3<f32>;\n var param: vec3<f32>;\n var param_1: f32;\n\n let _e30 = aPosition_1;\n local = vec4<f32>(_e30.x, _e30.y, _e30.z, 1f);\n let _e36 = unnamed.uModel;\n model = _e36;\n let _e37 = model;\n let _e38 = local;\n world = (_e37 * _e38);\n let _e40 = world;\n param = _e40.xyz;\n let _e43 = aChannel_1[0u];\n param_1 = _e43;\n let _e44 = channelBend_u0028_vf3_u003b_f1_u003b((&param), (&param_1));\n bent = _e44;\n let _e46 = unnamed.uLightViewProj;\n let _e47 = bent;\n let _e49 = world[3u];\n vLightPosition = (_e46 * vec4<f32>(_e47.x, _e47.y, _e47.z, _e49));\n let _e55 = vLightPosition;\n unnamed_1.gl_Position = _e55;\n let _e57 = aUv_1;\n let _e60 = unnamed.uUvScale;\n let _e61 = (_e57.xy * _e60);\n let _e63 = aUv_1[2u];\n vUv = vec3<f32>(_e61.x, _e61.y, _e63);\n let _e68 = unnamed.uAlphaCutout;\n vAlphaCutout = _e68;\n let _e69 = bent;\n vGlassWorld = _e69;\n return;\n}\n\n@vertex \nfn main(@location(0) aPosition: vec3<f32>, @location(13) aChannel: vec4<f32>, @location(5) aUv: vec3<f32>) -> VertexOutput {\n aPosition_1 = aPosition;\n aChannel_1 = aChannel;\n aUv_1 = aUv;\n main_1();\n let _e13 = unnamed_1.gl_Position.y;\n unnamed_1.gl_Position.y = -(_e13);\n let _e15 = vLightPosition;\n let _e16 = unnamed_1.gl_Position;\n let _e17 = vUv;\n let _e18 = vAlphaCutout;\n let _e19 = vGlassWorld;\n return VertexOutput(_e15, _e16, _e17, _e18, _e19);\n}\n";
9
+ export declare const GLASS_TINT_CUTOUT_VERT_WGSL = "struct Uniforms {\n uLightViewProj: mat4x4<f32>,\n uModel: mat4x4<f32>,\n uWindDirection: vec2<f32>,\n uWindSpeed: f32,\n uWindGust: f32,\n uWindTime: f32,\n uWindSpatialPhase: vec2<f32>,\n uUvScale: vec2<f32>,\n uUvOffset: vec2<f32>,\n uAlphaCutout: f32,\n}\n\nstruct gl_PerVertex {\n @builtin(position) gl_Position: vec4<f32>,\n gl_PointSize: f32,\n}\n\nstruct VertexOutput {\n @location(0) member: vec4<f32>,\n @builtin(position) gl_Position: vec4<f32>,\n @location(1) member_1: vec3<f32>,\n @location(2) @interpolate(flat) member_2: f32,\n @location(3) member_3: vec3<f32>,\n}\n\n@group(0) @binding(0) \nvar<uniform> unnamed: Uniforms;\nvar<private> aPosition_1: vec3<f32>;\nvar<private> aChannel_1: vec4<f32>;\nvar<private> vLightPosition: vec4<f32>;\nvar<private> unnamed_1: gl_PerVertex = gl_PerVertex(vec4<f32>(0f, 0f, 0f, 1f), 1f);\nvar<private> vUv: vec3<f32>;\nvar<private> aUv_1: vec3<f32>;\nvar<private> vAlphaCutout: f32;\nvar<private> vGlassWorld: vec3<f32>;\n\nfn channelBend_u0028_vf3_u003b_f1_u003b(worldPos: ptr<function, vec3<f32>>, sway: ptr<function, f32>) -> vec3<f32> {\n var phase: f32;\n var bend: f32;\n\n let _e29 = (*sway);\n if (_e29 <= 0f) {\n let _e31 = (*worldPos);\n return _e31;\n }\n let _e32 = (*worldPos);\n let _e35 = unnamed.uWindSpatialPhase;\n let _e38 = unnamed.uWindTime;\n phase = (dot(_e32.xz, _e35) + _e38);\n let _e41 = unnamed.uWindSpeed;\n let _e43 = unnamed.uWindGust;\n let _e45 = phase;\n let _e48 = (*sway);\n bend = (((_e41 + _e43) * sin(_e45)) * _e48);\n let _e51 = (*worldPos)[0u];\n let _e54 = unnamed.uWindDirection[0u];\n let _e55 = bend;\n let _e59 = (*worldPos)[1u];\n let _e61 = (*worldPos)[2u];\n let _e64 = unnamed.uWindDirection[1u];\n let _e65 = bend;\n return vec3<f32>((_e51 + (_e54 * _e55)), _e59, (_e61 + (_e64 * _e65)));\n}\n\nfn main_1() {\n var local: vec4<f32>;\n var model: mat4x4<f32>;\n var world: vec4<f32>;\n var bent: vec3<f32>;\n var param: vec3<f32>;\n var param_1: f32;\n\n let _e31 = aPosition_1;\n local = vec4<f32>(_e31.x, _e31.y, _e31.z, 1f);\n let _e37 = unnamed.uModel;\n model = _e37;\n let _e38 = model;\n let _e39 = local;\n world = (_e38 * _e39);\n let _e41 = world;\n param = _e41.xyz;\n let _e44 = aChannel_1[0u];\n param_1 = _e44;\n let _e45 = channelBend_u0028_vf3_u003b_f1_u003b((&param), (&param_1));\n bent = _e45;\n let _e47 = unnamed.uLightViewProj;\n let _e48 = bent;\n let _e50 = world[3u];\n vLightPosition = (_e47 * vec4<f32>(_e48.x, _e48.y, _e48.z, _e50));\n let _e56 = vLightPosition;\n unnamed_1.gl_Position = _e56;\n let _e58 = aUv_1;\n let _e61 = unnamed.uUvScale;\n let _e64 = unnamed.uUvOffset;\n let _e65 = ((_e58.xy * _e61) + _e64);\n let _e67 = aUv_1[2u];\n vUv = vec3<f32>(_e65.x, _e65.y, _e67);\n let _e72 = unnamed.uAlphaCutout;\n vAlphaCutout = _e72;\n let _e73 = bent;\n vGlassWorld = _e73;\n return;\n}\n\n@vertex \nfn main(@location(0) aPosition: vec3<f32>, @location(13) aChannel: vec4<f32>, @location(5) aUv: vec3<f32>) -> VertexOutput {\n aPosition_1 = aPosition;\n aChannel_1 = aChannel;\n aUv_1 = aUv;\n main_1();\n let _e13 = unnamed_1.gl_Position.y;\n unnamed_1.gl_Position.y = -(_e13);\n let _e15 = vLightPosition;\n let _e16 = unnamed_1.gl_Position;\n let _e17 = vUv;\n let _e18 = vAlphaCutout;\n let _e19 = vGlassWorld;\n return VertexOutput(_e15, _e16, _e17, _e18, _e19);\n}\n";
10
10
  export declare const GLASS_TINT_FRAG_WGSL = "struct Uniforms {\n uGlassPane: vec4<f32>,\n uGlassLight: vec4<f32>,\n}\n\nvar<private> vGlassWorld_1: vec3<f32>;\n@group(0) @binding(1) \nvar<uniform> unnamed: Uniforms;\nvar<private> outTint: vec4<f32>;\nvar<private> vLightPosition_1: vec4<f32>;\n\nfn main_1() {\n var n: vec3<f32>;\n var toLight: vec3<f32>;\n var local: vec3<f32>;\n var cosLight: f32;\n var reflected: f32;\n\n let _e17 = vGlassWorld_1;\n let _e18 = dpdx(_e17);\n let _e19 = vGlassWorld_1;\n let _e20 = dpdy(_e19);\n n = normalize(cross(_e18, _e20));\n let _e25 = unnamed.uGlassLight[3u];\n if (_e25 > 0.5f) {\n let _e28 = unnamed.uGlassLight;\n let _e30 = vGlassWorld_1;\n local = normalize((_e28.xyz - _e30));\n } else {\n let _e34 = unnamed.uGlassLight;\n local = _e34.xyz;\n }\n let _e36 = local;\n toLight = _e36;\n let _e37 = n;\n let _e38 = toLight;\n cosLight = abs(dot(_e37, _e38));\n let _e41 = cosLight;\n reflected = (0.04f + (0.96f * pow((1f - _e41), 5f)));\n let _e47 = unnamed.uGlassPane;\n let _e49 = reflected;\n let _e51 = (_e47.xyz * (1f - _e49));\n let _e54 = unnamed.uGlassPane[3u];\n outTint = vec4<f32>(_e51.x, _e51.y, _e51.z, _e54);\n return;\n}\n\n@fragment \nfn main(@location(1) vGlassWorld: vec3<f32>, @location(0) vLightPosition: vec4<f32>) -> @location(0) vec4<f32> {\n vGlassWorld_1 = vGlassWorld;\n vLightPosition_1 = vLightPosition;\n main_1();\n let _e5 = outTint;\n return _e5;\n}\n";
11
- export declare const GLASS_TINT_INSTANCED_CUTOUT_VERT_WGSL = "struct Uniforms {\n uLightViewProj: mat4x4<f32>,\n uUvScale: vec2<f32>,\n uAlphaCutout: f32,\n}\n\nstruct gl_PerVertex {\n @builtin(position) gl_Position: vec4<f32>,\n gl_PointSize: f32,\n}\n\nstruct VertexOutput {\n @location(0) member: vec4<f32>,\n @builtin(position) gl_Position: vec4<f32>,\n @location(1) member_1: vec3<f32>,\n @location(2) @interpolate(flat) member_2: f32,\n @location(3) member_3: vec3<f32>,\n}\n\nvar<private> aPosition_1: vec3<f32>;\nvar<private> aInstanceModel0_1: vec4<f32>;\nvar<private> aInstanceModel1_1: vec4<f32>;\nvar<private> aInstanceModel2_1: vec4<f32>;\nvar<private> aInstanceModel3_1: vec4<f32>;\nvar<private> vLightPosition: vec4<f32>;\n@group(0) @binding(0) \nvar<uniform> unnamed: Uniforms;\nvar<private> unnamed_1: gl_PerVertex = gl_PerVertex(vec4<f32>(0f, 0f, 0f, 1f), 1f);\nvar<private> vUv: vec3<f32>;\nvar<private> aUv_1: vec3<f32>;\nvar<private> vAlphaCutout: f32;\nvar<private> vGlassWorld: vec3<f32>;\n\nfn main_1() {\n var local: vec4<f32>;\n var model: mat4x4<f32>;\n var world: vec4<f32>;\n var bent: vec3<f32>;\n\n let _e23 = aPosition_1;\n local = vec4<f32>(_e23.x, _e23.y, _e23.z, 1f);\n let _e28 = aInstanceModel0_1;\n let _e29 = aInstanceModel1_1;\n let _e30 = aInstanceModel2_1;\n let _e31 = aInstanceModel3_1;\n model = mat4x4<f32>(vec4<f32>(_e28.x, _e28.y, _e28.z, _e28.w), vec4<f32>(_e29.x, _e29.y, _e29.z, _e29.w), vec4<f32>(_e30.x, _e30.y, _e30.z, _e30.w), vec4<f32>(_e31.x, _e31.y, _e31.z, _e31.w));\n let _e53 = model;\n let _e54 = local;\n world = (_e53 * _e54);\n let _e56 = world;\n bent = _e56.xyz;\n let _e59 = unnamed.uLightViewProj;\n let _e60 = bent;\n let _e62 = world[3u];\n vLightPosition = (_e59 * vec4<f32>(_e60.x, _e60.y, _e60.z, _e62));\n let _e68 = vLightPosition;\n unnamed_1.gl_Position = _e68;\n let _e70 = aUv_1;\n let _e73 = unnamed.uUvScale;\n let _e74 = (_e70.xy * _e73);\n let _e76 = aUv_1[2u];\n vUv = vec3<f32>(_e74.x, _e74.y, _e76);\n let _e81 = unnamed.uAlphaCutout;\n vAlphaCutout = _e81;\n let _e82 = bent;\n vGlassWorld = _e82;\n return;\n}\n\n@vertex \nfn main(@location(0) aPosition: vec3<f32>, @location(11) aInstanceModel0_: vec4<f32>, @location(12) aInstanceModel1_: vec4<f32>, @location(13) aInstanceModel2_: vec4<f32>, @location(14) aInstanceModel3_: vec4<f32>, @location(5) aUv: vec3<f32>) -> VertexOutput {\n aPosition_1 = aPosition;\n aInstanceModel0_1 = aInstanceModel0_;\n aInstanceModel1_1 = aInstanceModel1_;\n aInstanceModel2_1 = aInstanceModel2_;\n aInstanceModel3_1 = aInstanceModel3_;\n aUv_1 = aUv;\n main_1();\n let _e19 = unnamed_1.gl_Position.y;\n unnamed_1.gl_Position.y = -(_e19);\n let _e21 = vLightPosition;\n let _e22 = unnamed_1.gl_Position;\n let _e23 = vUv;\n let _e24 = vAlphaCutout;\n let _e25 = vGlassWorld;\n return VertexOutput(_e21, _e22, _e23, _e24, _e25);\n}\n";
11
+ export declare const GLASS_TINT_INSTANCED_CUTOUT_VERT_WGSL = "struct Uniforms {\n uLightViewProj: mat4x4<f32>,\n uUvScale: vec2<f32>,\n uUvOffset: vec2<f32>,\n uAlphaCutout: f32,\n}\n\nstruct gl_PerVertex {\n @builtin(position) gl_Position: vec4<f32>,\n gl_PointSize: f32,\n}\n\nstruct VertexOutput {\n @location(0) member: vec4<f32>,\n @builtin(position) gl_Position: vec4<f32>,\n @location(1) member_1: vec3<f32>,\n @location(2) @interpolate(flat) member_2: f32,\n @location(3) member_3: vec3<f32>,\n}\n\nvar<private> aPosition_1: vec3<f32>;\nvar<private> aInstanceModel0_1: vec4<f32>;\nvar<private> aInstanceModel1_1: vec4<f32>;\nvar<private> aInstanceModel2_1: vec4<f32>;\nvar<private> aInstanceModel3_1: vec4<f32>;\nvar<private> vLightPosition: vec4<f32>;\n@group(0) @binding(0) \nvar<uniform> unnamed: Uniforms;\nvar<private> unnamed_1: gl_PerVertex = gl_PerVertex(vec4<f32>(0f, 0f, 0f, 1f), 1f);\nvar<private> vUv: vec3<f32>;\nvar<private> aUv_1: vec3<f32>;\nvar<private> vAlphaCutout: f32;\nvar<private> vGlassWorld: vec3<f32>;\n\nfn main_1() {\n var local: vec4<f32>;\n var model: mat4x4<f32>;\n var world: vec4<f32>;\n var bent: vec3<f32>;\n\n let _e24 = aPosition_1;\n local = vec4<f32>(_e24.x, _e24.y, _e24.z, 1f);\n let _e29 = aInstanceModel0_1;\n let _e30 = aInstanceModel1_1;\n let _e31 = aInstanceModel2_1;\n let _e32 = aInstanceModel3_1;\n model = mat4x4<f32>(vec4<f32>(_e29.x, _e29.y, _e29.z, _e29.w), vec4<f32>(_e30.x, _e30.y, _e30.z, _e30.w), vec4<f32>(_e31.x, _e31.y, _e31.z, _e31.w), vec4<f32>(_e32.x, _e32.y, _e32.z, _e32.w));\n let _e54 = model;\n let _e55 = local;\n world = (_e54 * _e55);\n let _e57 = world;\n bent = _e57.xyz;\n let _e60 = unnamed.uLightViewProj;\n let _e61 = bent;\n let _e63 = world[3u];\n vLightPosition = (_e60 * vec4<f32>(_e61.x, _e61.y, _e61.z, _e63));\n let _e69 = vLightPosition;\n unnamed_1.gl_Position = _e69;\n let _e71 = aUv_1;\n let _e74 = unnamed.uUvScale;\n let _e77 = unnamed.uUvOffset;\n let _e78 = ((_e71.xy * _e74) + _e77);\n let _e80 = aUv_1[2u];\n vUv = vec3<f32>(_e78.x, _e78.y, _e80);\n let _e85 = unnamed.uAlphaCutout;\n vAlphaCutout = _e85;\n let _e86 = bent;\n vGlassWorld = _e86;\n return;\n}\n\n@vertex \nfn main(@location(0) aPosition: vec3<f32>, @location(11) aInstanceModel0_: vec4<f32>, @location(12) aInstanceModel1_: vec4<f32>, @location(13) aInstanceModel2_: vec4<f32>, @location(14) aInstanceModel3_: vec4<f32>, @location(5) aUv: vec3<f32>) -> VertexOutput {\n aPosition_1 = aPosition;\n aInstanceModel0_1 = aInstanceModel0_;\n aInstanceModel1_1 = aInstanceModel1_;\n aInstanceModel2_1 = aInstanceModel2_;\n aInstanceModel3_1 = aInstanceModel3_;\n aUv_1 = aUv;\n main_1();\n let _e19 = unnamed_1.gl_Position.y;\n unnamed_1.gl_Position.y = -(_e19);\n let _e21 = vLightPosition;\n let _e22 = unnamed_1.gl_Position;\n let _e23 = vUv;\n let _e24 = vAlphaCutout;\n let _e25 = vGlassWorld;\n return VertexOutput(_e21, _e22, _e23, _e24, _e25);\n}\n";
12
12
  export declare const GLASS_TINT_INSTANCED_VERT_WGSL = "struct Uniforms {\n uLightViewProj: mat4x4<f32>,\n}\n\nstruct gl_PerVertex {\n @builtin(position) gl_Position: vec4<f32>,\n gl_PointSize: f32,\n}\n\nstruct VertexOutput {\n @location(0) member: vec4<f32>,\n @builtin(position) gl_Position: vec4<f32>,\n @location(1) member_1: vec3<f32>,\n}\n\nvar<private> aPosition_1: vec3<f32>;\nvar<private> aInstanceModel0_1: vec4<f32>;\nvar<private> aInstanceModel1_1: vec4<f32>;\nvar<private> aInstanceModel2_1: vec4<f32>;\nvar<private> aInstanceModel3_1: vec4<f32>;\nvar<private> vLightPosition: vec4<f32>;\n@group(0) @binding(0) \nvar<uniform> unnamed: Uniforms;\nvar<private> unnamed_1: gl_PerVertex = gl_PerVertex(vec4<f32>(0f, 0f, 0f, 1f), 1f);\nvar<private> vGlassWorld: vec3<f32>;\n\nfn main_1() {\n var local: vec4<f32>;\n var model: mat4x4<f32>;\n var world: vec4<f32>;\n var bent: vec3<f32>;\n\n let _e17 = aPosition_1;\n local = vec4<f32>(_e17.x, _e17.y, _e17.z, 1f);\n let _e22 = aInstanceModel0_1;\n let _e23 = aInstanceModel1_1;\n let _e24 = aInstanceModel2_1;\n let _e25 = aInstanceModel3_1;\n model = mat4x4<f32>(vec4<f32>(_e22.x, _e22.y, _e22.z, _e22.w), vec4<f32>(_e23.x, _e23.y, _e23.z, _e23.w), vec4<f32>(_e24.x, _e24.y, _e24.z, _e24.w), vec4<f32>(_e25.x, _e25.y, _e25.z, _e25.w));\n let _e47 = model;\n let _e48 = local;\n world = (_e47 * _e48);\n let _e50 = world;\n bent = _e50.xyz;\n let _e53 = unnamed.uLightViewProj;\n let _e54 = bent;\n let _e56 = world[3u];\n vLightPosition = (_e53 * vec4<f32>(_e54.x, _e54.y, _e54.z, _e56));\n let _e62 = vLightPosition;\n unnamed_1.gl_Position = _e62;\n let _e64 = bent;\n vGlassWorld = _e64;\n return;\n}\n\n@vertex \nfn main(@location(0) aPosition: vec3<f32>, @location(11) aInstanceModel0_: vec4<f32>, @location(12) aInstanceModel1_: vec4<f32>, @location(13) aInstanceModel2_: vec4<f32>, @location(14) aInstanceModel3_: vec4<f32>) -> VertexOutput {\n aPosition_1 = aPosition;\n aInstanceModel0_1 = aInstanceModel0_;\n aInstanceModel1_1 = aInstanceModel1_;\n aInstanceModel2_1 = aInstanceModel2_;\n aInstanceModel3_1 = aInstanceModel3_;\n main_1();\n let _e15 = unnamed_1.gl_Position.y;\n unnamed_1.gl_Position.y = -(_e15);\n let _e17 = vLightPosition;\n let _e18 = unnamed_1.gl_Position;\n let _e19 = vGlassWorld;\n return VertexOutput(_e17, _e18, _e19);\n}\n";
13
13
  export declare const GLASS_TINT_SKINNED_VERT_WGSL = "struct Uniforms {\n uLightViewProj: mat4x4<f32>,\n uModel: mat4x4<f32>,\n uWindDirection: vec2<f32>,\n uWindSpeed: f32,\n uWindGust: f32,\n uWindTime: f32,\n uWindSpatialPhase: vec2<f32>,\n}\n\nstruct gl_PerVertex {\n @builtin(position) gl_Position: vec4<f32>,\n gl_PointSize: f32,\n}\n\nstruct VertexOutput {\n @location(0) member: vec4<f32>,\n @builtin(position) gl_Position: vec4<f32>,\n @location(1) member_1: vec3<f32>,\n}\n\n@group(0) @binding(16) \nvar uJointPalette_t: texture_2d<f32>;\nvar<private> aJoints_1: vec4<f32>;\nvar<private> aWeights_1: vec4<f32>;\n@group(0) @binding(0) \nvar<uniform> unnamed: Uniforms;\nvar<private> aPosition_1: vec3<f32>;\nvar<private> aChannel_1: vec4<f32>;\nvar<private> vLightPosition: vec4<f32>;\nvar<private> unnamed_1: gl_PerVertex = gl_PerVertex(vec4<f32>(0f, 0f, 0f, 1f), 1f);\nvar<private> vGlassWorld: vec3<f32>;\n@group(0) @binding(17) \nvar uJointPalette_s: sampler;\n\nfn channelBend_u0028_vf3_u003b_f1_u003b(worldPos: ptr<function, vec3<f32>>, sway: ptr<function, f32>) -> vec3<f32> {\n var phase: f32;\n var bend: f32;\n\n let _e27 = (*sway);\n if (_e27 <= 0f) {\n let _e29 = (*worldPos);\n return _e29;\n }\n let _e30 = (*worldPos);\n let _e33 = unnamed.uWindSpatialPhase;\n let _e36 = unnamed.uWindTime;\n phase = (dot(_e30.xz, _e33) + _e36);\n let _e39 = unnamed.uWindSpeed;\n let _e41 = unnamed.uWindGust;\n let _e43 = phase;\n let _e46 = (*sway);\n bend = (((_e39 + _e41) * sin(_e43)) * _e46);\n let _e49 = (*worldPos)[0u];\n let _e52 = unnamed.uWindDirection[0u];\n let _e53 = bend;\n let _e57 = (*worldPos)[1u];\n let _e59 = (*worldPos)[2u];\n let _e62 = unnamed.uWindDirection[1u];\n let _e63 = bend;\n return vec3<f32>((_e49 + (_e52 * _e53)), _e57, (_e59 + (_e62 * _e63)));\n}\n\nfn jointMatrix_u0028_i1_u003b(index: ptr<function, i32>) -> mat4x4<f32> {\n var x: i32;\n\n let _e25 = (*index);\n x = (_e25 * 4i);\n let _e27 = x;\n let _e29 = textureLoad(uJointPalette_t, vec2<i32>(_e27, 0i), 0i);\n let _e30 = x;\n let _e33 = textureLoad(uJointPalette_t, vec2<i32>((_e30 + 1i), 0i), 0i);\n let _e34 = x;\n let _e37 = textureLoad(uJointPalette_t, vec2<i32>((_e34 + 2i), 0i), 0i);\n let _e38 = x;\n let _e41 = textureLoad(uJointPalette_t, vec2<i32>((_e38 + 3i), 0i), 0i);\n return mat4x4<f32>(vec4<f32>(_e29.x, _e29.y, _e29.z, _e29.w), vec4<f32>(_e33.x, _e33.y, _e33.z, _e33.w), vec4<f32>(_e37.x, _e37.y, _e37.z, _e37.w), vec4<f32>(_e41.x, _e41.y, _e41.z, _e41.w));\n}\n\nfn skinMatrix_u0028_() -> mat4x4<f32> {\n var param: i32;\n var param_1: i32;\n var param_2: i32;\n var param_3: i32;\n\n let _e28 = aJoints_1[0u];\n param = i32(_e28);\n let _e30 = jointMatrix_u0028_i1_u003b((&param));\n let _e32 = aWeights_1[0u];\n let _e33 = (_e30 * _e32);\n let _e35 = aJoints_1[1u];\n param_1 = i32(_e35);\n let _e37 = jointMatrix_u0028_i1_u003b((&param_1));\n let _e39 = aWeights_1[1u];\n let _e40 = (_e37 * _e39);\n let _e53 = mat4x4<f32>((_e33[0] + _e40[0]), (_e33[1] + _e40[1]), (_e33[2] + _e40[2]), (_e33[3] + _e40[3]));\n let _e55 = aJoints_1[2u];\n param_2 = i32(_e55);\n let _e57 = jointMatrix_u0028_i1_u003b((&param_2));\n let _e59 = aWeights_1[2u];\n let _e60 = (_e57 * _e59);\n let _e73 = mat4x4<f32>((_e53[0] + _e60[0]), (_e53[1] + _e60[1]), (_e53[2] + _e60[2]), (_e53[3] + _e60[3]));\n let _e75 = aJoints_1[3u];\n param_3 = i32(_e75);\n let _e77 = jointMatrix_u0028_i1_u003b((&param_3));\n let _e79 = aWeights_1[3u];\n let _e80 = (_e77 * _e79);\n return mat4x4<f32>((_e73[0] + _e80[0]), (_e73[1] + _e80[1]), (_e73[2] + _e80[2]), (_e73[3] + _e80[3]));\n}\n\nfn main_1() {\n var local: vec4<f32>;\n var model: mat4x4<f32>;\n var world: vec4<f32>;\n var bent: vec3<f32>;\n var param_4: vec3<f32>;\n var param_5: f32;\n\n let _e29 = skinMatrix_u0028_();\n let _e30 = aPosition_1;\n local = (_e29 * vec4<f32>(_e30.x, _e30.y, _e30.z, 1f));\n let _e37 = unnamed.uModel;\n model = _e37;\n let _e38 = model;\n let _e39 = local;\n world = (_e38 * _e39);\n let _e41 = world;\n param_4 = _e41.xyz;\n let _e44 = aChannel_1[0u];\n param_5 = _e44;\n let _e45 = channelBend_u0028_vf3_u003b_f1_u003b((&param_4), (&param_5));\n bent = _e45;\n let _e47 = unnamed.uLightViewProj;\n let _e48 = bent;\n let _e50 = world[3u];\n vLightPosition = (_e47 * vec4<f32>(_e48.x, _e48.y, _e48.z, _e50));\n let _e56 = vLightPosition;\n unnamed_1.gl_Position = _e56;\n let _e58 = bent;\n vGlassWorld = _e58;\n return;\n}\n\n@vertex \nfn main(@location(11) aJoints: vec4<f32>, @location(12) aWeights: vec4<f32>, @location(0) aPosition: vec3<f32>, @location(13) aChannel: vec4<f32>) -> VertexOutput {\n aJoints_1 = aJoints;\n aWeights_1 = aWeights;\n aPosition_1 = aPosition;\n aChannel_1 = aChannel;\n main_1();\n let _e13 = unnamed_1.gl_Position.y;\n unnamed_1.gl_Position.y = -(_e13);\n let _e15 = vLightPosition;\n let _e16 = unnamed_1.gl_Position;\n let _e17 = vGlassWorld;\n return VertexOutput(_e15, _e16, _e17);\n}\n";
14
14
  export declare const GLASS_TINT_VERT_WGSL = "struct Uniforms {\n uLightViewProj: mat4x4<f32>,\n uModel: mat4x4<f32>,\n uWindDirection: vec2<f32>,\n uWindSpeed: f32,\n uWindGust: f32,\n uWindTime: f32,\n uWindSpatialPhase: vec2<f32>,\n}\n\nstruct gl_PerVertex {\n @builtin(position) gl_Position: vec4<f32>,\n gl_PointSize: f32,\n}\n\nstruct VertexOutput {\n @location(0) member: vec4<f32>,\n @builtin(position) gl_Position: vec4<f32>,\n @location(1) member_1: vec3<f32>,\n}\n\n@group(0) @binding(0) \nvar<uniform> unnamed: Uniforms;\nvar<private> aPosition_1: vec3<f32>;\nvar<private> aChannel_1: vec4<f32>;\nvar<private> vLightPosition: vec4<f32>;\nvar<private> unnamed_1: gl_PerVertex = gl_PerVertex(vec4<f32>(0f, 0f, 0f, 1f), 1f);\nvar<private> vGlassWorld: vec3<f32>;\n\nfn channelBend_u0028_vf3_u003b_f1_u003b(worldPos: ptr<function, vec3<f32>>, sway: ptr<function, f32>) -> vec3<f32> {\n var phase: f32;\n var bend: f32;\n\n let _e23 = (*sway);\n if (_e23 <= 0f) {\n let _e25 = (*worldPos);\n return _e25;\n }\n let _e26 = (*worldPos);\n let _e29 = unnamed.uWindSpatialPhase;\n let _e32 = unnamed.uWindTime;\n phase = (dot(_e26.xz, _e29) + _e32);\n let _e35 = unnamed.uWindSpeed;\n let _e37 = unnamed.uWindGust;\n let _e39 = phase;\n let _e42 = (*sway);\n bend = (((_e35 + _e37) * sin(_e39)) * _e42);\n let _e45 = (*worldPos)[0u];\n let _e48 = unnamed.uWindDirection[0u];\n let _e49 = bend;\n let _e53 = (*worldPos)[1u];\n let _e55 = (*worldPos)[2u];\n let _e58 = unnamed.uWindDirection[1u];\n let _e59 = bend;\n return vec3<f32>((_e45 + (_e48 * _e49)), _e53, (_e55 + (_e58 * _e59)));\n}\n\nfn main_1() {\n var local: vec4<f32>;\n var model: mat4x4<f32>;\n var world: vec4<f32>;\n var bent: vec3<f32>;\n var param: vec3<f32>;\n var param_1: f32;\n\n let _e25 = aPosition_1;\n local = vec4<f32>(_e25.x, _e25.y, _e25.z, 1f);\n let _e31 = unnamed.uModel;\n model = _e31;\n let _e32 = model;\n let _e33 = local;\n world = (_e32 * _e33);\n let _e35 = world;\n param = _e35.xyz;\n let _e38 = aChannel_1[0u];\n param_1 = _e38;\n let _e39 = channelBend_u0028_vf3_u003b_f1_u003b((&param), (&param_1));\n bent = _e39;\n let _e41 = unnamed.uLightViewProj;\n let _e42 = bent;\n let _e44 = world[3u];\n vLightPosition = (_e41 * vec4<f32>(_e42.x, _e42.y, _e42.z, _e44));\n let _e50 = vLightPosition;\n unnamed_1.gl_Position = _e50;\n let _e52 = bent;\n vGlassWorld = _e52;\n return;\n}\n\n@vertex \nfn main(@location(0) aPosition: vec3<f32>, @location(13) aChannel: vec4<f32>) -> VertexOutput {\n aPosition_1 = aPosition;\n aChannel_1 = aChannel;\n main_1();\n let _e9 = unnamed_1.gl_Position.y;\n unnamed_1.gl_Position.y = -(_e9);\n let _e11 = vLightPosition;\n let _e12 = unnamed_1.gl_Position;\n let _e13 = vGlassWorld;\n return VertexOutput(_e11, _e12, _e13);\n}\n";
@@ -43,7 +43,7 @@ export declare const DEPTH_BINDINGS: {
43
43
  };
44
44
  readonly DEPTH_CUTOUT_VERT: {
45
45
  readonly uniforms: 0;
46
- readonly uniformSize: 176;
46
+ readonly uniformSize: 192;
47
47
  readonly fields: {
48
48
  readonly uLightViewProj: {
49
49
  readonly offset: 0;
@@ -85,8 +85,13 @@ export declare const DEPTH_BINDINGS: {
85
85
  readonly size: 8;
86
86
  readonly type: "vec2";
87
87
  };
88
- readonly uAlphaCutout: {
88
+ readonly uUvOffset: {
89
89
  readonly offset: 168;
90
+ readonly size: 8;
91
+ readonly type: "vec2";
92
+ };
93
+ readonly uAlphaCutout: {
94
+ readonly offset: 176;
90
95
  readonly size: 4;
91
96
  readonly type: "float";
92
97
  };
@@ -113,7 +118,7 @@ export declare const DEPTH_BINDINGS: {
113
118
  };
114
119
  readonly DEPTH_INSTANCED_CUTOUT_VERT: {
115
120
  readonly uniforms: 0;
116
- readonly uniformSize: 80;
121
+ readonly uniformSize: 96;
117
122
  readonly fields: {
118
123
  readonly uLightViewProj: {
119
124
  readonly offset: 0;
@@ -125,8 +130,13 @@ export declare const DEPTH_BINDINGS: {
125
130
  readonly size: 8;
126
131
  readonly type: "vec2";
127
132
  };
128
- readonly uAlphaCutout: {
133
+ readonly uUvOffset: {
129
134
  readonly offset: 72;
135
+ readonly size: 8;
136
+ readonly type: "vec2";
137
+ };
138
+ readonly uAlphaCutout: {
139
+ readonly offset: 80;
130
140
  readonly size: 4;
131
141
  readonly type: "float";
132
142
  };
@@ -260,7 +270,7 @@ export declare const DEPTH_BINDINGS: {
260
270
  };
261
271
  readonly GLASS_TINT_CUTOUT_VERT: {
262
272
  readonly uniforms: 0;
263
- readonly uniformSize: 176;
273
+ readonly uniformSize: 192;
264
274
  readonly fields: {
265
275
  readonly uLightViewProj: {
266
276
  readonly offset: 0;
@@ -302,8 +312,13 @@ export declare const DEPTH_BINDINGS: {
302
312
  readonly size: 8;
303
313
  readonly type: "vec2";
304
314
  };
305
- readonly uAlphaCutout: {
315
+ readonly uUvOffset: {
306
316
  readonly offset: 168;
317
+ readonly size: 8;
318
+ readonly type: "vec2";
319
+ };
320
+ readonly uAlphaCutout: {
321
+ readonly offset: 176;
307
322
  readonly size: 4;
308
323
  readonly type: "float";
309
324
  };
@@ -329,7 +344,7 @@ export declare const DEPTH_BINDINGS: {
329
344
  };
330
345
  readonly GLASS_TINT_INSTANCED_CUTOUT_VERT: {
331
346
  readonly uniforms: 0;
332
- readonly uniformSize: 80;
347
+ readonly uniformSize: 96;
333
348
  readonly fields: {
334
349
  readonly uLightViewProj: {
335
350
  readonly offset: 0;
@@ -341,8 +356,13 @@ export declare const DEPTH_BINDINGS: {
341
356
  readonly size: 8;
342
357
  readonly type: "vec2";
343
358
  };
344
- readonly uAlphaCutout: {
359
+ readonly uUvOffset: {
345
360
  readonly offset: 72;
361
+ readonly size: 8;
362
+ readonly type: "vec2";
363
+ };
364
+ readonly uAlphaCutout: {
365
+ readonly offset: 80;
346
366
  readonly size: 4;
347
367
  readonly type: "float";
348
368
  };