@driftengine/core 4.13.3 → 4.13.5

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 (153) hide show
  1. package/CHANGELOG.json +52 -0
  2. package/README.md +1 -1
  3. package/dist/index.d.ts +3 -2
  4. package/dist/render/anisotropicLobe.d.ts +5 -0
  5. package/dist/render/anisotropicLobe.js +13 -0
  6. package/dist/render/atmosphere.d.ts +79 -1
  7. package/dist/render/atmosphere.js +66 -19
  8. package/dist/render/backend/webgl2/renderer.d.ts +34 -2
  9. package/dist/render/backend/webgl2/renderer.js +44 -12
  10. package/dist/render/backend/webgpu/boltPass.d.ts +1 -1
  11. package/dist/render/backend/webgpu/causticsPass.d.ts +1 -1
  12. package/dist/render/backend/webgpu/clothSetPack.js +1 -0
  13. package/dist/render/backend/webgpu/clothSolvePack.d.ts +5 -2
  14. package/dist/render/backend/webgpu/clothSolvePack.js +2 -1
  15. package/dist/render/backend/webgpu/filmPass.d.ts +1 -1
  16. package/dist/render/backend/webgpu/gpuClothSet.js +1 -1
  17. package/dist/render/backend/webgpu/gpuDrivenPass.js +20 -3
  18. package/dist/render/backend/webgpu/linePass.d.ts +1 -1
  19. package/dist/render/backend/webgpu/mediumFields.d.ts +17 -0
  20. package/dist/render/backend/webgpu/mediumFields.js +74 -0
  21. package/dist/render/backend/webgpu/plumePass.d.ts +3 -3
  22. package/dist/render/backend/webgpu/postPass.d.ts +7 -2
  23. package/dist/render/backend/webgpu/renderer.d.ts +13 -3
  24. package/dist/render/backend/webgpu/renderer.js +86 -150
  25. package/dist/render/backend/webgpu/scatterPass.d.ts +1 -1
  26. package/dist/render/backend/webgpu/shaders/clothSolve.wgsl.d.ts +1 -1
  27. package/dist/render/backend/webgpu/shaders/clothSolve.wgsl.js +7 -5
  28. package/dist/render/backend/webgpu/waterPass.d.ts +1 -1
  29. package/dist/render/environmentMixing.d.ts +18 -0
  30. package/dist/render/environmentMixing.js +40 -0
  31. package/dist/render/fog.d.ts +43 -1
  32. package/dist/render/fog.js +87 -22
  33. package/dist/render/globalMedium.d.ts +112 -10
  34. package/dist/render/globalMedium.js +96 -1
  35. package/dist/render/globalMediumPass.d.ts +7 -3
  36. package/dist/render/globalMediumPass.js +22 -1
  37. package/dist/render/hairLobes.d.ts +27 -2
  38. package/dist/render/hairLobes.js +57 -4
  39. package/dist/render/lightBudget.d.ts +12 -0
  40. package/dist/render/lightBudget.js +24 -0
  41. package/dist/render/sceneTarget.d.ts +5 -3
  42. package/dist/render/sceneTarget.js +14 -8
  43. package/dist/render/shaders/arcane.d.ts +1 -1
  44. package/dist/render/shaders/bolt.d.ts +1 -1
  45. package/dist/render/shaders/caustics.d.ts +1 -1
  46. package/dist/render/shaders/film.d.ts +1 -1
  47. package/dist/render/shaders/film.js +4 -1
  48. package/dist/render/shaders/fire.d.ts +1 -1
  49. package/dist/render/shaders/flat/anisotropic.d.ts +8 -1
  50. package/dist/render/shaders/flat/anisotropic.js +25 -3
  51. package/dist/render/shaders/flat/hair.js +77 -27
  52. package/dist/render/shaders/flat/main.d.ts +1 -1
  53. package/dist/render/shaders/flat/main.js +23 -3
  54. package/dist/render/shaders/flat/models.js +12 -5
  55. package/dist/render/shaders/flat/preamble.js +7 -0
  56. package/dist/render/shaders/fog.d.ts +4 -4
  57. package/dist/render/shaders/fog.js +81 -32
  58. package/dist/render/shaders/generated/arcane.wgsl.d.ts +29 -39
  59. package/dist/render/shaders/generated/arcane.wgsl.js +29 -39
  60. package/dist/render/shaders/generated/bolt.wgsl.d.ts +26 -36
  61. package/dist/render/shaders/generated/bolt.wgsl.js +26 -36
  62. package/dist/render/shaders/generated/caustics.wgsl.d.ts +25 -35
  63. package/dist/render/shaders/generated/caustics.wgsl.js +25 -35
  64. package/dist/render/shaders/generated/film.wgsl.d.ts +28 -38
  65. package/dist/render/shaders/generated/film.wgsl.js +28 -38
  66. package/dist/render/shaders/generated/fire.wgsl.d.ts +28 -38
  67. package/dist/render/shaders/generated/fire.wgsl.js +28 -38
  68. package/dist/render/shaders/generated/flat.wgsl.d.ts +1466 -1546
  69. package/dist/render/shaders/generated/flat.wgsl.js +1489 -1569
  70. package/dist/render/shaders/generated/globalMedium.wgsl.d.ts +98 -12
  71. package/dist/render/shaders/generated/globalMedium.wgsl.js +98 -12
  72. package/dist/render/shaders/generated/line.wgsl.d.ts +25 -35
  73. package/dist/render/shaders/generated/line.wgsl.js +25 -35
  74. package/dist/render/shaders/generated/particle.wgsl.d.ts +100 -140
  75. package/dist/render/shaders/generated/particle.wgsl.js +100 -140
  76. package/dist/render/shaders/generated/rush.wgsl.d.ts +20 -10
  77. package/dist/render/shaders/generated/rush.wgsl.js +20 -10
  78. package/dist/render/shaders/generated/scatter.wgsl.d.ts +25 -35
  79. package/dist/render/shaders/generated/scatter.wgsl.js +25 -35
  80. package/dist/render/shaders/generated/smoke.wgsl.d.ts +28 -38
  81. package/dist/render/shaders/generated/smoke.wgsl.js +28 -38
  82. package/dist/render/shaders/generated/water.wgsl.d.ts +29 -39
  83. package/dist/render/shaders/generated/water.wgsl.js +29 -39
  84. package/dist/render/shaders/globalMedium.js +114 -10
  85. package/dist/render/shaders/gpudriven/blendRaster.wgsl.js +2 -1
  86. package/dist/render/shaders/gpudriven/fog.wgsl.d.ts +10 -4
  87. package/dist/render/shaders/gpudriven/fog.wgsl.js +77 -19
  88. package/dist/render/shaders/gpudriven/frameBlock.wgsl.d.ts +1 -1
  89. package/dist/render/shaders/gpudriven/frameBlock.wgsl.js +12 -1
  90. package/dist/render/shaders/gpudriven/shade.wgsl.js +3 -1
  91. package/dist/render/shaders/line.d.ts +1 -1
  92. package/dist/render/shaders/line.js +4 -2
  93. package/dist/render/shaders/localExposure.d.ts +42 -1
  94. package/dist/render/shaders/localExposure.js +73 -6
  95. package/dist/render/shaders/particle.d.ts +3 -3
  96. package/dist/render/shaders/particle.js +10 -6
  97. package/dist/render/shaders/scatter.d.ts +1 -1
  98. package/dist/render/shaders/scatter.js +4 -2
  99. package/dist/render/shaders/smoke.d.ts +1 -1
  100. package/dist/render/shaders/water.d.ts +1 -1
  101. package/dist/render/shaders/water.js +2 -1
  102. package/dist/render/surfaceModel.d.ts +23 -4
  103. package/dist/render/surfaceModel.js +12 -2
  104. package/package.json +6 -6
  105. package/src/index.ts +12 -2
  106. package/src/render/anisotropicLobe.ts +20 -0
  107. package/src/render/atmosphere.ts +153 -20
  108. package/src/render/backend/webgl2/renderer.ts +63 -13
  109. package/src/render/backend/webgpu/clothSetPack.ts +1 -0
  110. package/src/render/backend/webgpu/clothSolvePack.ts +6 -2
  111. package/src/render/backend/webgpu/gpuClothSet.ts +1 -1
  112. package/src/render/backend/webgpu/gpuDrivenPass.ts +20 -3
  113. package/src/render/backend/webgpu/mediumFields.ts +87 -0
  114. package/src/render/backend/webgpu/renderer.ts +109 -157
  115. package/src/render/backend/webgpu/shaders/clothSolve.wgsl.ts +7 -5
  116. package/src/render/environmentMixing.ts +48 -0
  117. package/src/render/fog.ts +125 -25
  118. package/src/render/globalMedium.ts +214 -11
  119. package/src/render/globalMediumPass.ts +29 -4
  120. package/src/render/hairLobes.ts +109 -3
  121. package/src/render/lightBudget.ts +32 -0
  122. package/src/render/sceneTarget.ts +15 -11
  123. package/src/render/shaders/film.ts +4 -1
  124. package/src/render/shaders/flat/anisotropic.ts +25 -3
  125. package/src/render/shaders/flat/hair.ts +77 -27
  126. package/src/render/shaders/flat/main.ts +23 -3
  127. package/src/render/shaders/flat/models.ts +12 -5
  128. package/src/render/shaders/flat/preamble.ts +7 -0
  129. package/src/render/shaders/fog.ts +81 -32
  130. package/src/render/shaders/generated/arcane.wgsl.ts +29 -39
  131. package/src/render/shaders/generated/bolt.wgsl.ts +26 -36
  132. package/src/render/shaders/generated/caustics.wgsl.ts +25 -35
  133. package/src/render/shaders/generated/film.wgsl.ts +28 -38
  134. package/src/render/shaders/generated/fire.wgsl.ts +28 -38
  135. package/src/render/shaders/generated/flat.wgsl.ts +1489 -1569
  136. package/src/render/shaders/generated/globalMedium.wgsl.ts +98 -12
  137. package/src/render/shaders/generated/line.wgsl.ts +25 -35
  138. package/src/render/shaders/generated/particle.wgsl.ts +100 -140
  139. package/src/render/shaders/generated/rush.wgsl.ts +20 -10
  140. package/src/render/shaders/generated/scatter.wgsl.ts +25 -35
  141. package/src/render/shaders/generated/smoke.wgsl.ts +28 -38
  142. package/src/render/shaders/generated/water.wgsl.ts +29 -39
  143. package/src/render/shaders/globalMedium.ts +114 -10
  144. package/src/render/shaders/gpudriven/blendRaster.wgsl.ts +2 -1
  145. package/src/render/shaders/gpudriven/fog.wgsl.ts +78 -19
  146. package/src/render/shaders/gpudriven/frameBlock.wgsl.ts +12 -1
  147. package/src/render/shaders/gpudriven/shade.wgsl.ts +3 -1
  148. package/src/render/shaders/line.ts +4 -2
  149. package/src/render/shaders/localExposure.ts +115 -6
  150. package/src/render/shaders/particle.ts +10 -6
  151. package/src/render/shaders/scatter.ts +4 -2
  152. package/src/render/shaders/water.ts +2 -1
  153. package/src/render/surfaceModel.ts +41 -6
