@driftengine/core 4.8.7 → 4.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (163) hide show
  1. package/CHANGELOG.json +61 -0
  2. package/README.md +1 -1
  3. package/dist/index.d.ts +5 -0
  4. package/dist/index.js +7 -0
  5. package/dist/render/atmosphere.d.ts +13 -0
  6. package/dist/render/atmosphere.js +9 -1
  7. package/dist/render/backend/api.d.ts +9 -1
  8. package/dist/render/backend/createRenderer.d.ts +6 -0
  9. package/dist/render/backend/createRenderer.js +4 -1
  10. package/dist/render/backend/webgl2/renderer.d.ts +90 -2
  11. package/dist/render/backend/webgl2/renderer.js +297 -16
  12. package/dist/render/backend/webgpu/device.d.ts +7 -1
  13. package/dist/render/backend/webgpu/device.js +31 -3
  14. package/dist/render/backend/webgpu/flatPass.d.ts +16 -1
  15. package/dist/render/backend/webgpu/flatPass.js +58 -26
  16. package/dist/render/backend/webgpu/postPass.d.ts +51 -9
  17. package/dist/render/backend/webgpu/postPass.js +16 -2
  18. package/dist/render/backend/webgpu/reflectionSurfacePass.d.ts +30 -0
  19. package/dist/render/backend/webgpu/reflectionSurfacePass.js +100 -0
  20. package/dist/render/backend/webgpu/renderer.d.ts +131 -2
  21. package/dist/render/backend/webgpu/renderer.js +586 -70
  22. package/dist/render/displayRange.d.ts +31 -0
  23. package/dist/render/displayRange.js +47 -0
  24. package/dist/render/filmicCurve.d.ts +74 -0
  25. package/dist/render/filmicCurve.js +203 -0
  26. package/dist/render/fog.d.ts +4 -1
  27. package/dist/render/fog.js +12 -2
  28. package/dist/render/frame/resources.d.ts +2 -2
  29. package/dist/render/frame/resources.js +6 -0
  30. package/dist/render/frameReflections.d.ts +40 -0
  31. package/dist/render/frameReflections.js +48 -0
  32. package/dist/render/pass.d.ts +49 -0
  33. package/dist/render/reflectionSurfaceTargets.d.ts +28 -0
  34. package/dist/render/reflectionSurfaceTargets.js +99 -0
  35. package/dist/render/renderQuality.d.ts +39 -8
  36. package/dist/render/renderQuality.js +4 -0
  37. package/dist/render/sceneTarget.d.ts +5 -0
  38. package/dist/render/sceneTarget.js +24 -1
  39. package/dist/render/screenSpaceReflection.d.ts +5 -0
  40. package/dist/render/screenSpaceReflection.js +5 -0
  41. package/dist/render/shaders/arcane.d.ts +1 -1
  42. package/dist/render/shaders/bolt.d.ts +1 -1
  43. package/dist/render/shaders/caustics.d.ts +1 -1
  44. package/dist/render/shaders/film.d.ts +1 -1
  45. package/dist/render/shaders/filmLook.js +2 -1
  46. package/dist/render/shaders/fire.d.ts +1 -1
  47. package/dist/render/shaders/flat/glassTint.d.ts +1 -1
  48. package/dist/render/shaders/flat/glassTint.js +2 -0
  49. package/dist/render/shaders/flat/index.d.ts +10 -0
  50. package/dist/render/shaders/flat/index.js +6 -0
  51. package/dist/render/shaders/flat/main.d.ts +1 -1
  52. package/dist/render/shaders/flat/main.js +28 -0
  53. package/dist/render/shaders/flat/overlay.d.ts +16 -0
  54. package/dist/render/shaders/flat/overlay.js +117 -0
  55. package/dist/render/shaders/flat/pointShadow.js +1 -1
  56. package/dist/render/shaders/flat/reflectionSurface.d.ts +21 -0
  57. package/dist/render/shaders/flat/reflectionSurface.js +61 -0
  58. package/dist/render/shaders/fog.d.ts +1 -1
  59. package/dist/render/shaders/fog.js +9 -2
  60. package/dist/render/shaders/fringe.d.ts +29 -0
  61. package/dist/render/shaders/fringe.js +55 -0
  62. package/dist/render/shaders/generated/arcane.wgsl.d.ts +1 -1
  63. package/dist/render/shaders/generated/arcane.wgsl.js +1 -1
  64. package/dist/render/shaders/generated/bolt.wgsl.d.ts +1 -1
  65. package/dist/render/shaders/generated/bolt.wgsl.js +1 -1
  66. package/dist/render/shaders/generated/caustics.wgsl.d.ts +1 -1
  67. package/dist/render/shaders/generated/caustics.wgsl.js +1 -1
  68. package/dist/render/shaders/generated/film.wgsl.d.ts +1 -1
  69. package/dist/render/shaders/generated/film.wgsl.js +1 -1
  70. package/dist/render/shaders/generated/fire.wgsl.d.ts +1 -1
  71. package/dist/render/shaders/generated/fire.wgsl.js +1 -1
  72. package/dist/render/shaders/generated/flat.wgsl.d.ts +176 -16
  73. package/dist/render/shaders/generated/flat.wgsl.js +214 -54
  74. package/dist/render/shaders/generated/line.wgsl.d.ts +1 -1
  75. package/dist/render/shaders/generated/line.wgsl.js +1 -1
  76. package/dist/render/shaders/generated/particle.wgsl.d.ts +4 -4
  77. package/dist/render/shaders/generated/particle.wgsl.js +4 -4
  78. package/dist/render/shaders/generated/rush.wgsl.d.ts +56 -26
  79. package/dist/render/shaders/generated/rush.wgsl.js +56 -26
  80. package/dist/render/shaders/generated/scatter.wgsl.d.ts +1 -1
  81. package/dist/render/shaders/generated/scatter.wgsl.js +1 -1
  82. package/dist/render/shaders/generated/smoke.wgsl.d.ts +1 -1
  83. package/dist/render/shaders/generated/smoke.wgsl.js +1 -1
  84. package/dist/render/shaders/generated/ssrResolve.wgsl.d.ts +29 -0
  85. package/dist/render/shaders/generated/ssrResolve.wgsl.js +29 -0
  86. package/dist/render/shaders/generated/ssrTrace.wgsl.d.ts +22 -2
  87. package/dist/render/shaders/generated/ssrTrace.wgsl.js +22 -2
  88. package/dist/render/shaders/generated/water.wgsl.d.ts +1 -1
  89. package/dist/render/shaders/generated/water.wgsl.js +1 -1
  90. package/dist/render/shaders/gpudriven/fog.wgsl.d.ts +2 -2
  91. package/dist/render/shaders/gpudriven/fog.wgsl.js +11 -3
  92. package/dist/render/shaders/line.d.ts +1 -1
  93. package/dist/render/shaders/particle.d.ts +3 -3
  94. package/dist/render/shaders/rush.js +54 -11
  95. package/dist/render/shaders/scatter.d.ts +1 -1
  96. package/dist/render/shaders/smoke.d.ts +1 -1
  97. package/dist/render/shaders/ssrResolve.d.ts +17 -0
  98. package/dist/render/shaders/ssrResolve.js +51 -0
  99. package/dist/render/shaders/ssrTrace.js +26 -0
  100. package/dist/render/shaders/water.d.ts +1 -1
  101. package/dist/render/ssrPass.d.ts +16 -0
  102. package/dist/render/ssrPass.js +106 -1
  103. package/dist/render/surfaceOverlay.d.ts +132 -0
  104. package/dist/render/surfaceOverlay.js +85 -0
  105. package/dist/render/surfaceTexture.d.ts +19 -0
  106. package/dist/render/surfaceTexture.js +69 -0
  107. package/dist/render/temporalAa.d.ts +14 -0
  108. package/dist/render/temporalAa.js +20 -0
  109. package/dist/render/vertexDefaults.d.ts +17 -0
  110. package/dist/render/vertexDefaults.js +24 -0
  111. package/package.json +6 -6
  112. package/src/index.ts +16 -0
  113. package/src/render/atmosphere.ts +22 -1
  114. package/src/render/backend/api.ts +9 -0
  115. package/src/render/backend/createRenderer.ts +18 -1
  116. package/src/render/backend/webgl2/renderer.ts +357 -13
  117. package/src/render/backend/webgpu/device.ts +42 -3
  118. package/src/render/backend/webgpu/flatPass.ts +63 -26
  119. package/src/render/backend/webgpu/postPass.ts +18 -0
  120. package/src/render/backend/webgpu/reflectionSurfacePass.ts +114 -0
  121. package/src/render/backend/webgpu/renderer.ts +735 -83
  122. package/src/render/displayRange.ts +61 -0
  123. package/src/render/filmicCurve.ts +229 -0
  124. package/src/render/fog.ts +19 -3
  125. package/src/render/frame/resources.ts +6 -0
  126. package/src/render/frameReflections.ts +72 -0
  127. package/src/render/pass.ts +53 -1
  128. package/src/render/reflectionSurfaceTargets.ts +105 -0
  129. package/src/render/renderQuality.ts +44 -8
  130. package/src/render/sceneTarget.ts +30 -2
  131. package/src/render/screenSpaceReflection.ts +5 -0
  132. package/src/render/shaders/filmLook.ts +2 -1
  133. package/src/render/shaders/flat/glassTint.ts +5 -1
  134. package/src/render/shaders/flat/index.ts +16 -0
  135. package/src/render/shaders/flat/main.ts +28 -0
  136. package/src/render/shaders/flat/overlay.ts +117 -0
  137. package/src/render/shaders/flat/pointShadow.ts +1 -1
  138. package/src/render/shaders/flat/reflectionSurface.ts +61 -0
  139. package/src/render/shaders/fog.ts +9 -2
  140. package/src/render/shaders/fringe.ts +59 -0
  141. package/src/render/shaders/generated/arcane.wgsl.ts +1 -1
  142. package/src/render/shaders/generated/bolt.wgsl.ts +1 -1
  143. package/src/render/shaders/generated/caustics.wgsl.ts +1 -1
  144. package/src/render/shaders/generated/film.wgsl.ts +1 -1
  145. package/src/render/shaders/generated/fire.wgsl.ts +1 -1
  146. package/src/render/shaders/generated/flat.wgsl.ts +214 -54
  147. package/src/render/shaders/generated/line.wgsl.ts +1 -1
  148. package/src/render/shaders/generated/particle.wgsl.ts +4 -4
  149. package/src/render/shaders/generated/rush.wgsl.ts +56 -26
  150. package/src/render/shaders/generated/scatter.wgsl.ts +1 -1
  151. package/src/render/shaders/generated/smoke.wgsl.ts +1 -1
  152. package/src/render/shaders/generated/ssrResolve.wgsl.ts +30 -0
  153. package/src/render/shaders/generated/ssrTrace.wgsl.ts +22 -2
  154. package/src/render/shaders/generated/water.wgsl.ts +1 -1
  155. package/src/render/shaders/gpudriven/fog.wgsl.ts +11 -3
  156. package/src/render/shaders/rush.ts +54 -11
  157. package/src/render/shaders/ssrResolve.ts +52 -0
  158. package/src/render/shaders/ssrTrace.ts +26 -0
  159. package/src/render/ssrPass.ts +138 -1
  160. package/src/render/surfaceOverlay.ts +195 -0
  161. package/src/render/surfaceTexture.ts +67 -0
  162. package/src/render/temporalAa.ts +20 -0
  163. package/src/render/vertexDefaults.ts +28 -0
@@ -25,6 +25,10 @@ export const MAIN_GLSL = `void main() {
25
25
  vec2 fxDx = dFdx(surfaceAt.xy);
26
26
  vec2 fxDy = dFdy(surfaceAt.xy);
27
27
  if (uWriteMode.y != 0.0 && !ditherKeeps(uWriteMode.y)) discard;
28
+ /* A draw's dissolve cuts the surface away before anything is shaded: overlay.ts. */
29
+ if (SURFACE_OVERLAY) {
30
+ if (overlayCuts(surfaceAt.xy)) discard;
31
+ }
28
32
 
29
33
  /*
30
34
  * Surface colour and its coverage, resolved before anything else — including before it is
@@ -139,6 +143,11 @@ export const MAIN_GLSL = `void main() {
139
143
  }
140
144
 
141
145
  vec3 lit = albedo;
146
+ /* How much of the environment the frame shows here, and how a found reflection would land:
147
+ reflectionSurface.ts. None where nothing is reflected. */
148
+ vec3 reflectedProbe = vec3(0.0);
149
+ vec3 reflectedTint = vec3(0.0);
150
+ float reflectedRoughness = 1.0;
142
151
  /* Skin's diffuse, held before emission for the screen-space blur's own pass: models.ts. */
143
152
  vec3 diffuseAlone = vec3(0.0);
144
153
  /* The light arriving at a glass pane from behind it, gathered in each light loop below and added
@@ -186,7 +195,10 @@ export const MAIN_GLSL = `void main() {
186
195
  * right: a mipped colour image, sampled under uniform control flow, exactly as uAlbedo is
187
196
  * below. The rule is about non-uniform branches, and this branch is on a uniform.
188
197
  */
198
+ vec3 unmapped = n;
189
199
  if (uNormalStrength > 0.0) n = normalMapped(n, surfaceAt);
200
+ /* A draw's wrinkles, by region, over whatever the map made: overlay.ts. */
201
+ if (SURFACE_OVERLAY) n = overlayWrinkle(n, unmapped, surfaceAt.xy);
190
202
 
191
203
  /*
192
204
  * Microscopic relief: the surface's own texture, as a turn of the normal rather than a change
@@ -915,6 +927,15 @@ export const MAIN_GLSL = `void main() {
915
927
  environment * mix(vec3(1.0), albedo, metal),
916
928
  weight
917
929
  );
930
+ reflectedTint = mix(vec3(1.0), albedo, metal) * weight;
931
+ reflectedProbe = environment * reflectedTint;
932
+ reflectedRoughness = surfaceRoughness;
933
+ }
934
+ /* The reflection pass's surface half leaves here, before the lamps: reflectionSurface.ts. */
935
+ if (REFLECTION_SURFACE) {
936
+ reflectionSurfaceOut(reflectedProbe, reflectedTint, reflectedRoughness, ormOcclusion,
937
+ reflectionAir());
938
+ return;
918
939
  }
919
940
  /*
920
941
  * The sun's highlight, on top of whatever the surface reflects rather than underneath it —
@@ -1939,6 +1960,9 @@ export const MAIN_GLSL = `void main() {
1939
1960
  * mix(1.0, min(lightShade, sunShade), EMISSIVE_SHADOW_SHARE) * fxGlow;
1940
1961
  /* And a lit window's glow, which the scene's lit share already times: not gated on night. */
1941
1962
  lit += windowGlow * uEmission.x;
1963
+ /* And a draw's overlay: its rim, its dissolve's band and the colour laid over. Not gated on the
1964
+ night, as emission is: a glow the surface wears rather than light it gives off. overlay.ts. */
1965
+ if (SURFACE_OVERLAY) lit += overlayGlow(surfaceAt.xy, n);
1942
1966
 
1943
1967
  #if NIGHT_EMISSIVE
1944
1968
  /*
@@ -2137,6 +2161,10 @@ export const MAIN_GLSL = `void main() {
2137
2161
  return;
2138
2162
  }
2139
2163
 
2164
+ /* WebGL2's frame writes the reflection maps itself, with the fog already reckoned above. */
2165
+ if (REFLECTION_MAPS) {
2166
+ reflectionSurfaceOut(reflectedProbe, reflectedTint, reflectedRoughness, ormOcclusion, fog);
2167
+ }
2140
2168
  outColor = vec4(shaded, alpha);
