@driftengine/core 4.8.5 → 4.8.7

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 (214) hide show
  1. package/CHANGELOG.json +4392 -4250
  2. package/README.md +1 -1
  3. package/dist/index.d.ts +12 -4
  4. package/dist/index.js +12 -2
  5. package/dist/render/ambientHarmonics.d.ts +46 -0
  6. package/dist/render/ambientHarmonics.js +80 -0
  7. package/dist/render/anisotropicLobe.d.ts +10 -0
  8. package/dist/render/anisotropicLobe.js +19 -0
  9. package/dist/render/areaLights.d.ts +54 -0
  10. package/dist/render/areaLights.js +55 -0
  11. package/dist/render/backend/api.d.ts +43 -2
  12. package/dist/render/backend/webgl2/instanced.d.ts +2 -0
  13. package/dist/render/backend/webgl2/instanced.js +11 -2
  14. package/dist/render/backend/webgl2/renderer.d.ts +120 -11
  15. package/dist/render/backend/webgl2/renderer.js +356 -53
  16. package/dist/render/backend/webgl2/sceneCaptureTarget.d.ts +29 -0
  17. package/dist/render/backend/webgl2/sceneCaptureTarget.js +96 -0
  18. package/dist/render/backend/webgl2/skinScatter.d.ts +14 -0
  19. package/dist/render/backend/webgl2/skinScatter.js +88 -26
  20. package/dist/render/backend/webgpu/buffers.js +2 -1
  21. package/dist/render/backend/webgpu/clusterBinner.js +3 -2
  22. package/dist/render/backend/webgpu/flatPass.d.ts +7 -5
  23. package/dist/render/backend/webgpu/flatPass.js +15 -13
  24. package/dist/render/backend/webgpu/particlePass.d.ts +37 -4
  25. package/dist/render/backend/webgpu/particlePass.js +81 -12
  26. package/dist/render/backend/webgpu/postPass.d.ts +6 -1
  27. package/dist/render/backend/webgpu/postPass.js +7 -2
  28. package/dist/render/backend/webgpu/renderer.d.ts +93 -8
  29. package/dist/render/backend/webgpu/renderer.js +483 -93
  30. package/dist/render/backend/webgpu/sceneCaptureTarget.d.ts +24 -0
  31. package/dist/render/backend/webgpu/sceneCaptureTarget.js +59 -0
  32. package/dist/render/backend/webgpu/shaders/clusterBin.wgsl.d.ts +1 -1
  33. package/dist/render/backend/webgpu/shaders/clusterBin.wgsl.js +41 -1
  34. package/dist/render/backend/webgpu/skinPaletteRing.d.ts +40 -28
  35. package/dist/render/backend/webgpu/skinPaletteRing.js +69 -32
  36. package/dist/render/backend/webgpu/skinScatterPass.d.ts +10 -2
  37. package/dist/render/backend/webgpu/skinScatterPass.js +59 -9
  38. package/dist/render/backend/webgpu/surfaceTexturePass.d.ts +5 -1
  39. package/dist/render/backend/webgpu/surfaceTexturePass.js +45 -5
  40. package/dist/render/backend/webgpu/waterPass.d.ts +1 -1
  41. package/dist/render/bloomChain.d.ts +44 -0
  42. package/dist/render/bloomChain.js +28 -0
  43. package/dist/render/bloomPass.d.ts +3 -1
  44. package/dist/render/bloomPass.js +16 -2
  45. package/dist/render/clusteredLights.d.ts +78 -6
  46. package/dist/render/clusteredLights.js +214 -13
  47. package/dist/render/driftLight/bake.d.ts +2 -0
  48. package/dist/render/driftLight/bake.js +1 -1
  49. package/dist/render/driftLight/falloff.d.ts +4 -2
  50. package/dist/render/driftLight/falloff.js +8 -2
  51. package/dist/render/fixtureAtlas.js +1 -1
  52. package/dist/render/gi/bounceLights.d.ts +3 -2
  53. package/dist/render/gi/bounceLights.js +8 -3
  54. package/dist/render/instanceCull.js +12 -0
  55. package/dist/render/instances.d.ts +47 -11
  56. package/dist/render/instances.js +24 -9
  57. package/dist/render/lightBudget.d.ts +38 -2
  58. package/dist/render/lightBudget.js +48 -5
  59. package/dist/render/lightmap.d.ts +116 -0
  60. package/dist/render/lightmap.js +140 -0
  61. package/dist/render/mesh.js +2 -1
  62. package/dist/render/particleBatch.d.ts +59 -3
  63. package/dist/render/particleBatch.js +53 -2
  64. package/dist/render/particleMaterial.d.ts +6 -1
  65. package/dist/render/particleMaterial.js +10 -2
  66. package/dist/render/particlePool.d.ts +32 -0
  67. package/dist/render/particlePool.js +9 -0
  68. package/dist/render/particleSort.d.ts +34 -0
  69. package/dist/render/particleSort.js +96 -0
  70. package/dist/render/pointLightSelection.d.ts +13 -0
  71. package/dist/render/pointLightSelection.js +3 -1
  72. package/dist/render/renderQuality.d.ts +8 -7
  73. package/dist/render/rendererHarness.js +3 -0
  74. package/dist/render/rgb9e5.d.ts +22 -0
  75. package/dist/render/rgb9e5.js +47 -0
  76. package/dist/render/sceneCapture.d.ts +29 -0
  77. package/dist/render/sceneCapture.js +36 -0
  78. package/dist/render/sceneTarget.d.ts +5 -0
  79. package/dist/render/sceneTarget.js +8 -1
  80. package/dist/render/screenSpaceReflection.d.ts +27 -1
  81. package/dist/render/screenSpaceReflection.js +9 -0
  82. package/dist/render/shaders/bloom.d.ts +8 -4
  83. package/dist/render/shaders/bloom.js +20 -3
  84. package/dist/render/shaders/bolt.d.ts +1 -1
  85. package/dist/render/shaders/bolt.js +7 -1
  86. package/dist/render/shaders/depth.js +11 -0
  87. package/dist/render/shaders/flat/anisotropic.d.ts +1 -1
  88. package/dist/render/shaders/flat/anisotropic.js +37 -3
  89. package/dist/render/shaders/flat/areaLight.d.ts +10 -0
  90. package/dist/render/shaders/flat/areaLight.js +142 -0
  91. package/dist/render/shaders/flat/glassTint.d.ts +3 -2
  92. package/dist/render/shaders/flat/glassTint.js +3 -1
  93. package/dist/render/shaders/flat/index.d.ts +5 -0
  94. package/dist/render/shaders/flat/index.js +46 -6
  95. package/dist/render/shaders/flat/lobes.d.ts +6 -0
  96. package/dist/render/shaders/flat/lobes.js +49 -43
  97. package/dist/render/shaders/flat/main.d.ts +1 -1
  98. package/dist/render/shaders/flat/main.js +158 -121
  99. package/dist/render/shaders/flat/models.d.ts +21 -6
  100. package/dist/render/shaders/flat/models.js +161 -17
  101. package/dist/render/shaders/flat/normalMap.d.ts +10 -0
  102. package/dist/render/shaders/flat/normalMap.js +25 -0
  103. package/dist/render/shaders/flat/preamble.js +84 -40
  104. package/dist/render/shaders/flat/skin.js +6 -5
  105. package/dist/render/shaders/generated/bloom.wgsl.d.ts +13 -3
  106. package/dist/render/shaders/generated/bloom.wgsl.js +13 -3
  107. package/dist/render/shaders/generated/bolt.wgsl.d.ts +1 -1
  108. package/dist/render/shaders/generated/bolt.wgsl.js +1 -1
  109. package/dist/render/shaders/generated/depth.wgsl.d.ts +4 -4
  110. package/dist/render/shaders/generated/depth.wgsl.js +4 -4
  111. package/dist/render/shaders/generated/flat.wgsl.d.ts +1647 -2044
  112. package/dist/render/shaders/generated/flat.wgsl.js +1685 -2082
  113. package/dist/render/shaders/generated/particle.wgsl.d.ts +115 -1
  114. package/dist/render/shaders/generated/particle.wgsl.js +115 -1
  115. package/dist/render/shaders/generated/skinBlur.wgsl.d.ts +12 -2
  116. package/dist/render/shaders/generated/skinBlur.wgsl.js +12 -2
  117. package/dist/render/shaders/generated/ssrTrace.wgsl.d.ts +11 -6
  118. package/dist/render/shaders/generated/ssrTrace.wgsl.js +11 -6
  119. package/dist/render/shaders/generated/water.wgsl.d.ts +23 -16
  120. package/dist/render/shaders/generated/water.wgsl.js +23 -16
  121. package/dist/render/shaders/gi/probeBake.wgsl.js +9 -5
  122. package/dist/render/shaders/particle.d.ts +17 -1
  123. package/dist/render/shaders/particle.js +133 -1
  124. package/dist/render/shaders/recon/motion.wgsl.d.ts +1 -1
  125. package/dist/render/shaders/recon/motion.wgsl.js +13 -2
  126. package/dist/render/shaders/skinBlur.js +25 -3
  127. package/dist/render/shaders/ssrTrace.js +20 -1
  128. package/dist/render/shaders/water.d.ts +1 -1
  129. package/dist/render/shaders/water.js +12 -3
  130. package/dist/render/skinBlur.d.ts +8 -5
  131. package/dist/render/skinBlur.js +8 -5
  132. package/dist/render/skinScatter.d.ts +3 -1
  133. package/dist/render/skinScatter.js +3 -1
  134. package/dist/render/ssrPass.js +1 -0
  135. package/dist/render/surfaceModel.d.ts +49 -8
  136. package/dist/render/surfaceModel.js +54 -8
  137. package/dist/render/surfaceTexture.d.ts +38 -1
  138. package/dist/render/surfaceTexture.js +37 -2
  139. package/package.json +6 -6
  140. package/src/index.ts +26 -3
  141. package/src/render/ambientHarmonics.ts +92 -0
  142. package/src/render/anisotropicLobe.ts +29 -0
  143. package/src/render/areaLights.ts +97 -0
  144. package/src/render/backend/api.ts +61 -1
  145. package/src/render/backend/webgl2/instanced.ts +12 -2
  146. package/src/render/backend/webgl2/renderer.ts +470 -59
  147. package/src/render/backend/webgl2/sceneCaptureTarget.ts +130 -0
  148. package/src/render/backend/webgl2/skinScatter.ts +120 -43
  149. package/src/render/backend/webgpu/buffers.ts +2 -1
  150. package/src/render/backend/webgpu/clusterBinner.ts +3 -1
  151. package/src/render/backend/webgpu/flatPass.ts +18 -13
  152. package/src/render/backend/webgpu/particlePass.ts +119 -12
  153. package/src/render/backend/webgpu/postPass.ts +7 -2
  154. package/src/render/backend/webgpu/renderer.ts +589 -113
  155. package/src/render/backend/webgpu/sceneCaptureTarget.ts +63 -0
  156. package/src/render/backend/webgpu/shaders/clusterBin.wgsl.ts +41 -1
  157. package/src/render/backend/webgpu/skinPaletteRing.ts +65 -33
  158. package/src/render/backend/webgpu/skinScatterPass.ts +59 -9
  159. package/src/render/backend/webgpu/surfaceTexturePass.ts +57 -6
  160. package/src/render/bloomChain.ts +69 -0
  161. package/src/render/bloomPass.ts +26 -2
  162. package/src/render/clusteredLights.ts +259 -12
  163. package/src/render/driftLight/bake.ts +3 -1
  164. package/src/render/driftLight/falloff.ts +13 -2
  165. package/src/render/fixtureAtlas.ts +1 -1
  166. package/src/render/gi/bounceLights.ts +12 -3
  167. package/src/render/instanceCull.ts +9 -0
  168. package/src/render/instances.ts +61 -12
  169. package/src/render/lightBudget.ts +88 -4
  170. package/src/render/lightmap.ts +243 -0
  171. package/src/render/mesh.ts +2 -1
  172. package/src/render/particleBatch.ts +95 -4
  173. package/src/render/particleMaterial.ts +11 -1
  174. package/src/render/particlePool.ts +36 -0
  175. package/src/render/particleSort.ts +133 -0
  176. package/src/render/pointLightSelection.ts +20 -1
  177. package/src/render/renderQuality.ts +8 -7
  178. package/src/render/rendererHarness.ts +3 -0
  179. package/src/render/rgb9e5.ts +52 -0
  180. package/src/render/sceneCapture.ts +56 -0
  181. package/src/render/sceneTarget.ts +18 -1
  182. package/src/render/screenSpaceReflection.ts +33 -1
  183. package/src/render/shaders/bloom.ts +20 -3
  184. package/src/render/shaders/bolt.ts +7 -1
  185. package/src/render/shaders/depth.ts +11 -0
  186. package/src/render/shaders/flat/anisotropic.ts +37 -3
  187. package/src/render/shaders/flat/areaLight.ts +142 -0
  188. package/src/render/shaders/flat/glassTint.ts +9 -2
  189. package/src/render/shaders/flat/index.ts +51 -6
  190. package/src/render/shaders/flat/lobes.ts +50 -43
  191. package/src/render/shaders/flat/main.ts +158 -121
  192. package/src/render/shaders/flat/models.ts +170 -21
  193. package/src/render/shaders/flat/normalMap.ts +25 -0
  194. package/src/render/shaders/flat/preamble.ts +84 -40
  195. package/src/render/shaders/flat/skin.ts +6 -5
  196. package/src/render/shaders/generated/bloom.wgsl.ts +13 -3
  197. package/src/render/shaders/generated/bolt.wgsl.ts +1 -1
  198. package/src/render/shaders/generated/depth.wgsl.ts +4 -4
  199. package/src/render/shaders/generated/flat.wgsl.ts +1685 -2082
  200. package/src/render/shaders/generated/particle.wgsl.ts +116 -1
  201. package/src/render/shaders/generated/skinBlur.wgsl.ts +12 -2
  202. package/src/render/shaders/generated/ssrTrace.wgsl.ts +11 -6
  203. package/src/render/shaders/generated/water.wgsl.ts +23 -16
  204. package/src/render/shaders/gi/probeBake.wgsl.ts +9 -5
  205. package/src/render/shaders/particle.ts +134 -1
  206. package/src/render/shaders/recon/motion.wgsl.ts +13 -2
  207. package/src/render/shaders/skinBlur.ts +25 -3
  208. package/src/render/shaders/ssrTrace.ts +20 -1
  209. package/src/render/shaders/water.ts +12 -3
  210. package/src/render/skinBlur.ts +8 -5
  211. package/src/render/skinScatter.ts +3 -1
  212. package/src/render/ssrPass.ts +1 -0
  213. package/src/render/surfaceModel.ts +82 -10
  214. package/src/render/surfaceTexture.ts +101 -3
