@driftengine/core 4.13.5 → 4.14.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 +62 -0
- package/README.md +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +1 -0
- package/dist/render/backend/api.d.ts +19 -3
- package/dist/render/backend/webgl2/motionTarget.d.ts +39 -0
- package/dist/render/backend/webgl2/motionTarget.js +254 -0
- package/dist/render/backend/webgl2/pointSkinFeedback.d.ts +13 -3
- package/dist/render/backend/webgl2/pointSkinFeedback.js +45 -12
- package/dist/render/backend/webgl2/renderer.d.ts +101 -7
- package/dist/render/backend/webgl2/renderer.js +337 -9
- package/dist/render/backend/webgpu/pointSkinPass.d.ts +16 -3
- package/dist/render/backend/webgpu/pointSkinPass.js +79 -21
- package/dist/render/backend/webgpu/postPass.d.ts +6 -1
- package/dist/render/backend/webgpu/renderer.d.ts +41 -0
- package/dist/render/backend/webgpu/renderer.js +143 -5
- package/dist/render/baseDecals.d.ts +48 -0
- package/dist/render/baseDecals.js +71 -0
- package/dist/render/emissiveFlow.d.ts +40 -0
- package/dist/render/emissiveFlow.js +51 -0
- package/dist/render/fixtureAtlas.d.ts +8 -3
- package/dist/render/fixtureAtlas.js +17 -6
- package/dist/render/globalMedium.d.ts +17 -0
- package/dist/render/globalMedium.js +14 -0
- package/dist/render/globalMediumPass.js +3 -2
- package/dist/render/iridescentOverlay.d.ts +78 -0
- package/dist/render/iridescentOverlay.js +102 -0
- package/dist/render/mesh.d.ts +24 -0
- package/dist/render/mesh.js +79 -0
- package/dist/render/pointSkin.d.ts +18 -0
- package/dist/render/pointSkin.js +50 -5
- package/dist/render/recon/mover.d.ts +3 -2
- package/dist/render/recon/mover.js +3 -2
- package/dist/render/sceneTarget.d.ts +2 -0
- package/dist/render/sceneTarget.js +1 -1
- package/dist/render/shaders/flat/baseDecals.d.ts +17 -0
- package/dist/render/shaders/flat/baseDecals.js +71 -0
- package/dist/render/shaders/flat/emissiveFlow.d.ts +15 -0
- package/dist/render/shaders/flat/emissiveFlow.js +45 -0
- package/dist/render/shaders/flat/glassTint.d.ts +1 -1
- package/dist/render/shaders/flat/glassTint.js +3 -0
- package/dist/render/shaders/flat/index.d.ts +16 -0
- package/dist/render/shaders/flat/index.js +9 -0
- package/dist/render/shaders/flat/iridescentOverlay.d.ts +15 -0
- package/dist/render/shaders/flat/iridescentOverlay.js +65 -0
- package/dist/render/shaders/flat/layered.js +4 -4
- package/dist/render/shaders/flat/main.d.ts +1 -1
- package/dist/render/shaders/flat/main.js +12 -1
- package/dist/render/shaders/flat/mapReads.d.ts +1 -1
- package/dist/render/shaders/flat/mapReads.js +7 -3
- package/dist/render/shaders/flat/worldUv.js +6 -5
- package/dist/render/shaders/generated/flat.wgsl.d.ts +480 -16
- package/dist/render/shaders/generated/flat.wgsl.js +519 -55
- package/dist/render/shaders/generated/temporalResolve.wgsl.d.ts +15 -5
- package/dist/render/shaders/generated/temporalResolve.wgsl.js +15 -5
- package/dist/render/shaders/temporalResolve.js +25 -9
- package/dist/render/surfaceTexture.d.ts +32 -0
- package/dist/render/temporalPass.d.ts +3 -1
- package/dist/render/temporalPass.js +9 -1
- package/package.json +6 -6
- package/src/index.ts +3 -0
- package/src/render/backend/api.ts +19 -2
- package/src/render/backend/webgl2/motionTarget.ts +299 -0
- package/src/render/backend/webgl2/pointSkinFeedback.ts +49 -14
- package/src/render/backend/webgl2/renderer.ts +411 -9
- package/src/render/backend/webgpu/pointSkinPass.ts +90 -23
- package/src/render/backend/webgpu/renderer.ts +163 -3
- package/src/render/baseDecals.ts +93 -0
- package/src/render/emissiveFlow.ts +66 -0
- package/src/render/fixtureAtlas.ts +26 -7
- package/src/render/globalMedium.ts +31 -0
- package/src/render/globalMediumPass.ts +3 -7
- package/src/render/iridescentOverlay.ts +177 -0
- package/src/render/mesh.ts +82 -0
- package/src/render/pointSkin.ts +64 -5
- package/src/render/recon/mover.ts +3 -2
- package/src/render/sceneTarget.ts +3 -0
- package/src/render/shaders/flat/baseDecals.ts +71 -0
- package/src/render/shaders/flat/emissiveFlow.ts +45 -0
- package/src/render/shaders/flat/glassTint.ts +7 -1
- package/src/render/shaders/flat/index.ts +25 -0
- package/src/render/shaders/flat/iridescentOverlay.ts +65 -0
- package/src/render/shaders/flat/layered.ts +4 -4
- package/src/render/shaders/flat/main.ts +12 -1
- package/src/render/shaders/flat/mapReads.ts +7 -3
- package/src/render/shaders/flat/worldUv.ts +6 -5
- package/src/render/shaders/generated/flat.wgsl.ts +519 -55
- package/src/render/shaders/generated/temporalResolve.wgsl.ts +15 -5
- package/src/render/shaders/temporalResolve.ts +25 -9
- package/src/render/surfaceTexture.ts +32 -0
- package/src/render/temporalPass.ts +8 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FrameBudget } from '../budget.ts';
|
|
2
|
-
import type
|
|
2
|
+
import { type Mover } from '../../recon/mover.ts';
|
|
3
3
|
import type { GlassOptions } from '../../glass.ts';
|
|
4
4
|
import type { ReadonlyMat4 } from 'gl-matrix';
|
|
5
5
|
import type { Camera } from '../../camera.ts';
|
|
@@ -15,6 +15,7 @@ import type { Vec3 } from '../../../math/color.ts';
|
|
|
15
15
|
import type { LocalExposureOptions } from '../../shaders/localExposure.ts';
|
|
16
16
|
import { GpuTimer } from '../../gpuTimer.ts';
|
|
17
17
|
import { type SurfaceOverlay } from '../../surfaceOverlay.ts';
|
|
18
|
+
import { type BaseDecal } from '../../baseDecals.ts';
|
|
18
19
|
import type { ColourGradeLut } from '../../colourGrade.ts';
|
|
19
20
|
import { type BloomResponse } from '../../bloomChain.ts';
|
|
20
21
|
import { LightField } from '../../driftLight/lightField.ts';
|
|
@@ -1230,6 +1231,17 @@ export declare class WebGL2Renderer implements RendererApi {
|
|
|
1230
1231
|
private iesAtlas;
|
|
1231
1232
|
/** The cookie images, kept so a new set of profiles can rebuild the atlas around them. */
|
|
1232
1233
|
private cookieImages;
|
|
1234
|
+
/** The images the frame's base decals lay, in the atlas's band of them. See `setBaseDecalImages`. */
|
|
1235
|
+
private decalImages;
|
|
1236
|
+
/** The decals as last laid, packed again whenever the atlas moves their band. */
|
|
1237
|
+
private baseDecalList;
|
|
1238
|
+
/** `uBaseDecals`, held until the next `setBaseDecals`, across passes. */
|
|
1239
|
+
private readonly baseDecalFloats;
|
|
1240
|
+
/** Whether the lit stage has room for base decals, asked once. */
|
|
1241
|
+
private decalRoom;
|
|
1242
|
+
private warnedDecalRoom;
|
|
1243
|
+
/** The refusals of a decal or its image already said, each once. */
|
|
1244
|
+
private readonly warnedBaseDecals;
|
|
1233
1245
|
/** Rows of profile in the atlas. One until a consumer loads a profile, which is the row of ones. */
|
|
1234
1246
|
private iesRows;
|
|
1235
1247
|
/** Cookie tiles in the atlas. 0 is none, and the whole off path. */
|
|
@@ -1312,6 +1324,18 @@ export declare class WebGL2Renderer implements RendererApi {
|
|
|
1312
1324
|
private warnedLooksRoom;
|
|
1313
1325
|
/** `uDetail`, the material's tiled detail packed by `packSurfaceDetail`. */
|
|
1314
1326
|
private readonly detailFloats;
|
|
1327
|
+
/** `uEmissiveFlow`, a material's glow moved and masked, packed by `packEmissiveFlow`. */
|
|
1328
|
+
private readonly flowFloats;
|
|
1329
|
+
/** Whether the lit stage has room for that, asked once. See `emissiveFlowFits`. */
|
|
1330
|
+
private flowRoom;
|
|
1331
|
+
private warnedFlowRoom;
|
|
1332
|
+
/** `uIridescence`, a material's iridescent overlay packed by `packIridescentOverlay`. */
|
|
1333
|
+
private readonly iridescentFloats;
|
|
1334
|
+
/** Whether the lit stage has room for it, asked once. See `iridescentOf`. */
|
|
1335
|
+
private iridescentRoom;
|
|
1336
|
+
private warnedIridescentRoom;
|
|
1337
|
+
/** The refusals of an overlay already said, each once. */
|
|
1338
|
+
private readonly warnedIridescent;
|
|
1315
1339
|
/** Whether the lit stage has room for detail on this part, asked once. See `detailOfMaterial`. */
|
|
1316
1340
|
private detailRoom;
|
|
1317
1341
|
private warnedDetailRoom;
|
|
@@ -1419,6 +1443,19 @@ export declare class WebGL2Renderer implements RendererApi {
|
|
|
1419
1443
|
private shadowMatrix;
|
|
1420
1444
|
private sceneMatrix;
|
|
1421
1445
|
private shadowPassActive;
|
|
1446
|
+
/**
|
|
1447
|
+
* The motion WebGL2's temporal resolve follows: the frame's movers, recorded as they are drawn and
|
|
1448
|
+
* drawn into a target of their own at `endFrame`. See `motionTarget.ts`.
|
|
1449
|
+
*/
|
|
1450
|
+
private readonly motionPass;
|
|
1451
|
+
/** Which renderer a `Mover` was last drawn by, and the frame serial it reads. See `mover.ts`. */
|
|
1452
|
+
private readonly moverRenderer;
|
|
1453
|
+
private moverFrame;
|
|
1454
|
+
/** Between `beginFrame` and `endFrame`, which decides which frame a rewrite belongs to. */
|
|
1455
|
+
private inFrame;
|
|
1456
|
+
private readonly motionJittered;
|
|
1457
|
+
private warnedMoverTwice;
|
|
1458
|
+
private warnedMotionUnkept;
|
|
1422
1459
|
/** Non-zero while the drawing buffer is pinned; see `lockDrawingBuffer`. */
|
|
1423
1460
|
private lockedWidth;
|
|
1424
1461
|
private lockedHeight;
|
|
@@ -1748,6 +1785,25 @@ export declare class WebGL2Renderer implements RendererApi {
|
|
|
1748
1785
|
*/
|
|
1749
1786
|
setSpotCookies(images: readonly TexImageSource[]): void;
|
|
1750
1787
|
setIesProfiles(profiles: readonly PhotometricProfile[]): void;
|
|
1788
|
+
/**
|
|
1789
|
+
* The images the frame's base decals lay, each a `BASE_DECAL_TILE` square, into the fixture
|
|
1790
|
+
* atlas's band of them. **Once a frame is what this is for**: the same count again uploads the
|
|
1791
|
+
* squares and nothing else, while a different count builds the atlas again. An image of another
|
|
1792
|
+
* size is refused, said once, and its square left clear. See `baseDecals.ts`.
|
|
1793
|
+
*/
|
|
1794
|
+
setBaseDecalImages(images: readonly TexImageSource[]): void;
|
|
1795
|
+
/** The decal images into their squares of the atlas bound on the fixture unit. */
|
|
1796
|
+
private uploadDecalImages;
|
|
1797
|
+
/** Whether an image is a decal's square, said once where it is not. */
|
|
1798
|
+
private decalImageFits;
|
|
1799
|
+
/**
|
|
1800
|
+
* The decals laid into the base colours of the draws after it, until the next call, across
|
|
1801
|
+
* passes: each a box, an image of `setBaseDecalImages` and how much of it. **Refused, said once,
|
|
1802
|
+
* where the lit stage has no room** for their thirty-four vectors, and the draws are then marked
|
|
1803
|
+
* by none. See `baseDecals.ts`.
|
|
1804
|
+
*/
|
|
1805
|
+
setBaseDecals(decals: readonly BaseDecal[]): void;
|
|
1806
|
+
private baseDecalsFit;
|
|
1751
1807
|
/**
|
|
1752
1808
|
* The fixture atlas from the profiles and cookies in hand: the profiles' rows at the bottom, the
|
|
1753
1809
|
* cookies' tiles on top, one `RGBA16F` texture. See `fixtureAtlas.ts` for the layout.
|
|
@@ -1901,6 +1957,11 @@ export declare class WebGL2Renderer implements RendererApi {
|
|
|
1901
1957
|
* floats, column-major. A command in the stream, so the draws after it read this pose.
|
|
1902
1958
|
*/
|
|
1903
1959
|
posePointSkin(skin: GlPointSkin, matrices: Float32Array): void;
|
|
1960
|
+
/**
|
|
1961
|
+
* Rewrite part of a skin in place. A command in the stream like a pose, so the pose after it reads
|
|
1962
|
+
* the rewrite. See `GlPointSkin.rewrite`.
|
|
1963
|
+
*/
|
|
1964
|
+
updatePointSkin(skin: GlPointSkin, first: number, data: PointSkinData): void;
|
|
1904
1965
|
disposePointSkin(skin: GlPointSkin): void;
|
|
1905
1966
|
/**
|
|
1906
1967
|
* Rewrite a mesh's colours, on a mesh made `dynamicColors`. The VAO is left alone for the reason
|
|
@@ -2186,6 +2247,17 @@ export declare class WebGL2Renderer implements RendererApi {
|
|
|
2186
2247
|
private overlayRoomLeft;
|
|
2187
2248
|
/** Whether the lit shader with the overlay compiled in fits this GPU: counted once. */
|
|
2188
2249
|
private overlayFits;
|
|
2250
|
+
/**
|
|
2251
|
+
* A material's iridescent overlay, or null where it is refused: malformed, or the lit stage has no
|
|
2252
|
+
* room for its thirty-six vectors. Each said once.
|
|
2253
|
+
*/
|
|
2254
|
+
private iridescentOf;
|
|
2255
|
+
/**
|
|
2256
|
+
* Whether a material's glow can be moved and masked: the lit stage has room for its two vectors.
|
|
2257
|
+
* **Refused, said once, where it has not**, and the glow is then drawn still and unmasked, as it
|
|
2258
|
+
* was before it existed.
|
|
2259
|
+
*/
|
|
2260
|
+
private emissiveFlowFits;
|
|
2189
2261
|
/**
|
|
2190
2262
|
* Whether a material's projection can be drawn: none asked, or the lit stage has the room for its
|
|
2191
2263
|
* one vector. **Refused, said once, where it has not**, as the overlay is, and the material's
|
|
@@ -3901,14 +3973,36 @@ export declare class WebGL2Renderer implements RendererApi {
|
|
|
3901
3973
|
*/
|
|
3902
3974
|
tint?: Vec3 | null,
|
|
3903
3975
|
/**
|
|
3904
|
-
* Where the mesh was last frame
|
|
3905
|
-
*
|
|
3906
|
-
*
|
|
3907
|
-
*
|
|
3908
|
-
* here, so there is no motion target for this to be written into, and a mover passed here is
|
|
3909
|
-
* neither read nor advanced.
|
|
3976
|
+
* Where the mesh was last frame, a `Mover` or a matrix, which the temporal resolve follows under
|
|
3977
|
+
* `temporalAa`: a rigid, skinned or rewritten mesh is drawn again into the motion target at the
|
|
3978
|
+
* end of the frame, so its pixels reproject by its own motion and not the camera's alone. See
|
|
3979
|
+
* `motionTarget.ts`; a mover is advanced only where the resolve reads it.
|
|
3910
3980
|
*/
|
|
3911
3981
|
previousModel?: ReadonlyMat4 | Mover | null): void;
|
|
3982
|
+
/**
|
|
3983
|
+
* The frame's movers drawn into the motion target against its depth, rasterised through the
|
|
3984
|
+
* jittered matrix every geometry upload took (`viewProjFor`) and moved between the unjittered
|
|
3985
|
+
* ones; null where nothing moved or the frame is multisampled, which keeps the camera's motion
|
|
3986
|
+
* and says so once.
|
|
3987
|
+
*/
|
|
3988
|
+
private drawMotionPass;
|
|
3989
|
+
/**
|
|
3990
|
+
* Whether a draw now is one the temporal resolve follows: the profile resolves temporally, this is
|
|
3991
|
+
* the frame's own picture between `beginFrame` and `endFrame`, and not a mirror's, a probe's, a
|
|
3992
|
+
* capture's, a shadow's or the view model's. See `motionTarget.ts`.
|
|
3993
|
+
*/
|
|
3994
|
+
private followsMotion;
|
|
3995
|
+
/**
|
|
3996
|
+
* A draw's motion for the resolve, decided as WebGPU's `recordDrawMotion` decides it: a mesh
|
|
3997
|
+
* rewritten this frame by its last positions, with or without a mover; a skinned mover by its last
|
|
3998
|
+
* pose; a rigid one by its last model. A cloth draw keeps the camera's motion, said once.
|
|
3999
|
+
*/
|
|
4000
|
+
private recordDrawMotion;
|
|
4001
|
+
/**
|
|
4002
|
+
* Keep a dynamic mesh's positions before its frame's first rewrite, where the temporal resolve
|
|
4003
|
+
* follows motion: a rewrite before `beginFrame` belongs to the next frame (`frameOfChange`).
|
|
4004
|
+
*/
|
|
4005
|
+
private keepPositionsBefore;
|
|
3912
4006
|
/**
|
|
3913
4007
|
* Whether a skin draw now draws its two halves: the profile asked, the frame has not spread its
|
|
3914
4008
|
* skin yet, this is the frame's own picture — not a mirror's or a probe's, nor an overlay after
|