@driftengine/core 4.8.6 → 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.
- package/CHANGELOG.json +132 -0
- package/README.md +1 -1
- package/dist/index.d.ts +7 -2
- package/dist/index.js +8 -1
- package/dist/render/anisotropicLobe.d.ts +10 -0
- package/dist/render/anisotropicLobe.js +19 -0
- package/dist/render/areaLights.d.ts +35 -0
- package/dist/render/areaLights.js +35 -0
- package/dist/render/atmosphere.d.ts +13 -0
- package/dist/render/atmosphere.js +9 -1
- package/dist/render/backend/api.d.ts +41 -3
- package/dist/render/backend/createRenderer.d.ts +6 -0
- package/dist/render/backend/createRenderer.js +4 -1
- package/dist/render/backend/webgl2/renderer.d.ts +140 -16
- package/dist/render/backend/webgl2/renderer.js +436 -44
- package/dist/render/backend/webgl2/sceneCaptureTarget.d.ts +29 -0
- package/dist/render/backend/webgl2/sceneCaptureTarget.js +96 -0
- package/dist/render/backend/webgpu/device.d.ts +7 -1
- package/dist/render/backend/webgpu/device.js +31 -3
- package/dist/render/backend/webgpu/flatPass.d.ts +16 -1
- package/dist/render/backend/webgpu/flatPass.js +58 -26
- package/dist/render/backend/webgpu/particlePass.js +2 -1
- package/dist/render/backend/webgpu/postPass.d.ts +51 -9
- package/dist/render/backend/webgpu/postPass.js +16 -2
- package/dist/render/backend/webgpu/reflectionSurfacePass.d.ts +30 -0
- package/dist/render/backend/webgpu/reflectionSurfacePass.js +100 -0
- package/dist/render/backend/webgpu/renderer.d.ts +166 -3
- package/dist/render/backend/webgpu/renderer.js +738 -83
- package/dist/render/backend/webgpu/sceneCaptureTarget.d.ts +24 -0
- package/dist/render/backend/webgpu/sceneCaptureTarget.js +59 -0
- package/dist/render/backend/webgpu/shaders/clusterBin.wgsl.d.ts +1 -1
- package/dist/render/backend/webgpu/surfaceTexturePass.d.ts +4 -1
- package/dist/render/backend/webgpu/surfaceTexturePass.js +34 -8
- package/dist/render/backend/webgpu/waterPass.d.ts +1 -1
- package/dist/render/clusteredLights.d.ts +23 -5
- package/dist/render/clusteredLights.js +35 -8
- package/dist/render/displayRange.d.ts +31 -0
- package/dist/render/displayRange.js +47 -0
- package/dist/render/driftLight/bake.d.ts +2 -0
- package/dist/render/driftLight/bake.js +1 -1
- package/dist/render/driftLight/falloff.d.ts +4 -2
- package/dist/render/driftLight/falloff.js +8 -2
- package/dist/render/filmicCurve.d.ts +74 -0
- package/dist/render/filmicCurve.js +203 -0
- package/dist/render/fog.d.ts +4 -1
- package/dist/render/fog.js +12 -2
- package/dist/render/frame/resources.d.ts +2 -2
- package/dist/render/frame/resources.js +6 -0
- package/dist/render/frameReflections.d.ts +40 -0
- package/dist/render/frameReflections.js +48 -0
- package/dist/render/gi/bounceLights.d.ts +3 -2
- package/dist/render/gi/bounceLights.js +8 -3
- package/dist/render/instanceCull.js +5 -0
- package/dist/render/instances.d.ts +19 -5
- package/dist/render/instances.js +9 -3
- package/dist/render/lightBudget.d.ts +12 -1
- package/dist/render/lightBudget.js +23 -3
- package/dist/render/lightmap.d.ts +23 -9
- package/dist/render/lightmap.js +40 -18
- package/dist/render/particlePool.d.ts +21 -0
- package/dist/render/particlePool.js +7 -0
- package/dist/render/pass.d.ts +49 -0
- package/dist/render/pointLightSelection.d.ts +13 -0
- package/dist/render/pointLightSelection.js +3 -1
- package/dist/render/reflectionSurfaceTargets.d.ts +28 -0
- package/dist/render/reflectionSurfaceTargets.js +99 -0
- package/dist/render/renderQuality.d.ts +47 -15
- package/dist/render/renderQuality.js +4 -0
- package/dist/render/rendererHarness.js +3 -0
- package/dist/render/rgb9e5.d.ts +22 -0
- package/dist/render/rgb9e5.js +47 -0
- package/dist/render/sceneCapture.d.ts +29 -0
- package/dist/render/sceneCapture.js +36 -0
- package/dist/render/sceneTarget.d.ts +5 -0
- package/dist/render/sceneTarget.js +24 -1
- package/dist/render/screenSpaceReflection.d.ts +32 -1
- package/dist/render/screenSpaceReflection.js +14 -0
- package/dist/render/shaders/arcane.d.ts +1 -1
- package/dist/render/shaders/bolt.d.ts +1 -1
- package/dist/render/shaders/bolt.js +7 -1
- package/dist/render/shaders/caustics.d.ts +1 -1
- package/dist/render/shaders/depth.js +11 -0
- package/dist/render/shaders/film.d.ts +1 -1
- package/dist/render/shaders/filmLook.js +2 -1
- package/dist/render/shaders/fire.d.ts +1 -1
- package/dist/render/shaders/flat/anisotropic.d.ts +1 -1
- package/dist/render/shaders/flat/anisotropic.js +37 -3
- package/dist/render/shaders/flat/areaLight.d.ts +1 -1
- package/dist/render/shaders/flat/areaLight.js +46 -0
- package/dist/render/shaders/flat/glassTint.d.ts +3 -2
- package/dist/render/shaders/flat/glassTint.js +5 -1
- package/dist/render/shaders/flat/index.d.ts +15 -0
- package/dist/render/shaders/flat/index.js +22 -2
- package/dist/render/shaders/flat/lobes.d.ts +6 -0
- package/dist/render/shaders/flat/lobes.js +49 -43
- package/dist/render/shaders/flat/main.d.ts +1 -1
- package/dist/render/shaders/flat/main.js +85 -22
- package/dist/render/shaders/flat/models.d.ts +5 -2
- package/dist/render/shaders/flat/models.js +100 -16
- package/dist/render/shaders/flat/overlay.d.ts +16 -0
- package/dist/render/shaders/flat/overlay.js +117 -0
- package/dist/render/shaders/flat/pointShadow.js +1 -1
- package/dist/render/shaders/flat/preamble.js +10 -3
- package/dist/render/shaders/flat/reflectionSurface.d.ts +21 -0
- package/dist/render/shaders/flat/reflectionSurface.js +61 -0
- package/dist/render/shaders/fog.d.ts +1 -1
- package/dist/render/shaders/fog.js +9 -2
- package/dist/render/shaders/fringe.d.ts +29 -0
- package/dist/render/shaders/fringe.js +55 -0
- package/dist/render/shaders/generated/arcane.wgsl.d.ts +1 -1
- package/dist/render/shaders/generated/arcane.wgsl.js +1 -1
- package/dist/render/shaders/generated/bolt.wgsl.d.ts +1 -1
- package/dist/render/shaders/generated/bolt.wgsl.js +1 -1
- package/dist/render/shaders/generated/caustics.wgsl.d.ts +1 -1
- package/dist/render/shaders/generated/caustics.wgsl.js +1 -1
- package/dist/render/shaders/generated/depth.wgsl.d.ts +4 -4
- package/dist/render/shaders/generated/depth.wgsl.js +4 -4
- package/dist/render/shaders/generated/film.wgsl.d.ts +1 -1
- package/dist/render/shaders/generated/film.wgsl.js +1 -1
- package/dist/render/shaders/generated/fire.wgsl.d.ts +1 -1
- package/dist/render/shaders/generated/fire.wgsl.js +1 -1
- package/dist/render/shaders/generated/flat.wgsl.d.ts +192 -16
- package/dist/render/shaders/generated/flat.wgsl.js +230 -54
- package/dist/render/shaders/generated/line.wgsl.d.ts +1 -1
- package/dist/render/shaders/generated/line.wgsl.js +1 -1
- package/dist/render/shaders/generated/particle.wgsl.d.ts +4 -4
- package/dist/render/shaders/generated/particle.wgsl.js +4 -4
- package/dist/render/shaders/generated/rush.wgsl.d.ts +56 -26
- package/dist/render/shaders/generated/rush.wgsl.js +56 -26
- package/dist/render/shaders/generated/scatter.wgsl.d.ts +1 -1
- package/dist/render/shaders/generated/scatter.wgsl.js +1 -1
- package/dist/render/shaders/generated/smoke.wgsl.d.ts +1 -1
- package/dist/render/shaders/generated/smoke.wgsl.js +1 -1
- package/dist/render/shaders/generated/ssrResolve.wgsl.d.ts +29 -0
- package/dist/render/shaders/generated/ssrResolve.wgsl.js +29 -0
- package/dist/render/shaders/generated/ssrTrace.wgsl.d.ts +32 -7
- package/dist/render/shaders/generated/ssrTrace.wgsl.js +32 -7
- package/dist/render/shaders/generated/water.wgsl.d.ts +23 -16
- package/dist/render/shaders/generated/water.wgsl.js +23 -16
- package/dist/render/shaders/gi/probeBake.wgsl.js +9 -5
- package/dist/render/shaders/gpudriven/fog.wgsl.d.ts +2 -2
- package/dist/render/shaders/gpudriven/fog.wgsl.js +11 -3
- package/dist/render/shaders/line.d.ts +1 -1
- package/dist/render/shaders/particle.d.ts +3 -3
- package/dist/render/shaders/recon/motion.wgsl.d.ts +1 -1
- package/dist/render/shaders/recon/motion.wgsl.js +13 -2
- package/dist/render/shaders/rush.js +54 -11
- package/dist/render/shaders/scatter.d.ts +1 -1
- package/dist/render/shaders/smoke.d.ts +1 -1
- package/dist/render/shaders/ssrResolve.d.ts +17 -0
- package/dist/render/shaders/ssrResolve.js +51 -0
- package/dist/render/shaders/ssrTrace.js +46 -1
- package/dist/render/shaders/water.d.ts +1 -1
- package/dist/render/shaders/water.js +12 -3
- package/dist/render/skinScatter.d.ts +3 -1
- package/dist/render/skinScatter.js +3 -1
- package/dist/render/ssrPass.d.ts +16 -0
- package/dist/render/ssrPass.js +107 -1
- package/dist/render/surfaceModel.d.ts +29 -8
- package/dist/render/surfaceModel.js +33 -9
- package/dist/render/surfaceOverlay.d.ts +132 -0
- package/dist/render/surfaceOverlay.js +85 -0
- package/dist/render/surfaceTexture.d.ts +44 -1
- package/dist/render/surfaceTexture.js +96 -5
- package/dist/render/temporalAa.d.ts +14 -0
- package/dist/render/temporalAa.js +20 -0
- package/dist/render/vertexDefaults.d.ts +17 -0
- package/dist/render/vertexDefaults.js +24 -0
- package/package.json +6 -6
- package/src/index.ts +22 -2
- package/src/render/anisotropicLobe.ts +29 -0
- package/src/render/areaLights.ts +58 -0
- package/src/render/atmosphere.ts +22 -1
- package/src/render/backend/api.ts +58 -2
- package/src/render/backend/createRenderer.ts +18 -1
- package/src/render/backend/webgl2/renderer.ts +548 -50
- package/src/render/backend/webgl2/sceneCaptureTarget.ts +130 -0
- package/src/render/backend/webgpu/device.ts +42 -3
- package/src/render/backend/webgpu/flatPass.ts +63 -26
- package/src/render/backend/webgpu/particlePass.ts +2 -1
- package/src/render/backend/webgpu/postPass.ts +18 -0
- package/src/render/backend/webgpu/reflectionSurfacePass.ts +114 -0
- package/src/render/backend/webgpu/renderer.ts +927 -100
- package/src/render/backend/webgpu/sceneCaptureTarget.ts +63 -0
- package/src/render/backend/webgpu/surfaceTexturePass.ts +44 -14
- package/src/render/clusteredLights.ts +41 -8
- package/src/render/displayRange.ts +61 -0
- package/src/render/driftLight/bake.ts +3 -1
- package/src/render/driftLight/falloff.ts +13 -2
- package/src/render/filmicCurve.ts +229 -0
- package/src/render/fog.ts +19 -3
- package/src/render/frame/resources.ts +6 -0
- package/src/render/frameReflections.ts +72 -0
- package/src/render/gi/bounceLights.ts +12 -3
- package/src/render/instanceCull.ts +4 -0
- package/src/render/instances.ts +26 -6
- package/src/render/lightBudget.ts +40 -2
- package/src/render/lightmap.ts +64 -23
- package/src/render/particlePool.ts +23 -0
- package/src/render/pass.ts +53 -1
- package/src/render/pointLightSelection.ts +20 -1
- package/src/render/reflectionSurfaceTargets.ts +105 -0
- package/src/render/renderQuality.ts +52 -15
- package/src/render/rendererHarness.ts +3 -0
- package/src/render/rgb9e5.ts +52 -0
- package/src/render/sceneCapture.ts +56 -0
- package/src/render/sceneTarget.ts +30 -2
- package/src/render/screenSpaceReflection.ts +38 -1
- package/src/render/shaders/bolt.ts +7 -1
- package/src/render/shaders/depth.ts +11 -0
- package/src/render/shaders/filmLook.ts +2 -1
- package/src/render/shaders/flat/anisotropic.ts +37 -3
- package/src/render/shaders/flat/areaLight.ts +46 -0
- package/src/render/shaders/flat/glassTint.ts +13 -2
- package/src/render/shaders/flat/index.ts +37 -2
- package/src/render/shaders/flat/lobes.ts +50 -43
- package/src/render/shaders/flat/main.ts +85 -22
- package/src/render/shaders/flat/models.ts +100 -16
- package/src/render/shaders/flat/overlay.ts +117 -0
- package/src/render/shaders/flat/pointShadow.ts +1 -1
- package/src/render/shaders/flat/preamble.ts +10 -3
- package/src/render/shaders/flat/reflectionSurface.ts +61 -0
- package/src/render/shaders/fog.ts +9 -2
- package/src/render/shaders/fringe.ts +59 -0
- package/src/render/shaders/generated/arcane.wgsl.ts +1 -1
- package/src/render/shaders/generated/bolt.wgsl.ts +1 -1
- package/src/render/shaders/generated/caustics.wgsl.ts +1 -1
- package/src/render/shaders/generated/depth.wgsl.ts +4 -4
- package/src/render/shaders/generated/film.wgsl.ts +1 -1
- package/src/render/shaders/generated/fire.wgsl.ts +1 -1
- package/src/render/shaders/generated/flat.wgsl.ts +230 -54
- package/src/render/shaders/generated/line.wgsl.ts +1 -1
- package/src/render/shaders/generated/particle.wgsl.ts +4 -4
- package/src/render/shaders/generated/rush.wgsl.ts +56 -26
- package/src/render/shaders/generated/scatter.wgsl.ts +1 -1
- package/src/render/shaders/generated/smoke.wgsl.ts +1 -1
- package/src/render/shaders/generated/ssrResolve.wgsl.ts +30 -0
- package/src/render/shaders/generated/ssrTrace.wgsl.ts +32 -7
- package/src/render/shaders/generated/water.wgsl.ts +23 -16
- package/src/render/shaders/gi/probeBake.wgsl.ts +9 -5
- package/src/render/shaders/gpudriven/fog.wgsl.ts +11 -3
- package/src/render/shaders/recon/motion.wgsl.ts +13 -2
- package/src/render/shaders/rush.ts +54 -11
- package/src/render/shaders/ssrResolve.ts +52 -0
- package/src/render/shaders/ssrTrace.ts +46 -1
- package/src/render/shaders/water.ts +12 -3
- package/src/render/skinScatter.ts +3 -1
- package/src/render/ssrPass.ts +139 -1
- package/src/render/surfaceModel.ts +47 -10
- package/src/render/surfaceOverlay.ts +195 -0
- package/src/render/surfaceTexture.ts +136 -9
- package/src/render/temporalAa.ts +20 -0
- package/src/render/vertexDefaults.ts +28 -0
|
@@ -12,6 +12,7 @@ import type { ComputeDefinition, ComputeHandle } from '../../compute.ts';
|
|
|
12
12
|
import type { PassDefinition, PassHandle } from '../../pass.ts';
|
|
13
13
|
import type { Vec3 } from '../../../math/color.ts';
|
|
14
14
|
import { GpuTimer } from '../../gpuTimer.ts';
|
|
15
|
+
import { type SurfaceOverlay } from '../../surfaceOverlay.ts';
|
|
15
16
|
import type { ColourGradeLut } from '../../colourGrade.ts';
|
|
16
17
|
import { type BloomResponse } from '../../bloomChain.ts';
|
|
17
18
|
import { LightField } from '../../driftLight/lightField.ts';
|
|
@@ -61,7 +62,7 @@ import type { Atmosphere } from '../../atmosphere.ts';
|
|
|
61
62
|
import { InstancedMesh } from '../../instancedMesh.ts';
|
|
62
63
|
import { ParticleBatch } from '../../particleBatch.ts';
|
|
63
64
|
import type { ParticleBatchOptions } from '../../particleBatch.ts';
|
|
64
|
-
import type { ParticleInstances } from '../../particlePool.ts';
|
|
65
|
+
import type { DeviceParticles, ParticleInstances } from '../../particlePool.ts';
|
|
65
66
|
import { BoltBatch } from '../../boltBatch.ts';
|
|
66
67
|
import type { BoltSegments } from '../../boltPool.ts';
|
|
67
68
|
import { LineBatch } from '../../lineBatch.ts';
|
|
@@ -72,6 +73,8 @@ import { TextRenderer } from '../../textRenderer.ts';
|
|
|
72
73
|
import { SdfTextRenderer } from '../../sdfTextRenderer.ts';
|
|
73
74
|
import type { SdfFont } from '../../sdfFont.ts';
|
|
74
75
|
import type { SdfTextStyle } from '../../sdfTextLayout.ts';
|
|
76
|
+
import type { DisplayRange } from '../../displayRange.ts';
|
|
77
|
+
import { type FilmicCurve } from '../../filmicCurve.ts';
|
|
75
78
|
import type { RenderBackend } from '../api.ts';
|
|
76
79
|
import type { TextStyle } from '../../textLayout.ts';
|
|
77
80
|
import { WindStreakRenderer } from '../../windStreakRenderer.ts';
|
|
@@ -198,6 +201,11 @@ export interface Environment extends Atmosphere {
|
|
|
198
201
|
lightDirections: Float32Array;
|
|
199
202
|
/** Two per active light: the cosine of the inner cone angle, then of the outer. */
|
|
200
203
|
lightConeCos: Float32Array;
|
|
204
|
+
/**
|
|
205
|
+
* One per active light: its own falloff exponent, or 0 for the frame's. Optional: absent is 0 for
|
|
206
|
+
* every light. See `PointLightSource.falloffExponent`.
|
|
207
|
+
*/
|
|
208
|
+
lightFalloffExponents?: Float32Array;
|
|
201
209
|
/** One per active light: a row of the photometric atlas, or −1 for none. */
|
|
202
210
|
lightIesProfiles: Float32Array;
|
|
203
211
|
/**
|
|
@@ -969,6 +977,10 @@ export declare class WebGL2Renderer implements RendererApi {
|
|
|
969
977
|
private readonly reflectionQueue;
|
|
970
978
|
/** Built on the first frame that submits a surface, and never for a scene with none. */
|
|
971
979
|
private ssr;
|
|
980
|
+
/** The frame's materials' reflections, resolved; null where off. See `frameReflections.ts`. */
|
|
981
|
+
private readonly frameReflections;
|
|
982
|
+
/** Their two maps on the scene's framebuffer, null where they cannot be drawn. */
|
|
983
|
+
private readonly reflectionTargets;
|
|
972
984
|
/** Said once where a reflection cannot be traced at all. */
|
|
973
985
|
private reflectionsRefused;
|
|
974
986
|
/** Where the frame's camera stands, which is what gives a reconstructed normal its sign. */
|
|
@@ -1028,6 +1040,8 @@ export declare class WebGL2Renderer implements RendererApi {
|
|
|
1028
1040
|
* exactly as it asked to be and nothing about it changes.
|
|
1029
1041
|
*/
|
|
1030
1042
|
private exposure;
|
|
1043
|
+
/** The `filmic` curve's eight constants, held until `setFilmicCurve` is called again. */
|
|
1044
|
+
private readonly filmConstants;
|
|
1031
1045
|
/**
|
|
1032
1046
|
* This frame's veil colour, and how much of it to composite. See `setFrameVeil`.
|
|
1033
1047
|
*
|
|
@@ -1229,8 +1243,26 @@ export declare class WebGL2Renderer implements RendererApi {
|
|
|
1229
1243
|
private warnedNoPointShadowArray;
|
|
1230
1244
|
/** Said once, for the retired ambient dial. */
|
|
1231
1245
|
private warnedEnvironmentAmbient;
|
|
1246
|
+
/** The overlay the draws wear, `uOverlay`: see `setSurfaceOverlay`. */
|
|
1247
|
+
private readonly overlayFloats;
|
|
1248
|
+
/** Its atlas, and the 2D copy of it bound where the refraction copy goes. */
|
|
1249
|
+
private overlayMaps;
|
|
1250
|
+
private overlayTexture;
|
|
1251
|
+
/** Whether this device's lit stage has room for the overlay's vectors: asked once. */
|
|
1252
|
+
private overlayRoom;
|
|
1253
|
+
private warnedOverlayRoom;
|
|
1254
|
+
private warnedOverlayBlocks;
|
|
1232
1255
|
/** Whether a probe is being baked, so the passes that would recurse into one can tell. */
|
|
1233
1256
|
private probePassActive;
|
|
1257
|
+
/**
|
|
1258
|
+
* Whether a scene capture is being drawn (`captureScene`): an off-screen pass like a bake, so the
|
|
1259
|
+
* frame's own view, its refraction copy and skin's spread are left alone, but lit as the frame is.
|
|
1260
|
+
*/
|
|
1261
|
+
private capturePassActive;
|
|
1262
|
+
/** Each capture's framebuffer, beside the texture a material binds. See `createSceneCapture`. */
|
|
1263
|
+
private readonly captureTargets;
|
|
1264
|
+
/** Said once, where a driver refuses to draw into a capture. */
|
|
1265
|
+
private warnedCapture;
|
|
1234
1266
|
/** Whether the bake under way lights its faces by the grid. `ProbeBakeOptions.bounce`. */
|
|
1235
1267
|
private probeBounce;
|
|
1236
1268
|
/** The clip-control extension, or null where this context does not offer it. */
|
|
@@ -1544,6 +1576,8 @@ export declare class WebGL2Renderer implements RendererApi {
|
|
|
1544
1576
|
* call. `init` runs now rather than at the first frame, because building a pipeline in the
|
|
1545
1577
|
* frame loop is the allocation the house rules are about.
|
|
1546
1578
|
*/
|
|
1579
|
+
/** Each registered pass's declared reads, as a mask, resolved once at registration. */
|
|
1580
|
+
private readonly passReads;
|
|
1547
1581
|
registerPass(definition: PassDefinition): PassHandle;
|
|
1548
1582
|
/**
|
|
1549
1583
|
* How many registered passes declare `prepare`, so a frame with none walks nothing.
|
|
@@ -1833,6 +1867,21 @@ export declare class WebGL2Renderer implements RendererApi {
|
|
|
1833
1867
|
createSurfaceTextureArray(sources: readonly SurfaceSource[], options?: SurfaceTextureOptions): SurfaceTexture;
|
|
1834
1868
|
/** A baked lightmap page, as a `lightmapModel` material's `modelMap`. See `RendererApi`. */
|
|
1835
1869
|
createLightmap(page: LightmapPage): SurfaceTexture;
|
|
1870
|
+
/**
|
|
1871
|
+
* A texture the scene can be drawn into, for a material to show. See `RendererApi` and
|
|
1872
|
+
* `sceneCapture.ts`. Half floats where the frame keeps range, as a probe does.
|
|
1873
|
+
*/
|
|
1874
|
+
createSceneCapture(width: number, height: number): SurfaceTexture;
|
|
1875
|
+
/**
|
|
1876
|
+
* Draw the scene into a capture from `camera`: `draw` is handed the camera, its matrices updated
|
|
1877
|
+
* for the capture's shape, and submits the scene as it would to the screen. See `RendererApi`.
|
|
1878
|
+
*
|
|
1879
|
+
* **Radiance, as a probe bake stores it**: the output transform and exposure are held off for the
|
|
1880
|
+
* pass, so the frame grades a screen showing it once. No temporal jitter, which a capture has no
|
|
1881
|
+
* resolve to undo. Returns whether it drew: false for a texture that is not a capture, or one the
|
|
1882
|
+
* driver will not draw into.
|
|
1883
|
+
*/
|
|
1884
|
+
captureScene(capture: SurfaceTexture, camera: Camera, clearColor: Vec3, draw: (camera: Camera) => void): boolean;
|
|
1836
1885
|
/**
|
|
1837
1886
|
* Replace a surface texture's pixels, keeping the GPU object and its sampler state.
|
|
1838
1887
|
*
|
|
@@ -1963,18 +2012,6 @@ export declare class WebGL2Renderer implements RendererApi {
|
|
|
1963
2012
|
* program state, and this puts it back to what `currentSurfaceTexture` says it should be.
|
|
1964
2013
|
*/
|
|
1965
2014
|
private restoreSurfaceTextureUnit;
|
|
1966
|
-
/**
|
|
1967
|
-
* A pass-level scale over the grain the geometry itself declared, 0 to 1.
|
|
1968
|
-
*
|
|
1969
|
-
* Which surfaces are mineral is now `MeshData.grain`, stated per vertex through
|
|
1970
|
-
* `MeshBuilder.setGrain` — because it is a property of a material, and absent means none.
|
|
1971
|
-
* This stays as the override for the case that has no answer to state: an imported model
|
|
1972
|
-
* arrives with no grain information at all, and a caller drawing one decides for it.
|
|
1973
|
-
*
|
|
1974
|
-
* Pass state, like `setSurfaceTexture`, because a material covers many draws. The default
|
|
1975
|
-
* is 1 and `bindMeshPass` restores it, so it scales geometry that declared grain and
|
|
1976
|
-
* leaves geometry that did not exactly as it is.
|
|
1977
|
-
*/
|
|
1978
2015
|
/**
|
|
1979
2016
|
* The ambient the following draws take, as nine spherical-harmonic coefficients of incoming
|
|
1980
2017
|
* radiance — red, green and blue of each, twenty-seven numbers — or `null` for the frame's own:
|
|
@@ -1986,6 +2023,7 @@ export declare class WebGL2Renderer implements RendererApi {
|
|
|
1986
2023
|
* only — a glossy surface still reflects the probes — and it is pass state like the material,
|
|
1987
2024
|
* which `bindMeshPass` clears, so a mirror or a probe bake drawn after does not inherit it.
|
|
1988
2025
|
*/
|
|
2026
|
+
setAmbientSH(coefficients: ArrayLike<number> | null): void;
|
|
1989
2027
|
/**
|
|
1990
2028
|
* How much of the environment the following draws mirror, 0 to 1.
|
|
1991
2029
|
*
|
|
@@ -1996,8 +2034,28 @@ export declare class WebGL2Renderer implements RendererApi {
|
|
|
1996
2034
|
* Defaults to zero and bindMeshPass restores it, so a scene that never calls this looks
|
|
1997
2035
|
* exactly as it did.
|
|
1998
2036
|
*/
|
|
1999
|
-
setAmbientSH(coefficients: ArrayLike<number> | null): void;
|
|
2000
2037
|
setSurfaceReflectivity(amount: number): void;
|
|
2038
|
+
/**
|
|
2039
|
+
* The overlay the following draws wear — a rim of light, a dissolve, wrinkles by region — or null
|
|
2040
|
+
* for none. Pass state, as the material is: `bindMeshPass` puts it back to none. See
|
|
2041
|
+
* `surfaceOverlay.ts` for what it lays and `shaders/flat/overlay.ts` for how.
|
|
2042
|
+
*
|
|
2043
|
+
* **Refused, said once, where the lit stage has no room for it.** Fifteen vectors more than the
|
|
2044
|
+
* program this device fits: counted from the source as `fitFlatProgram` counts, and on a device
|
|
2045
|
+
* whose limit is the 256 an Adreno 740 reports, the eight-light build at 254 has none. The draws
|
|
2046
|
+
* then wear nothing, which is the picture a game without the feature draws. Its atlas is bound as
|
|
2047
|
+
* a 2D copy of its first layer, in the refraction copy's unit (`SurfaceTexture.flatLayer`); a
|
|
2048
|
+
* compressed atlas has no copy and is read as none, also said once.
|
|
2049
|
+
*/
|
|
2050
|
+
setSurfaceOverlay(overlay: SurfaceOverlay | null): void;
|
|
2051
|
+
/** The overlay's atlas into the refraction copy's unit, as a 2D copy, or the empty texture. */
|
|
2052
|
+
private bindOverlayMaps;
|
|
2053
|
+
/** The most fragment uniform vectors this GPU offers a stage. */
|
|
2054
|
+
private fragmentVectorLimit;
|
|
2055
|
+
/** What the lit shader at this renderer's budget leaves of the limit, with no overlay. */
|
|
2056
|
+
private overlayRoomLeft;
|
|
2057
|
+
/** Whether the lit shader with the overlay compiled in fits this GPU: counted once. */
|
|
2058
|
+
private overlayFits;
|
|
2001
2059
|
/**
|
|
2002
2060
|
* How bright the environment the surfaces drawn next reflect is. 1 is the default and identity.
|
|
2003
2061
|
*
|
|
@@ -2026,6 +2084,18 @@ export declare class WebGL2Renderer implements RendererApi {
|
|
|
2026
2084
|
* a coordinated release is happening anyway.
|
|
2027
2085
|
*/
|
|
2028
2086
|
setEnvironmentAmbient(_amount: number): void;
|
|
2087
|
+
/**
|
|
2088
|
+
* A pass-level scale over the grain the geometry itself declared, 0 to 1.
|
|
2089
|
+
*
|
|
2090
|
+
* Which surfaces are mineral is now `MeshData.grain`, stated per vertex through
|
|
2091
|
+
* `MeshBuilder.setGrain` — because it is a property of a material, and absent means none.
|
|
2092
|
+
* This stays as the override for the case that has no answer to state: an imported model
|
|
2093
|
+
* arrives with no grain information at all, and a caller drawing one decides for it.
|
|
2094
|
+
*
|
|
2095
|
+
* Pass state, like `setSurfaceTexture`, because a material covers many draws. The default
|
|
2096
|
+
* is 1 and `bindMeshPass` restores it, so it scales geometry that declared grain and
|
|
2097
|
+
* leaves geometry that did not exactly as it is.
|
|
2098
|
+
*/
|
|
2029
2099
|
setSurfaceGrain(amount: number): void;
|
|
2030
2100
|
/**
|
|
2031
2101
|
* Whether the surfaces drawn next meet the medium: distance fog and the global medium's haze.
|
|
@@ -2361,6 +2431,13 @@ export declare class WebGL2Renderer implements RendererApi {
|
|
|
2361
2431
|
* emitters; it is a material that knows what a particle is.
|
|
2362
2432
|
*/
|
|
2363
2433
|
createParticles(capacity: number, options: ParticleBatchOptions): ParticleBatch;
|
|
2434
|
+
/**
|
|
2435
|
+
* Particles a caller's own compute wrote: WebGPU's alone, since this backend has no compute stage
|
|
2436
|
+
* to have written them (`computeSupported`). Said once, and nothing is drawn.
|
|
2437
|
+
*/
|
|
2438
|
+
drawDeviceParticles(_batch: ParticleBatch, _particles: DeviceParticles, _camera: Camera, _env: Environment, _timeSeconds: number): void;
|
|
2439
|
+
/** Said once: see `drawDeviceParticles`. */
|
|
2440
|
+
private warnedDeviceParticles;
|
|
2364
2441
|
/**
|
|
2365
2442
|
* Draw a live particle pool.
|
|
2366
2443
|
*
|
|
@@ -2979,8 +3056,17 @@ export declare class WebGL2Renderer implements RendererApi {
|
|
|
2979
3056
|
* Set before `beginFrame` and held until changed, like `setSpeedRush`, which it sits
|
|
2980
3057
|
* beside for the same reason: both describe how the finished image is presented rather
|
|
2981
3058
|
* than anything in the world.
|
|
3059
|
+
*
|
|
3060
|
+
* `maxShare` is the longest smear, as a share of the frame (0.03 unless given, at most half): a
|
|
3061
|
+
* fast turn softens the frame rather than erasing it. **Each drawn object's own motion is
|
|
3062
|
+
* followed only under a reconstruction on WebGPU**, which draws the motion target it reads; here,
|
|
3063
|
+
* and on WebGPU without one, the camera's motion alone smears the frame, and a draw that names
|
|
3064
|
+
* where it was last frame is told so once.
|
|
2982
3065
|
*/
|
|
2983
|
-
setCameraMotionBlur(scale: number): void;
|
|
3066
|
+
setCameraMotionBlur(scale: number, maxShare?: number): void;
|
|
3067
|
+
/** The longest smear, as a share of the frame. See `setCameraMotionBlur`. */
|
|
3068
|
+
private motionBlurMax;
|
|
3069
|
+
private warnedObjectBlur;
|
|
2984
3070
|
/**
|
|
2985
3071
|
* The camera has cut: this frame is a new shot, not the next moment of the last one.
|
|
2986
3072
|
*
|
|
@@ -3142,6 +3228,30 @@ export declare class WebGL2Renderer implements RendererApi {
|
|
|
3142
3228
|
* black frame with a sign error in it.
|
|
3143
3229
|
*/
|
|
3144
3230
|
setOutputExposure(exposure: number): void;
|
|
3231
|
+
/**
|
|
3232
|
+
* The `filmic` curve this and every later frame is graded through, until it is set again: a
|
|
3233
|
+
* grading volume's five numbers, solved once here into the constants the resolve reads. Ignored
|
|
3234
|
+
* unless `outputTransform` is `filmic`. A number out of range is clamped into it and said once,
|
|
3235
|
+
* since a frame loop must not throw. See `filmicCurve.ts`.
|
|
3236
|
+
*/
|
|
3237
|
+
setFilmicCurve(curve: FilmicCurve): void;
|
|
3238
|
+
private warnedFilmClamped;
|
|
3239
|
+
/**
|
|
3240
|
+
* The range the frame goes out in: `'high'` where the profile asked for `highDynamicRange`, the
|
|
3241
|
+
* frame holds light past white and the display shows it — on WebGPU — and `'standard'` otherwise.
|
|
3242
|
+
* **Always standard here**: this backend draws into a canvas of eight bits a channel, which has
|
|
3243
|
+
* nothing above white to show. Typed as the question rather than this backend's answer, because
|
|
3244
|
+
* the shared surface is derived from this class.
|
|
3245
|
+
*/
|
|
3246
|
+
readonly displayRange: DisplayRange;
|
|
3247
|
+
/** Why it is that range, in words, for a game choosing its look and for a bug report. */
|
|
3248
|
+
get displayRangeReason(): string;
|
|
3249
|
+
/**
|
|
3250
|
+
* How bright paper white and the display's peak are, in one unit, held until changed: their
|
|
3251
|
+
* ratio is how far above white the highlights may run where `displayRange` is `'high'`, and
|
|
3252
|
+
* nothing changes where it is standard, which is always here.
|
|
3253
|
+
*/
|
|
3254
|
+
setDisplayLuminance(paperWhite: number, peak: number): void;
|
|
3145
3255
|
/**
|
|
3146
3256
|
* Composite a flat colour over the finished frame — for a cut dipping to white or to black.
|
|
3147
3257
|
*
|
|
@@ -3206,6 +3316,14 @@ export declare class WebGL2Renderer implements RendererApi {
|
|
|
3206
3316
|
* see `filmLook.ts`. Needs `screenEffects`, and says so once rather than doing nothing.
|
|
3207
3317
|
*/
|
|
3208
3318
|
setVignette(strength: number): void;
|
|
3319
|
+
/**
|
|
3320
|
+
* The lens's colour fringe, held until changed: `intensity` is a percentage, 0 is none, and red
|
|
3321
|
+
* and green are pulled toward the centre by their wavelength's distance from blue, growing from
|
|
3322
|
+
* `start` — a share of the half-frame, 0 the centre — to the whole of it at the edge. Applied to
|
|
3323
|
+
* scene light at the composite's first read. Needs `screenEffects`, and says so once rather than
|
|
3324
|
+
* doing nothing. See `shaders/fringe.ts`.
|
|
3325
|
+
*/
|
|
3326
|
+
setChromaticAberration(intensity: number, start?: number): void;
|
|
3209
3327
|
/**
|
|
3210
3328
|
* Film grain, held until changed: an amplitude in display values (0 is none, 0.03 is a fine
|
|
3211
3329
|
* grain) and this frame's seed. **The seed is the caller's**, because the engine takes time from
|
|
@@ -3481,12 +3599,18 @@ export declare class WebGL2Renderer implements RendererApi {
|
|
|
3481
3599
|
* here, so there is no motion target for this to be written into, and a mover passed here is
|
|
3482
3600
|
* neither read nor advanced.
|
|
3483
3601
|
*/
|
|
3484
|
-
|
|
3602
|
+
previousModel?: ReadonlyMat4 | Mover | null): void;
|
|
3485
3603
|
/**
|
|
3486
3604
|
* Whether a skin draw now draws its two halves: the profile asked, the frame has not spread its
|
|
3487
3605
|
* skin yet, this is the frame's own picture — not a mirror's or a probe's, nor an overlay after
|
|
3488
3606
|
* the frame — and the blur's target can be had.
|
|
3489
3607
|
*/
|
|
3608
|
+
/**
|
|
3609
|
+
* Whether a draw now is the frame's own, opaque and lit, and so writes the two maps beside its
|
|
3610
|
+
* colour: not a mirror's, a probe's or a capture's, whose framebuffers have no maps, and not after
|
|
3611
|
+
* the frame. See `reflectionSurfaceTargets.ts`.
|
|
3612
|
+
*/
|
|
3613
|
+
private reflectionKeeps;
|
|
3490
3614
|
private skinSplits;
|
|
3491
3615
|
/**
|
|
3492
3616
|
* Spread the frame's skin and add it back: once, at the first blended draw or at the frame's end.
|