2141
2169
  }
2142
2170
  `;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * A draw's surface overlay in the lit stage: the rim, the dissolve and the wrinkles
3
+ * `surfaceOverlay.ts` packs into `uOverlay`. Called from `main` at three places — the dissolve's cut
4
+ * before anything is shaded, the wrinkles after the normal map, and the glow beside emission.
5
+ *
6
+ * **A lit switch, `SURFACE_OVERLAY`**, off until a draw first sets an overlay and then on for good,
7
+ * as `litSwitchesGlsl`'s are; declared after the models so every switch before it keeps its id.
8
+ * Compiled out, the three calls are stubs and the fifteen vectors are not declared at all, which is
9
+ * what lets WebGL2 build a lit program without them on a device that has no room.
10
+ *
11
+ * **Images come from the atlas bound where the frame's refraction copy goes**, which an opaque draw
12
+ * never reads; a draw that refracts or is glass reads that copy there, so its overlay reads no image
13
+ * (`overlayImagesBound`). Each image is read by `textureLod` at level 0: several are reached under a
14
+ * branch on a per-pixel value, and the atlas carries no chain anyway.
15
+ */
16
+ export declare function overlayGlsl(on: boolean): string;
@@ -0,0 +1,117 @@
1
+ /**
2
+ * A draw's surface overlay in the lit stage: the rim, the dissolve and the wrinkles
3
+ * `surfaceOverlay.ts` packs into `uOverlay`. Called from `main` at three places — the dissolve's cut
4
+ * before anything is shaded, the wrinkles after the normal map, and the glow beside emission.
5
+ *
6
+ * **A lit switch, `SURFACE_OVERLAY`**, off until a draw first sets an overlay and then on for good,
7
+ * as `litSwitchesGlsl`'s are; declared after the models so every switch before it keeps its id.
8
+ * Compiled out, the three calls are stubs and the fifteen vectors are not declared at all, which is
9
+ * what lets WebGL2 build a lit program without them on a device that has no room.
10
+ *
11
+ * **Images come from the atlas bound where the frame's refraction copy goes**, which an opaque draw
12
+ * never reads; a draw that refracts or is glass reads that copy there, so its overlay reads no image
13
+ * (`overlayImagesBound`). Each image is read by `textureLod` at level 0: several are reached under a
14
+ * branch on a per-pixel value, and the atlas carries no chain anyway.
15
+ */
16
+ export function overlayGlsl(on) {
17
+ if (!on) {
18
+ return /* glsl */ `
19
+ const bool SURFACE_OVERLAY = false; // wgsl:override
20
+ bool overlayCuts(vec2 uv) { return false; }
21
+ vec3 overlayWrinkle(vec3 mapped, vec3 unmapped, vec2 uv) { return mapped; }
22
+ vec3 overlayGlow(vec2 uv, vec3 n) { return vec3(0.0); }
23
+ `;
24
+ }
25
+ return /* glsl */ `
26
+ /* Whether this program carries a draw's overlay. Off but where one has been set: overlay.ts. */
27
+ const bool SURFACE_OVERLAY = true; // wgsl:override
28
+ /* The overlay's fifteen vectors; packSurfaceOverlay in surfaceOverlay.ts says what each holds. */
29
+ uniform vec4 uOverlay[15];
30
+
31
+ /* Whether the atlas is what the refraction slot holds: not where this draw refracts or is glass. */
32
+ bool overlayImagesBound() {
33
+ return uSeeThrough.x <= 0.0 && uSeeThrough.z <= 0.0;
34
+ }
35
+
36
+ /* One image of the atlas at uv, repeated within its region; zero where the region has no size. */
37
+ vec4 overlayImage(vec4 region, vec2 uv) {
38
+ if (region.x <= 0.0) return vec4(0.0);
39
+ return textureLod(uRefractScene, region.zw + fract(uv) * region.xy, 0.0);
40
+ }
41
+
42
+ /* The dissolve's noise at uv, and whether the draw dissolves at all: -1 where it does not. */
43
+ float overlayDissolveNoise(vec2 uv) {
44
+ if (uOverlay[6].x <= 0.0 || uOverlay[7].z <= 0.0) return -1.0;
45
+ if (!overlayImagesBound()) return -1.0;
46
+ return overlayImage(uOverlay[6], uv * uOverlay[7].xy).r;
47
+ }
48
+
49
+ /* Whether the dissolve cuts this fragment away: where its noise is under the threshold, or all of
50
+ it at a threshold of 1. */
51
+ bool overlayCuts(vec2 uv) {
52
+ float noise = overlayDissolveNoise(uv);
53
+ if (noise < 0.0) return false;
54
+ return noise < uOverlay[7].z || uOverlay[7].z >= 1.0;
55
+ }
56
+
57
+ /*
58
+ * The wrinkle normal blended into the mapped one by the two masks' channels times the six weights,
59
+ * in the frame the normal map is read in. **Under uniform control flow up to the frame**, which
60
+ * takes derivatives: every branch before it is on the overlay's numbers alone, and the weight a
61
+ * pixel takes is a mix rather than a branch.
62
+ */
63
+ vec3 overlayWrinkle(vec3 mapped, vec3 unmapped, vec2 uv) {
64
+ if (uOverlay[10].x <= 0.0 || !overlayImagesBound()) return mapped;
65
+ mat3 tbn = tangentFrame(unmapped, vWorldPos, vUv.xy, vTangent, vHasTangents);
66
+ vec3 a = overlayImage(uOverlay[11], uv).rgb;
67
+ vec3 b = overlayImage(uOverlay[12], uv).rgb;
68
+ float weight = clamp(
69
+ dot(a, uOverlay[13].xyz) + dot(b, vec3(uOverlay[13].w, uOverlay[14].xy)), 0.0, 1.0);
70
+ vec3 wrinkle = overlayImage(uOverlay[10], uv).xyz * 2.0 - 1.0;
71
+ /* z rebuilt where none is stored, as normalMapped does: see normalMap.ts. */
72
+ wrinkle.z = wrinkle.z > 0.0 ? wrinkle.z : sqrt(max(0.0, 1.0 - dot(wrinkle.xy, wrinkle.xy)));
73
+ return normalize(mix(mapped, normalize(tbn * wrinkle), weight));
74
+ }
75
+
76
+ /*
77
+ * The rim's place on the screen, 0 to 1 up its height and its width in the same units: from view
78
+ * space and the projection's tangent, not from gl_FragCoord, whose y runs up on one backend and
79
+ * down on the other (the 2026-08-17 rule), and whose scale is a render target's, not the screen's.
80
+ */
81
+ vec2 overlayScreen() {
82
+ vec4 eye = uView * vec4(vWorldPos, 1.0);
83
+ float depth = max(-eye.z, 1e-4) * uClusterFrustum.z;
84
+ return vec2(eye.x / depth + uClusterFrustum.w, eye.y / depth + 1.0) * 0.5;
85
+ }
86
+
87
+ /* What the overlay adds to the light the surface gives off: the dissolve's band, the colour laid
88
+ over through its noise, and the rim. Zero where the draw sets none of them. */
89
+ vec3 overlayGlow(vec2 uv, vec3 n) {
90
+ vec3 glow = vec3(0.0);
91
+ float noise = overlayDissolveNoise(uv);
92
+ if (noise >= 0.0) {
93
+ float band = 1.0 - clamp((noise - uOverlay[7].z) / uOverlay[7].w, 0.0, 1.0);
94
+ glow += uOverlay[8].rgb * uOverlay[8].w * band + uOverlay[9].rgb * uOverlay[9].w * noise;
95
+ }
96
+ float strength = uOverlay[0].w;
97
+ if (strength > 0.0) {
98
+ vec3 toEye = normalize(uCameraPos - vWorldPos);
99
+ float edge = pow(1.0 - clamp(dot(n, toEye), 0.0, 1.0), max(uOverlay[1].x, 1e-4));
100
+ float up = pow(clamp(n.y * 0.5 + 0.5, 0.0, 1.0), max(uOverlay[1].y, 1e-4));
101
+ float rim = pow(edge * up, max(uOverlay[1].z, 1e-4));
102
+ float time = uSurfaceScene.x;
103
+ if (uOverlay[2].x > 0.0 && overlayImagesBound()) {
104
+ vec2 at = overlayScreen() * uOverlay[3].z + uOverlay[3].xy * time;
105
+ rim *= overlayImage(uOverlay[2], at).r;
106
+ }
107
+ rim = min(rim, 1.0);
108
+ rim *= mix(uOverlay[4].x, uOverlay[4].y, 0.5 + 0.5 * sin(uOverlay[3].w * time));
109
+ if (uOverlay[5].x > 0.0 && overlayImagesBound()) {
110
+ rim *= 1.0 - uOverlay[1].w * overlayImage(uOverlay[5], uv).r;
111
+ }
112
+ glow += uOverlay[0].rgb * strength * rim;
113
+ }
114
+ return glow;
115
+ }
116
+ `;
117
+ }
@@ -341,7 +341,7 @@ float areaShadow(
341
341
  ${LAMP_GLASS_GLSL}
342
342
  #endif
343
343
 
344
- out vec4 outColor;
344
+ layout(location = 0) out vec4 outColor;
345
345
 
346
346
  ${OUTPUT_TRANSFORM_GLSL}
347
347
 
@@ -0,0 +1,21 @@
1
+ /**
2
+ * What the lit stage leaves for a reflection traced in the frame: how much of the environment each
3
+ * pixel shows, and how a reflection found in the frame would land there instead. Read by the
4
+ * reflection pass (`screenSpaceReflection.ts`), which swaps the one for the other where its ray
5
+ * finds something.
6
+ *
7
+ * **The swap is exact because the lit stage's own blend is a mix**: `lit = mix(lit, environment ·
8
+ * tint, weight)` leaves `environment · tint · weight` of the probe in the frame, and a reflection
9
+ * found in the frame belongs there with the same tint and the same weight. So the frame gains
10
+ * `(found · tint − environment · tint) · weight` and nothing else moves: the diffuse the blend
11
+ * already took its share from keeps it. Both are carried the rest of the way the shaded colour
12
+ * goes — the occlusion, the water and the medium in front of the surface — so the swap lands in the
13
+ * frame's own units.
14
+ *
15
+ * **Two outputs beside the colour, written by every lit draw and kept only where a target is
16
+ * bound.** WebGL2 binds them during opaque lit draws alone; WebGPU's frame pass binds none, and a
17
+ * second pass replays the frame's opaque draws into them with `REFLECTION_SURFACE` on, which leaves
18
+ * before the lamps (`main`). What it gives up is a vector of arithmetic on every lit pixel whether
19
+ * or not anything reads it.
20
+ */
21
+ export declare function reflectionSurfaceGlsl(maps: boolean): string;
@@ -0,0 +1,61 @@
1
+ /**
2
+ * What the lit stage leaves for a reflection traced in the frame: how much of the environment each
3
+ * pixel shows, and how a reflection found in the frame would land there instead. Read by the
4
+ * reflection pass (`screenSpaceReflection.ts`), which swaps the one for the other where its ray
5
+ * finds something.
6
+ *
7
+ * **The swap is exact because the lit stage's own blend is a mix**: `lit = mix(lit, environment ·
8
+ * tint, weight)` leaves `environment · tint · weight` of the probe in the frame, and a reflection
9
+ * found in the frame belongs there with the same tint and the same weight. So the frame gains
10
+ * `(found · tint − environment · tint) · weight` and nothing else moves: the diffuse the blend
11
+ * already took its share from keeps it. Both are carried the rest of the way the shaded colour
12
+ * goes — the occlusion, the water and the medium in front of the surface — so the swap lands in the
13
+ * frame's own units.
14
+ *
15
+ * **Two outputs beside the colour, written by every lit draw and kept only where a target is
16
+ * bound.** WebGL2 binds them during opaque lit draws alone; WebGPU's frame pass binds none, and a
17
+ * second pass replays the frame's opaque draws into them with `REFLECTION_SURFACE` on, which leaves
18
+ * before the lamps (`main`). What it gives up is a vector of arithmetic on every lit pixel whether
19
+ * or not anything reads it.
20
+ */
21
+ export function reflectionSurfaceGlsl(maps) {
22
+ return /* glsl */ `
23
+ /*
24
+ * Whether this pipeline is the reflection pass's surface half: the frame's opaque draws again,
25
+ * against the depth they wrote, leaving the two outputs below and no light. Off in every other
26
+ * pipeline, and set from the key as skin's halves are. See reflectionSurface.ts.
27
+ */
28
+ const bool REFLECTION_SURFACE = false; // wgsl:override
29
+ /*
30
+ * Whether the frame's own draws write the two outputs as well: WebGL2's arrangement, on where the
31
+ * frame's materials' reflections are, and off in every WebGPU pipeline, which replays the draws
32
+ * instead. A lit switch, so a program that does not write them carries nothing live across the
33
+ * lamps for them.
34
+ */
35
+ const bool REFLECTION_MAPS = ${maps ? 'true' : 'false'}; // wgsl:override
36
+ /* The environment as the frame shows it, and the surface's roughness in w. */
37
+ layout(location = 1) out vec4 outReflectedProbe;
38
+ /* What a reflection found in the frame is multiplied by to land where the environment did. */
39
+ layout(location = 2) out vec4 outReflectedTint;
40
+
41
+ /* How much of the surface the medium in front of it leaves: the fog block below's own measure. */
42
+ float reflectionAir() {
43
+ return uFogEnabled != 0 ? mediumFog(distance(vWorldPos, uCameraPos), vWorldPos.y) : 0.0;
44
+ }
45
+
46
+ /*
47
+ * The two outputs, carried through what the shaded colour meets after the blend: its occlusion,
48
+ * the water, and the air, as \`main\` applies them. \`air\` is the fog the caller has already
49
+ * reckoned, so the frame's own draws pay for it once.
50
+ */
51
+ void reflectionSurfaceOut(vec3 probe, vec3 tint, float roughness, float occlusion, float air) {
52
+ vec3 keep = vec3(occlusion * (1.0 - air));
53
+ if (uFogEnabled != 0) {
54
+ vec3 waterTransmission = vec3(0.42) + uUnderwaterColor * 2.0;
55
+ keep *= mix(vec3(1.0), waterTransmission, uUnderwaterFactor * 0.55);
56
+ }
57
+ outReflectedProbe = vec4(probe * keep, roughness);
58
+ outReflectedTint = vec4(tint * keep, 1.0);
59
+ }
60
+ `;
61
+ }
@@ -34,4 +34,4 @@
34
34
  * never needed the camera position in their fragment stage, and a block that declares
35
35
  * everything it uses can be pasted anywhere.
36
36
  */
37
- export declare const FOG_GLSL = "\nuniform vec3 uFogColor;\n/** Extinction per metre **at the camera's own height**, not at the base. */\nuniform float uFogDensity;\n/** Reciprocal scale height of the haze, per metre. 0 is a uniform medium. */\nuniform float uFogHeightFalloff;\n/** The camera's height, so a fragment's own height is one subtraction away. */\nuniform float uFogEyeY;\nuniform vec3 uUnderwaterColor;\nuniform float uUnderwaterFogDensity;\nuniform float uUnderwaterFactor;\n/** 0 integrates a medium (Beer-Lambert); 1 ramps linearly between near and far. */\nuniform int uFogMode;\n/** Linear mode only: where haze begins, and where it is total. */\nuniform float uFogNear;\nuniform float uFogFar;\n\n/** What distance converges toward: the day's haze, or the water column. */\nvec3 mediumColor() {\n return mix(uFogColor, uUnderwaterColor, uUnderwaterFactor);\n}\n\n/**\n * How much of a surface standing at height pointY, dist metres away, is lost to\n * the medium in between. 0 is perfectly clear, 1 is the medium's own colour.\n */\nfloat mediumFog(float dist, float pointY) {\n /*\n * A depth ramp rather than a medium, for worlds authored against one.\n *\n * Beer-Lambert is the honest model and stays the default: it integrates something\n * physically there, so extinction begins at the eye and never stops. A linear near/far\n * fog is not that \u2014 it is a *look*, with a hard start distance before which the air is\n * perfectly clear, and it is what the fixed-function pipeline offered and what several\n * renderers still expose. Approximating one with the other is not a matter of tuning:\n * matched at half occlusion, the exponential curve still lays haze over everything\n * inside near, where the ramp lays none, and near-field colour desaturates toward the\n * fog colour with nothing to show for it.\n *\n * Height falloff has no meaning here and is ignored: a ramp is defined on distance\n * alone.\n */\n if (uFogMode == 1) {\n float span = max(uFogFar - uFogNear, 1e-4);\n float ramp = clamp((dist - uFogNear) / span, 0.0, 1.0);\n if (uUnderwaterFactor <= 0.0) return ramp;\n float wetLinear = uUnderwaterFogDensity * dist;\n return mix(ramp, 1.0 - exp2(-wetLinear * wetLinear * 1.442695), uUnderwaterFactor);\n }\n\n float t = (pointY - uFogEyeY) * uFogHeightFalloff;\n // (1 - e^-t)/t, which tends to 1 as the ray levels out. Guarded rather than\n // branched: at t = 0 the quotient is 0/0, and 1e-4 of a scale height is 8 mm.\n float denom = abs(t) < 1e-4 ? 1e-4 : t;\n float air = 1.0 - exp(-uFogDensity * dist * (1.0 - exp(-denom)) / denom);\n if (uUnderwaterFactor <= 0.0) return air;\n // Water is its own medium and keeps its own curve, so crossing the surface\n // changes nothing about how the water column reads.\n float wet = uUnderwaterFogDensity * dist;\n return mix(air, 1.0 - exp2(-wet * wet * 1.442695), uUnderwaterFactor);\n}\n";
37
+ export declare const FOG_GLSL = "\nuniform vec3 uFogColor;\n/** Extinction per metre **at the camera's own height**, not at the base. */\nuniform float uFogDensity;\n/** Reciprocal scale height of the haze, per metre. 0 is a uniform medium. */\nuniform float uFogHeightFalloff;\n/** The camera's height, so a fragment's own height is one subtraction away. */\nuniform float uFogEyeY;\nuniform vec3 uUnderwaterColor;\nuniform float uUnderwaterFogDensity;\nuniform float uUnderwaterFactor;\n/** 0 integrates a medium (Beer-Lambert); 1 ramps linearly between near and far. */\nuniform int uFogMode;\n/** Linear mode only: where haze begins, and where it is total. */\nuniform float uFogNear;\nuniform float uFogFar;\n\n/** What distance converges toward: the day's haze, or the water column. */\nvec3 mediumColor() {\n return mix(uFogColor, uUnderwaterColor, uUnderwaterFactor);\n}\n\n/**\n * How much of a surface standing at height pointY, dist metres away, is lost to\n * the medium in between. 0 is perfectly clear, 1 is the medium's own colour.\n */\nfloat mediumFog(float dist, float pointY) {\n /*\n * A depth ramp rather than a medium, for worlds authored against one.\n *\n * Beer-Lambert is the honest model and stays the default: it integrates something\n * physically there, so extinction begins at the eye and never stops. A linear near/far\n * fog is not that \u2014 it is a *look*, with a hard start distance before which the air is\n * perfectly clear, and it is what the fixed-function pipeline offered and what several\n * renderers still expose. Approximating one with the other is not a matter of tuning:\n * matched at half occlusion, the exponential curve still lays haze over everything\n * inside near, where the ramp lays none, and near-field colour desaturates toward the\n * fog colour with nothing to show for it.\n *\n * Height falloff has no meaning here and is ignored: a ramp is defined on distance\n * alone.\n */\n if (uFogMode == 1) {\n float span = max(uFogFar - uFogNear, 1e-4);\n float ramp = clamp((dist - uFogNear) / span, 0.0, 1.0);\n if (uUnderwaterFactor <= 0.0) return ramp;\n float wetLinear = uUnderwaterFogDensity * dist;\n return mix(ramp, 1.0 - exp2(-wetLinear * wetLinear * 1.442695), uUnderwaterFactor);\n }\n\n // Where the medium begins along the ray: uFogNear, the linear mode's slot, which this mode\n // never read before Atmosphere.fogStart. The ray is integrated from there on, at the density\n // of that point; at a start of 0 every term is the one it always was. See render/fog.ts.\n float start = min(uFogNear, dist);\n float before = dist > 0.0 ? start / dist : 0.0;\n float t = (pointY - uFogEyeY) * uFogHeightFalloff;\n float rest = t * (1.0 - before);\n // (1 - e^-t)/t, which tends to 1 as the ray levels out. Guarded rather than\n // branched: at t = 0 the quotient is 0/0, and 1e-4 of a scale height is 8 mm.\n float denom = abs(rest) < 1e-4 ? 1e-4 : rest;\n float air =\n 1.0 - exp(-uFogDensity * exp(-t * before) * (dist - start) * (1.0 - exp(-denom)) / denom);\n if (uUnderwaterFactor <= 0.0) return air;\n // Water is its own medium and keeps its own curve, so crossing the surface\n // changes nothing about how the water column reads.\n float wet = uUnderwaterFogDensity * dist;\n return mix(air, 1.0 - exp2(-wet * wet * 1.442695), uUnderwaterFactor);\n}\n";
@@ -84,11 +84,18 @@ float mediumFog(float dist, float pointY) {
84
84
  return mix(ramp, 1.0 - exp2(-wetLinear * wetLinear * 1.442695), uUnderwaterFactor);
85
85
  }
86
86
 
87
+ // Where the medium begins along the ray: uFogNear, the linear mode's slot, which this mode
88
+ // never read before Atmosphere.fogStart. The ray is integrated from there on, at the density
89
+ // of that point; at a start of 0 every term is the one it always was. See render/fog.ts.
90
+ float start = min(uFogNear, dist);
91
+ float before = dist > 0.0 ? start / dist : 0.0;
87
92
  float t = (pointY - uFogEyeY) * uFogHeightFalloff;
93
+ float rest = t * (1.0 - before);
88
94
  // (1 - e^-t)/t, which tends to 1 as the ray levels out. Guarded rather than
89
95
  // branched: at t = 0 the quotient is 0/0, and 1e-4 of a scale height is 8 mm.
90
- float denom = abs(t) < 1e-4 ? 1e-4 : t;
91
- float air = 1.0 - exp(-uFogDensity * dist * (1.0 - exp(-denom)) / denom);
96
+ float denom = abs(rest) < 1e-4 ? 1e-4 : rest;
97
+ float air =
98
+ 1.0 - exp(-uFogDensity * exp(-t * before) * (dist - start) * (1.0 - exp(-denom)) / denom);
92
99
  if (uUnderwaterFactor <= 0.0) return air;
93
100
  // Water is its own medium and keeps its own curve, so crossing the surface
94
101
  // changes nothing about how the water column reads.
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Chromatic aberration: a lens bending each colour by its own amount, so red and green land a
3
+ * little nearer the centre than blue toward the frame's edges.
4
+ *
5
+ * **Linear in wavelength, from an offset outward.** A simple lens's dispersion is close to linear
6
+ * in wavelength over the visible range, so red (611 nm) and green (549 nm) are pulled toward the
7
+ * centre by their distance from blue (464 nm), which is drawn where it is. Nothing moves inside
8
+ * `start` — a share of the half-frame, 0 at the centre — and the pull grows linearly past it,
9
+ * scaled so that the frame's edge takes the whole of `intensity`, which is a percentage.
10
+ *
11
+ * **What it gives up**: it re-reads the scene at the composite's first sample, so the camera's
12
+ * motion blur and the depth of field, which re-read the scene themselves, carry less of the fringe
13
+ * where they are strong. A pass of its own after both would carry it whole, at a full-frame read
14
+ * and write a frame. **What would make that wrong** is a game that blurs heavily and fringes
15
+ * heavily at once, where the colour edges would be seen to soften with the blur.
16
+ */
17
+ /** How many floats `resolveFringe` fills: the red pull, the green pull, and where they begin. */
18
+ export declare const FRINGE_FLOATS = 3;
19
+ /**
20
+ * The fringe's three numbers, into `out`: how far red and green are pulled toward the centre at
21
+ * the frame's edge, as a share of the half-frame, and the start offset. `intensity` 0 or below is
22
+ * none; a start of 1 or more is none too, since nothing then lies past it. Not finite is none.
23
+ */
24
+ export declare function resolveFringe(intensity: number, start: number, out: Float32Array): void;
25
+ /**
26
+ * `withFringe(scene)`: the scene's colour with red and green read again where the lens put them.
27
+ * Reads `uScene` and `vUv`, which the including stage declares, and `uFringe`, which this declares.
28
+ */
29
+ export declare const FRINGE_GLSL = "\n/** Red's and green's pull at the frame's edge, and where it begins: see shaders/fringe.ts. */\nuniform vec3 uFringe;\n\nvec3 withFringe(vec3 scene) {\n if (uFringe.x <= 0.0) return scene;\n vec2 lens = vUv * 2.0 - 1.0;\n vec2 past = sign(lens) * clamp(abs(lens) - uFringe.z, 0.0, 1.0);\n vec2 red = (lens - past * uFringe.x) * 0.5 + 0.5;\n vec2 green = (lens - past * uFringe.y) * 0.5 + 0.5;\n return vec3(textureLod(uScene, red, 0.0).r, textureLod(uScene, green, 0.0).g, scene.b);\n}\n";
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Chromatic aberration: a lens bending each colour by its own amount, so red and green land a
3
+ * little nearer the centre than blue toward the frame's edges.
4
+ *
5
+ * **Linear in wavelength, from an offset outward.** A simple lens's dispersion is close to linear
6
+ * in wavelength over the visible range, so red (611 nm) and green (549 nm) are pulled toward the
7
+ * centre by their distance from blue (464 nm), which is drawn where it is. Nothing moves inside
8
+ * `start` — a share of the half-frame, 0 at the centre — and the pull grows linearly past it,
9
+ * scaled so that the frame's edge takes the whole of `intensity`, which is a percentage.
10
+ *
11
+ * **What it gives up**: it re-reads the scene at the composite's first sample, so the camera's
12
+ * motion blur and the depth of field, which re-read the scene themselves, carry less of the fringe
13
+ * where they are strong. A pass of its own after both would carry it whole, at a full-frame read
14
+ * and write a frame. **What would make that wrong** is a game that blurs heavily and fringes
15
+ * heavily at once, where the colour edges would be seen to soften with the blur.
16
+ */
17
+ /** How many floats `resolveFringe` fills: the red pull, the green pull, and where they begin. */
18
+ export const FRINGE_FLOATS = 3;
19
+ /** The primaries' wavelengths, nanometres. */
20
+ const RED_NM = 611.3;
21
+ const GREEN_NM = 549.1;
22
+ const BLUE_NM = 464.3;
23
+ /** The lens's dispersion per nanometre, the constant that makes `intensity` a percentage. */
24
+ const PER_NM = 0.007;
25
+ /**
26
+ * The fringe's three numbers, into `out`: how far red and green are pulled toward the centre at
27
+ * the frame's edge, as a share of the half-frame, and the start offset. `intensity` 0 or below is
28
+ * none; a start of 1 or more is none too, since nothing then lies past it. Not finite is none.
29
+ */
30
+ export function resolveFringe(intensity, start, out) {
31
+ const at = Number.isFinite(start) ? Math.min(Math.max(start, 0), 1) : 0;
32
+ const amount = Number.isFinite(intensity) && intensity > 0 && at < 1 ? intensity * 0.01 : 0;
33
+ /* Divided only where there is something to divide: at a start of 1 this is 0 over 0. */
34
+ const reach = amount > 0 ? amount / (1 - at) : 0;
35
+ out[0] = reach * PER_NM * (RED_NM - BLUE_NM);
36
+ out[1] = reach * PER_NM * (GREEN_NM - BLUE_NM);
37
+ out[2] = at;
38
+ }
39
+ /**
40
+ * `withFringe(scene)`: the scene's colour with red and green read again where the lens put them.
41
+ * Reads `uScene` and `vUv`, which the including stage declares, and `uFringe`, which this declares.
42
+ */
43
+ export const FRINGE_GLSL = `
44
+ /** Red's and green's pull at the frame's edge, and where it begins: see shaders/fringe.ts. */
45
+ uniform vec3 uFringe;
46
+
47
+ vec3 withFringe(vec3 scene) {
48
+ if (uFringe.x <= 0.0) return scene;
49
+ vec2 lens = vUv * 2.0 - 1.0;
50
+ vec2 past = sign(lens) * clamp(abs(lens) - uFringe.z, 0.0, 1.0);
51
+ vec2 red = (lens - past * uFringe.x) * 0.5 + 0.5;
52
+ vec2 green = (lens - past * uFringe.y) * 0.5 + 0.5;
53
+ return vec3(textureLod(uScene, red, 0.0).r, textureLod(uScene, green, 0.0).g, scene.b);
54
+ }
55
+ `;
@@ -1,4 +1,4 @@
1
- export declare const ARCANE_FRAG_WGSL = "struct Uniforms {\n uTime: f32,\n uFogColor: vec3<f32>,\n uFogDensity: f32,\n uFogHeightFalloff: f32,\n uFogEyeY: f32,\n uUnderwaterColor: vec3<f32>,\n uUnderwaterFogDensity: f32,\n uUnderwaterFactor: f32,\n uFogMode: i32,\n uFogNear: f32,\n uFogFar: f32,\n uNoiseOctaves: i32,\n uClipPlane: vec4<f32>,\n uClipEnabled: i32,\n uTint: vec3<f32>,\n}\n\n@group(0) @binding(1) \nvar<uniform> unnamed: Uniforms;\nvar<private> vWorldPos_1: vec3<f32>;\nvar<private> vUv_1: vec2<f32>;\nvar<private> vSeed_1: f32;\nvar<private> vDistance_1: f32;\nvar<private> outColor: vec4<f32>;\n\nfn mediumColor_u0028_() -> vec3<f32> {\n let _e59 = unnamed.uFogColor;\n let _e61 = unnamed.uUnderwaterColor;\n let _e63 = unnamed.uUnderwaterFactor;\n return mix(_e59, _e61, vec3(_e63));\n}\n\nfn mediumFog_u0028_f1_u003b_f1_u003b(dist: ptr<function, f32>, pointY: ptr<function, f32>) -> f32 {\n var span: f32;\n var ramp: f32;\n var wetLinear: f32;\n var t: f32;\n var denom: f32;\n var air: f32;\n var wet: f32;\n\n let _e68 = unnamed.uFogMode;\n if (_e68 == 1i) {\n let _e71 = unnamed.uFogFar;\n let _e73 = unnamed.uFogNear;\n span = max((_e71 - _e73), 0.0001f);\n let _e76 = (*dist);\n let _e78 = unnamed.uFogNear;\n let _e80 = span;\n ramp = clamp(((_e76 - _e78) / _e80), 0f, 1f);\n let _e84 = unnamed.uUnderwaterFactor;\n if (_e84 <= 0f) {\n let _e86 = ramp;\n return _e86;\n }\n let _e88 = unnamed.uUnderwaterFogDensity;\n let _e89 = (*dist);\n wetLinear = (_e88 * _e89);\n let _e91 = ramp;\n let _e92 = wetLinear;\n let _e94 = wetLinear;\n let _e100 = unnamed.uUnderwaterFactor;\n return mix(_e91, (1f - exp2(((-(_e92) * _e94) * 1.442695f))), _e100);\n }\n let _e102 = (*pointY);\n let _e104 = unnamed.uFogEyeY;\n let _e107 = unnamed.uFogHeightFalloff;\n t = ((_e102 - _e104) * _e107);\n let _e109 = t;\n let _e112 = t;\n denom = select(_e112, 0.0001f, (abs(_e109) < 0.0001f));\n let _e115 = unnamed.uFogDensity;\n let _e117 = (*dist);\n let _e119 = denom;\n let _e124 = denom;\n air = (1f - exp((((-(_e115) * _e117) * (1f - exp(-(_e119)))) / _e124)));\n let _e129 = unnamed.uUnderwaterFactor;\n if (_e129 <= 0f) {\n let _e131 = air;\n return _e131;\n }\n let _e133 = unnamed.uUnderwaterFogDensity;\n let _e134 = (*dist);\n wet = (_e133 * _e134);\n let _e136 = air;\n let _e137 = wet;\n let _e139 = wet;\n let _e145 = unnamed.uUnderwaterFactor;\n return mix(_e136, (1f - exp2(((-(_e137) * _e139) * 1.442695f))), _e145);\n}\n\nfn hash21_u0028_vf2_u003b(p: ptr<function, vec2<f32>>) -> f32 {\n let _e59 = (*p);\n return fract((sin(dot(_e59, vec2<f32>(127.1f, 311.7f))) * 43758.547f));\n}\n\nfn valueNoise_u0028_vf2_u003b(p_1: ptr<function, vec2<f32>>) -> f32 {\n var i: vec2<f32>;\n var f: vec2<f32>;\n var u: vec2<f32>;\n var param: vec2<f32>;\n var param_1: vec2<f32>;\n var param_2: vec2<f32>;\n var param_3: vec2<f32>;\n\n let _e66 = (*p_1);\n i = floor(_e66);\n let _e68 = (*p_1);\n f = fract(_e68);\n let _e70 = f;\n let _e71 = f;\n let _e73 = f;\n u = ((_e70 * _e71) * (vec2(3f) - (_e73 * 2f)));\n let _e78 = i;\n param = _e78;\n let _e79 = hash21_u0028_vf2_u003b((&param));\n let _e80 = i;\n param_1 = (_e80 + vec2<f32>(1f, 0f));\n let _e82 = hash21_u0028_vf2_u003b((&param_1));\n let _e84 = u[0u];\n let _e86 = i;\n param_2 = (_e86 + vec2<f32>(0f, 1f));\n let _e88 = hash21_u0028_vf2_u003b((&param_2));\n let _e89 = i;\n param_3 = (_e89 + vec2<f32>(1f, 1f));\n let _e91 = hash21_u0028_vf2_u003b((&param_3));\n let _e93 = u[0u];\n let _e96 = u[1u];\n return mix(mix(_e79, _e82, _e84), mix(_e88, _e91, _e93), _e96);\n}\n\nfn main_1() {\n var radius: f32;\n var d: vec2<f32>;\n var angle: f32;\n var t_1: f32;\n var inner: f32;\n var param_4: vec2<f32>;\n var outer: f32;\n var param_5: vec2<f32>;\n var swirl: f32;\n var param_6: vec2<f32>;\n var core: f32;\n var corona: f32;\n var body: f32;\n var col: vec3<f32>;\n var alpha: f32;\n var fog: f32;\n var param_7: f32;\n var param_8: f32;\n var phi_237_: bool;\n\n let _e77 = unnamed.uClipEnabled;\n let _e78 = (_e77 != 0i);\n phi_237_ = _e78;\n if _e78 {\n let _e79 = vWorldPos_1;\n let _e85 = unnamed.uClipPlane;\n phi_237_ = (dot(vec4<f32>(_e79.x, _e79.y, _e79.z, 1f), _e85) < 0f);\n }\n let _e89 = phi_237_;\n if _e89 {\n discard;\n }\n let _e90 = vUv_1;\n radius = (length((_e90 - vec2(0.5f))) * 2f);\n let _e95 = radius;\n if (_e95 >= 1f) {\n discard;\n }\n let _e97 = vUv_1;\n d = (_e97 - vec2(0.5f));\n let _e101 = d[1u];\n let _e103 = d[0u];\n angle = atan2(_e101, _e103);\n let _e106 = unnamed.uTime;\n let _e107 = vSeed_1;\n t_1 = (_e106 + (_e107 * 37f));\n let _e110 = angle;\n let _e112 = t_1;\n let _e115 = radius;\n param_4 = vec2<f32>(((_e110 * 1.9f) + (_e112 * 0.55f)), (_e115 * 4.2f));\n let _e118 = valueNoise_u0028_vf2_u003b((&param_4));\n inner = _e118;\n let _e119 = angle;\n let _e121 = t_1;\n let _e124 = radius;\n param_5 = vec2<f32>(((_e119 * 3.1f) - (_e121 * 0.34f)), (_e124 * 2.6f));\n let _e127 = valueNoise_u0028_vf2_u003b((&param_5));\n outer = _e127;\n let _e128 = inner;\n let _e130 = outer;\n swirl = ((_e128 * 0.62f) + (_e130 * 0.38f));\n let _e134 = unnamed.uNoiseOctaves;\n if (_e134 > 1i) {\n let _e136 = swirl;\n let _e137 = swirl;\n let _e138 = angle;\n let _e140 = t_1;\n let _e143 = radius;\n param_6 = vec2<f32>(((_e138 * 6.3f) + (_e140 * 0.9f)), (_e143 * 8f));\n let _e146 = valueNoise_u0028_vf2_u003b((&param_6));\n swirl = mix(_e136, ((_e137 * _e146) * 2f), 0.35f);\n }\n let _e150 = radius;\n core = (1f - smoothstep(0f, 0.28f, _e150));\n let _e153 = radius;\n let _e156 = swirl;\n corona = ((1f - smoothstep(0.18f, 1f, _e153)) * (0.35f + (_e156 * 0.65f)));\n let _e160 = core;\n let _e162 = corona;\n body = ((_e160 * 0.9f) + _e162);\n let _e164 = body;\n if (_e164 <= 0.02f) {\n discard;\n }\n let _e167 = unnamed.uTint;\n let _e170 = unnamed.uTint;\n let _e171 = body;\n col = mix((_e167 * 0.35f), _e170, vec3(smoothstep(0f, 0.55f, _e171)));\n let _e175 = col;\n let _e176 = body;\n col = mix(_e175, vec3<f32>(1f, 1f, 1f), vec3(smoothstep(0.82f, 1.4f, _e176)));\n let _e181 = unnamed.uTint;\n let _e182 = col;\n col = (_e182 * _e181);\n let _e184 = body;\n alpha = clamp((_e184 * 1.6f), 0f, 1f);\n let _e187 = vDistance_1;\n param_7 = _e187;\n let _e189 = vWorldPos_1[1u];\n param_8 = _e189;\n let _e190 = mediumFog_u0028_f1_u003b_f1_u003b((&param_7), (&param_8));\n fog = _e190;\n let _e191 = col;\n let _e192 = mediumColor_u0028_();\n let _e193 = fog;\n col = mix(_e191, _e192, vec3(_e193));\n let _e196 = fog;\n let _e198 = alpha;\n alpha = (_e198 * (1f - _e196));\n let _e200 = col;\n let _e201 = alpha;\n outColor = vec4<f32>(_e200.x, _e200.y, _e200.z, _e201);\n return;\n}\n\n@fragment \nfn main(@location(3) vWorldPos: vec3<f32>, @location(0) vUv: vec2<f32>, @location(1) vSeed: f32, @location(2) vDistance: f32) -> @location(0) vec4<f32> {\n vWorldPos_1 = vWorldPos;\n vUv_1 = vUv;\n vSeed_1 = vSeed;\n vDistance_1 = vDistance;\n main_1();\n let _e9 = outColor;\n return _e9;\n}\n";
1
+ export declare const ARCANE_FRAG_WGSL = "struct Uniforms {\n uTime: f32,\n uFogColor: vec3<f32>,\n uFogDensity: f32,\n uFogHeightFalloff: f32,\n uFogEyeY: f32,\n uUnderwaterColor: vec3<f32>,\n uUnderwaterFogDensity: f32,\n uUnderwaterFactor: f32,\n uFogMode: i32,\n uFogNear: f32,\n uFogFar: f32,\n uNoiseOctaves: i32,\n uClipPlane: vec4<f32>,\n uClipEnabled: i32,\n uTint: vec3<f32>,\n}\n\n@group(0) @binding(1) \nvar<uniform> unnamed: Uniforms;\nvar<private> vWorldPos_1: vec3<f32>;\nvar<private> vUv_1: vec2<f32>;\nvar<private> vSeed_1: f32;\nvar<private> vDistance_1: f32;\nvar<private> outColor: vec4<f32>;\n\nfn mediumColor_u0028_() -> vec3<f32> {\n let _e59 = unnamed.uFogColor;\n let _e61 = unnamed.uUnderwaterColor;\n let _e63 = unnamed.uUnderwaterFactor;\n return mix(_e59, _e61, vec3(_e63));\n}\n\nfn mediumFog_u0028_f1_u003b_f1_u003b(dist: ptr<function, f32>, pointY: ptr<function, f32>) -> f32 {\n var span: f32;\n var ramp: f32;\n var wetLinear: f32;\n var start: f32;\n var before: f32;\n var local: f32;\n var t: f32;\n var rest: f32;\n var denom: f32;\n var air: f32;\n var wet: f32;\n\n let _e72 = unnamed.uFogMode;\n if (_e72 == 1i) {\n let _e75 = unnamed.uFogFar;\n let _e77 = unnamed.uFogNear;\n span = max((_e75 - _e77), 0.0001f);\n let _e80 = (*dist);\n let _e82 = unnamed.uFogNear;\n let _e84 = span;\n ramp = clamp(((_e80 - _e82) / _e84), 0f, 1f);\n let _e88 = unnamed.uUnderwaterFactor;\n if (_e88 <= 0f) {\n let _e90 = ramp;\n return _e90;\n }\n let _e92 = unnamed.uUnderwaterFogDensity;\n let _e93 = (*dist);\n wetLinear = (_e92 * _e93);\n let _e95 = ramp;\n let _e96 = wetLinear;\n let _e98 = wetLinear;\n let _e104 = unnamed.uUnderwaterFactor;\n return mix(_e95, (1f - exp2(((-(_e96) * _e98) * 1.442695f))), _e104);\n }\n let _e107 = unnamed.uFogNear;\n let _e108 = (*dist);\n start = min(_e107, _e108);\n let _e110 = (*dist);\n if (_e110 > 0f) {\n let _e112 = start;\n let _e113 = (*dist);\n local = (_e112 / _e113);\n } else {\n local = 0f;\n }\n let _e115 = local;\n before = _e115;\n let _e116 = (*pointY);\n let _e118 = unnamed.uFogEyeY;\n let _e121 = unnamed.uFogHeightFalloff;\n t = ((_e116 - _e118) * _e121);\n let _e123 = t;\n let _e124 = before;\n rest = (_e123 * (1f - _e124));\n let _e127 = rest;\n let _e130 = rest;\n denom = select(_e130, 0.0001f, (abs(_e127) < 0.0001f));\n let _e133 = unnamed.uFogDensity;\n let _e135 = t;\n let _e137 = before;\n let _e141 = (*dist);\n let _e142 = start;\n let _e145 = denom;\n let _e150 = denom;\n air = (1f - exp(((((-(_e133) * exp((-(_e135) * _e137))) * (_e141 - _e142)) * (1f - exp(-(_e145)))) / _e150)));\n let _e155 = unnamed.uUnderwaterFactor;\n if (_e155 <= 0f) {\n let _e157 = air;\n return _e157;\n }\n let _e159 = unnamed.uUnderwaterFogDensity;\n let _e160 = (*dist);\n wet = (_e159 * _e160);\n let _e162 = air;\n let _e163 = wet;\n let _e165 = wet;\n let _e171 = unnamed.uUnderwaterFactor;\n return mix(_e162, (1f - exp2(((-(_e163) * _e165) * 1.442695f))), _e171);\n}\n\nfn hash21_u0028_vf2_u003b(p: ptr<function, vec2<f32>>) -> f32 {\n let _e59 = (*p);\n return fract((sin(dot(_e59, vec2<f32>(127.1f, 311.7f))) * 43758.547f));\n}\n\nfn valueNoise_u0028_vf2_u003b(p_1: ptr<function, vec2<f32>>) -> f32 {\n var i: vec2<f32>;\n var f: vec2<f32>;\n var u: vec2<f32>;\n var param: vec2<f32>;\n var param_1: vec2<f32>;\n var param_2: vec2<f32>;\n var param_3: vec2<f32>;\n\n let _e66 = (*p_1);\n i = floor(_e66);\n let _e68 = (*p_1);\n f = fract(_e68);\n let _e70 = f;\n let _e71 = f;\n let _e73 = f;\n u = ((_e70 * _e71) * (vec2(3f) - (_e73 * 2f)));\n let _e78 = i;\n param = _e78;\n let _e79 = hash21_u0028_vf2_u003b((&param));\n let _e80 = i;\n param_1 = (_e80 + vec2<f32>(1f, 0f));\n let _e82 = hash21_u0028_vf2_u003b((&param_1));\n let _e84 = u[0u];\n let _e86 = i;\n param_2 = (_e86 + vec2<f32>(0f, 1f));\n let _e88 = hash21_u0028_vf2_u003b((&param_2));\n let _e89 = i;\n param_3 = (_e89 + vec2<f32>(1f, 1f));\n let _e91 = hash21_u0028_vf2_u003b((&param_3));\n let _e93 = u[0u];\n let _e96 = u[1u];\n return mix(mix(_e79, _e82, _e84), mix(_e88, _e91, _e93), _e96);\n}\n\nfn main_1() {\n var radius: f32;\n var d: vec2<f32>;\n var angle: f32;\n var t_1: f32;\n var inner: f32;\n var param_4: vec2<f32>;\n var outer: f32;\n var param_5: vec2<f32>;\n var swirl: f32;\n var param_6: vec2<f32>;\n var core: f32;\n var corona: f32;\n var body: f32;\n var col: vec3<f32>;\n var alpha: f32;\n var fog: f32;\n var param_7: f32;\n var param_8: f32;\n var phi_266_: bool;\n\n let _e77 = unnamed.uClipEnabled;\n let _e78 = (_e77 != 0i);\n phi_266_ = _e78;\n if _e78 {\n let _e79 = vWorldPos_1;\n let _e85 = unnamed.uClipPlane;\n phi_266_ = (dot(vec4<f32>(_e79.x, _e79.y, _e79.z, 1f), _e85) < 0f);\n }\n let _e89 = phi_266_;\n if _e89 {\n discard;\n }\n let _e90 = vUv_1;\n radius = (length((_e90 - vec2(0.5f))) * 2f);\n let _e95 = radius;\n if (_e95 >= 1f) {\n discard;\n }\n let _e97 = vUv_1;\n d = (_e97 - vec2(0.5f));\n let _e101 = d[1u];\n let _e103 = d[0u];\n angle = atan2(_e101, _e103);\n let _e106 = unnamed.uTime;\n let _e107 = vSeed_1;\n t_1 = (_e106 + (_e107 * 37f));\n let _e110 = angle;\n let _e112 = t_1;\n let _e115 = radius;\n param_4 = vec2<f32>(((_e110 * 1.9f) + (_e112 * 0.55f)), (_e115 * 4.2f));\n let _e118 = valueNoise_u0028_vf2_u003b((&param_4));\n inner = _e118;\n let _e119 = angle;\n let _e121 = t_1;\n let _e124 = radius;\n param_5 = vec2<f32>(((_e119 * 3.1f) - (_e121 * 0.34f)), (_e124 * 2.6f));\n let _e127 = valueNoise_u0028_vf2_u003b((&param_5));\n outer = _e127;\n let _e128 = inner;\n let _e130 = outer;\n swirl = ((_e128 * 0.62f) + (_e130 * 0.38f));\n let _e134 = unnamed.uNoiseOctaves;\n if (_e134 > 1i) {\n let _e136 = swirl;\n let _e137 = swirl;\n let _e138 = angle;\n let _e140 = t_1;\n let _e143 = radius;\n param_6 = vec2<f32>(((_e138 * 6.3f) + (_e140 * 0.9f)), (_e143 * 8f));\n let _e146 = valueNoise_u0028_vf2_u003b((&param_6));\n swirl = mix(_e136, ((_e137 * _e146) * 2f), 0.35f);\n }\n let _e150 = radius;\n core = (1f - smoothstep(0f, 0.28f, _e150));\n let _e153 = radius;\n let _e156 = swirl;\n corona = ((1f - smoothstep(0.18f, 1f, _e153)) * (0.35f + (_e156 * 0.65f)));\n let _e160 = core;\n let _e162 = corona;\n body = ((_e160 * 0.9f) + _e162);\n let _e164 = body;\n if (_e164 <= 0.02f) {\n discard;\n }\n let _e167 = unnamed.uTint;\n let _e170 = unnamed.uTint;\n let _e171 = body;\n col = mix((_e167 * 0.35f), _e170, vec3(smoothstep(0f, 0.55f, _e171)));\n let _e175 = col;\n let _e176 = body;\n col = mix(_e175, vec3<f32>(1f, 1f, 1f), vec3(smoothstep(0.82f, 1.4f, _e176)));\n let _e181 = unnamed.uTint;\n let _e182 = col;\n col = (_e182 * _e181);\n let _e184 = body;\n alpha = clamp((_e184 * 1.6f), 0f, 1f);\n let _e187 = vDistance_1;\n param_7 = _e187;\n let _e189 = vWorldPos_1[1u];\n param_8 = _e189;\n let _e190 = mediumFog_u0028_f1_u003b_f1_u003b((&param_7), (&param_8));\n fog = _e190;\n let _e191 = col;\n let _e192 = mediumColor_u0028_();\n let _e193 = fog;\n col = mix(_e191, _e192, vec3(_e193));\n let _e196 = fog;\n let _e198 = alpha;\n alpha = (_e198 * (1f - _e196));\n let _e200 = col;\n let _e201 = alpha;\n outColor = vec4<f32>(_e200.x, _e200.y, _e200.z, _e201);\n return;\n}\n\n@fragment \nfn main(@location(3) vWorldPos: vec3<f32>, @location(0) vUv: vec2<f32>, @location(1) vSeed: f32, @location(2) vDistance: f32) -> @location(0) vec4<f32> {\n vWorldPos_1 = vWorldPos;\n vUv_1 = vUv;\n vSeed_1 = vSeed;\n vDistance_1 = vDistance;\n main_1();\n let _e9 = outColor;\n return _e9;\n}\n";
2
2
  /**
3
3
  * What the transform assigned, so the renderer binds the same numbers.
4
4
  *
@@ -4,7 +4,7 @@
4
4
  * The GLSL beside this file is the source of truth. A hand edit here is discarded by
5
5
  * the next generation, and `npm run wgsl:check` fails the build when this is stale.
6
6
  */
7
- export const ARCANE_FRAG_WGSL = "struct Uniforms {\n uTime: f32,\n uFogColor: vec3<f32>,\n uFogDensity: f32,\n uFogHeightFalloff: f32,\n uFogEyeY: f32,\n uUnderwaterColor: vec3<f32>,\n uUnderwaterFogDensity: f32,\n uUnderwaterFactor: f32,\n uFogMode: i32,\n uFogNear: f32,\n uFogFar: f32,\n uNoiseOctaves: i32,\n uClipPlane: vec4<f32>,\n uClipEnabled: i32,\n uTint: vec3<f32>,\n}\n\n@group(0) @binding(1) \nvar<uniform> unnamed: Uniforms;\nvar<private> vWorldPos_1: vec3<f32>;\nvar<private> vUv_1: vec2<f32>;\nvar<private> vSeed_1: f32;\nvar<private> vDistance_1: f32;\nvar<private> outColor: vec4<f32>;\n\nfn mediumColor_u0028_() -> vec3<f32> {\n let _e59 = unnamed.uFogColor;\n let _e61 = unnamed.uUnderwaterColor;\n let _e63 = unnamed.uUnderwaterFactor;\n return mix(_e59, _e61, vec3(_e63));\n}\n\nfn mediumFog_u0028_f1_u003b_f1_u003b(dist: ptr<function, f32>, pointY: ptr<function, f32>) -> f32 {\n var span: f32;\n var ramp: f32;\n var wetLinear: f32;\n var t: f32;\n var denom: f32;\n var air: f32;\n var wet: f32;\n\n let _e68 = unnamed.uFogMode;\n if (_e68 == 1i) {\n let _e71 = unnamed.uFogFar;\n let _e73 = unnamed.uFogNear;\n span = max((_e71 - _e73), 0.0001f);\n let _e76 = (*dist);\n let _e78 = unnamed.uFogNear;\n let _e80 = span;\n ramp = clamp(((_e76 - _e78) / _e80), 0f, 1f);\n let _e84 = unnamed.uUnderwaterFactor;\n if (_e84 <= 0f) {\n let _e86 = ramp;\n return _e86;\n }\n let _e88 = unnamed.uUnderwaterFogDensity;\n let _e89 = (*dist);\n wetLinear = (_e88 * _e89);\n let _e91 = ramp;\n let _e92 = wetLinear;\n let _e94 = wetLinear;\n let _e100 = unnamed.uUnderwaterFactor;\n return mix(_e91, (1f - exp2(((-(_e92) * _e94) * 1.442695f))), _e100);\n }\n let _e102 = (*pointY);\n let _e104 = unnamed.uFogEyeY;\n let _e107 = unnamed.uFogHeightFalloff;\n t = ((_e102 - _e104) * _e107);\n let _e109 = t;\n let _e112 = t;\n denom = select(_e112, 0.0001f, (abs(_e109) < 0.0001f));\n let _e115 = unnamed.uFogDensity;\n let _e117 = (*dist);\n let _e119 = denom;\n let _e124 = denom;\n air = (1f - exp((((-(_e115) * _e117) * (1f - exp(-(_e119)))) / _e124)));\n let _e129 = unnamed.uUnderwaterFactor;\n if (_e129 <= 0f) {\n let _e131 = air;\n return _e131;\n }\n let _e133 = unnamed.uUnderwaterFogDensity;\n let _e134 = (*dist);\n wet = (_e133 * _e134);\n let _e136 = air;\n let _e137 = wet;\n let _e139 = wet;\n let _e145 = unnamed.uUnderwaterFactor;\n return mix(_e136, (1f - exp2(((-(_e137) * _e139) * 1.442695f))), _e145);\n}\n\nfn hash21_u0028_vf2_u003b(p: ptr<function, vec2<f32>>) -> f32 {\n let _e59 = (*p);\n return fract((sin(dot(_e59, vec2<f32>(127.1f, 311.7f))) * 43758.547f));\n}\n\nfn valueNoise_u0028_vf2_u003b(p_1: ptr<function, vec2<f32>>) -> f32 {\n var i: vec2<f32>;\n var f: vec2<f32>;\n var u: vec2<f32>;\n var param: vec2<f32>;\n var param_1: vec2<f32>;\n var param_2: vec2<f32>;\n var param_3: vec2<f32>;\n\n let _e66 = (*p_1);\n i = floor(_e66);\n let _e68 = (*p_1);\n f = fract(_e68);\n let _e70 = f;\n let _e71 = f;\n let _e73 = f;\n u = ((_e70 * _e71) * (vec2(3f) - (_e73 * 2f)));\n let _e78 = i;\n param = _e78;\n let _e79 = hash21_u0028_vf2_u003b((&param));\n let _e80 = i;\n param_1 = (_e80 + vec2<f32>(1f, 0f));\n let _e82 = hash21_u0028_vf2_u003b((&param_1));\n let _e84 = u[0u];\n let _e86 = i;\n param_2 = (_e86 + vec2<f32>(0f, 1f));\n let _e88 = hash21_u0028_vf2_u003b((&param_2));\n let _e89 = i;\n param_3 = (_e89 + vec2<f32>(1f, 1f));\n let _e91 = hash21_u0028_vf2_u003b((&param_3));\n let _e93 = u[0u];\n let _e96 = u[1u];\n return mix(mix(_e79, _e82, _e84), mix(_e88, _e91, _e93), _e96);\n}\n\nfn main_1() {\n var radius: f32;\n var d: vec2<f32>;\n var angle: f32;\n var t_1: f32;\n var inner: f32;\n var param_4: vec2<f32>;\n var outer: f32;\n var param_5: vec2<f32>;\n var swirl: f32;\n var param_6: vec2<f32>;\n var core: f32;\n var corona: f32;\n var body: f32;\n var col: vec3<f32>;\n var alpha: f32;\n var fog: f32;\n var param_7: f32;\n var param_8: f32;\n var phi_237_: bool;\n\n let _e77 = unnamed.uClipEnabled;\n let _e78 = (_e77 != 0i);\n phi_237_ = _e78;\n if _e78 {\n let _e79 = vWorldPos_1;\n let _e85 = unnamed.uClipPlane;\n phi_237_ = (dot(vec4<f32>(_e79.x, _e79.y, _e79.z, 1f), _e85) < 0f);\n }\n let _e89 = phi_237_;\n if _e89 {\n discard;\n }\n let _e90 = vUv_1;\n radius = (length((_e90 - vec2(0.5f))) * 2f);\n let _e95 = radius;\n if (_e95 >= 1f) {\n discard;\n }\n let _e97 = vUv_1;\n d = (_e97 - vec2(0.5f));\n let _e101 = d[1u];\n let _e103 = d[0u];\n angle = atan2(_e101, _e103);\n let _e106 = unnamed.uTime;\n let _e107 = vSeed_1;\n t_1 = (_e106 + (_e107 * 37f));\n let _e110 = angle;\n let _e112 = t_1;\n let _e115 = radius;\n param_4 = vec2<f32>(((_e110 * 1.9f) + (_e112 * 0.55f)), (_e115 * 4.2f));\n let _e118 = valueNoise_u0028_vf2_u003b((&param_4));\n inner = _e118;\n let _e119 = angle;\n let _e121 = t_1;\n let _e124 = radius;\n param_5 = vec2<f32>(((_e119 * 3.1f) - (_e121 * 0.34f)), (_e124 * 2.6f));\n let _e127 = valueNoise_u0028_vf2_u003b((&param_5));\n outer = _e127;\n let _e128 = inner;\n let _e130 = outer;\n swirl = ((_e128 * 0.62f) + (_e130 * 0.38f));\n let _e134 = unnamed.uNoiseOctaves;\n if (_e134 > 1i) {\n let _e136 = swirl;\n let _e137 = swirl;\n let _e138 = angle;\n let _e140 = t_1;\n let _e143 = radius;\n param_6 = vec2<f32>(((_e138 * 6.3f) + (_e140 * 0.9f)), (_e143 * 8f));\n let _e146 = valueNoise_u0028_vf2_u003b((&param_6));\n swirl = mix(_e136, ((_e137 * _e146) * 2f), 0.35f);\n }\n let _e150 = radius;\n core = (1f - smoothstep(0f, 0.28f, _e150));\n let _e153 = radius;\n let _e156 = swirl;\n corona = ((1f - smoothstep(0.18f, 1f, _e153)) * (0.35f + (_e156 * 0.65f)));\n let _e160 = core;\n let _e162 = corona;\n body = ((_e160 * 0.9f) + _e162);\n let _e164 = body;\n if (_e164 <= 0.02f) {\n discard;\n }\n let _e167 = unnamed.uTint;\n let _e170 = unnamed.uTint;\n let _e171 = body;\n col = mix((_e167 * 0.35f), _e170, vec3(smoothstep(0f, 0.55f, _e171)));\n let _e175 = col;\n let _e176 = body;\n col = mix(_e175, vec3<f32>(1f, 1f, 1f), vec3(smoothstep(0.82f, 1.4f, _e176)));\n let _e181 = unnamed.uTint;\n let _e182 = col;\n col = (_e182 * _e181);\n let _e184 = body;\n alpha = clamp((_e184 * 1.6f), 0f, 1f);\n let _e187 = vDistance_1;\n param_7 = _e187;\n let _e189 = vWorldPos_1[1u];\n param_8 = _e189;\n let _e190 = mediumFog_u0028_f1_u003b_f1_u003b((&param_7), (&param_8));\n fog = _e190;\n let _e191 = col;\n let _e192 = mediumColor_u0028_();\n let _e193 = fog;\n col = mix(_e191, _e192, vec3(_e193));\n let _e196 = fog;\n let _e198 = alpha;\n alpha = (_e198 * (1f - _e196));\n let _e200 = col;\n let _e201 = alpha;\n outColor = vec4<f32>(_e200.x, _e200.y, _e200.z, _e201);\n return;\n}\n\n@fragment \nfn main(@location(3) vWorldPos: vec3<f32>, @location(0) vUv: vec2<f32>, @location(1) vSeed: f32, @location(2) vDistance: f32) -> @location(0) vec4<f32> {\n vWorldPos_1 = vWorldPos;\n vUv_1 = vUv;\n vSeed_1 = vSeed;\n vDistance_1 = vDistance;\n main_1();\n let _e9 = outColor;\n return _e9;\n}\n";
7
+ export const ARCANE_FRAG_WGSL = "struct Uniforms {\n uTime: f32,\n uFogColor: vec3<f32>,\n uFogDensity: f32,\n uFogHeightFalloff: f32,\n uFogEyeY: f32,\n uUnderwaterColor: vec3<f32>,\n uUnderwaterFogDensity: f32,\n uUnderwaterFactor: f32,\n uFogMode: i32,\n uFogNear: f32,\n uFogFar: f32,\n uNoiseOctaves: i32,\n uClipPlane: vec4<f32>,\n uClipEnabled: i32,\n uTint: vec3<f32>,\n}\n\n@group(0) @binding(1) \nvar<uniform> unnamed: Uniforms;\nvar<private> vWorldPos_1: vec3<f32>;\nvar<private> vUv_1: vec2<f32>;\nvar<private> vSeed_1: f32;\nvar<private> vDistance_1: f32;\nvar<private> outColor: vec4<f32>;\n\nfn mediumColor_u0028_() -> vec3<f32> {\n let _e59 = unnamed.uFogColor;\n let _e61 = unnamed.uUnderwaterColor;\n let _e63 = unnamed.uUnderwaterFactor;\n return mix(_e59, _e61, vec3(_e63));\n}\n\nfn mediumFog_u0028_f1_u003b_f1_u003b(dist: ptr<function, f32>, pointY: ptr<function, f32>) -> f32 {\n var span: f32;\n var ramp: f32;\n var wetLinear: f32;\n var start: f32;\n var before: f32;\n var local: f32;\n var t: f32;\n var rest: f32;\n var denom: f32;\n var air: f32;\n var wet: f32;\n\n let _e72 = unnamed.uFogMode;\n if (_e72 == 1i) {\n let _e75 = unnamed.uFogFar;\n let _e77 = unnamed.uFogNear;\n span = max((_e75 - _e77), 0.0001f);\n let _e80 = (*dist);\n let _e82 = unnamed.uFogNear;\n let _e84 = span;\n ramp = clamp(((_e80 - _e82) / _e84), 0f, 1f);\n let _e88 = unnamed.uUnderwaterFactor;\n if (_e88 <= 0f) {\n let _e90 = ramp;\n return _e90;\n }\n let _e92 = unnamed.uUnderwaterFogDensity;\n let _e93 = (*dist);\n wetLinear = (_e92 * _e93);\n let _e95 = ramp;\n let _e96 = wetLinear;\n let _e98 = wetLinear;\n let _e104 = unnamed.uUnderwaterFactor;\n return mix(_e95, (1f - exp2(((-(_e96) * _e98) * 1.442695f))), _e104);\n }\n let _e107 = unnamed.uFogNear;\n let _e108 = (*dist);\n start = min(_e107, _e108);\n let _e110 = (*dist);\n if (_e110 > 0f) {\n let _e112 = start;\n let _e113 = (*dist);\n local = (_e112 / _e113);\n } else {\n local = 0f;\n }\n let _e115 = local;\n before = _e115;\n let _e116 = (*pointY);\n let _e118 = unnamed.uFogEyeY;\n let _e121 = unnamed.uFogHeightFalloff;\n t = ((_e116 - _e118) * _e121);\n let _e123 = t;\n let _e124 = before;\n rest = (_e123 * (1f - _e124));\n let _e127 = rest;\n let _e130 = rest;\n denom = select(_e130, 0.0001f, (abs(_e127) < 0.0001f));\n let _e133 = unnamed.uFogDensity;\n let _e135 = t;\n let _e137 = before;\n let _e141 = (*dist);\n let _e142 = start;\n let _e145 = denom;\n let _e150 = denom;\n air = (1f - exp(((((-(_e133) * exp((-(_e135) * _e137))) * (_e141 - _e142)) * (1f - exp(-(_e145)))) / _e150)));\n let _e155 = unnamed.uUnderwaterFactor;\n if (_e155 <= 0f) {\n let _e157 = air;\n return _e157;\n }\n let _e159 = unnamed.uUnderwaterFogDensity;\n let _e160 = (*dist);\n wet = (_e159 * _e160);\n let _e162 = air;\n let _e163 = wet;\n let _e165 = wet;\n let _e171 = unnamed.uUnderwaterFactor;\n return mix(_e162, (1f - exp2(((-(_e163) * _e165) * 1.442695f))), _e171);\n}\n\nfn hash21_u0028_vf2_u003b(p: ptr<function, vec2<f32>>) -> f32 {\n let _e59 = (*p);\n return fract((sin(dot(_e59, vec2<f32>(127.1f, 311.7f))) * 43758.547f));\n}\n\nfn valueNoise_u0028_vf2_u003b(p_1: ptr<function, vec2<f32>>) -> f32 {\n var i: vec2<f32>;\n var f: vec2<f32>;\n var u: vec2<f32>;\n var param: vec2<f32>;\n var param_1: vec2<f32>;\n var param_2: vec2<f32>;\n var param_3: vec2<f32>;\n\n let _e66 = (*p_1);\n i = floor(_e66);\n let _e68 = (*p_1);\n f = fract(_e68);\n let _e70 = f;\n let _e71 = f;\n let _e73 = f;\n u = ((_e70 * _e71) * (vec2(3f) - (_e73 * 2f)));\n let _e78 = i;\n param = _e78;\n let _e79 = hash21_u0028_vf2_u003b((&param));\n let _e80 = i;\n param_1 = (_e80 + vec2<f32>(1f, 0f));\n let _e82 = hash21_u0028_vf2_u003b((&param_1));\n let _e84 = u[0u];\n let _e86 = i;\n param_2 = (_e86 + vec2<f32>(0f, 1f));\n let _e88 = hash21_u0028_vf2_u003b((&param_2));\n let _e89 = i;\n param_3 = (_e89 + vec2<f32>(1f, 1f));\n let _e91 = hash21_u0028_vf2_u003b((&param_3));\n let _e93 = u[0u];\n let _e96 = u[1u];\n return mix(mix(_e79, _e82, _e84), mix(_e88, _e91, _e93), _e96);\n}\n\nfn main_1() {\n var radius: f32;\n var d: vec2<f32>;\n var angle: f32;\n var t_1: f32;\n var inner: f32;\n var param_4: vec2<f32>;\n var outer: f32;\n var param_5: vec2<f32>;\n var swirl: f32;\n var param_6: vec2<f32>;\n var core: f32;\n var corona: f32;\n var body: f32;\n var col: vec3<f32>;\n var alpha: f32;\n var fog: f32;\n var param_7: f32;\n var param_8: f32;\n var phi_266_: bool;\n\n let _e77 = unnamed.uClipEnabled;\n let _e78 = (_e77 != 0i);\n phi_266_ = _e78;\n if _e78 {\n let _e79 = vWorldPos_1;\n let _e85 = unnamed.uClipPlane;\n phi_266_ = (dot(vec4<f32>(_e79.x, _e79.y, _e79.z, 1f), _e85) < 0f);\n }\n let _e89 = phi_266_;\n if _e89 {\n discard;\n }\n let _e90 = vUv_1;\n radius = (length((_e90 - vec2(0.5f))) * 2f);\n let _e95 = radius;\n if (_e95 >= 1f) {\n discard;\n }\n let _e97 = vUv_1;\n d = (_e97 - vec2(0.5f));\n let _e101 = d[1u];\n let _e103 = d[0u];\n angle = atan2(_e101, _e103);\n let _e106 = unnamed.uTime;\n let _e107 = vSeed_1;\n t_1 = (_e106 + (_e107 * 37f));\n let _e110 = angle;\n let _e112 = t_1;\n let _e115 = radius;\n param_4 = vec2<f32>(((_e110 * 1.9f) + (_e112 * 0.55f)), (_e115 * 4.2f));\n let _e118 = valueNoise_u0028_vf2_u003b((&param_4));\n inner = _e118;\n let _e119 = angle;\n let _e121 = t_1;\n let _e124 = radius;\n param_5 = vec2<f32>(((_e119 * 3.1f) - (_e121 * 0.34f)), (_e124 * 2.6f));\n let _e127 = valueNoise_u0028_vf2_u003b((&param_5));\n outer = _e127;\n let _e128 = inner;\n let _e130 = outer;\n swirl = ((_e128 * 0.62f) + (_e130 * 0.38f));\n let _e134 = unnamed.uNoiseOctaves;\n if (_e134 > 1i) {\n let _e136 = swirl;\n let _e137 = swirl;\n let _e138 = angle;\n let _e140 = t_1;\n let _e143 = radius;\n param_6 = vec2<f32>(((_e138 * 6.3f) + (_e140 * 0.9f)), (_e143 * 8f));\n let _e146 = valueNoise_u0028_vf2_u003b((&param_6));\n swirl = mix(_e136, ((_e137 * _e146) * 2f), 0.35f);\n }\n let _e150 = radius;\n core = (1f - smoothstep(0f, 0.28f, _e150));\n let _e153 = radius;\n let _e156 = swirl;\n corona = ((1f - smoothstep(0.18f, 1f, _e153)) * (0.35f + (_e156 * 0.65f)));\n let _e160 = core;\n let _e162 = corona;\n body = ((_e160 * 0.9f) + _e162);\n let _e164 = body;\n if (_e164 <= 0.02f) {\n discard;\n }\n let _e167 = unnamed.uTint;\n let _e170 = unnamed.uTint;\n let _e171 = body;\n col = mix((_e167 * 0.35f), _e170, vec3(smoothstep(0f, 0.55f, _e171)));\n let _e175 = col;\n let _e176 = body;\n col = mix(_e175, vec3<f32>(1f, 1f, 1f), vec3(smoothstep(0.82f, 1.4f, _e176)));\n let _e181 = unnamed.uTint;\n let _e182 = col;\n col = (_e182 * _e181);\n let _e184 = body;\n alpha = clamp((_e184 * 1.6f), 0f, 1f);\n let _e187 = vDistance_1;\n param_7 = _e187;\n let _e189 = vWorldPos_1[1u];\n param_8 = _e189;\n let _e190 = mediumFog_u0028_f1_u003b_f1_u003b((&param_7), (&param_8));\n fog = _e190;\n let _e191 = col;\n let _e192 = mediumColor_u0028_();\n let _e193 = fog;\n col = mix(_e191, _e192, vec3(_e193));\n let _e196 = fog;\n let _e198 = alpha;\n alpha = (_e198 * (1f - _e196));\n let _e200 = col;\n let _e201 = alpha;\n outColor = vec4<f32>(_e200.x, _e200.y, _e200.z, _e201);\n return;\n}\n\n@fragment \nfn main(@location(3) vWorldPos: vec3<f32>, @location(0) vUv: vec2<f32>, @location(1) vSeed: f32, @location(2) vDistance: f32) -> @location(0) vec4<f32> {\n vWorldPos_1 = vWorldPos;\n vUv_1 = vUv;\n vSeed_1 = vSeed;\n vDistance_1 = vDistance;\n main_1();\n let _e9 = outColor;\n return _e9;\n}\n";
8
8
  /**
9
9
  * What the transform assigned, so the renderer binds the same numbers.
10
10
  *
@@ -1,4 +1,4 @@
1
- export declare const BOLT_FRAG_WGSL = "struct Uniforms {\n uTime: f32,\n uCoreColor: vec3<f32>,\n uEdgeColor: vec3<f32>,\n uCoreGain: f32,\n uFogColor: vec3<f32>,\n uFogDensity: f32,\n uFogHeightFalloff: f32,\n uFogEyeY: f32,\n uUnderwaterColor: vec3<f32>,\n uUnderwaterFogDensity: f32,\n uUnderwaterFactor: f32,\n uFogMode: i32,\n uFogNear: f32,\n uFogFar: f32,\n uCameraPos: vec3<f32>,\n}\n\n@group(0) @binding(1) \nvar<uniform> unnamed: Uniforms;\nvar<private> vSide_1: f32;\nvar<private> vSeed_1: f32;\nvar<private> vAlong_1: f32;\nvar<private> vFade_1: f32;\nvar<private> vGain_1: f32;\nvar<private> vWorldPos_1: vec3<f32>;\nvar<private> outColor: vec4<f32>;\n\nfn mediumFog_u0028_f1_u003b_f1_u003b(dist: ptr<function, f32>, pointY: ptr<function, f32>) -> f32 {\n var span: f32;\n var ramp: f32;\n var wetLinear: f32;\n var t: f32;\n var denom: f32;\n var air: f32;\n var wet: f32;\n\n let _e48 = unnamed.uFogMode;\n if (_e48 == 1i) {\n let _e51 = unnamed.uFogFar;\n let _e53 = unnamed.uFogNear;\n span = max((_e51 - _e53), 0.0001f);\n let _e56 = (*dist);\n let _e58 = unnamed.uFogNear;\n let _e60 = span;\n ramp = clamp(((_e56 - _e58) / _e60), 0f, 1f);\n let _e64 = unnamed.uUnderwaterFactor;\n if (_e64 <= 0f) {\n let _e66 = ramp;\n return _e66;\n }\n let _e68 = unnamed.uUnderwaterFogDensity;\n let _e69 = (*dist);\n wetLinear = (_e68 * _e69);\n let _e71 = ramp;\n let _e72 = wetLinear;\n let _e74 = wetLinear;\n let _e80 = unnamed.uUnderwaterFactor;\n return mix(_e71, (1f - exp2(((-(_e72) * _e74) * 1.442695f))), _e80);\n }\n let _e82 = (*pointY);\n let _e84 = unnamed.uFogEyeY;\n let _e87 = unnamed.uFogHeightFalloff;\n t = ((_e82 - _e84) * _e87);\n let _e89 = t;\n let _e92 = t;\n denom = select(_e92, 0.0001f, (abs(_e89) < 0.0001f));\n let _e95 = unnamed.uFogDensity;\n let _e97 = (*dist);\n let _e99 = denom;\n let _e104 = denom;\n air = (1f - exp((((-(_e95) * _e97) * (1f - exp(-(_e99)))) / _e104)));\n let _e109 = unnamed.uUnderwaterFactor;\n if (_e109 <= 0f) {\n let _e111 = air;\n return _e111;\n }\n let _e113 = unnamed.uUnderwaterFogDensity;\n let _e114 = (*dist);\n wet = (_e113 * _e114);\n let _e116 = air;\n let _e117 = wet;\n let _e119 = wet;\n let _e125 = unnamed.uUnderwaterFactor;\n return mix(_e116, (1f - exp2(((-(_e117) * _e119) * 1.442695f))), _e125);\n}\n\nfn hash11_u0028_f1_u003b(p: ptr<function, f32>) -> f32 {\n let _e39 = (*p);\n return fract((sin((_e39 * 12.9898f)) * 43758.547f));\n}\n\nfn main_1() {\n var across: f32;\n var core: f32;\n var glow: f32;\n var t_1: f32;\n var stutter: f32;\n var param: f32;\n var param_1: f32;\n var taper: f32;\n var energy: f32;\n var lit: vec3<f32>;\n var fog: f32;\n var param_2: f32;\n var param_3: f32;\n\n let _e51 = vSide_1;\n across = clamp((1f - abs(_e51)), 0f, 1f);\n let _e55 = across;\n core = pow(_e55, 10f);\n let _e57 = across;\n glow = pow(_e57, 1.1f);\n let _e60 = unnamed.uTime;\n let _e62 = vSeed_1;\n t_1 = ((_e60 * 47f) + (_e62 * 17f));\n let _e65 = t_1;\n param = floor(_e65);\n let _e67 = hash11_u0028_f1_u003b((&param));\n let _e69 = t_1;\n param_1 = floor((_e69 * 2.37f));\n let _e72 = hash11_u0028_f1_u003b((&param_1));\n stutter = (0.78f + (0.22f * ((_e67 * 0.6f) + (_e72 * 0.4f))));\n let _e77 = vAlong_1;\n taper = (1f - (_e77 * 0.55f));\n let _e80 = vFade_1;\n let _e81 = stutter;\n let _e83 = taper;\n let _e85 = vGain_1;\n energy = (((_e80 * _e81) * _e83) * _e85);\n let _e88 = unnamed.uEdgeColor;\n let _e89 = glow;\n let _e92 = unnamed.uCoreColor;\n let _e93 = core;\n let _e96 = unnamed.uCoreGain;\n lit = ((_e88 * _e89) + ((_e92 * _e93) * _e96));\n let _e99 = vWorldPos_1;\n let _e101 = unnamed.uCameraPos;\n param_2 = distance(_e99, _e101);\n let _e104 = vWorldPos_1[1u];\n param_3 = _e104;\n let _e105 = mediumFog_u0028_f1_u003b_f1_u003b((&param_2), (&param_3));\n fog = _e105;\n let _e106 = lit;\n let _e107 = energy;\n let _e109 = fog;\n let _e111 = ((_e106 * _e107) * (1f - _e109));\n outColor = vec4<f32>(_e111.x, _e111.y, _e111.z, 1f);\n return;\n}\n\n@fragment \nfn main(@location(0) vSide: f32, @location(3) vSeed: f32, @location(1) vAlong: f32, @location(2) vFade: f32, @location(4) vGain: f32, @location(5) vWorldPos: vec3<f32>) -> @location(0) vec4<f32> {\n vSide_1 = vSide;\n vSeed_1 = vSeed;\n vAlong_1 = vAlong;\n vFade_1 = vFade;\n vGain_1 = vGain;\n vWorldPos_1 = vWorldPos;\n main_1();\n let _e13 = outColor;\n return _e13;\n}\n";
1
+ export declare const BOLT_FRAG_WGSL = "struct Uniforms {\n uTime: f32,\n uCoreColor: vec3<f32>,\n uEdgeColor: vec3<f32>,\n uCoreGain: f32,\n uFogColor: vec3<f32>,\n uFogDensity: f32,\n uFogHeightFalloff: f32,\n uFogEyeY: f32,\n uUnderwaterColor: vec3<f32>,\n uUnderwaterFogDensity: f32,\n uUnderwaterFactor: f32,\n uFogMode: i32,\n uFogNear: f32,\n uFogFar: f32,\n uCameraPos: vec3<f32>,\n}\n\n@group(0) @binding(1) \nvar<uniform> unnamed: Uniforms;\nvar<private> vSide_1: f32;\nvar<private> vSeed_1: f32;\nvar<private> vAlong_1: f32;\nvar<private> vFade_1: f32;\nvar<private> vGain_1: f32;\nvar<private> vWorldPos_1: vec3<f32>;\nvar<private> outColor: vec4<f32>;\n\nfn mediumFog_u0028_f1_u003b_f1_u003b(dist: ptr<function, f32>, pointY: ptr<function, f32>) -> f32 {\n var span: f32;\n var ramp: f32;\n var wetLinear: f32;\n var start: f32;\n var before: f32;\n var local: f32;\n var t: f32;\n var rest: f32;\n var denom: f32;\n var air: f32;\n var wet: f32;\n\n let _e52 = unnamed.uFogMode;\n if (_e52 == 1i) {\n let _e55 = unnamed.uFogFar;\n let _e57 = unnamed.uFogNear;\n span = max((_e55 - _e57), 0.0001f);\n let _e60 = (*dist);\n let _e62 = unnamed.uFogNear;\n let _e64 = span;\n ramp = clamp(((_e60 - _e62) / _e64), 0f, 1f);\n let _e68 = unnamed.uUnderwaterFactor;\n if (_e68 <= 0f) {\n let _e70 = ramp;\n return _e70;\n }\n let _e72 = unnamed.uUnderwaterFogDensity;\n let _e73 = (*dist);\n wetLinear = (_e72 * _e73);\n let _e75 = ramp;\n let _e76 = wetLinear;\n let _e78 = wetLinear;\n let _e84 = unnamed.uUnderwaterFactor;\n return mix(_e75, (1f - exp2(((-(_e76) * _e78) * 1.442695f))), _e84);\n }\n let _e87 = unnamed.uFogNear;\n let _e88 = (*dist);\n start = min(_e87, _e88);\n let _e90 = (*dist);\n if (_e90 > 0f) {\n let _e92 = start;\n let _e93 = (*dist);\n local = (_e92 / _e93);\n } else {\n local = 0f;\n }\n let _e95 = local;\n before = _e95;\n let _e96 = (*pointY);\n let _e98 = unnamed.uFogEyeY;\n let _e101 = unnamed.uFogHeightFalloff;\n t = ((_e96 - _e98) * _e101);\n let _e103 = t;\n let _e104 = before;\n rest = (_e103 * (1f - _e104));\n let _e107 = rest;\n let _e110 = rest;\n denom = select(_e110, 0.0001f, (abs(_e107) < 0.0001f));\n let _e113 = unnamed.uFogDensity;\n let _e115 = t;\n let _e117 = before;\n let _e121 = (*dist);\n let _e122 = start;\n let _e125 = denom;\n let _e130 = denom;\n air = (1f - exp(((((-(_e113) * exp((-(_e115) * _e117))) * (_e121 - _e122)) * (1f - exp(-(_e125)))) / _e130)));\n let _e135 = unnamed.uUnderwaterFactor;\n if (_e135 <= 0f) {\n let _e137 = air;\n return _e137;\n }\n let _e139 = unnamed.uUnderwaterFogDensity;\n let _e140 = (*dist);\n wet = (_e139 * _e140);\n let _e142 = air;\n let _e143 = wet;\n let _e145 = wet;\n let _e151 = unnamed.uUnderwaterFactor;\n return mix(_e142, (1f - exp2(((-(_e143) * _e145) * 1.442695f))), _e151);\n}\n\nfn hash11_u0028_f1_u003b(p: ptr<function, f32>) -> f32 {\n let _e39 = (*p);\n return fract((sin((_e39 * 12.9898f)) * 43758.547f));\n}\n\nfn main_1() {\n var across: f32;\n var core: f32;\n var glow: f32;\n var t_1: f32;\n var stutter: f32;\n var param: f32;\n var param_1: f32;\n var taper: f32;\n var energy: f32;\n var lit: vec3<f32>;\n var fog: f32;\n var param_2: f32;\n var param_3: f32;\n\n let _e51 = vSide_1;\n across = clamp((1f - abs(_e51)), 0f, 1f);\n let _e55 = across;\n core = pow(_e55, 10f);\n let _e57 = across;\n glow = pow(_e57, 1.1f);\n let _e60 = unnamed.uTime;\n let _e62 = vSeed_1;\n t_1 = ((_e60 * 47f) + (_e62 * 17f));\n let _e65 = t_1;\n param = floor(_e65);\n let _e67 = hash11_u0028_f1_u003b((&param));\n let _e69 = t_1;\n param_1 = floor((_e69 * 2.37f));\n let _e72 = hash11_u0028_f1_u003b((&param_1));\n stutter = (0.78f + (0.22f * ((_e67 * 0.6f) + (_e72 * 0.4f))));\n let _e77 = vAlong_1;\n taper = (1f - (_e77 * 0.55f));\n let _e80 = vFade_1;\n let _e81 = stutter;\n let _e83 = taper;\n let _e85 = vGain_1;\n energy = (((_e80 * _e81) * _e83) * _e85);\n let _e88 = unnamed.uEdgeColor;\n let _e89 = glow;\n let _e92 = unnamed.uCoreColor;\n let _e93 = core;\n let _e96 = unnamed.uCoreGain;\n lit = ((_e88 * _e89) + ((_e92 * _e93) * _e96));\n let _e99 = vWorldPos_1;\n let _e101 = unnamed.uCameraPos;\n param_2 = distance(_e99, _e101);\n let _e104 = vWorldPos_1[1u];\n param_3 = _e104;\n let _e105 = mediumFog_u0028_f1_u003b_f1_u003b((&param_2), (&param_3));\n fog = _e105;\n let _e106 = lit;\n let _e107 = energy;\n let _e109 = fog;\n let _e111 = ((_e106 * _e107) * (1f - _e109));\n outColor = vec4<f32>(_e111.x, _e111.y, _e111.z, 1f);\n return;\n}\n\n@fragment \nfn main(@location(0) vSide: f32, @location(3) vSeed: f32, @location(1) vAlong: f32, @location(2) vFade: f32, @location(4) vGain: f32, @location(5) vWorldPos: vec3<f32>) -> @location(0) vec4<f32> {\n vSide_1 = vSide;\n vSeed_1 = vSeed;\n vAlong_1 = vAlong;\n vFade_1 = vFade;\n vGain_1 = vGain;\n vWorldPos_1 = vWorldPos;\n main_1();\n let _e13 = outColor;\n return _e13;\n}\n";
2
2
  export declare const BOLT_VERT_WGSL = "struct Uniforms {\n uViewProj: mat4x4<f32>,\n uCameraPos: vec3<f32>,\n uWidth: f32,\n uMinWidthPerMetre: 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: f32,\n @location(1) member_1: f32,\n @location(2) member_2: f32,\n @location(3) member_3: f32,\n @location(4) member_4: f32,\n @location(5) member_5: vec3<f32>,\n @builtin(position) gl_Position: vec4<f32>,\n}\n\nvar<private> aFrom_1: vec3<f32>;\nvar<private> aTo_1: vec3<f32>;\nvar<private> aCorner_1: vec2<f32>;\n@group(0) @binding(0) \nvar<uniform> unnamed: Uniforms;\nvar<private> vSide: f32;\nvar<private> vAlong: f32;\nvar<private> aArc_1: vec4<f32>;\nvar<private> vFade: f32;\nvar<private> vSeed: f32;\nvar<private> vGain: f32;\nvar<private> vWorldPos: vec3<f32>;\nvar<private> unnamed_1: gl_PerVertex = gl_PerVertex(vec4<f32>(0f, 0f, 0f, 1f), 1f);\n\nfn main_1() {\n var mid: vec3<f32>;\n var dir: vec3<f32>;\n var len: f32;\n var local: vec3<f32>;\n var view: vec3<f32>;\n var dist: f32;\n var local_1: vec3<f32>;\n var across: vec3<f32>;\n var span: f32;\n var local_2: vec3<f32>;\n var halfWidth: f32;\n var world: vec3<f32>;\n\n let _e40 = aFrom_1;\n let _e41 = aTo_1;\n let _e43 = aCorner_1[0u];\n mid = mix(_e40, _e41, vec3(_e43));\n let _e46 = aTo_1;\n let _e47 = aFrom_1;\n dir = (_e46 - _e47);\n let _e49 = dir;\n len = length(_e49);\n let _e51 = len;\n if (_e51 > 0.000001f) {\n let _e53 = dir;\n let _e54 = len;\n local = (_e53 / vec3(_e54));\n } else {\n local = vec3<f32>(0f, 1f, 0f);\n }\n let _e57 = local;\n dir = _e57;\n let _e58 = mid;\n let _e60 = unnamed.uCameraPos;\n view = (_e58 - _e60);\n let _e62 = view;\n dist = length(_e62);\n let _e64 = dist;\n if (_e64 > 0.000001f) {\n let _e66 = view;\n let _e67 = dist;\n local_1 = (_e66 / vec3(_e67));\n } else {\n local_1 = vec3<f32>(0f, 0f, 1f);\n }\n let _e70 = local_1;\n view = _e70;\n let _e71 = dir;\n let _e72 = view;\n across = cross(_e71, _e72);\n let _e74 = across;\n span = length(_e74);\n let _e76 = span;\n if (_e76 > 0.0001f) {\n let _e78 = across;\n let _e79 = span;\n local_2 = (_e78 / vec3(_e79));\n } else {\n let _e82 = dir;\n local_2 = normalize((cross(_e82, vec3<f32>(0f, 1f, 0f)) + vec3<f32>(0.001f, 0.001f, 0.001f)));\n }\n let _e86 = local_2;\n across = _e86;\n let _e88 = unnamed.uWidth;\n let _e89 = dist;\n let _e91 = unnamed.uMinWidthPerMetre;\n halfWidth = max(_e88, (_e89 * _e91));\n let _e94 = mid;\n let _e95 = across;\n let _e97 = aCorner_1[1u];\n let _e99 = halfWidth;\n world = (_e94 + ((_e95 * _e97) * _e99));\n let _e103 = aCorner_1[1u];\n vSide = _e103;\n let _e105 = aArc_1[0u];\n vAlong = _e105;\n let _e107 = aArc_1[1u];\n vFade = _e107;\n let _e109 = aArc_1[2u];\n vSeed = _e109;\n let _e111 = aArc_1[3u];\n vGain = _e111;\n let _e112 = world;\n vWorldPos = _e112;\n let _e114 = unnamed.uViewProj;\n let _e115 = world;\n unnamed_1.gl_Position = (_e114 * vec4<f32>(_e115.x, _e115.y, _e115.z, 1f));\n return;\n}\n\n@vertex \nfn main(@location(0) aFrom: vec3<f32>, @location(1) aTo: vec3<f32>, @location(2) aCorner: vec2<f32>, @location(3) aArc: vec4<f32>) -> VertexOutput {\n aFrom_1 = aFrom;\n aTo_1 = aTo;\n aCorner_1 = aCorner;\n aArc_1 = aArc;\n main_1();\n let _e17 = unnamed_1.gl_Position.y;\n unnamed_1.gl_Position.y = -(_e17);\n let _e19 = vSide;\n let _e20 = vAlong;\n let _e21 = vFade;\n let _e22 = vSeed;\n let _e23 = vGain;\n let _e24 = vWorldPos;\n let _e25 = unnamed_1.gl_Position;\n return VertexOutput(_e19, _e20, _e21, _e22, _e23, _e24, _e25);\n}\n";
3
3
  /**
4
4
  * What the transform assigned, so the renderer binds the same numbers.
@@ -4,7 +4,7 @@
4
4
  * The GLSL beside this file is the source of truth. A hand edit here is discarded by
5
5
  * the next generation, and `npm run wgsl:check` fails the build when this is stale.
6
6
  */
7
- export const BOLT_FRAG_WGSL = "struct Uniforms {\n uTime: f32,\n uCoreColor: vec3<f32>,\n uEdgeColor: vec3<f32>,\n uCoreGain: f32,\n uFogColor: vec3<f32>,\n uFogDensity: f32,\n uFogHeightFalloff: f32,\n uFogEyeY: f32,\n uUnderwaterColor: vec3<f32>,\n uUnderwaterFogDensity: f32,\n uUnderwaterFactor: f32,\n uFogMode: i32,\n uFogNear: f32,\n uFogFar: f32,\n uCameraPos: vec3<f32>,\n}\n\n@group(0) @binding(1) \nvar<uniform> unnamed: Uniforms;\nvar<private> vSide_1: f32;\nvar<private> vSeed_1: f32;\nvar<private> vAlong_1: f32;\nvar<private> vFade_1: f32;\nvar<private> vGain_1: f32;\nvar<private> vWorldPos_1: vec3<f32>;\nvar<private> outColor: vec4<f32>;\n\nfn mediumFog_u0028_f1_u003b_f1_u003b(dist: ptr<function, f32>, pointY: ptr<function, f32>) -> f32 {\n var span: f32;\n var ramp: f32;\n var wetLinear: f32;\n var t: f32;\n var denom: f32;\n var air: f32;\n var wet: f32;\n\n let _e48 = unnamed.uFogMode;\n if (_e48 == 1i) {\n let _e51 = unnamed.uFogFar;\n let _e53 = unnamed.uFogNear;\n span = max((_e51 - _e53), 0.0001f);\n let _e56 = (*dist);\n let _e58 = unnamed.uFogNear;\n let _e60 = span;\n ramp = clamp(((_e56 - _e58) / _e60), 0f, 1f);\n let _e64 = unnamed.uUnderwaterFactor;\n if (_e64 <= 0f) {\n let _e66 = ramp;\n return _e66;\n }\n let _e68 = unnamed.uUnderwaterFogDensity;\n let _e69 = (*dist);\n wetLinear = (_e68 * _e69);\n let _e71 = ramp;\n let _e72 = wetLinear;\n let _e74 = wetLinear;\n let _e80 = unnamed.uUnderwaterFactor;\n return mix(_e71, (1f - exp2(((-(_e72) * _e74) * 1.442695f))), _e80);\n }\n let _e82 = (*pointY);\n let _e84 = unnamed.uFogEyeY;\n let _e87 = unnamed.uFogHeightFalloff;\n t = ((_e82 - _e84) * _e87);\n let _e89 = t;\n let _e92 = t;\n denom = select(_e92, 0.0001f, (abs(_e89) < 0.0001f));\n let _e95 = unnamed.uFogDensity;\n let _e97 = (*dist);\n let _e99 = denom;\n let _e104 = denom;\n air = (1f - exp((((-(_e95) * _e97) * (1f - exp(-(_e99)))) / _e104)));\n let _e109 = unnamed.uUnderwaterFactor;\n if (_e109 <= 0f) {\n let _e111 = air;\n return _e111;\n }\n let _e113 = unnamed.uUnderwaterFogDensity;\n let _e114 = (*dist);\n wet = (_e113 * _e114);\n let _e116 = air;\n let _e117 = wet;\n let _e119 = wet;\n let _e125 = unnamed.uUnderwaterFactor;\n return mix(_e116, (1f - exp2(((-(_e117) * _e119) * 1.442695f))), _e125);\n}\n\nfn hash11_u0028_f1_u003b(p: ptr<function, f32>) -> f32 {\n let _e39 = (*p);\n return fract((sin((_e39 * 12.9898f)) * 43758.547f));\n}\n\nfn main_1() {\n var across: f32;\n var core: f32;\n var glow: f32;\n var t_1: f32;\n var stutter: f32;\n var param: f32;\n var param_1: f32;\n var taper: f32;\n var energy: f32;\n var lit: vec3<f32>;\n var fog: f32;\n var param_2: f32;\n var param_3: f32;\n\n let _e51 = vSide_1;\n across = clamp((1f - abs(_e51)), 0f, 1f);\n let _e55 = across;\n core = pow(_e55, 10f);\n let _e57 = across;\n glow = pow(_e57, 1.1f);\n let _e60 = unnamed.uTime;\n let _e62 = vSeed_1;\n t_1 = ((_e60 * 47f) + (_e62 * 17f));\n let _e65 = t_1;\n param = floor(_e65);\n let _e67 = hash11_u0028_f1_u003b((&param));\n let _e69 = t_1;\n param_1 = floor((_e69 * 2.37f));\n let _e72 = hash11_u0028_f1_u003b((&param_1));\n stutter = (0.78f + (0.22f * ((_e67 * 0.6f) + (_e72 * 0.4f))));\n let _e77 = vAlong_1;\n taper = (1f - (_e77 * 0.55f));\n let _e80 = vFade_1;\n let _e81 = stutter;\n let _e83 = taper;\n let _e85 = vGain_1;\n energy = (((_e80 * _e81) * _e83) * _e85);\n let _e88 = unnamed.uEdgeColor;\n let _e89 = glow;\n let _e92 = unnamed.uCoreColor;\n let _e93 = core;\n let _e96 = unnamed.uCoreGain;\n lit = ((_e88 * _e89) + ((_e92 * _e93) * _e96));\n let _e99 = vWorldPos_1;\n let _e101 = unnamed.uCameraPos;\n param_2 = distance(_e99, _e101);\n let _e104 = vWorldPos_1[1u];\n param_3 = _e104;\n let _e105 = mediumFog_u0028_f1_u003b_f1_u003b((&param_2), (&param_3));\n fog = _e105;\n let _e106 = lit;\n let _e107 = energy;\n let _e109 = fog;\n let _e111 = ((_e106 * _e107) * (1f - _e109));\n outColor = vec4<f32>(_e111.x, _e111.y, _e111.z, 1f);\n return;\n}\n\n@fragment \nfn main(@location(0) vSide: f32, @location(3) vSeed: f32, @location(1) vAlong: f32, @location(2) vFade: f32, @location(4) vGain: f32, @location(5) vWorldPos: vec3<f32>) -> @location(0) vec4<f32> {\n vSide_1 = vSide;\n vSeed_1 = vSeed;\n vAlong_1 = vAlong;\n vFade_1 = vFade;\n vGain_1 = vGain;\n vWorldPos_1 = vWorldPos;\n main_1();\n let _e13 = outColor;\n return _e13;\n}\n";
7
+ export const BOLT_FRAG_WGSL = "struct Uniforms {\n uTime: f32,\n uCoreColor: vec3<f32>,\n uEdgeColor: vec3<f32>,\n uCoreGain: f32,\n uFogColor: vec3<f32>,\n uFogDensity: f32,\n uFogHeightFalloff: f32,\n uFogEyeY: f32,\n uUnderwaterColor: vec3<f32>,\n uUnderwaterFogDensity: f32,\n uUnderwaterFactor: f32,\n uFogMode: i32,\n uFogNear: f32,\n uFogFar: f32,\n uCameraPos: vec3<f32>,\n}\n\n@group(0) @binding(1) \nvar<uniform> unnamed: Uniforms;\nvar<private> vSide_1: f32;\nvar<private> vSeed_1: f32;\nvar<private> vAlong_1: f32;\nvar<private> vFade_1: f32;\nvar<private> vGain_1: f32;\nvar<private> vWorldPos_1: vec3<f32>;\nvar<private> outColor: vec4<f32>;\n\nfn mediumFog_u0028_f1_u003b_f1_u003b(dist: ptr<function, f32>, pointY: ptr<function, f32>) -> f32 {\n var span: f32;\n var ramp: f32;\n var wetLinear: f32;\n var start: f32;\n var before: f32;\n var local: f32;\n var t: f32;\n var rest: f32;\n var denom: f32;\n var air: f32;\n var wet: f32;\n\n let _e52 = unnamed.uFogMode;\n if (_e52 == 1i) {\n let _e55 = unnamed.uFogFar;\n let _e57 = unnamed.uFogNear;\n span = max((_e55 - _e57), 0.0001f);\n let _e60 = (*dist);\n let _e62 = unnamed.uFogNear;\n let _e64 = span;\n ramp = clamp(((_e60 - _e62) / _e64), 0f, 1f);\n let _e68 = unnamed.uUnderwaterFactor;\n if (_e68 <= 0f) {\n let _e70 = ramp;\n return _e70;\n }\n let _e72 = unnamed.uUnderwaterFogDensity;\n let _e73 = (*dist);\n wetLinear = (_e72 * _e73);\n let _e75 = ramp;\n let _e76 = wetLinear;\n let _e78 = wetLinear;\n let _e84 = unnamed.uUnderwaterFactor;\n return mix(_e75, (1f - exp2(((-(_e76) * _e78) * 1.442695f))), _e84);\n }\n let _e87 = unnamed.uFogNear;\n let _e88 = (*dist);\n start = min(_e87, _e88);\n let _e90 = (*dist);\n if (_e90 > 0f) {\n let _e92 = start;\n let _e93 = (*dist);\n local = (_e92 / _e93);\n } else {\n local = 0f;\n }\n let _e95 = local;\n before = _e95;\n let _e96 = (*pointY);\n let _e98 = unnamed.uFogEyeY;\n let _e101 = unnamed.uFogHeightFalloff;\n t = ((_e96 - _e98) * _e101);\n let _e103 = t;\n let _e104 = before;\n rest = (_e103 * (1f - _e104));\n let _e107 = rest;\n let _e110 = rest;\n denom = select(_e110, 0.0001f, (abs(_e107) < 0.0001f));\n let _e113 = unnamed.uFogDensity;\n let _e115 = t;\n let _e117 = before;\n let _e121 = (*dist);\n let _e122 = start;\n let _e125 = denom;\n let _e130 = denom;\n air = (1f - exp(((((-(_e113) * exp((-(_e115) * _e117))) * (_e121 - _e122)) * (1f - exp(-(_e125)))) / _e130)));\n let _e135 = unnamed.uUnderwaterFactor;\n if (_e135 <= 0f) {\n let _e137 = air;\n return _e137;\n }\n let _e139 = unnamed.uUnderwaterFogDensity;\n let _e140 = (*dist);\n wet = (_e139 * _e140);\n let _e142 = air;\n let _e143 = wet;\n let _e145 = wet;\n let _e151 = unnamed.uUnderwaterFactor;\n return mix(_e142, (1f - exp2(((-(_e143) * _e145) * 1.442695f))), _e151);\n}\n\nfn hash11_u0028_f1_u003b(p: ptr<function, f32>) -> f32 {\n let _e39 = (*p);\n return fract((sin((_e39 * 12.9898f)) * 43758.547f));\n}\n\nfn main_1() {\n var across: f32;\n var core: f32;\n var glow: f32;\n var t_1: f32;\n var stutter: f32;\n var param: f32;\n var param_1: f32;\n var taper: f32;\n var energy: f32;\n var lit: vec3<f32>;\n var fog: f32;\n var param_2: f32;\n var param_3: f32;\n\n let _e51 = vSide_1;\n across = clamp((1f - abs(_e51)), 0f, 1f);\n let _e55 = across;\n core = pow(_e55, 10f);\n let _e57 = across;\n glow = pow(_e57, 1.1f);\n let _e60 = unnamed.uTime;\n let _e62 = vSeed_1;\n t_1 = ((_e60 * 47f) + (_e62 * 17f));\n let _e65 = t_1;\n param = floor(_e65);\n let _e67 = hash11_u0028_f1_u003b((&param));\n let _e69 = t_1;\n param_1 = floor((_e69 * 2.37f));\n let _e72 = hash11_u0028_f1_u003b((&param_1));\n stutter = (0.78f + (0.22f * ((_e67 * 0.6f) + (_e72 * 0.4f))));\n let _e77 = vAlong_1;\n taper = (1f - (_e77 * 0.55f));\n let _e80 = vFade_1;\n let _e81 = stutter;\n let _e83 = taper;\n let _e85 = vGain_1;\n energy = (((_e80 * _e81) * _e83) * _e85);\n let _e88 = unnamed.uEdgeColor;\n let _e89 = glow;\n let _e92 = unnamed.uCoreColor;\n let _e93 = core;\n let _e96 = unnamed.uCoreGain;\n lit = ((_e88 * _e89) + ((_e92 * _e93) * _e96));\n let _e99 = vWorldPos_1;\n let _e101 = unnamed.uCameraPos;\n param_2 = distance(_e99, _e101);\n let _e104 = vWorldPos_1[1u];\n param_3 = _e104;\n let _e105 = mediumFog_u0028_f1_u003b_f1_u003b((&param_2), (&param_3));\n fog = _e105;\n let _e106 = lit;\n let _e107 = energy;\n let _e109 = fog;\n let _e111 = ((_e106 * _e107) * (1f - _e109));\n outColor = vec4<f32>(_e111.x, _e111.y, _e111.z, 1f);\n return;\n}\n\n@fragment \nfn main(@location(0) vSide: f32, @location(3) vSeed: f32, @location(1) vAlong: f32, @location(2) vFade: f32, @location(4) vGain: f32, @location(5) vWorldPos: vec3<f32>) -> @location(0) vec4<f32> {\n vSide_1 = vSide;\n vSeed_1 = vSeed;\n vAlong_1 = vAlong;\n vFade_1 = vFade;\n vGain_1 = vGain;\n vWorldPos_1 = vWorldPos;\n main_1();\n let _e13 = outColor;\n return _e13;\n}\n";
8
8
  export const BOLT_VERT_WGSL = "struct Uniforms {\n uViewProj: mat4x4<f32>,\n uCameraPos: vec3<f32>,\n uWidth: f32,\n uMinWidthPerMetre: 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: f32,\n @location(1) member_1: f32,\n @location(2) member_2: f32,\n @location(3) member_3: f32,\n @location(4) member_4: f32,\n @location(5) member_5: vec3<f32>,\n @builtin(position) gl_Position: vec4<f32>,\n}\n\nvar<private> aFrom_1: vec3<f32>;\nvar<private> aTo_1: vec3<f32>;\nvar<private> aCorner_1: vec2<f32>;\n@group(0) @binding(0) \nvar<uniform> unnamed: Uniforms;\nvar<private> vSide: f32;\nvar<private> vAlong: f32;\nvar<private> aArc_1: vec4<f32>;\nvar<private> vFade: f32;\nvar<private> vSeed: f32;\nvar<private> vGain: f32;\nvar<private> vWorldPos: vec3<f32>;\nvar<private> unnamed_1: gl_PerVertex = gl_PerVertex(vec4<f32>(0f, 0f, 0f, 1f), 1f);\n\nfn main_1() {\n var mid: vec3<f32>;\n var dir: vec3<f32>;\n var len: f32;\n var local: vec3<f32>;\n var view: vec3<f32>;\n var dist: f32;\n var local_1: vec3<f32>;\n var across: vec3<f32>;\n var span: f32;\n var local_2: vec3<f32>;\n var halfWidth: f32;\n var world: vec3<f32>;\n\n let _e40 = aFrom_1;\n let _e41 = aTo_1;\n let _e43 = aCorner_1[0u];\n mid = mix(_e40, _e41, vec3(_e43));\n let _e46 = aTo_1;\n let _e47 = aFrom_1;\n dir = (_e46 - _e47);\n let _e49 = dir;\n len = length(_e49);\n let _e51 = len;\n if (_e51 > 0.000001f) {\n let _e53 = dir;\n let _e54 = len;\n local = (_e53 / vec3(_e54));\n } else {\n local = vec3<f32>(0f, 1f, 0f);\n }\n let _e57 = local;\n dir = _e57;\n let _e58 = mid;\n let _e60 = unnamed.uCameraPos;\n view = (_e58 - _e60);\n let _e62 = view;\n dist = length(_e62);\n let _e64 = dist;\n if (_e64 > 0.000001f) {\n let _e66 = view;\n let _e67 = dist;\n local_1 = (_e66 / vec3(_e67));\n } else {\n local_1 = vec3<f32>(0f, 0f, 1f);\n }\n let _e70 = local_1;\n view = _e70;\n let _e71 = dir;\n let _e72 = view;\n across = cross(_e71, _e72);\n let _e74 = across;\n span = length(_e74);\n let _e76 = span;\n if (_e76 > 0.0001f) {\n let _e78 = across;\n let _e79 = span;\n local_2 = (_e78 / vec3(_e79));\n } else {\n let _e82 = dir;\n local_2 = normalize((cross(_e82, vec3<f32>(0f, 1f, 0f)) + vec3<f32>(0.001f, 0.001f, 0.001f)));\n }\n let _e86 = local_2;\n across = _e86;\n let _e88 = unnamed.uWidth;\n let _e89 = dist;\n let _e91 = unnamed.uMinWidthPerMetre;\n halfWidth = max(_e88, (_e89 * _e91));\n let _e94 = mid;\n let _e95 = across;\n let _e97 = aCorner_1[1u];\n let _e99 = halfWidth;\n world = (_e94 + ((_e95 * _e97) * _e99));\n let _e103 = aCorner_1[1u];\n vSide = _e103;\n let _e105 = aArc_1[0u];\n vAlong = _e105;\n let _e107 = aArc_1[1u];\n vFade = _e107;\n let _e109 = aArc_1[2u];\n vSeed = _e109;\n let _e111 = aArc_1[3u];\n vGain = _e111;\n let _e112 = world;\n vWorldPos = _e112;\n let _e114 = unnamed.uViewProj;\n let _e115 = world;\n unnamed_1.gl_Position = (_e114 * vec4<f32>(_e115.x, _e115.y, _e115.z, 1f));\n return;\n}\n\n@vertex \nfn main(@location(0) aFrom: vec3<f32>, @location(1) aTo: vec3<f32>, @location(2) aCorner: vec2<f32>, @location(3) aArc: vec4<f32>) -> VertexOutput {\n aFrom_1 = aFrom;\n aTo_1 = aTo;\n aCorner_1 = aCorner;\n aArc_1 = aArc;\n main_1();\n let _e17 = unnamed_1.gl_Position.y;\n unnamed_1.gl_Position.y = -(_e17);\n let _e19 = vSide;\n let _e20 = vAlong;\n let _e21 = vFade;\n let _e22 = vSeed;\n let _e23 = vGain;\n let _e24 = vWorldPos;\n let _e25 = unnamed_1.gl_Position;\n return VertexOutput(_e19, _e20, _e21, _e22, _e23, _e24, _e25);\n}\n";
9
9
  /**
10
10
  * What the transform assigned, so the renderer binds the same numbers.