@@ -694,8 +694,9 @@ export const MAIN_GLSL = `void main() {
694
694
  * branch it did not take before.
695
695
  */
696
696
  /* A model reflects its environment whatever the pass asked of the standard model: see
697
- modelReflectance. On the switches alone, so the derivatives below stay in uniform flow. */
698
- if (uEnvironmentDials.y > 0.0 || uMaterialFlags.y != 0 || modelled) {
697
+ modelReflectance. Hair takes none: modelReflects. On the switches alone, so the derivatives
698
+ below stay in uniform flow. */
699
+ if ((uEnvironmentDials.y > 0.0 || uMaterialFlags.y != 0 || modelled) && modelReflects()) {
699
700
  vec3 toEye = normalize(uCameraPos - vWorldPos);
700
701
  vec3 mirrored = reflect(-toEye, modelled ? modelReflectNormal(n) : n);
701
702
  vec3 environment = mix(uAmbientGround, uAmbient, mirrored.y * 0.5 + 0.5);
@@ -833,6 +834,19 @@ export const MAIN_GLSL = `void main() {
833
834
  * caller sets this.
834
835
  */
835
836
  environment *= mix(1.0, uEnvironmentDials.z, metal);
837
+ /*
838
+ * **And brought to the light where the surface stands**, metal or not: a probe is captured
839
+ * at one place and seen from many, so a rough surface standing in light twice what the probe
840
+ * saw takes twice its reflection, and a mirror keeps the capture as it is. The weight is the
841
+ * caller's, the place's indirect light over the probe's average; mixed in by roughness, with
842
+ * the smoothstep written out because GLSL leaves one over an empty range undefined. 0, the
843
+ * weight less one, is exactly the reflection there was.
844
+ */
845
+ if (uEnvironmentMixing.x != 0.0) {
846
+ float span = max(uEnvironmentMixing.z - uEnvironmentMixing.y, 1e-4);
847
+ float rough = clamp((surfaceRoughness - uEnvironmentMixing.y) / span, 0.0, 1.0);
848
+ environment *= 1.0 + uEnvironmentMixing.x * rough * rough * (3.0 - 2.0 * rough);
849
+ }
836
850
  float facing = 1.0 - max(dot(n, toEye), 0.0);
837
851
  /*
838
852
  * **A metal's Fresnel base is close to its albedo, not a dielectric's four percent.** Schlick
@@ -2088,8 +2102,14 @@ export const MAIN_GLSL = `void main() {
2088
2102
  * the medium's colour and adding it puts the haze into the frame twice — a glow by day drew as
2089
2103
  * a grey shape of itself, greyer the thicker the air.
2090
2104
  */
2105
+ /* And the sun's glow in the haze, which a surface takes after its fog and an added light never
2106
+ does: what is behind it already has it. */
2107
+ vec3 glow = vec3(0.0);
2108
+ if (uFogEnabled == 1) {
2109
+ glow = mediumGlow(distance(vWorldPos, uCameraPos), vWorldPos.y, normalize(vWorldPos - uCameraPos));
2110
+ }
2091
2111
  vec3 shaded = applyOutputTransform(
2092
- uFogEnabled == 2 ? lit * (1.0 - fog) : mix(lit, mediumColor(), fog));
2112
+ uFogEnabled == 2 ? lit * (1.0 - fog) : mix(lit, mediumColor(), fog) + glow);
2093
2113
 
2094
2114
  /*
2095
2115
  * **Refraction: the scene behind this surface, bent and absorbed.**
@@ -12,8 +12,8 @@
12
12
  * **Where the models plug in.** `main` gathers the surface once (`modelSurface`), then asks at each
13
13
  * place light arrives: `modelLight` for the sun, each lamp and each rectangle, `modelAmbient` for
14
14
  * the sky and the probe's irradiance, `modelIrradiance` for DriftLight, `modelReflectNormal` and
15
- * `modelReflectance` for the environment's reflection. Each returns today's term for the standard
16
- * model, and each model's file is where its own answers are.
15
+ * `modelReflectance` for the environment's reflection, which `modelReflects` keeps from hair. Each
16
+ * returns today's term for the standard model, and each model's file is where its own answers are.
17
17
  *
18
18
  * **What a model returns from a light** is the two halves the standard terms are: a diffuse already
19
19
  * weighted by the angle of arrival, and a specular lobe in the engine's peak-normalised units (see
@@ -93,6 +93,15 @@ bool modelSeesBehind() {
93
93
  return false;
94
94
  }
95
95
 
96
+ /**
97
+ * Whether the environment's reflection reaches this surface: every model's but hair's, whose share
98
+ * of it is in its light from every side (hair.ts).
99
+ */
100
+ bool modelReflects() {
101
+ if (MODEL_HAIR) return false;
102
+ return true;
103
+ }
104
+
96
105
  /* The surface a model shades, gathered once in main before any light reaches it. */
97
106
  vec3 mNormal;
98
107
  vec3 mToEye;
@@ -224,7 +233,7 @@ void modelSurface(vec3 n, vec3 albedo, float roughness, float metal, vec3 at) {
224
233
  mMap = vec4(0.5, 0.5, 1.0, 1.0);
225
234
  if (uModelParams[1].w > 0.0) mMap = texture(uModelMap, at);
226
235
  if (MODEL_ANISOTROPIC) anisotropicSurface();
227
- if (MODEL_HAIR) hairSurface();
236
+ if (MODEL_HAIR) hairSurface(at);
228
237
  if (MODEL_SKIN) skinSurface();
229
238
  if (MODEL_EYE) eyeSurface(at);
230
239
  }
