@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
@@ -23,3 +23,51 @@ vec4 glassUnmix(vec4 mip, float centreClarity) {
23
23
  }
24
24
  `;
25
25
  }
26
+
27
+ /**
28
+ * The lit stage's switches, by the name of the constant each is: the decision both backends make
29
+ * about which optional code a lit program carries. See `litSwitchesGlsl`.
30
+ */
31
+ export type LitSwitch =
32
+ 'GLASS_SHADOWS' | 'CLUSTERED_LIGHTS' | 'LIGHT_FIXTURES' | 'SURFACE_EFFECTS' | 'DRIFT_LIGHT';
33
+
34
+ /** Every switch off: what a renderer starts from before its profile and its content say otherwise. */
35
+ export function noLitSwitches(): Record<LitSwitch, boolean> {
36
+ return {
37
+ GLASS_SHADOWS: false,
38
+ CLUSTERED_LIGHTS: false,
39
+ LIGHT_FIXTURES: false,
40
+ SURFACE_EFFECTS: false,
41
+ DRIFT_LIGHT: false,
42
+ };
43
+ }
44
+
45
+ /** Which of the lit stage's optional features a build reads. See `litSwitchesGlsl`. */
46
+ export interface LitSwitches {
47
+ readonly clusteredLights: boolean;
48
+ readonly lightFixtures: boolean;
49
+ readonly surfaceEffects: boolean;
50
+ readonly driftLight: boolean;
51
+ }
52
+
53
+ /**
54
+ * The lit stage's other switches, declared after `GLASS_SHADOWS` so that one keeps the id 0 the
55
+ * pipelines and their tests already name, each a pipeline-overridable constant on the generated
56
+ * WGSL and a written-in value on WebGL2 — the arrangement `GLASS_SHADOWS` has, for its reason:
57
+ * code a branch never runs still costs a shader its registers, and the device compiles it away
58
+ * only where the switch is a constant.
59
+ *
60
+ * **Clustering is the profile's and fixed.** The other three are content, off until a consumer
61
+ * first uses them — a measured profile or a cookie, a material with an effects table, a DriftLight
62
+ * volume — and then on for good; see `PipelineCache.enable` and the WebGL2 renderer's rebuild.
63
+ * Measured on RADV against the lit shader with glass already out: 6,852 instructions and 120
64
+ * registers, 4,641 and 96 with all four out.
65
+ */
66
+ export function litSwitchesGlsl(switches: LitSwitches): string {
67
+ return /* glsl */ `
68
+ const bool CLUSTERED_LIGHTS = ${switches.clusteredLights ? 'true' : 'false'}; // wgsl:override
69
+ const bool LIGHT_FIXTURES = ${switches.lightFixtures ? 'true' : 'false'}; // wgsl:override
70
+ const bool SURFACE_EFFECTS = ${switches.surfaceEffects ? 'true' : 'false'}; // wgsl:override
71
+ const bool DRIFT_LIGHT = ${switches.driftLight ? 'true' : 'false'}; // wgsl:override
72
+ `;
73
+ }
@@ -7,7 +7,7 @@ import { preambleGlsl } from './preamble.ts';
7
7
  import { LOBES_GLSL } from './lobes.ts';
8
8
  import { POINTSHADOW_GLSL } from './pointShadow.ts';
9
9
  import { DIRECTIONALSHADOW_GLSL } from './directionalShadow.ts';
10
- import { glassTintGlsl } from './glassTint.ts';
10
+ import { glassTintGlsl, litSwitchesGlsl } from './glassTint.ts';
11
11
  import { MORPH_GLSL } from '../morph.ts';
12
12
  import { SKINNING_GLSL } from '../skinning.ts';
13
13
  import { SURFACE_GLSL } from './surface.ts';
@@ -62,6 +62,11 @@ uniform mat4 uLightViewProj;
62
62
  * when no texture is bound.
63
63
  */
64
64
  uniform vec2 uUvScale;
65
+ /**
66
+ * Where the texture starts, per axis, added after the scale: \`uv * uUvScale + uUvOffset\`. What
67
+ * picks a cell of a flipbook or an atlas through the material. See \`SurfaceMaterial.uOffset\`.
68
+ */
69
+ uniform vec2 uUvOffset;
65
70
 
66
71
  /*
67
72
  * **Placement and tint are declared last of the shared uniforms, and the position is the
@@ -244,7 +249,7 @@ void main() {
244
249
  vColor = aColor * tint;
245
250
  vEmissive = aEmissive;
246
251
  vSpecular = aSpecular;
247
- vUv = vec3(aUv.xy * uUvScale, aUv.z);
252
+ vUv = vec3(aUv.xy * uUvScale + uUvOffset, aUv.z);
248
253
  vEmissiveColor = aEmissiveColor;
249
254
  vRoughness = aRoughness;
250
255
  vGrain = aGrain;
@@ -379,6 +384,18 @@ export interface FlatShaderOptions {
379
384
  * courtyard at night, measured, and nothing once compiled out.
380
385
  */
381
386
  readonly glassShadows?: boolean;
387
+ /**
388
+ * Whether this build has the clustered arm of the light loop: `clusteredLights`, fixed per
389
+ * renderer. True when absent, which is what the generated WGSL is built with. See
390
+ * `litSwitchesGlsl`.
391
+ */
392
+ readonly clusteredLights?: boolean;
393
+ /** Whether it reads measured profiles and cookies. True when absent. See `litSwitchesGlsl`. */
394
+ readonly lightFixtures?: boolean;
395
+ /** Whether it reads a material's effects table. True when absent. See `litSwitchesGlsl`. */
396
+ readonly surfaceEffects?: boolean;
397
+ /** Whether it reads a DriftLight volume. True when absent. See `litSwitchesGlsl`. */
398
+ readonly driftLight?: boolean;
382
399
  /**
383
400
  * How many point lights this build declares room for. `MAX_POINT_LIGHTS` when absent.
384
401
  *
@@ -484,6 +501,12 @@ export function flatFrag(options: FlatShaderOptions): string {
484
501
  /* Depth zero as well: both glass lookups, sun and lamps, call it, and every permutation
485
502
  declares its switch, which the pipelines set whether the permutation reads it or not. */
486
503
  glassTintGlsl(options.glassShadows ?? true),
504
+ litSwitchesGlsl({
505
+ clusteredLights: options.clusteredLights ?? true,
506
+ lightFixtures: options.lightFixtures ?? true,
507
+ surfaceEffects: options.surfaceEffects ?? true,
508
+ driftLight: options.driftLight ?? true,
509
+ }),
487
510
  LOBES_GLSL,
488
511
  POINTSHADOW_GLSL,
489
512
  DIRECTIONALSHADOW_GLSL,
@@ -14,8 +14,13 @@ export const MAIN_GLSL = `void main() {
14
14
  * the material moves together. The gradients are taken here, outside every branch, for the room
15
15
  * a window samples through textureGrad further down.
16
16
  */
17
- fxLoad(int(surfaceAt.z));
18
- surfaceAt = fxAnimate(surfaceAt);
17
+ /* Zero rows unless a material has carried a table: \`SURFACE_EFFECTS\` is off until one does, and
18
+ every effect below reads exactly nothing from zero rows, which the device folds away. */
19
+ fxClear();
20
+ if (SURFACE_EFFECTS) {
21
+ fxLoad(int(surfaceAt.z));
22
+ surfaceAt = fxAnimate(surfaceAt);
23
+ }
19
24
  vec2 fxDx = dFdx(surfaceAt.xy);
20
25
  vec2 fxDy = dFdy(surfaceAt.xy);
21
26
  if (uWriteMode.y != 0.0 && !ditherKeeps(uWriteMode.y)) discard;
@@ -908,7 +913,12 @@ export const MAIN_GLSL = `void main() {
908
913
  */
909
914
  vec3 lampOpen = vec3(0.0);
910
915
  vec3 lampShadowed = vec3(0.0);
911
- float driftShare = driftLightShare(vWorldPos);
916
+ /* \`DRIFT_LIGHT\` is off until a consumer gives the renderer a DriftLight volume, and the device
917
+ compiles the volume's reads away with it. */
918
+ float driftShare = 0.0;
919
+ if (DRIFT_LIGHT) {
920
+ driftShare = driftLightShare(vWorldPos);
921
+ }
912
922
 
913
923
  /*
914
924
  * Which froxel this fragment is in.
@@ -921,28 +931,53 @@ export const MAIN_GLSL = `void main() {
921
931
  * same order and with the same clamps, because a fragment reading a froxel the binner filled
922
932
  * differently is a fragment lit by somebody else's lights.
923
933
  */
924
- vec3 clusterView = (uView * vec4(vWorldPos, 1.0)).xyz;
925
- float clusterDepth = -clusterView.z;
926
- float clusterHalfH = max(clusterDepth, 1e-4) * uClusterFrustum.z;
927
- float clusterHalfW = clusterHalfH * uClusterFrustum.w;
928
- int clusterTileX = clamp(
929
- int(floor((clusterView.x / clusterHalfW + 1.0) * 0.5 * float(CLUSTER_X))), 0, CLUSTER_X - 1);
930
- int clusterTileY = clamp(
931
- int(floor((clusterView.y / clusterHalfH + 1.0) * 0.5 * float(CLUSTER_Y))), 0, CLUSTER_Y - 1);
932
- int clusterSlice = 0;
933
- if (clusterDepth > uClusterFrustum.x) {
934
- clusterSlice = clamp(
935
- int(floor(log(clusterDepth / uClusterFrustum.x)
936
- / log(uClusterFrustum.y / uClusterFrustum.x) * float(CLUSTER_Z))),
937
- 0, CLUSTER_Z - 1);
934
+ /*
935
+ * **Only in a build that clusters, and there only in a frame that does.** \`CLUSTERED_LIGHTS\` is
936
+ * the profile's \`clusteredLights\`, a pipeline constant the device compiles this whole arm away
937
+ * on: the view transform, two logarithms and the froxel fetch below ran on every lit pixel of
938
+ * every scene, clustered or not, and the arm's records held their registers through the loop.
939
+ */
940
+ int clusterBaseTexel = 0;
941
+ int clusterLights = 0;
942
+ bool clusteredArm = false;
943
+ if (CLUSTERED_LIGHTS) {
944
+ if (uClustered != 0) {
945
+ vec3 clusterView = (uView * vec4(vWorldPos, 1.0)).xyz;
946
+ float clusterDepth = -clusterView.z;
947
+ float clusterHalfH = max(clusterDepth, 1e-4) * uClusterFrustum.z;
948
+ float clusterHalfW = clusterHalfH * uClusterFrustum.w;
949
+ int clusterTileX = clamp(
950
+ int(floor((clusterView.x / clusterHalfW + 1.0) * 0.5 * float(CLUSTER_X))), 0, CLUSTER_X - 1);
951
+ int clusterTileY = clamp(
952
+ int(floor((clusterView.y / clusterHalfH + 1.0) * 0.5 * float(CLUSTER_Y))), 0, CLUSTER_Y - 1);
953
+ int clusterSlice = 0;
954
+ if (clusterDepth > uClusterFrustum.x) {
955
+ clusterSlice = clamp(
956
+ int(floor(log(clusterDepth / uClusterFrustum.x)
957
+ / log(uClusterFrustum.y / uClusterFrustum.x) * float(CLUSTER_Z))),
958
+ 0, CLUSTER_Z - 1);
959
+ }
960
+ clusterBaseTexel = LIGHT_REGION_TEXELS
961
+ + (clusterTileX + clusterTileY * CLUSTER_X + clusterSlice * CLUSTER_X * CLUSTER_Y)
962
+ * CLUSTER_TEXELS;
963
+ clusterLights = int(clusterTexel(clusterBaseTexel).x);
964
+ clusteredArm = true;
965
+ }
938
966
  }
939
- int clusterBaseTexel = LIGHT_REGION_TEXELS
940
- + (clusterTileX + clusterTileY * CLUSTER_X + clusterSlice * CLUSTER_X * CLUSTER_Y)
941
- * CLUSTER_TEXELS;
942
- int clusterLights = uClustered != 0 ? int(clusterTexel(clusterBaseTexel).x) : 0;
943
967
 
944
968
  /* The fixture atlas's size, asked once: its cookie band and its profile rows are found from it. */
945
969
  vec2 fixtureSize = vec2(textureSize(uFixtureAtlas, 0));
970
+ /*
971
+ * Whether any light can carry a measured profile or a cookie, decided once rather than per
972
+ * light. \`LIGHT_FIXTURES\` is off until a consumer loads one, and the device compiles the
973
+ * fixture lookups away with it, which they hold their registers for in every scene otherwise.
974
+ */
975
+ bool fixtureProfiles = false;
976
+ bool fixtureShapes = false;
977
+ if (LIGHT_FIXTURES) {
978
+ fixtureProfiles = uIesAtlasRows > 1.0;
979
+ fixtureShapes = uIesPlaneCount > 1.0 || uCookieTiles > 0.0;
980
+ }
946
981
 
947
982
  // Point lights. Inverse-square-ish falloff clipped to a finite radius, so a
948
983
  // light can be culled without a visible seam.
@@ -968,7 +1003,7 @@ export const MAIN_GLSL = `void main() {
968
1003
  float iesProfile;
969
1004
  vec3 iesAxis;
970
1005
  float cookie;
971
- if (uClustered != 0) {
1006
+ if (clusteredArm) {
972
1007
  if (slot >= clusterLights) break;
973
1008
  /*
974
1009
  * Four indices to a texel. Selected with compares rather than by indexing the vector,
@@ -1273,7 +1308,7 @@ export const MAIN_GLSL = `void main() {
1273
1308
  vec3 iesRay = -toLight / max(dist, 1e-4);
1274
1309
  /* The angle from the fixture's axis, as a fraction of the 0-to-180 arc every row spans. */
1275
1310
  float iesU = 0.0;
1276
- if (uIesAtlasRows > 1.0) {
1311
+ if (fixtureProfiles) {
1277
1312
  float iesAngle = acos(clamp(dot(iesRay, lightDir), -1.0, 1.0));
1278
1313
  /* Clamped to the row's first and last texel centres, which is what the edge clamp of a
1279
1314
  texture exactly one row wide gave; the atlas can be wider now, with cookies beside it. */
@@ -1297,7 +1332,7 @@ export const MAIN_GLSL = `void main() {
1297
1332
  * \`uLightIesAxis\` to answer it. Behind a branch on two uniforms, so a scene using neither
1298
1333
  * builds no frame at all.
1299
1334
  */
1300
- if (uIesPlaneCount > 1.0 || uCookieTiles > 0.0) {
1335
+ if (fixtureShapes) {
1301
1336
  vec3 iesRef = iesAxis - lightDir * dot(iesAxis, lightDir);
1302
1337
  float iesRefLen = length(iesRef);
1303
1338
  if (iesRefLen > 1e-5) {
@@ -1354,7 +1389,7 @@ export const MAIN_GLSL = `void main() {
1354
1389
  * bytes on \`core-only\`** across the sixteen fragment permutations.
1355
1390
  */
1356
1391
  float photometric = 1.0;
1357
- if (uIesAtlasRows > 1.0) {
1392
+ if (fixtureProfiles) {
1358
1393
  float iesBase = iesRow * (uIesPlaneCount + 1.0);
1359
1394
  /* The profiles are the atlas's bottom rows, below any cookies. */
1360
1395
  float iesTop = fixtureSize.y - uIesAtlasRows;
@@ -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);
@@ -7,11 +7,11 @@
7
7
 
8
8
  export 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";
9
9
 
10
- export 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";
10
+ export 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";
11
11
 
12
12
  export 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";
13
13
 
14
- export 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";
14
+ export 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";
15
15
 
16
16
  export 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";
17
17
 
@@ -21,11 +21,11 @@ export const DEPTH_VERT_WGSL = "struct Uniforms {\n uLightViewProj: mat4x4<f3
21
21
 
22
22
  export 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";
23
23
 
24
- export 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";
24
+ export 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";
25
25
 
26
26
  export 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";
27
27
 
28
- export 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";
28
+ export 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";
29
29
 
30
30
  export 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";
31
31
 
@@ -64,7 +64,7 @@ export const DEPTH_BINDINGS = {
64
64
  },
65
65
  "DEPTH_CUTOUT_VERT": {
66
66
  "uniforms": 0,
67
- "uniformSize": 176,
67
+ "uniformSize": 192,
68
68
  "fields": {
69
69
  "uLightViewProj": {
70
70
  "offset": 0,
@@ -106,8 +106,13 @@ export const DEPTH_BINDINGS = {
106
106
  "size": 8,
107
107
  "type": "vec2"
108
108
  },
109
- "uAlphaCutout": {
109
+ "uUvOffset": {
110
110
  "offset": 168,
111
+ "size": 8,
112
+ "type": "vec2"
113
+ },
114
+ "uAlphaCutout": {
115
+ "offset": 176,
111
116
  "size": 4,
112
117
  "type": "float"
113
118
  }
@@ -134,7 +139,7 @@ export const DEPTH_BINDINGS = {
134
139
  },
135
140
  "DEPTH_INSTANCED_CUTOUT_VERT": {
136
141
  "uniforms": 0,
137
- "uniformSize": 80,
142
+ "uniformSize": 96,
138
143
  "fields": {
139
144
  "uLightViewProj": {
140
145
  "offset": 0,
@@ -146,8 +151,13 @@ export const DEPTH_BINDINGS = {
146
151
  "size": 8,
147
152
  "type": "vec2"
148
153
  },
149
- "uAlphaCutout": {
154
+ "uUvOffset": {
150
155
  "offset": 72,
156
+ "size": 8,
157
+ "type": "vec2"
158
+ },
159
+ "uAlphaCutout": {
160
+ "offset": 80,
151
161
  "size": 4,
152
162
  "type": "float"
153
163
  }
@@ -281,7 +291,7 @@ export const DEPTH_BINDINGS = {
281
291
  },
282
292
  "GLASS_TINT_CUTOUT_VERT": {
283
293
  "uniforms": 0,
284
- "uniformSize": 176,
294
+ "uniformSize": 192,
285
295
  "fields": {
286
296
  "uLightViewProj": {
287
297
  "offset": 0,
@@ -323,8 +333,13 @@ export const DEPTH_BINDINGS = {
323
333
  "size": 8,
324
334
  "type": "vec2"
325
335
  },
326
- "uAlphaCutout": {
336
+ "uUvOffset": {
327
337
  "offset": 168,
338
+ "size": 8,
339
+ "type": "vec2"
340
+ },
341
+ "uAlphaCutout": {
342
+ "offset": 176,
328
343
  "size": 4,
329
344
  "type": "float"
330
345
  }
@@ -350,7 +365,7 @@ export const DEPTH_BINDINGS = {
350
365
  },
351
366
  "GLASS_TINT_INSTANCED_CUTOUT_VERT": {
352
367
  "uniforms": 0,
353
- "uniformSize": 80,
368
+ "uniformSize": 96,
354
369
  "fields": {
355
370
  "uLightViewProj": {
356
371
  "offset": 0,
@@ -362,8 +377,13 @@ export const DEPTH_BINDINGS = {
362
377
  "size": 8,
363
378
  "type": "vec2"
364
379
  },
365
- "uAlphaCutout": {
380
+ "uUvOffset": {
366
381
  "offset": 72,
382
+ "size": 8,
383
+ "type": "vec2"
384
+ },
385
+ "uAlphaCutout": {
386
+ "offset": 80,
367
387
  "size": 4,
368
388
  "type": "float"
369
389
  }