@@ -13,6 +13,7 @@ import type { PassDefinition, PassHandle } from '../../pass.ts';
13
13
  import type { Vec3 } from '../../../math/color.ts';
14
14
  import { GpuTimer } from '../../gpuTimer.ts';
15
15
  import type { ColourGradeLut } from '../../colourGrade.ts';
16
+ import { type BloomResponse } from '../../bloomChain.ts';
16
17
  import { LightField } from '../../driftLight/lightField.ts';
17
18
  import type { LightFieldOptions, LightFieldSource } from '../../driftLight/lightField.ts';
18
19
  import type { DenseLightVolume } from '../../driftLight/denseField.ts';
@@ -33,6 +34,7 @@ import type { WorldLightFieldOptions } from '../../driftLight/worldLightField.ts
33
34
  * Beyond this the velocity is shortened and the direction kept.
34
35
  */
35
36
  import type { RendererApi } from '../api.ts';
37
+ import type { LightmapPage } from '../../lightmap.ts';
36
38
  import type { ClothBindingData } from '../../clothBindingData.ts';
37
39
  import { GlClothBinding, GlClothParticles } from './clothTextures.ts';
38
40
  import type { ProbeBakeOptions } from '../../reflectionProbe.ts';
@@ -59,7 +61,7 @@ import type { Atmosphere } from '../../atmosphere.ts';
59
61
  import { InstancedMesh } from '../../instancedMesh.ts';