@@ -282,7 +291,6 @@ vec3 modelIrradiance(vec3 irradiance) {
282
291
  /** The normal the environment is reflected about: the surface's own, but for a stretched lobe. */
283
292
  vec3 modelReflectNormal(vec3 n) {
284
293
  if (MODEL_ANISOTROPIC) return anisotropicReflectNormal(n);
285
- if (MODEL_HAIR) return hairAcross();
286
294
  return n;
287
295
  }
288
296
 
@@ -358,7 +366,6 @@ vec3 modelDiffuseOut(vec3 diffuse, float fog) {
358
366
  * what the standard model would.
359
367
  */
360
368
  float modelReflectance(float standard) {
361
- if (MODEL_HAIR) return hairReflectance();
362
369
  if (MODEL_SKIN) return skinReflectance();
363
370
  if (MODEL_EYE) return eyeReflectance();
364
371
  return standard;
@@ -276,6 +276,13 @@ uniform vec3 uOrmScale; // wgsl:material
276
276
  */
277
277
  uniform vec3 uEnvironmentDials; // wgsl:material
278
278
 
279
+ /**
280
+ * The environment a surface reflects brought to the light where it stands, for every surface:
281
+ * \`setEnvironmentMixing\`. x is the weight less one, so a program nothing wrote reflects as it did;
282
+ * y and z the roughnesses the weight is mixed in over, smooth to rough.
283
+ */
284
+ uniform vec4 uEnvironmentMixing; // wgsl:material
285
+
279
286
  /**
280
287
  * Where a surface glows, and in what colour.
281
288
  *
@@ -30,8 +30,8 @@
30
30
  * at the eye times `(1 − e⁻ᵗ)/t`, with `t` the height climbed in scale heights. The eye
31
31
  * density and `1/H` arrive precomputed from `bindAtmosphere`.
32
32
  *
33
- * `uFogEyeY` rather than `uCameraPos.y` because two of the seven programs (the plumes)
34
- * never needed the camera position in their fragment stage, and a block that declares
35
- * everything it uses can be pasted anywhere.
33
+ * `uFogMedium.z`, the eye's height, rather than `uCameraPos.y`, because two of the seven
34
+ * programs (the plumes) never needed the camera position in their fragment stage, and a block
35
+ * that declares 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 // 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";
37
+ export declare const FOG_GLSL = "\nuniform vec3 uFogColor;\n/**\n * The haze: its extinction per metre **at the camera's own height**, not at the base; its\n * reciprocal scale height per metre, 0 for a uniform medium; the camera's height, so a fragment's\n * own height is one subtraction away; and the water column's own density.\n *\n * **Four numbers in one vector rather than four uniforms**, and the reason is a phone: a scalar\n * costs a whole row of the uniform grid, and the lit stage at its eight-light rung must fit the 256\n * rows an Adreno 740 offers (uniformVectorBudget.ts). Packed, the haze's eight scalars cost two\n * rows where they cost eight, which is what paid for the second layer and the sun's glow below.\n */\nuniform vec4 uFogMedium;\n/** Where haze begins, where a linear ramp is total, and the mode: 0 a medium, 1 a ramp. */\nuniform vec4 uFogRange;\nuniform vec3 uUnderwaterColor;\nuniform float uUnderwaterFactor;\n/**\n * The second layer's extinction per metre at the camera's height and its falloff; then the least of\n * a surface the haze must leave, Atmosphere.fogMaxOpacity's complement, and the distance past which\n * it hides nothing (0 is none). **Every lane is none at zero**, and so are uFogGlow's: a program a\n * binder never wrote these into draws the haze it drew before they existed, rather than none.\n */\nuniform vec4 uFogLayer2;\n/** The sun's glow in the haze: its colour, black for none, and the exponent of its lobe. */\nuniform vec4 uFogGlow;\n/** Surface \u2192 the glow's light, and how far past the haze's start the glow begins. */\nuniform vec4 uFogGlowDir;\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 * The haze's optical depth from where it begins along the ray to a point at height pointY, dist\n * metres away: each layer's density at the eye carried over what is left of the ray, with the\n * second layer only where there is one. The fog and the sun's glow both integrate it.\n */\nfloat hazeDepth(float dist, float pointY) {\n // Where the medium begins along the ray: uFogRange.x, 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(uFogRange.x, dist);\n float before = dist > 0.0 ? start / dist : 0.0;\n float t = (pointY - uFogMedium.z) * uFogMedium.y;\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 depth = uFogMedium.x * exp(-t * before) * (dist - start) * (1.0 - exp(-denom)) / denom;\n if (uFogLayer2.x > 0.0) {\n float t2 = (pointY - uFogMedium.z) * uFogLayer2.y;\n float rest2 = t2 * (1.0 - before);\n float denom2 = abs(rest2) < 1e-4 ? 1e-4 : rest2;\n depth += uFogLayer2.x * exp(-t2 * before) * (dist - start) * (1.0 - exp(-denom2)) / denom2;\n }\n return depth;\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 /* Past the cutoff the air hides nothing, in either mode; the water column keeps its own law. */\n bool cut = uFogLayer2.w > 0.0 && dist > uFogLayer2.w;\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 (uFogRange.z == 1.0) {\n float span = max(uFogRange.y - uFogRange.x, 1e-4);\n float ramp = cut ? 0.0 : min(clamp((dist - uFogRange.x) / span, 0.0, 1.0), 1.0 - uFogLayer2.z);\n if (uUnderwaterFactor <= 0.0) return ramp;\n float wetLinear = uFogMedium.w * dist;\n return mix(ramp, 1.0 - exp2(-wetLinear * wetLinear * 1.442695), uUnderwaterFactor);\n }\n\n // Beer-Lambert through both layers, leaving at least uFogLayer2.z of the surface: a floor on\n // what survives rather than a ceiling on the depth, so the curve keeps its shape above it.\n float air = cut ? 0.0 : 1.0 - max(exp(-hazeDepth(dist, pointY)), uFogLayer2.z);\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 = uFogMedium.w * dist;\n return mix(air, 1.0 - exp2(-wet * wet * 1.442695), uUnderwaterFactor);\n}\n\n/**\n * The sun's light the haze scatters toward the eye along a ray to a point at height pointY, dist\n * metres away in the direction toPoint: added to a surface after its fog, never mixed. A lobe of\n * cos^exponent about the light, by as much of the ray past the glow's own start as the haze hides \u2014\n * the haze's depth per metre carried over that stretch. None in a linear ramp, past the cutoff, or\n * under water, which keeps its own medium.\n */\nvec3 mediumGlow(float dist, float pointY, vec3 toPoint) {\n if (uFogRange.z == 1.0 || max(max(uFogGlow.r, uFogGlow.g), uFogGlow.b) <= 0.0) return vec3(0.0);\n if (uFogLayer2.w > 0.0 && dist > uFogLayer2.w) return vec3(0.0);\n float span = dist - min(uFogRange.x, dist);\n if (span <= 0.0) return vec3(0.0);\n float perMetre = hazeDepth(dist, pointY) / span;\n float hidden = 1.0 - exp(-perMetre * max(span - uFogGlowDir.w, 0.0));\n float lobe = pow(clamp(dot(toPoint, uFogGlowDir.xyz), 0.0, 1.0), uFogGlow.a);\n return uFogGlow.rgb * (lobe * hidden * (1.0 - uUnderwaterFactor));\n}\n";
@@ -30,37 +30,77 @@
30
30
  * at the eye times `(1 − e⁻ᵗ)/t`, with `t` the height climbed in scale heights. The eye
31
31
  * density and `1/H` arrive precomputed from `bindAtmosphere`.
32
32
  *
33
- * `uFogEyeY` rather than `uCameraPos.y` because two of the seven programs (the plumes)
34
- * never needed the camera position in their fragment stage, and a block that declares
35
- * everything it uses can be pasted anywhere.
33
+ * `uFogMedium.z`, the eye's height, rather than `uCameraPos.y`, because two of the seven
34
+ * programs (the plumes) never needed the camera position in their fragment stage, and a block
35
+ * that declares everything it uses can be pasted anywhere.
36
36
  */
37
37
  export const FOG_GLSL = `
38
38
  uniform vec3 uFogColor;
39
- /** Extinction per metre **at the camera's own height**, not at the base. */
40
- uniform float uFogDensity;
41
- /** Reciprocal scale height of the haze, per metre. 0 is a uniform medium. */
42
- uniform float uFogHeightFalloff;
43
- /** The camera's height, so a fragment's own height is one subtraction away. */
44
- uniform float uFogEyeY;
39
+ /**
40
+ * The haze: its extinction per metre **at the camera's own height**, not at the base; its
41
+ * reciprocal scale height per metre, 0 for a uniform medium; the camera's height, so a fragment's
42
+ * own height is one subtraction away; and the water column's own density.
43
+ *
44
+ * **Four numbers in one vector rather than four uniforms**, and the reason is a phone: a scalar
45
+ * costs a whole row of the uniform grid, and the lit stage at its eight-light rung must fit the 256
46
+ * rows an Adreno 740 offers (uniformVectorBudget.ts). Packed, the haze's eight scalars cost two
47
+ * rows where they cost eight, which is what paid for the second layer and the sun's glow below.
48
+ */
49
+ uniform vec4 uFogMedium;
50
+ /** Where haze begins, where a linear ramp is total, and the mode: 0 a medium, 1 a ramp. */
51
+ uniform vec4 uFogRange;
45
52
  uniform vec3 uUnderwaterColor;
46
- uniform float uUnderwaterFogDensity;
47
53
  uniform float uUnderwaterFactor;
48
- /** 0 integrates a medium (Beer-Lambert); 1 ramps linearly between near and far. */
49
- uniform int uFogMode;
50
- /** Linear mode only: where haze begins, and where it is total. */
51
- uniform float uFogNear;
52
- uniform float uFogFar;
54
+ /**
55
+ * The second layer's extinction per metre at the camera's height and its falloff; then the least of
56
+ * a surface the haze must leave, Atmosphere.fogMaxOpacity's complement, and the distance past which
57
+ * it hides nothing (0 is none). **Every lane is none at zero**, and so are uFogGlow's: a program a
58
+ * binder never wrote these into draws the haze it drew before they existed, rather than none.
59
+ */
60
+ uniform vec4 uFogLayer2;
61
+ /** The sun's glow in the haze: its colour, black for none, and the exponent of its lobe. */
62
+ uniform vec4 uFogGlow;
63
+ /** Surface → the glow's light, and how far past the haze's start the glow begins. */
64
+ uniform vec4 uFogGlowDir;
53
65
 
54
66
  /** What distance converges toward: the day's haze, or the water column. */
55
67
  vec3 mediumColor() {
56
68
  return mix(uFogColor, uUnderwaterColor, uUnderwaterFactor);
57
69
  }
58
70
 
71
+ /**
72
+ * The haze's optical depth from where it begins along the ray to a point at height pointY, dist
73
+ * metres away: each layer's density at the eye carried over what is left of the ray, with the
74
+ * second layer only where there is one. The fog and the sun's glow both integrate it.
75
+ */
76
+ float hazeDepth(float dist, float pointY) {
77
+ // Where the medium begins along the ray: uFogRange.x, the linear mode's slot, which this mode
78
+ // never read before Atmosphere.fogStart. The ray is integrated from there on, at the density
79
+ // of that point; at a start of 0 every term is the one it always was. See render/fog.ts.
80
+ float start = min(uFogRange.x, dist);
81
+ float before = dist > 0.0 ? start / dist : 0.0;
82
+ float t = (pointY - uFogMedium.z) * uFogMedium.y;
83
+ float rest = t * (1.0 - before);
84
+ // (1 - e^-t)/t, which tends to 1 as the ray levels out. Guarded rather than
85
+ // branched: at t = 0 the quotient is 0/0, and 1e-4 of a scale height is 8 mm.
86
+ float denom = abs(rest) < 1e-4 ? 1e-4 : rest;
87
+ float depth = uFogMedium.x * exp(-t * before) * (dist - start) * (1.0 - exp(-denom)) / denom;
88
+ if (uFogLayer2.x > 0.0) {
89
+ float t2 = (pointY - uFogMedium.z) * uFogLayer2.y;
90
+ float rest2 = t2 * (1.0 - before);
91
+ float denom2 = abs(rest2) < 1e-4 ? 1e-4 : rest2;
92
+ depth += uFogLayer2.x * exp(-t2 * before) * (dist - start) * (1.0 - exp(-denom2)) / denom2;
93
+ }
94
+ return depth;
95
+ }
96
+
59
97
  /**
60
98
  * How much of a surface standing at height pointY, dist metres away, is lost to
61
99
  * the medium in between. 0 is perfectly clear, 1 is the medium's own colour.
62
100
  */
63
101
  float mediumFog(float dist, float pointY) {
102
+ /* Past the cutoff the air hides nothing, in either mode; the water column keeps its own law. */
103
+ bool cut = uFogLayer2.w > 0.0 && dist > uFogLayer2.w;
64
104
  /*
65
105
  * A depth ramp rather than a medium, for worlds authored against one.
66
106
  *
@@ -76,30 +116,39 @@ float mediumFog(float dist, float pointY) {
76
116
  * Height falloff has no meaning here and is ignored: a ramp is defined on distance
77
117
  * alone.
78
118
  */
79
- if (uFogMode == 1) {
80
- float span = max(uFogFar - uFogNear, 1e-4);
81
- float ramp = clamp((dist - uFogNear) / span, 0.0, 1.0);
119
+ if (uFogRange.z == 1.0) {
120
+ float span = max(uFogRange.y - uFogRange.x, 1e-4);
121
+ float ramp = cut ? 0.0 : min(clamp((dist - uFogRange.x) / span, 0.0, 1.0), 1.0 - uFogLayer2.z);
82
122
  if (uUnderwaterFactor <= 0.0) return ramp;
83
- float wetLinear = uUnderwaterFogDensity * dist;
123
+ float wetLinear = uFogMedium.w * dist;
84
124
  return mix(ramp, 1.0 - exp2(-wetLinear * wetLinear * 1.442695), uUnderwaterFactor);
85
125
  }
86
126
 
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;
92
- float t = (pointY - uFogEyeY) * uFogHeightFalloff;
93
- float rest = t * (1.0 - before);
94
- // (1 - e^-t)/t, which tends to 1 as the ray levels out. Guarded rather than
95
- // branched: at t = 0 the quotient is 0/0, and 1e-4 of a scale height is 8 mm.
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);
127
+ // Beer-Lambert through both layers, leaving at least uFogLayer2.z of the surface: a floor on
128
+ // what survives rather than a ceiling on the depth, so the curve keeps its shape above it.
129
+ float air = cut ? 0.0 : 1.0 - max(exp(-hazeDepth(dist, pointY)), uFogLayer2.z);
99
130
  if (uUnderwaterFactor <= 0.0) return air;
100
131
  // Water is its own medium and keeps its own curve, so crossing the surface
101
132
  // changes nothing about how the water column reads.
102
- float wet = uUnderwaterFogDensity * dist;
133
+ float wet = uFogMedium.w * dist;
103
134
  return mix(air, 1.0 - exp2(-wet * wet * 1.442695), uUnderwaterFactor);
104
135
  }
136
+
137
+ /**
138
+ * The sun's light the haze scatters toward the eye along a ray to a point at height pointY, dist
139
+ * metres away in the direction toPoint: added to a surface after its fog, never mixed. A lobe of
140
+ * cos^exponent about the light, by as much of the ray past the glow's own start as the haze hides —
141
+ * the haze's depth per metre carried over that stretch. None in a linear ramp, past the cutoff, or
142
+ * under water, which keeps its own medium.
143
+ */
144
+ vec3 mediumGlow(float dist, float pointY, vec3 toPoint) {
145
+ if (uFogRange.z == 1.0 || max(max(uFogGlow.r, uFogGlow.g), uFogGlow.b) <= 0.0) return vec3(0.0);
146
+ if (uFogLayer2.w > 0.0 && dist > uFogLayer2.w) return vec3(0.0);
147
+ float span = dist - min(uFogRange.x, dist);
148
+ if (span <= 0.0) return vec3(0.0);
149
+ float perMetre = hazeDepth(dist, pointY) / span;
150
+ float hidden = 1.0 - exp(-perMetre * max(span - uFogGlowDir.w, 0.0));
151
+ float lobe = pow(clamp(dot(toPoint, uFogGlowDir.xyz), 0.0, 1.0), uFogGlow.a);
152
+ return uFogGlow.rgb * (lobe * hidden * (1.0 - uUnderwaterFactor));
153
+ }
105
154
  `;
@@ -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 uOutputTransform: i32,\n uOutputExposure: f32,\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 linearToSrgb_u0028_vf3_u003b(c: ptr<function, vec3<f32>>) -> vec3<f32> {\n var low: vec3<f32>;\n var high: vec3<f32>;\n\n let _e105 = (*c);\n low = (_e105 * 12.92f);\n let _e107 = (*c);\n high = ((pow(max(_e107, vec3<f32>(0f, 0f, 0f)), vec3<f32>(0.41666666f, 0.41666666f, 0.41666666f)) * 1.055f) - vec3(0.055f));\n let _e113 = high;\n let _e114 = low;\n let _e115 = (*c);\n return mix(_e113, _e114, step(_e115, vec3<f32>(0.0031308f, 0.0031308f, 0.0031308f)));\n}\n\nfn highlightShoulder_u0028_vf3_u003b(c_1: ptr<function, vec3<f32>>) -> vec3<f32> {\n var m: f32;\n var e: f32;\n\n let _e106 = (*c_1)[0u];\n let _e108 = (*c_1)[1u];\n let _e110 = (*c_1)[2u];\n m = max(_e106, max(_e108, _e110));\n let _e113 = m;\n if (_e113 <= 0.8f) {\n let _e115 = (*c_1);\n return _e115;\n }\n let _e116 = m;\n e = (_e116 - 0.8f);\n let _e118 = (*c_1);\n let _e119 = e;\n let _e121 = e;\n let _e125 = m;\n return (_e118 * ((0.8f + ((0.2f * _e119) / (_e121 + 0.2f))) / _e125));\n}\n\nfn rrtAndOdtFit_u0028_vf3_u003b(v: ptr<function, vec3<f32>>) -> vec3<f32> {\n var a: vec3<f32>;\n var b: vec3<f32>;\n\n let _e105 = (*v);\n let _e106 = (*v);\n a = ((_e105 * (_e106 + vec3(0.0245786f))) - vec3(0.000090537f));\n let _e112 = (*v);\n let _e113 = (*v);\n b = ((_e112 * ((_e113 * 0.983729f) + vec3(0.432951f))) + vec3(0.238081f));\n let _e120 = a;\n let _e121 = b;\n return (_e120 / _e121);\n}\n\nfn acesFilmic_u0028_vf3_u003b(x: ptr<function, vec3<f32>>) -> vec3<f32> {\n var param: vec3<f32>;\n\n let _e105 = unnamed.uOutputExposure;\n let _e106 = (*x);\n (*x) = (_e106 * _e105);\n let _e108 = (*x);\n param = (mat3x3<f32>(vec3<f32>(0.59719f, 0.076f, 0.0284f), vec3<f32>(0.35458f, 0.90834f, 0.13383f), vec3<f32>(0.04823f, 0.01566f, 0.83777f)) * _e108);\n let _e110 = rrtAndOdtFit_u0028_vf3_u003b((&param));\n return clamp((mat3x3<f32>(vec3<f32>(1.60475f, -0.10208f, -0.00327f), vec3<f32>(-0.53108f, 1.10813f, -0.07276f), vec3<f32>(-0.07367f, -0.00605f, 1.07602f)) * _e110), vec3(0f), vec3(1f));\n}\n\nfn applyOutputTransform_u0028_vf3_u003b(c_2: ptr<function, vec3<f32>>) -> vec3<f32> {\n var param_1: vec3<f32>;\n var param_2: vec3<f32>;\n var param_3: vec3<f32>;\n\n let _e107 = unnamed.uOutputTransform;\n if (_e107 == 0i) {\n let _e109 = (*c_2);\n return _e109;\n }\n let _e111 = unnamed.uOutputTransform;\n if (_e111 == 2i) {\n let _e113 = (*c_2);\n param_1 = _e113;\n let _e114 = acesFilmic_u0028_vf3_u003b((&param_1));\n (*c_2) = _e114;\n }\n let _e116 = unnamed.uOutputTransform;\n if (_e116 == 3i) {\n let _e118 = (*c_2);\n let _e120 = unnamed.uOutputExposure;\n param_2 = (_e118 * _e120);\n let _e122 = highlightShoulder_u0028_vf3_u003b((&param_2));\n (*c_2) = _e122;\n }\n let _e123 = (*c_2);\n param_3 = _e123;\n let _e124 = linearToSrgb_u0028_vf3_u003b((&param_3));\n return _e124;\n}\n\nfn mediumColor_u0028_() -> vec3<f32> {\n let _e103 = unnamed.uFogColor;\n let _e105 = unnamed.uUnderwaterColor;\n let _e107 = unnamed.uUnderwaterFactor;\n return mix(_e103, _e105, vec3(_e107));\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 _e116 = unnamed.uFogMode;\n if (_e116 == 1i) {\n let _e119 = unnamed.uFogFar;\n let _e121 = unnamed.uFogNear;\n span = max((_e119 - _e121), 0.0001f);\n let _e124 = (*dist);\n let _e126 = unnamed.uFogNear;\n let _e128 = span;\n ramp = clamp(((_e124 - _e126) / _e128), 0f, 1f);\n let _e132 = unnamed.uUnderwaterFactor;\n if (_e132 <= 0f) {\n let _e134 = ramp;\n return _e134;\n }\n let _e136 = unnamed.uUnderwaterFogDensity;\n let _e137 = (*dist);\n wetLinear = (_e136 * _e137);\n let _e139 = ramp;\n let _e140 = wetLinear;\n let _e142 = wetLinear;\n let _e148 = unnamed.uUnderwaterFactor;\n return mix(_e139, (1f - exp2(((-(_e140) * _e142) * 1.442695f))), _e148);\n }\n let _e151 = unnamed.uFogNear;\n let _e152 = (*dist);\n start = min(_e151, _e152);\n let _e154 = (*dist);\n if (_e154 > 0f) {\n let _e156 = start;\n let _e157 = (*dist);\n local = (_e156 / _e157);\n } else {\n local = 0f;\n }\n let _e159 = local;\n before = _e159;\n let _e160 = (*pointY);\n let _e162 = unnamed.uFogEyeY;\n let _e165 = unnamed.uFogHeightFalloff;\n t = ((_e160 - _e162) * _e165);\n let _e167 = t;\n let _e168 = before;\n rest = (_e167 * (1f - _e168));\n let _e171 = rest;\n let _e174 = rest;\n denom = select(_e174, 0.0001f, (abs(_e171) < 0.0001f));\n let _e177 = unnamed.uFogDensity;\n let _e179 = t;\n let _e181 = before;\n let _e185 = (*dist);\n let _e186 = start;\n let _e189 = denom;\n let _e194 = denom;\n air = (1f - exp(((((-(_e177) * exp((-(_e179) * _e181))) * (_e185 - _e186)) * (1f - exp(-(_e189)))) / _e194)));\n let _e199 = unnamed.uUnderwaterFactor;\n if (_e199 <= 0f) {\n let _e201 = air;\n return _e201;\n }\n let _e203 = unnamed.uUnderwaterFogDensity;\n let _e204 = (*dist);\n wet = (_e203 * _e204);\n let _e206 = air;\n let _e207 = wet;\n let _e209 = wet;\n let _e215 = unnamed.uUnderwaterFactor;\n return mix(_e206, (1f - exp2(((-(_e207) * _e209) * 1.442695f))), _e215);\n}\n\nfn hash21_u0028_vf2_u003b(p: ptr<function, vec2<f32>>) -> f32 {\n let _e103 = (*p);\n return fract((sin(dot(_e103, 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_4: vec2<f32>;\n var param_5: vec2<f32>;\n var param_6: vec2<f32>;\n var param_7: vec2<f32>;\n\n let _e110 = (*p_1);\n i = floor(_e110);\n let _e112 = (*p_1);\n f = fract(_e112);\n let _e114 = f;\n let _e115 = f;\n let _e117 = f;\n u = ((_e114 * _e115) * (vec2(3f) - (_e117 * 2f)));\n let _e122 = i;\n param_4 = _e122;\n let _e123 = hash21_u0028_vf2_u003b((&param_4));\n let _e124 = i;\n param_5 = (_e124 + vec2<f32>(1f, 0f));\n let _e126 = hash21_u0028_vf2_u003b((&param_5));\n let _e128 = u[0u];\n let _e130 = i;\n param_6 = (_e130 + vec2<f32>(0f, 1f));\n let _e132 = hash21_u0028_vf2_u003b((&param_6));\n let _e133 = i;\n param_7 = (_e133 + vec2<f32>(1f, 1f));\n let _e135 = hash21_u0028_vf2_u003b((&param_7));\n let _e137 = u[0u];\n let _e140 = u[1u];\n return mix(mix(_e123, _e126, _e128), mix(_e132, _e135, _e137), _e140);\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_8: vec2<f32>;\n var outer: f32;\n var param_9: vec2<f32>;\n var swirl: f32;\n var param_10: 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_11: f32;\n var param_12: f32;\n var param_13: vec3<f32>;\n var phi_442_: bool;\n\n let _e122 = unnamed.uClipEnabled;\n let _e123 = (_e122 != 0i);\n phi_442_ = _e123;\n if _e123 {\n let _e124 = vWorldPos_1;\n let _e130 = unnamed.uClipPlane;\n phi_442_ = (dot(vec4<f32>(_e124.x, _e124.y, _e124.z, 1f), _e130) < 0f);\n }\n let _e134 = phi_442_;\n if _e134 {\n discard;\n }\n let _e135 = vUv_1;\n radius = (length((_e135 - vec2(0.5f))) * 2f);\n let _e140 = radius;\n if (_e140 >= 1f) {\n discard;\n }\n let _e142 = vUv_1;\n d = (_e142 - vec2(0.5f));\n let _e146 = d[1u];\n let _e148 = d[0u];\n angle = atan2(_e146, _e148);\n let _e151 = unnamed.uTime;\n let _e152 = vSeed_1;\n t_1 = (_e151 + (_e152 * 37f));\n let _e155 = angle;\n let _e157 = t_1;\n let _e160 = radius;\n param_8 = vec2<f32>(((_e155 * 1.9f) + (_e157 * 0.55f)), (_e160 * 4.2f));\n let _e163 = valueNoise_u0028_vf2_u003b((&param_8));\n inner = _e163;\n let _e164 = angle;\n let _e166 = t_1;\n let _e169 = radius;\n param_9 = vec2<f32>(((_e164 * 3.1f) - (_e166 * 0.34f)), (_e169 * 2.6f));\n let _e172 = valueNoise_u0028_vf2_u003b((&param_9));\n outer = _e172;\n let _e173 = inner;\n let _e175 = outer;\n swirl = ((_e173 * 0.62f) + (_e175 * 0.38f));\n let _e179 = unnamed.uNoiseOctaves;\n if (_e179 > 1i) {\n let _e181 = swirl;\n let _e182 = swirl;\n let _e183 = angle;\n let _e185 = t_1;\n let _e188 = radius;\n param_10 = vec2<f32>(((_e183 * 6.3f) + (_e185 * 0.9f)), (_e188 * 8f));\n let _e191 = valueNoise_u0028_vf2_u003b((&param_10));\n swirl = mix(_e181, ((_e182 * _e191) * 2f), 0.35f);\n }\n let _e195 = radius;\n core = (1f - smoothstep(0f, 0.28f, _e195));\n let _e198 = radius;\n let _e201 = swirl;\n corona = ((1f - smoothstep(0.18f, 1f, _e198)) * (0.35f + (_e201 * 0.65f)));\n let _e205 = core;\n let _e207 = corona;\n body = ((_e205 * 0.9f) + _e207);\n let _e209 = body;\n if (_e209 <= 0.02f) {\n discard;\n }\n let _e212 = unnamed.uTint;\n let _e215 = unnamed.uTint;\n let _e216 = body;\n col = mix((_e212 * 0.35f), _e215, vec3(smoothstep(0f, 0.55f, _e216)));\n let _e220 = col;\n let _e221 = body;\n col = mix(_e220, vec3<f32>(1f, 1f, 1f), vec3(smoothstep(0.82f, 1.4f, _e221)));\n let _e226 = unnamed.uTint;\n let _e227 = col;\n col = (_e227 * _e226);\n let _e229 = body;\n alpha = clamp((_e229 * 1.6f), 0f, 1f);\n let _e232 = vDistance_1;\n param_11 = _e232;\n let _e234 = vWorldPos_1[1u];\n param_12 = _e234;\n let _e235 = mediumFog_u0028_f1_u003b_f1_u003b((&param_11), (&param_12));\n fog = _e235;\n let _e236 = col;\n let _e237 = mediumColor_u0028_();\n let _e238 = fog;\n col = mix(_e236, _e237, vec3(_e238));\n let _e241 = fog;\n let _e243 = alpha;\n alpha = (_e243 * (1f - _e241));\n let _e245 = col;\n param_13 = _e245;\n let _e246 = applyOutputTransform_u0028_vf3_u003b((&param_13));\n let _e247 = alpha;\n outColor = vec4<f32>(_e246.x, _e246.y, _e246.z, _e247);\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 uFogMedium: vec4<f32>,\n uFogRange: vec4<f32>,\n uUnderwaterColor: vec3<f32>,\n uUnderwaterFactor: f32,\n uFogLayer2_: vec4<f32>,\n uFogGlow: vec4<f32>,\n uFogGlowDir: vec4<f32>,\n uNoiseOctaves: i32,\n uClipPlane: vec4<f32>,\n uClipEnabled: i32,\n uOutputTransform: i32,\n uOutputExposure: f32,\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 linearToSrgb_u0028_vf3_u003b(c: ptr<function, vec3<f32>>) -> vec3<f32> {\n var low: vec3<f32>;\n var high: vec3<f32>;\n\n let _e102 = (*c);\n low = (_e102 * 12.92f);\n let _e104 = (*c);\n high = ((pow(max(_e104, vec3<f32>(0f, 0f, 0f)), vec3<f32>(0.41666666f, 0.41666666f, 0.41666666f)) * 1.055f) - vec3(0.055f));\n let _e110 = high;\n let _e111 = low;\n let _e112 = (*c);\n return mix(_e110, _e111, step(_e112, vec3<f32>(0.0031308f, 0.0031308f, 0.0031308f)));\n}\n\nfn highlightShoulder_u0028_vf3_u003b(c_1: ptr<function, vec3<f32>>) -> vec3<f32> {\n var m: f32;\n var e: f32;\n\n let _e103 = (*c_1)[0u];\n let _e105 = (*c_1)[1u];\n let _e107 = (*c_1)[2u];\n m = max(_e103, max(_e105, _e107));\n let _e110 = m;\n if (_e110 <= 0.8f) {\n let _e112 = (*c_1);\n return _e112;\n }\n let _e113 = m;\n e = (_e113 - 0.8f);\n let _e115 = (*c_1);\n let _e116 = e;\n let _e118 = e;\n let _e122 = m;\n return (_e115 * ((0.8f + ((0.2f * _e116) / (_e118 + 0.2f))) / _e122));\n}\n\nfn rrtAndOdtFit_u0028_vf3_u003b(v: ptr<function, vec3<f32>>) -> vec3<f32> {\n var a: vec3<f32>;\n var b: vec3<f32>;\n\n let _e102 = (*v);\n let _e103 = (*v);\n a = ((_e102 * (_e103 + vec3(0.0245786f))) - vec3(0.000090537f));\n let _e109 = (*v);\n let _e110 = (*v);\n b = ((_e109 * ((_e110 * 0.983729f) + vec3(0.432951f))) + vec3(0.238081f));\n let _e117 = a;\n let _e118 = b;\n return (_e117 / _e118);\n}\n\nfn acesFilmic_u0028_vf3_u003b(x: ptr<function, vec3<f32>>) -> vec3<f32> {\n var param: vec3<f32>;\n\n let _e102 = unnamed.uOutputExposure;\n let _e103 = (*x);\n (*x) = (_e103 * _e102);\n let _e105 = (*x);\n param = (mat3x3<f32>(vec3<f32>(0.59719f, 0.076f, 0.0284f), vec3<f32>(0.35458f, 0.90834f, 0.13383f), vec3<f32>(0.04823f, 0.01566f, 0.83777f)) * _e105);\n let _e107 = rrtAndOdtFit_u0028_vf3_u003b((&param));\n return clamp((mat3x3<f32>(vec3<f32>(1.60475f, -0.10208f, -0.00327f), vec3<f32>(-0.53108f, 1.10813f, -0.07276f), vec3<f32>(-0.07367f, -0.00605f, 1.07602f)) * _e107), vec3(0f), vec3(1f));\n}\n\nfn applyOutputTransform_u0028_vf3_u003b(c_2: ptr<function, vec3<f32>>) -> vec3<f32> {\n var param_1: vec3<f32>;\n var param_2: vec3<f32>;\n var param_3: vec3<f32>;\n\n let _e104 = unnamed.uOutputTransform;\n if (_e104 == 0i) {\n let _e106 = (*c_2);\n return _e106;\n }\n let _e108 = unnamed.uOutputTransform;\n if (_e108 == 2i) {\n let _e110 = (*c_2);\n param_1 = _e110;\n let _e111 = acesFilmic_u0028_vf3_u003b((&param_1));\n (*c_2) = _e111;\n }\n let _e113 = unnamed.uOutputTransform;\n if (_e113 == 3i) {\n let _e115 = (*c_2);\n let _e117 = unnamed.uOutputExposure;\n param_2 = (_e115 * _e117);\n let _e119 = highlightShoulder_u0028_vf3_u003b((&param_2));\n (*c_2) = _e119;\n }\n let _e120 = (*c_2);\n param_3 = _e120;\n let _e121 = linearToSrgb_u0028_vf3_u003b((&param_3));\n return _e121;\n}\n\nfn mediumColor_u0028_() -> vec3<f32> {\n let _e100 = unnamed.uFogColor;\n let _e102 = unnamed.uUnderwaterColor;\n let _e104 = unnamed.uUnderwaterFactor;\n return mix(_e100, _e102, vec3(_e104));\n}\n\nfn hazeDepth_u0028_f1_u003b_f1_u003b(dist: ptr<function, f32>, pointY: ptr<function, f32>) -> 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 depth: f32;\n var t2_: f32;\n var rest2_: f32;\n var denom2_: f32;\n\n let _e113 = unnamed.uFogRange[0u];\n let _e114 = (*dist);\n start = min(_e113, _e114);\n let _e116 = (*dist);\n if (_e116 > 0f) {\n let _e118 = start;\n let _e119 = (*dist);\n local = (_e118 / _e119);\n } else {\n local = 0f;\n }\n let _e121 = local;\n before = _e121;\n let _e122 = (*pointY);\n let _e125 = unnamed.uFogMedium[2u];\n let _e129 = unnamed.uFogMedium[1u];\n t = ((_e122 - _e125) * _e129);\n let _e131 = t;\n let _e132 = before;\n rest = (_e131 * (1f - _e132));\n let _e135 = rest;\n let _e138 = rest;\n denom = select(_e138, 0.0001f, (abs(_e135) < 0.0001f));\n let _e142 = unnamed.uFogMedium[0u];\n let _e143 = t;\n let _e145 = before;\n let _e149 = (*dist);\n let _e150 = start;\n let _e153 = denom;\n let _e158 = denom;\n depth = ((((_e142 * exp((-(_e143) * _e145))) * (_e149 - _e150)) * (1f - exp(-(_e153)))) / _e158);\n let _e162 = unnamed.uFogLayer2_[0u];\n if (_e162 > 0f) {\n let _e164 = (*pointY);\n let _e167 = unnamed.uFogMedium[2u];\n let _e171 = unnamed.uFogLayer2_[1u];\n t2_ = ((_e164 - _e167) * _e171);\n let _e173 = t2_;\n let _e174 = before;\n rest2_ = (_e173 * (1f - _e174));\n let _e177 = rest2_;\n let _e180 = rest2_;\n denom2_ = select(_e180, 0.0001f, (abs(_e177) < 0.0001f));\n let _e184 = unnamed.uFogLayer2_[0u];\n let _e185 = t2_;\n let _e187 = before;\n let _e191 = (*dist);\n let _e192 = start;\n let _e195 = denom2_;\n let _e200 = denom2_;\n let _e202 = depth;\n depth = (_e202 + ((((_e184 * exp((-(_e185) * _e187))) * (_e191 - _e192)) * (1f - exp(-(_e195)))) / _e200));\n }\n let _e204 = depth;\n return _e204;\n}\n\nfn mediumFog_u0028_f1_u003b_f1_u003b(dist_1: ptr<function, f32>, pointY_1: ptr<function, f32>) -> f32 {\n var cut: bool;\n var span: f32;\n var ramp: f32;\n var local_1: f32;\n var wetLinear: f32;\n var air: f32;\n var local_2: f32;\n var param_4: f32;\n var param_5: f32;\n var wet: f32;\n var phi_193_: bool;\n\n let _e113 = unnamed.uFogLayer2_[3u];\n let _e114 = (_e113 > 0f);\n phi_193_ = _e114;\n if _e114 {\n let _e115 = (*dist_1);\n let _e118 = unnamed.uFogLayer2_[3u];\n phi_193_ = (_e115 > _e118);\n }\n let _e121 = phi_193_;\n cut = _e121;\n let _e124 = unnamed.uFogRange[2u];\n if (_e124 == 1f) {\n let _e128 = unnamed.uFogRange[1u];\n let _e131 = unnamed.uFogRange[0u];\n span = max((_e128 - _e131), 0.0001f);\n let _e134 = cut;\n if _e134 {\n local_1 = 0f;\n } else {\n let _e135 = (*dist_1);\n let _e138 = unnamed.uFogRange[0u];\n let _e140 = span;\n let _e145 = unnamed.uFogLayer2_[2u];\n local_1 = min(clamp(((_e135 - _e138) / _e140), 0f, 1f), (1f - _e145));\n }\n let _e148 = local_1;\n ramp = _e148;\n let _e150 = unnamed.uUnderwaterFactor;\n if (_e150 <= 0f) {\n let _e152 = ramp;\n return _e152;\n }\n let _e155 = unnamed.uFogMedium[3u];\n let _e156 = (*dist_1);\n wetLinear = (_e155 * _e156);\n let _e158 = ramp;\n let _e159 = wetLinear;\n let _e161 = wetLinear;\n let _e167 = unnamed.uUnderwaterFactor;\n return mix(_e158, (1f - exp2(((-(_e159) * _e161) * 1.442695f))), _e167);\n }\n let _e169 = cut;\n if _e169 {\n local_2 = 0f;\n } else {\n let _e170 = (*dist_1);\n param_4 = _e170;\n let _e171 = (*pointY_1);\n param_5 = _e171;\n let _e172 = hazeDepth_u0028_f1_u003b_f1_u003b((&param_4), (&param_5));\n let _e177 = unnamed.uFogLayer2_[2u];\n local_2 = (1f - max(exp(-(_e172)), _e177));\n }\n let _e180 = local_2;\n air = _e180;\n let _e182 = unnamed.uUnderwaterFactor;\n if (_e182 <= 0f) {\n let _e184 = air;\n return _e184;\n }\n let _e187 = unnamed.uFogMedium[3u];\n let _e188 = (*dist_1);\n wet = (_e187 * _e188);\n let _e190 = air;\n let _e191 = wet;\n let _e193 = wet;\n let _e199 = unnamed.uUnderwaterFactor;\n return mix(_e190, (1f - exp2(((-(_e191) * _e193) * 1.442695f))), _e199);\n}\n\nfn hash21_u0028_vf2_u003b(p: ptr<function, vec2<f32>>) -> f32 {\n let _e100 = (*p);\n return fract((sin(dot(_e100, 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_6: vec2<f32>;\n var param_7: vec2<f32>;\n var param_8: vec2<f32>;\n var param_9: vec2<f32>;\n\n let _e107 = (*p_1);\n i = floor(_e107);\n let _e109 = (*p_1);\n f = fract(_e109);\n let _e111 = f;\n let _e112 = f;\n let _e114 = f;\n u = ((_e111 * _e112) * (vec2(3f) - (_e114 * 2f)));\n let _e119 = i;\n param_6 = _e119;\n let _e120 = hash21_u0028_vf2_u003b((&param_6));\n let _e121 = i;\n param_7 = (_e121 + vec2<f32>(1f, 0f));\n let _e123 = hash21_u0028_vf2_u003b((&param_7));\n let _e125 = u[0u];\n let _e127 = i;\n param_8 = (_e127 + vec2<f32>(0f, 1f));\n let _e129 = hash21_u0028_vf2_u003b((&param_8));\n let _e130 = i;\n param_9 = (_e130 + vec2<f32>(1f, 1f));\n let _e132 = hash21_u0028_vf2_u003b((&param_9));\n let _e134 = u[0u];\n let _e137 = u[1u];\n return mix(mix(_e120, _e123, _e125), mix(_e129, _e132, _e134), _e137);\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_10: vec2<f32>;\n var outer: f32;\n var param_11: vec2<f32>;\n var swirl: f32;\n var param_12: 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_13: f32;\n var param_14: f32;\n var param_15: vec3<f32>;\n var phi_528_: bool;\n\n let _e119 = unnamed.uClipEnabled;\n let _e120 = (_e119 != 0i);\n phi_528_ = _e120;\n if _e120 {\n let _e121 = vWorldPos_1;\n let _e127 = unnamed.uClipPlane;\n phi_528_ = (dot(vec4<f32>(_e121.x, _e121.y, _e121.z, 1f), _e127) < 0f);\n }\n let _e131 = phi_528_;\n if _e131 {\n discard;\n }\n let _e132 = vUv_1;\n radius = (length((_e132 - vec2(0.5f))) * 2f);\n let _e137 = radius;\n if (_e137 >= 1f) {\n discard;\n }\n let _e139 = vUv_1;\n d = (_e139 - vec2(0.5f));\n let _e143 = d[1u];\n let _e145 = d[0u];\n angle = atan2(_e143, _e145);\n let _e148 = unnamed.uTime;\n let _e149 = vSeed_1;\n t_1 = (_e148 + (_e149 * 37f));\n let _e152 = angle;\n let _e154 = t_1;\n let _e157 = radius;\n param_10 = vec2<f32>(((_e152 * 1.9f) + (_e154 * 0.55f)), (_e157 * 4.2f));\n let _e160 = valueNoise_u0028_vf2_u003b((&param_10));\n inner = _e160;\n let _e161 = angle;\n let _e163 = t_1;\n let _e166 = radius;\n param_11 = vec2<f32>(((_e161 * 3.1f) - (_e163 * 0.34f)), (_e166 * 2.6f));\n let _e169 = valueNoise_u0028_vf2_u003b((&param_11));\n outer = _e169;\n let _e170 = inner;\n let _e172 = outer;\n swirl = ((_e170 * 0.62f) + (_e172 * 0.38f));\n let _e176 = unnamed.uNoiseOctaves;\n if (_e176 > 1i) {\n let _e178 = swirl;\n let _e179 = swirl;\n let _e180 = angle;\n let _e182 = t_1;\n let _e185 = radius;\n param_12 = vec2<f32>(((_e180 * 6.3f) + (_e182 * 0.9f)), (_e185 * 8f));\n let _e188 = valueNoise_u0028_vf2_u003b((&param_12));\n swirl = mix(_e178, ((_e179 * _e188) * 2f), 0.35f);\n }\n let _e192 = radius;\n core = (1f - smoothstep(0f, 0.28f, _e192));\n let _e195 = radius;\n let _e198 = swirl;\n corona = ((1f - smoothstep(0.18f, 1f, _e195)) * (0.35f + (_e198 * 0.65f)));\n let _e202 = core;\n let _e204 = corona;\n body = ((_e202 * 0.9f) + _e204);\n let _e206 = body;\n if (_e206 <= 0.02f) {\n discard;\n }\n let _e209 = unnamed.uTint;\n let _e212 = unnamed.uTint;\n let _e213 = body;\n col = mix((_e209 * 0.35f), _e212, vec3(smoothstep(0f, 0.55f, _e213)));\n let _e217 = col;\n let _e218 = body;\n col = mix(_e217, vec3<f32>(1f, 1f, 1f), vec3(smoothstep(0.82f, 1.4f, _e218)));\n let _e223 = unnamed.uTint;\n let _e224 = col;\n col = (_e224 * _e223);\n let _e226 = body;\n alpha = clamp((_e226 * 1.6f), 0f, 1f);\n let _e229 = vDistance_1;\n param_13 = _e229;\n let _e231 = vWorldPos_1[1u];\n param_14 = _e231;\n let _e232 = mediumFog_u0028_f1_u003b_f1_u003b((&param_13), (&param_14));\n fog = _e232;\n let _e233 = col;\n let _e234 = mediumColor_u0028_();\n let _e235 = fog;\n col = mix(_e233, _e234, vec3(_e235));\n let _e238 = fog;\n let _e240 = alpha;\n alpha = (_e240 * (1f - _e238));\n let _e242 = col;\n param_15 = _e242;\n let _e243 = applyOutputTransform_u0028_vf3_u003b((&param_15));\n let _e244 = alpha;\n outColor = vec4<f32>(_e243.x, _e243.y, _e243.z, _e244);\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
  *
@@ -7,7 +7,7 @@ export declare const ARCANE_FRAG_WGSL = "struct Uniforms {\n uTime: f32,\n
7
7
  export declare const ARCANE_BINDINGS: {
8
8
  readonly ARCANE_FRAG: {
9
9
  readonly uniforms: 1;
10
- readonly uniformSize: 144;
10
+ readonly uniformSize: 192;
11
11
  readonly fields: {
12
12
  readonly uTime: {
13
13
  readonly offset: 0;
@@ -19,78 +19,68 @@ export declare const ARCANE_BINDINGS: {
19
19
  readonly size: 12;
20
20
  readonly type: "vec3";
21
21
  };
22
- readonly uFogDensity: {
23
- readonly offset: 28;
24
- readonly size: 4;
25
- readonly type: "float";
26
- };
27
- readonly uFogHeightFalloff: {
22
+ readonly uFogMedium: {
28
23
  readonly offset: 32;
29
- readonly size: 4;
30
- readonly type: "float";
24
+ readonly size: 16;
25
+ readonly type: "vec4";
31
26
  };
32
- readonly uFogEyeY: {
33
- readonly offset: 36;
34
- readonly size: 4;
35
- readonly type: "float";
27
+ readonly uFogRange: {
28
+ readonly offset: 48;
29
+ readonly size: 16;
30
+ readonly type: "vec4";
36
31
  };
37
32
  readonly uUnderwaterColor: {
38
- readonly offset: 48;
33
+ readonly offset: 64;
39
34
  readonly size: 12;
40
35
  readonly type: "vec3";
41
36
  };
42
- readonly uUnderwaterFogDensity: {
43
- readonly offset: 60;
44
- readonly size: 4;
45
- readonly type: "float";
46
- };
47
37
  readonly uUnderwaterFactor: {
48
- readonly offset: 64;
38
+ readonly offset: 76;
49
39
  readonly size: 4;
50
40
  readonly type: "float";
51
41
  };
52
- readonly uFogMode: {
53
- readonly offset: 68;
54
- readonly size: 4;
55
- readonly type: "int";
42
+ readonly uFogLayer2: {
43
+ readonly offset: 80;
44
+ readonly size: 16;
45
+ readonly type: "vec4";
56
46
  };
57
- readonly uFogNear: {
58
- readonly offset: 72;
59
- readonly size: 4;
60
- readonly type: "float";
47
+ readonly uFogGlow: {
48
+ readonly offset: 96;
49
+ readonly size: 16;
50
+ readonly type: "vec4";
61
51
  };
62
- readonly uFogFar: {
63
- readonly offset: 76;
64
- readonly size: 4;
65
- readonly type: "float";
52
+ readonly uFogGlowDir: {
53
+ readonly offset: 112;
54
+ readonly size: 16;
55
+ readonly type: "vec4";
66
56
  };
67
57
  readonly uNoiseOctaves: {
68
- readonly offset: 80;
58
+ readonly offset: 128;
69
59
  readonly size: 4;
70
60
  readonly type: "int";
71
61
  };
72
62
  readonly uClipPlane: {
73
- readonly offset: 96;
63
+ readonly offset: 144;
74
64
  readonly size: 16;
75
65
  readonly type: "vec4";
76
66
  };
77
67
  readonly uClipEnabled: {
78
- readonly offset: 112;
68
+ readonly offset: 160;
79
69
  readonly size: 4;
80
70
  readonly type: "int";
81
71
  };
82
72
  readonly uOutputTransform: {
83
- readonly offset: 116;
73
+ readonly offset: 164;
84
74
  readonly size: 4;
85
75
  readonly type: "int";
86
76
  };
87
77
  readonly uOutputExposure: {
88
- readonly offset: 120;
78
+ readonly offset: 168;
89
79
  readonly size: 4;
90
80
  readonly type: "float";
91
81
  };
92
82
  readonly uTint: {
93
- readonly offset: 128;
83
+ readonly offset: 176;
94
84
  readonly size: 12;
95
85
  readonly type: "vec3";
96
86
  };