60
62
  import { ParticleBatch } from '../../particleBatch.ts';
61
63
  import type { ParticleBatchOptions } from '../../particleBatch.ts';
62
- import type { ParticleInstances } from '../../particlePool.ts';
64
+ import type { DeviceParticles, ParticleInstances } from '../../particlePool.ts';
63
65
  import { BoltBatch } from '../../boltBatch.ts';
64
66
  import type { BoltSegments } from '../../boltPool.ts';
65
67
  import { LineBatch } from '../../lineBatch.ts';
@@ -196,6 +198,11 @@ export interface Environment extends Atmosphere {
196
198
  lightDirections: Float32Array;
197
199
  /** Two per active light: the cosine of the inner cone angle, then of the outer. */
198
200
  lightConeCos: Float32Array;
201
+ /**
202
+ * One per active light: its own falloff exponent, or 0 for the frame's. Optional: absent is 0 for
203
+ * every light. See `PointLightSource.falloffExponent`.
204
+ */
205
+ lightFalloffExponents?: Float32Array;
199
206
  /** One per active light: a row of the photometric atlas, or −1 for none. */
200
207
  lightIesProfiles: Float32Array;
201
208
  /**
@@ -208,6 +215,12 @@ export interface Environment extends Atmosphere {
208
215
  lightIesAxes: Float32Array;
209
216
  /** One per active light: a tile of the cookie atlas, or −1 for none. */
210
217
  lightCookies: Float32Array;
218
+ /**
219
+ * One per active light: the lighting channels it lights, a mask from 1 to 255. Absent, short, or
220
+ * a light at 1 is the default channel every surface is on too. See `PointLightSet.lightChannels`
221
+ * and `SurfaceMaterial.lightChannels`.
222
+ */
223
+ lightChannels?: Float32Array;
211
224
  /**
212
225
  * The rectangular emitters this frame, or null for none.
213
226
  *
@@ -994,6 +1007,23 @@ export declare class WebGL2Renderer implements RendererApi {
994
1007
  private motionBlurScale;
995
1008
  /** How much of the bloom ceiling this frame takes. See `setBloom`. */
996
1009
  private bloomScale;
1010
+ /** The draw's own ambient, as `packAmbientSH` writes it; zeros are the frame's. */
1011
+ private readonly ambientSH;
1012
+ /** Scratch for a sprite's depth conversion, so a particle draw allocates nothing. */
1013
+ private readonly spriteInverseProjection;
1014
+ /** Said once: a sprite asked for a soft edge where no depth copy could be had. */
1015
+ private warnedSpriteDepth;
1016
+ /** Said once: more rectangles than the fixed arm shades, and no froxel table for the rest. */
1017
+ private warnedAreaOverflow;
1018
+ /**
1019
+ * `uEnvironmentDials` as it stands: which chain the probe holds, the reflectivity, the gain. One
1020
+ * vector on the device, so written whole, and kept here so a setter moving one keeps the others.
1021
+ */
1022
+ private readonly environmentDials;
1023
+ /** `uEmission` as it stands: the emissive gain and the night factor. */
1024
+ private readonly emission;
1025
+ /** The ramp and each level's tint, as `resolveBloomResponse` writes them; the subtraction and white. */
1026
+ private readonly bloomResponse;
997
1027
  /** In scene units, once `setBloom` has moved it; null reads the profile's. */
998
1028
  private bloomThresholdSet;
999
1029
  /**
@@ -1206,6 +1236,15 @@ export declare class WebGL2Renderer implements RendererApi {
1206
1236
  private warnedEnvironmentAmbient;
1207
1237
  /** Whether a probe is being baked, so the passes that would recurse into one can tell. */
1208
1238
  private probePassActive;
1239
+ /**
1240
+ * Whether a scene capture is being drawn (`captureScene`): an off-screen pass like a bake, so the
1241
+ * frame's own view, its refraction copy and skin's spread are left alone, but lit as the frame is.
1242
+ */
1243
+ private capturePassActive;
1244
+ /** Each capture's framebuffer, beside the texture a material binds. See `createSceneCapture`. */
1245
+ private readonly captureTargets;
1246
+ /** Said once, where a driver refuses to draw into a capture. */
1247
+ private warnedCapture;
1209
1248
  /** Whether the bake under way lights its faces by the grid. `ProbeBakeOptions.bounce`. */
1210
1249
  private probeBounce;
1211
1250
  /** The clip-control extension, or null where this context does not offer it. */
@@ -1806,6 +1845,23 @@ export declare class WebGL2Renderer implements RendererApi {
1806
1845
  * refusal names the first that is not.
1807
1846
  */
1808
1847
  createSurfaceTextureArray(sources: readonly SurfaceSource[], options?: SurfaceTextureOptions): SurfaceTexture;
1848
+ /** A baked lightmap page, as a `lightmapModel` material's `modelMap`. See `RendererApi`. */
1849
+ createLightmap(page: LightmapPage): SurfaceTexture;
1850
+ /**
1851
+ * A texture the scene can be drawn into, for a material to show. See `RendererApi` and
1852
+ * `sceneCapture.ts`. Half floats where the frame keeps range, as a probe does.
1853
+ */
1854
+ createSceneCapture(width: number, height: number): SurfaceTexture;
1855
+ /**
1856
+ * Draw the scene into a capture from `camera`: `draw` is handed the camera, its matrices updated
1857
+ * for the capture's shape, and submits the scene as it would to the screen. See `RendererApi`.
1858
+ *
1859
+ * **Radiance, as a probe bake stores it**: the output transform and exposure are held off for the
1860
+ * pass, so the frame grades a screen showing it once. No temporal jitter, which a capture has no
1861
+ * resolve to undo. Returns whether it drew: false for a texture that is not a capture, or one the
1862
+ * driver will not draw into.
1863
+ */
1864
+ captureScene(capture: SurfaceTexture, camera: Camera, clearColor: Vec3, draw: (camera: Camera) => void): boolean;
1809
1865
  /**
1810
1866
  * Replace a surface texture's pixels, keeping the GPU object and its sampler state.
1811
1867
  *
@@ -1937,17 +1993,17 @@ export declare class WebGL2Renderer implements RendererApi {
1937
1993
  */
1938
1994
  private restoreSurfaceTextureUnit;
1939
1995
  /**
1940
- * A pass-level scale over the grain the geometry itself declared, 0 to 1.
1996
+ * The ambient the following draws take, as nine spherical-harmonic coefficients of incoming
1997
+ * radiance — red, green and blue of each, twenty-seven numbers — or `null` for the frame's own:
1998
+ * the sky's gradient, or the probes'. See `ambientHarmonics.ts` for the basis and the axes.
1941
1999
  *
1942
- * Which surfaces are mineral is now `MeshData.grain`, stated per vertex through
1943
- * `MeshBuilder.setGrain` — because it is a property of a material, and absent means none.
1944
- * This stays as the override for the case that has no answer to state: an imported model
1945
- * arrives with no grain information at all, and a caller drawing one decides for it.
1946
- *
1947
- * Pass state, like `setSurfaceTexture`, because a material covers many draws. The default
1948
- * is 1 and `bindMeshPass` restores it, so it scales geometry that declared grain and
1949
- * leaves geometry that did not exactly as it is.
2000
+ * **For a thing lit by where it stands**: a consumer sampling a stage's baked volume of indirect
2001
+ * light at a character every frame sets the result around that character's draws, and the
2002
+ * character takes the light of its spot rather than the frame's. It replaces the diffuse ambient
2003
+ * only — a glossy surface still reflects the probes — and it is pass state like the material,
2004
+ * which `bindMeshPass` clears, so a mirror or a probe bake drawn after does not inherit it.
1950
2005
  */
2006
+ setAmbientSH(coefficients: ArrayLike<number> | null): void;
1951
2007
  /**
1952
2008
  * How much of the environment the following draws mirror, 0 to 1.
1953
2009
  *
@@ -1987,6 +2043,18 @@ export declare class WebGL2Renderer implements RendererApi {
1987
2043
  * a coordinated release is happening anyway.
1988
2044
  */
1989
2045
  setEnvironmentAmbient(_amount: number): void;
2046
+ /**
2047
+ * A pass-level scale over the grain the geometry itself declared, 0 to 1.
2048
+ *
2049
+ * Which surfaces are mineral is now `MeshData.grain`, stated per vertex through
2050
+ * `MeshBuilder.setGrain` — because it is a property of a material, and absent means none.
2051
+ * This stays as the override for the case that has no answer to state: an imported model
2052
+ * arrives with no grain information at all, and a caller drawing one decides for it.
2053
+ *
2054
+ * Pass state, like `setSurfaceTexture`, because a material covers many draws. The default
2055
+ * is 1 and `bindMeshPass` restores it, so it scales geometry that declared grain and
2056
+ * leaves geometry that did not exactly as it is.
2057
+ */
1990
2058
  setSurfaceGrain(amount: number): void;
1991
2059
  /**
1992
2060
  * Whether the surfaces drawn next meet the medium: distance fog and the global medium's haze.
@@ -2014,6 +2082,8 @@ export declare class WebGL2Renderer implements RendererApi {
2014
2082
  * reads, drew what was asked.
2015
2083
  */
2016
2084
  private writeFlatFloat;
2085
+ /** A vector of material state, two to four floats, into every flat program. */
2086
+ private writeFlatVector;
2017
2087
  /** One int of material state, into every flat program, for `writeFlatFloat`'s reason. */
2018
2088
  private writeFlatInt;
2019
2089
  /**
@@ -2320,6 +2390,13 @@ export declare class WebGL2Renderer implements RendererApi {
2320
2390
  * emitters; it is a material that knows what a particle is.
2321
2391
  */
2322
2392
  createParticles(capacity: number, options: ParticleBatchOptions): ParticleBatch;
2393
+ /**
2394
+ * Particles a caller's own compute wrote: WebGPU's alone, since this backend has no compute stage
2395
+ * to have written them (`computeSupported`). Said once, and nothing is drawn.
2396
+ */
2397
+ drawDeviceParticles(_batch: ParticleBatch, _particles: DeviceParticles, _camera: Camera, _env: Environment, _timeSeconds: number): void;
2398
+ /** Said once: see `drawDeviceParticles`. */
2399
+ private warnedDeviceParticles;
2323
2400
  /**
2324
2401
  * Draw a live particle pool.
2325
2402
  *
@@ -2330,6 +2407,13 @@ export declare class WebGL2Renderer implements RendererApi {
2330
2407
  * whole milestone from a buffer nothing had ever written.
2331
2408
  */
2332
2409
  drawParticles(batch: ParticleBatch, data: ParticleInstances, camera: Camera, env: Environment, timeSeconds: number): void;
2410
+ /**
2411
+ * A sprite's two fades and the depth copy the soft one reads. The copy is the frame's opaque
2412
+ * depth, so it is taken only in the frame's own picture: in a mirror or a probe's face it would
2413
+ * be another view's, and the edge stays hard there. Without a scene target there is no copy at
2414
+ * all, and the renderer says so once rather than drawing a hard edge that was asked to be soft.
2415
+ */
2416
+ private bindSpriteFades;
2333
2417
  /** Build a batch for electrical arcs. `capacity` is in segments, not arcs. */
2334
2418
  createBolts(segmentCapacity: number, label?: string): BoltBatch;
2335
2419
  /**
@@ -3039,8 +3123,14 @@ export declare class WebGL2Renderer implements RendererApi {
3039
3123
  * and wrong for a day whose exposure spans 2.5 to 14: a courtyard blooming at noon, or candles
3040
3124
  * never blooming at night. A caller whose exposure moves passes what it wants on screen over the
3041
3125
  * exposure. Omitted leaves it where it was, so a caller that never passes one keeps the profile's.
3126
+ *
3127
+ * **`response` is how a colour comes in past the threshold and what colour each octave of the
3128
+ * halo takes** — a ramp in place of the subtraction, and a tint a level — held until moved like
3129
+ * the threshold; `null` goes back to the subtraction and white. See `BloomResponse`: it is what
3130
+ * matches a stage built for another engine's bloom, whose tints are how a strength past 1 is
3131
+ * asked for.
3042
3132
  */
3043
- setBloom(scale: number, threshold?: number): void;
3133
+ setBloom(scale: number, threshold?: number, response?: BloomResponse | null): void;
3044
3134
  /**
3045
3135
  * How thick the air is, this frame: a global participating medium filling the whole frustum.
3046
3136
  *
@@ -3550,6 +3640,25 @@ export declare class WebGL2Renderer implements RendererApi {
3550
3640
  readonly height: number;
3551
3641
  readonly data: Float32Array;
3552
3642
  }, options?: ProbeBakeOptions): boolean;
3643
+ /**
3644
+ * One layer of the declared probe grid from an image, the way `setEnvironmentImage` fills a
3645
+ * single probe: the same equirectangular image of linear RGB floats, projected onto the capture
3646
+ * cube and prefiltered into that layer, the others left as they are. Returns false — and says
3647
+ * why — where there is no probe, no grid, or no such layer.
3648
+ *
3649
+ * **What it is for**: a scene baked somewhere else. Another engine's reflection captures are
3650
+ * images taken where each one stands; a consumer fits them to a lattice — for each point, the
3651
+ * capture whose reach holds it — and hands each point its image here, where `bakeProbe` would
3652
+ * have drawn this engine's own world into it.
3653
+ *
3654
+ * `options.irradiance` decides, at grid scope as a bake's does, whether the grid also lights the
3655
+ * scene's diffuse ambient. A grid that crossfades writes the set being swept, as a bake does.
3656
+ */
3657
+ setProbeLayerImage(layer: number, image: {
3658
+ readonly width: number;
3659
+ readonly height: number;
3660
+ readonly data: Float32Array;
3661
+ }, options?: ProbeBakeOptions): boolean;
3553
3662
  /**
3554
3663
  * Draw a volume of light: a beam from a lamp, a shaft through a window, the cone under a
3555
3664
  * street light.