@driftengine/core 4.4.2 → 4.5.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 +46 -0
- package/README.md +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +7 -0
- package/dist/render/backend/api.d.ts +17 -11
- package/dist/render/backend/webgl2/glassTintPrograms.d.ts +13 -0
- package/dist/render/backend/webgl2/glassTintPrograms.js +38 -0
- package/dist/render/backend/webgl2/renderer.d.ts +79 -8
- package/dist/render/backend/webgl2/renderer.js +360 -105
- package/dist/render/backend/webgpu/buffers.d.ts +19 -1
- package/dist/render/backend/webgpu/buffers.js +27 -1
- package/dist/render/backend/webgpu/depthPass.d.ts +1 -1
- package/dist/render/backend/webgpu/depthPass.js +2 -1
- package/dist/render/backend/webgpu/flatPass.d.ts +2 -0
- package/dist/render/backend/webgpu/flatPass.js +20 -1
- package/dist/render/backend/webgpu/glassTintPass.d.ts +28 -0
- package/dist/render/backend/webgpu/glassTintPass.js +205 -0
- package/dist/render/backend/webgpu/gpuDrivenPass.d.ts +60 -1
- package/dist/render/backend/webgpu/gpuDrivenPass.js +305 -5
- package/dist/render/backend/webgpu/instanced.d.ts +12 -1
- package/dist/render/backend/webgpu/instanced.js +20 -1
- package/dist/render/backend/webgpu/latePass.d.ts +26 -0
- package/dist/render/backend/webgpu/latePass.js +133 -0
- package/dist/render/backend/webgpu/lightVolumePass.js +5 -1
- package/dist/render/backend/webgpu/motionPass.d.ts +95 -0
- package/dist/render/backend/webgpu/motionPass.js +491 -0
- package/dist/render/backend/webgpu/pipelineCache.d.ts +10 -1
- package/dist/render/backend/webgpu/pipelineCache.js +11 -1
- package/dist/render/backend/webgpu/pointGlassTintPass.d.ts +32 -0
- package/dist/render/backend/webgpu/pointGlassTintPass.js +193 -0
- package/dist/render/backend/webgpu/pointShadowPass.d.ts +35 -6
- package/dist/render/backend/webgpu/pointShadowPass.js +105 -20
- package/dist/render/backend/webgpu/postPass.d.ts +2 -12
- package/dist/render/backend/webgpu/renderer.d.ts +171 -54
- package/dist/render/backend/webgpu/renderer.js +944 -390
- package/dist/render/backend/webgpu/scatterPass.js +2 -1
- package/dist/render/backend/webgpu/skinPaletteRing.d.ts +4 -0
- package/dist/render/backend/webgpu/skinPaletteRing.js +4 -0
- package/dist/render/backend/webgpu/snapshotMips.d.ts +29 -0
- package/dist/render/backend/webgpu/snapshotMips.js +52 -0
- package/dist/render/backend/webgpu/surfaceTexturePass.d.ts +5 -0
- package/dist/render/backend/webgpu/surfaceTexturePass.js +1 -1
- package/dist/render/glass.d.ts +45 -0
- package/dist/render/glass.js +39 -0
- package/dist/render/glassCasters.d.ts +40 -0
- package/dist/render/glassCasters.js +84 -0
- package/dist/render/glassShadow.d.ts +78 -0
- package/dist/render/glassShadow.js +125 -0
- package/dist/render/globalMediumPass.d.ts +2 -3
- package/dist/render/globalMediumPass.js +2 -8
- package/dist/render/gpudriven/lit.d.ts +12 -0
- package/dist/render/gpudriven/lit.js +23 -0
- package/dist/render/gpudriven/materialTable.d.ts +15 -5
- package/dist/render/gpudriven/materialTable.js +26 -6
- package/dist/render/gpudriven/pipeline.d.ts +1 -1
- package/dist/render/gpudriven/pipeline.js +4 -3
- package/dist/render/gpudriven/sunGlass.d.ts +35 -0
- package/dist/render/gpudriven/sunGlass.js +89 -0
- package/dist/render/lightBudget.d.ts +17 -5
- package/dist/render/lightBudget.js +17 -5
- package/dist/render/pointGlassTint.d.ts +59 -0
- package/dist/render/pointGlassTint.js +198 -0
- package/dist/render/pointShadowArray.d.ts +56 -3
- package/dist/render/pointShadowArray.js +127 -16
- package/dist/render/pointShadowMap.d.ts +23 -1
- package/dist/render/pointShadowMap.js +27 -1
- package/dist/render/recon/changeFrames.d.ts +15 -0
- package/dist/render/recon/changeFrames.js +21 -0
- package/dist/render/recon/lateRouting.d.ts +14 -0
- package/dist/render/recon/lateRouting.js +18 -0
- package/dist/render/recon/mover.d.ts +57 -0
- package/dist/render/recon/mover.js +86 -0
- package/dist/render/renderQuality.d.ts +35 -0
- package/dist/render/renderQuality.js +7 -0
- package/dist/render/rendererHarness.js +12 -0
- package/dist/render/sceneTarget.d.ts +7 -1
- package/dist/render/sceneTarget.js +58 -12
- package/dist/render/shaders/depth.d.ts +16 -1
- package/dist/render/shaders/depth.js +85 -9
- package/dist/render/shaders/flat/directionalShadow.js +91 -6
- package/dist/render/shaders/flat/glassTint.d.ts +6 -0
- package/dist/render/shaders/flat/glassTint.js +25 -0
- package/dist/render/shaders/flat/index.d.ts +13 -0
- package/dist/render/shaders/flat/index.js +4 -0
- package/dist/render/shaders/flat/lampGlass.d.ts +1 -0
- package/dist/render/shaders/flat/lampGlass.js +183 -0
- package/dist/render/shaders/flat/main.d.ts +1 -1
- package/dist/render/shaders/flat/main.js +115 -15
- package/dist/render/shaders/flat/pointShadow.d.ts +1 -1
- package/dist/render/shaders/flat/pointShadow.js +2 -0
- package/dist/render/shaders/flat/preamble.js +21 -6
- package/dist/render/shaders/generated/depth.wgsl.d.ts +227 -4
- package/dist/render/shaders/generated/depth.wgsl.js +227 -4
- package/dist/render/shaders/generated/flat.wgsl.d.ts +360 -312
- package/dist/render/shaders/generated/flat.wgsl.js +376 -328
- package/dist/render/shaders/generated/globalMedium.wgsl.d.ts +3 -13
- package/dist/render/shaders/generated/globalMedium.wgsl.js +3 -13
- package/dist/render/shaders/generated/lightVolume.wgsl.d.ts +3 -13
- package/dist/render/shaders/generated/lightVolume.wgsl.js +4 -14
- package/dist/render/shaders/generated/octahedralResolve.wgsl.d.ts +29 -0
- package/dist/render/shaders/generated/octahedralResolve.wgsl.js +29 -0
- package/dist/render/shaders/globalMedium.js +6 -6
- package/dist/render/shaders/gpudriven/blendRaster.wgsl.d.ts +7 -0
- package/dist/render/shaders/gpudriven/blendRaster.wgsl.js +86 -1
- package/dist/render/shaders/gpudriven/cull.wgsl.d.ts +1 -1
- package/dist/render/shaders/gpudriven/cull.wgsl.js +11 -2
- package/dist/render/shaders/gpudriven/materialTable.wgsl.d.ts +1 -1
- package/dist/render/shaders/gpudriven/materialTable.wgsl.js +3 -1
- package/dist/render/shaders/gpudriven/shade.wgsl.js +50 -1
- package/dist/render/shaders/gpudriven/sunGlass.wgsl.d.ts +9 -0
- package/dist/render/shaders/gpudriven/sunGlass.wgsl.js +133 -0
- package/dist/render/shaders/lightVolume.js +6 -6
- package/dist/render/shaders/octahedralResolve.d.ts +8 -0
- package/dist/render/shaders/octahedralResolve.js +48 -17
- package/dist/render/shaders/recon/lateDepth.wgsl.d.ts +1 -0
- package/dist/render/shaders/recon/lateDepth.wgsl.js +44 -0
- package/dist/render/shaders/recon/motion.wgsl.d.ts +1 -1
- package/dist/render/shaders/recon/motion.wgsl.js +84 -0
- package/dist/render/shadowCasters.d.ts +20 -1
- package/dist/render/shadowCasters.js +15 -1
- package/dist/render/shadowMap.d.ts +54 -5
- package/dist/render/shadowMap.js +190 -36
- package/dist/render/sunGlassTint.d.ts +25 -0
- package/dist/render/sunGlassTint.js +79 -0
- package/dist/render/translucentQueue.d.ts +6 -0
- package/dist/render/translucentQueue.js +15 -1
- package/package.json +6 -6
- package/src/index.ts +10 -0
- package/src/render/backend/api.ts +15 -9
- package/src/render/backend/webgl2/glassTintPrograms.ts +58 -0
- package/src/render/backend/webgl2/renderer.ts +401 -108
- package/src/render/backend/webgpu/buffers.ts +50 -2
- package/src/render/backend/webgpu/depthPass.ts +2 -1
- package/src/render/backend/webgpu/flatPass.ts +22 -1
- package/src/render/backend/webgpu/glassTintPass.ts +244 -0
- package/src/render/backend/webgpu/gpuDrivenPass.ts +349 -5
- package/src/render/backend/webgpu/instanced.ts +21 -1
- package/src/render/backend/webgpu/latePass.ts +152 -0
- package/src/render/backend/webgpu/lightVolumePass.ts +5 -1
- package/src/render/backend/webgpu/motionPass.ts +535 -0
- package/src/render/backend/webgpu/pipelineCache.ts +12 -1
- package/src/render/backend/webgpu/pointGlassTintPass.ts +233 -0
- package/src/render/backend/webgpu/pointShadowPass.ts +158 -26
- package/src/render/backend/webgpu/renderer.ts +1108 -421
- package/src/render/backend/webgpu/scatterPass.ts +2 -1
- package/src/render/backend/webgpu/skinPaletteRing.ts +4 -0
- package/src/render/backend/webgpu/snapshotMips.ts +80 -0
- package/src/render/backend/webgpu/surfaceTexturePass.ts +1 -1
- package/src/render/glass.ts +74 -0
- package/src/render/glassCasters.ts +164 -0
- package/src/render/glassShadow.ts +153 -0
- package/src/render/globalMediumPass.ts +4 -11
- package/src/render/gpudriven/lit.ts +31 -0
- package/src/render/gpudriven/materialTable.ts +28 -6
- package/src/render/gpudriven/pipeline.ts +4 -3
- package/src/render/gpudriven/sunGlass.ts +117 -0
- package/src/render/lightBudget.ts +19 -5
- package/src/render/pointGlassTint.ts +250 -0
- package/src/render/pointShadowArray.ts +188 -22
- package/src/render/pointShadowMap.ts +41 -0
- package/src/render/recon/changeFrames.ts +24 -0
- package/src/render/recon/lateRouting.ts +29 -0
- package/src/render/recon/mover.ts +118 -0
- package/src/render/renderQuality.ts +47 -0
- package/src/render/rendererHarness.ts +12 -0
- package/src/render/sceneTarget.ts +58 -11
- package/src/render/shaders/depth.ts +109 -9
- package/src/render/shaders/flat/directionalShadow.ts +97 -6
- package/src/render/shaders/flat/glassTint.ts +25 -0
- package/src/render/shaders/flat/index.ts +17 -0
- package/src/render/shaders/flat/lampGlass.ts +185 -0
- package/src/render/shaders/flat/main.ts +115 -15
- package/src/render/shaders/flat/pointShadow.ts +2 -0
- package/src/render/shaders/flat/preamble.ts +21 -6
- package/src/render/shaders/generated/depth.wgsl.ts +234 -4
- package/src/render/shaders/generated/flat.wgsl.ts +376 -328
- package/src/render/shaders/generated/globalMedium.wgsl.ts +3 -13
- package/src/render/shaders/generated/lightVolume.wgsl.ts +4 -14
- package/src/render/shaders/generated/octahedralResolve.wgsl.ts +30 -0
- package/src/render/shaders/globalMedium.ts +6 -6
- package/src/render/shaders/gpudriven/blendRaster.wgsl.ts +88 -1
- package/src/render/shaders/gpudriven/cull.wgsl.ts +11 -2
- package/src/render/shaders/gpudriven/materialTable.wgsl.ts +3 -1
- package/src/render/shaders/gpudriven/shade.wgsl.ts +50 -1
- package/src/render/shaders/gpudriven/sunGlass.wgsl.ts +139 -0
- package/src/render/shaders/lightVolume.ts +6 -6
- package/src/render/shaders/octahedralResolve.ts +50 -17
- package/src/render/shaders/recon/lateDepth.wgsl.ts +47 -0
- package/src/render/shaders/recon/motion.wgsl.ts +84 -0
- package/src/render/shadowCasters.ts +28 -1
- package/src/render/shadowMap.ts +231 -37
- package/src/render/sunGlassTint.ts +86 -0
- package/src/render/translucentQueue.ts +20 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ProbeBakeOptions } from '../../reflectionProbe.ts';
|
|
2
2
|
import type { ReadonlyMat4 } from 'gl-matrix';
|
|
3
|
+
import type { Mover } from '../../recon/mover.ts';
|
|
3
4
|
import type { Vec3 } from '../../../math/color.ts';
|
|
4
5
|
import { Camera } from '../../camera.ts';
|
|
5
6
|
import type { PickHit, PickableSource } from '../../pickable.ts';
|
|
@@ -156,6 +157,8 @@ export declare class WebGPURenderer implements RendererApi {
|
|
|
156
157
|
* caller who passed null gets — rather than reading a slot this frame has already re-let.
|
|
157
158
|
*/
|
|
158
159
|
private skinPaletteSlot;
|
|
160
|
+
/** The palette `skinPaletteSlot` was uploaded from, for a skinned mover to copy. See `Mover`. */
|
|
161
|
+
private skinPaletteData;
|
|
159
162
|
private readonly surface;
|
|
160
163
|
/** The encoder for the frame in flight, or null between frames. */
|
|
161
164
|
private encoder;
|
|
@@ -163,6 +166,27 @@ export declare class WebGPURenderer implements RendererApi {
|
|
|
163
166
|
private readonly meshPresent;
|
|
164
167
|
private pass;
|
|
165
168
|
private readonly pipelines;
|
|
169
|
+
/**
|
|
170
|
+
* The pipelines a reconstructing frame's blended draws are built for: the reconstructed picture's
|
|
171
|
+
* format at one sample, which is where `LatePass` draws them. Aliased to `pipelines` when the
|
|
172
|
+
* world already lands on exactly that, as `overlayPipelines` is.
|
|
173
|
+
*/
|
|
174
|
+
private readonly latePipelines;
|
|
175
|
+
/** The blended draws of a reconstructing frame, drawn after the upscale. See `LatePass`. */
|
|
176
|
+
private latePass;
|
|
177
|
+
/** A late draw asked to refract: `runLate` copies the reconstructed picture before replaying. */
|
|
178
|
+
private lateRefractWanted;
|
|
179
|
+
/** The refraction copy's mip chain, recorded after each copy: what frosted glass reads. */
|
|
180
|
+
private refractMips;
|
|
181
|
+
/**
|
|
182
|
+
* The refraction copy's sampler: filtering, and **between levels as well**, so a frosted pane's
|
|
183
|
+
* level falls smoothly between two blurs rather than stepping from one to the next.
|
|
184
|
+
*/
|
|
185
|
+
private refractSampler;
|
|
186
|
+
/** One glass resolution reused by every draw, so a pane allocates nothing. See `glass.ts`. */
|
|
187
|
+
private readonly glassScratch;
|
|
188
|
+
/** `issueCommand` bound once, so the late replay allocates no closure per frame. */
|
|
189
|
+
private readonly issueBound;
|
|
166
190
|
/**
|
|
167
191
|
* The same pipelines again, built for the canvas, for anything drawn after `endFrame`.
|
|
168
192
|
*
|
|
@@ -640,10 +664,10 @@ export declare class WebGPURenderer implements RendererApi {
|
|
|
640
664
|
* the *unsharpened* result — sharpening into the history would sharpen a sharpened picture every
|
|
641
665
|
* frame, which is the halo the reference's own clamp exists to prevent, compounded.
|
|
642
666
|
*
|
|
643
|
-
* The motion target is render size and carries a drawn object's own motion where
|
|
644
|
-
* one
|
|
645
|
-
*
|
|
646
|
-
* exact
|
|
667
|
+
* The motion target is render size and carries a drawn object's own motion where the motion pass
|
|
668
|
+
* wrote one — a draw that named its mover, or passed last frame's matrix. Every other texel is
|
|
669
|
+
* cleared, and the resolve takes the camera's motion there, derived from the depth and the
|
|
670
|
+
* reprojection: exact for anything that did not move. See `MotionPass`.
|
|
647
671
|
*/
|
|
648
672
|
private reconHistories;
|
|
649
673
|
private reconHistoryViews;
|
|
@@ -665,34 +689,15 @@ export declare class WebGPURenderer implements RendererApi {
|
|
|
665
689
|
private reconGroups;
|
|
666
690
|
private reconSharpenGroups;
|
|
667
691
|
private reconRushGroup;
|
|
668
|
-
/**
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
private
|
|
676
|
-
private
|
|
677
|
-
private motionCount;
|
|
678
|
-
private motionLayout;
|
|
679
|
-
/**
|
|
680
|
-
* One pipeline per vertex stride, because a stride is a property of the *mesh*.
|
|
681
|
-
*
|
|
682
|
-
* Which optional attributes a mesh supplied decides how far apart its positions are, and this
|
|
683
|
-
* pass reads nothing but positions — so two meshes drawn by the same shader still need two
|
|
684
|
-
* vertex layouts. A map rather than a cache key on the pipeline cache: there is one shader here
|
|
685
|
-
* and a handful of strides in any scene.
|
|
686
|
-
*/
|
|
687
|
-
private readonly motionPipelines;
|
|
688
|
-
private motionModule;
|
|
689
|
-
private motionPipelineLayout;
|
|
690
|
-
private motionFrameBuffer;
|
|
691
|
-
private motionDrawBuffer;
|
|
692
|
-
private motionDrawCapacity;
|
|
693
|
-
private motionGroup;
|
|
694
|
-
private readonly motionFrameStaging;
|
|
695
|
-
private motionDrawStaging;
|
|
692
|
+
/** The motion pass, made with the reconstruction's targets. See `MotionPass`. */
|
|
693
|
+
private motionPass;
|
|
694
|
+
/** This renderer's identity to a `Mover`. See `claimRendererId`. */
|
|
695
|
+
private readonly moverRenderer;
|
|
696
|
+
/** Frames begun, so a mover can tell last frame from any other. Advanced in `beginFrame`. */
|
|
697
|
+
private moverFrame;
|
|
698
|
+
/** Between `beginFrame` and `endFrame`. A change outside it is the next frame's. */
|
|
699
|
+
private inFrame;
|
|
700
|
+
private warnedMoverTwice;
|
|
696
701
|
/** The scene's own clip transform with the generated shaders' y negation folded in. */
|
|
697
702
|
private readonly motionRaster;
|
|
698
703
|
private reconSizeKey;
|
|
@@ -1597,8 +1602,39 @@ export declare class WebGPURenderer implements RendererApi {
|
|
|
1597
1602
|
private readonly sdfTextVerts;
|
|
1598
1603
|
private readonly sdfTextFrags;
|
|
1599
1604
|
private readonly sdfTextBindGroups;
|
|
1600
|
-
|
|
1601
|
-
|
|
1605
|
+
/**
|
|
1606
|
+
* The sun's static, moving and peeled maps, as layers of one texture (`shadowMap.ts`). The three
|
|
1607
|
+
* views below are single layers, what each pass attaches; the two here are what is sampled.
|
|
1608
|
+
*/
|
|
1609
|
+
private sunShadowTexture;
|
|
1610
|
+
/** Every layer, for the lit pass, the light volumes and the medium. */
|
|
1611
|
+
private sunArrayView;
|
|
1612
|
+
/**
|
|
1613
|
+
* The static layer alone, as an array, for the peel: it draws into another layer of the same
|
|
1614
|
+
* texture, and a view covering that layer too would put it in two usages in one pass.
|
|
1615
|
+
*/
|
|
1616
|
+
private sunStaticArrayView;
|
|
1617
|
+
/** How many layers the sun's texture holds: its maps, and the two glass layers once glass casts. */
|
|
1618
|
+
private sunLayerCount;
|
|
1619
|
+
/** The glass depth layers, static then moving, once glass has cast. See `growSunForGlass`. */
|
|
1620
|
+
private sunGlassViews;
|
|
1621
|
+
/** The texture a growth replaced, destroyed once the encoder that copied out of it is submitted. */
|
|
1622
|
+
private retiredSunTexture;
|
|
1623
|
+
/** What the sun's light keeps through glass: two `rgba8unorm` layers, made when glass first casts. */
|
|
1624
|
+
private sunTint;
|
|
1625
|
+
/** The tint pass's layouts, per-draw block, groups and pipelines, made when glass first casts. */
|
|
1626
|
+
private glassTint;
|
|
1627
|
+
/** The tint pass open while the glass list is replayed into it. */
|
|
1628
|
+
private tintPass;
|
|
1629
|
+
/** True while the glass list is replayed into a glass depth layer through `casterSink`. */
|
|
1630
|
+
private drawingGlassDepth;
|
|
1631
|
+
/** Whether the open sun pass is the movers' layer, whose glass goes to the moving glass layer. */
|
|
1632
|
+
private shadowLayerIsDynamic;
|
|
1633
|
+
/** The glass tints' sampler: filtering, and between levels, for frost's coarser reads. */
|
|
1634
|
+
private readonly tintSampler;
|
|
1635
|
+
/** The light a tint pass is drawn for: xyz a direction (w 0) or a position (w 1). */
|
|
1636
|
+
private readonly glassLight;
|
|
1637
|
+
private shadowView;
|
|
1602
1638
|
private readonly shadowLayout;
|
|
1603
1639
|
/** The same layout plus the joint palette. See `createDepthBindGroupLayout`. */
|
|
1604
1640
|
private readonly shadowSkinnedLayout;
|
|
@@ -1624,8 +1660,7 @@ export declare class WebGPURenderer implements RendererApi {
|
|
|
1624
1660
|
* read twice — so a profile that switches peeling off gets no map and no pass on either
|
|
1625
1661
|
* backend rather than a map nothing writes.
|
|
1626
1662
|
*/
|
|
1627
|
-
private
|
|
1628
|
-
private readonly peelView;
|
|
1663
|
+
private peelView;
|
|
1629
1664
|
/**
|
|
1630
1665
|
* The movers' own layer: the character, the rope it swings on, and anything else that walks.
|
|
1631
1666
|
*
|
|
@@ -1646,10 +1681,9 @@ export declare class WebGPURenderer implements RendererApi {
|
|
|
1646
1681
|
* and therefore as lit — so nothing looked broken, only empty, which is why it survived the
|
|
1647
1682
|
* port and every gate in it.
|
|
1648
1683
|
*/
|
|
1649
|
-
private
|
|
1650
|
-
private readonly dynamicView;
|
|
1684
|
+
private dynamicView;
|
|
1651
1685
|
/** The peel's own bind groups: `uPeelShadowLayer` at 1, and the static map to peel against. */
|
|
1652
|
-
private
|
|
1686
|
+
private shadowPeelBindGroup;
|
|
1653
1687
|
/**
|
|
1654
1688
|
* The cutout casters' layout, and a bind group per cutout map for each layer, built the first
|
|
1655
1689
|
* time a map casts and kept: a `createBindGroup` per draw is the allocation the house rules forbid.
|
|
@@ -1661,7 +1695,7 @@ export declare class WebGPURenderer implements RendererApi {
|
|
|
1661
1695
|
private readonly cutoutPeelGroups;
|
|
1662
1696
|
private shadowPeelPassUniforms;
|
|
1663
1697
|
private shadowPeelSampler;
|
|
1664
|
-
private
|
|
1698
|
+
private scatterDepthPeelBindGroup;
|
|
1665
1699
|
/** Which layer the open pass is writing, so the sink picks the bindings that match it. */
|
|
1666
1700
|
private shadowLayerIsPeel;
|
|
1667
1701
|
/**
|
|
@@ -1732,6 +1766,10 @@ export declare class WebGPURenderer implements RendererApi {
|
|
|
1732
1766
|
* Built once and held, rather than made per call: it closes over `this` and a fresh one
|
|
1733
1767
|
* every frame would be an allocation in a per-frame path.
|
|
1734
1768
|
*/
|
|
1769
|
+
/** The glass the open shadow pass was offered, kept for its own passes: `glassCasters.ts`. */
|
|
1770
|
+
private readonly glassCasters;
|
|
1771
|
+
/** One resolution every glass caster is read through, so recording one allocates nothing. */
|
|
1772
|
+
private readonly glassCasterScratch;
|
|
1735
1773
|
private readonly casterSink;
|
|
1736
1774
|
/** Said once rather than every frame, because a full ring is a flood otherwise. */
|
|
1737
1775
|
private warnedFull;
|
|
@@ -2016,7 +2054,7 @@ export declare class WebGPURenderer implements RendererApi {
|
|
|
2016
2054
|
*/
|
|
2017
2055
|
drawMesh(mesh: GpuMesh, model: ArrayLike<number>, depthLayer?: number, tint?: Vec3 | null,
|
|
2018
2056
|
/** Where it was last frame. See `RendererApi.drawMesh`, and `runMotion` for what reads it. */
|
|
2019
|
-
previousModel?: ArrayLike<number> | null): void;
|
|
2057
|
+
previousModel?: ArrayLike<number> | Mover | null): void;
|
|
2020
2058
|
/**
|
|
2021
2059
|
* Draw a mesh that lets the world through, at `opacity`.
|
|
2022
2060
|
*
|
|
@@ -2115,6 +2153,18 @@ export declare class WebGPURenderer implements RendererApi {
|
|
|
2115
2153
|
drawTranslucentInstanced(batch: GpuInstancedBatch, data: MeshInstances, opacity: number, options?: TranslucentMeshOptions): void;
|
|
2116
2154
|
/** Release the placement. The mesh is the caller's and is not released. */
|
|
2117
2155
|
disposeInstanced(batch: GpuInstancedBatch): void;
|
|
2156
|
+
/**
|
|
2157
|
+
* Write what a translucent draw shows through it into the material scratch: refraction's bend and
|
|
2158
|
+
* absorption, and glass. Returns whether the frame's copy is there to read, and so whether
|
|
2159
|
+
* `releaseSeeThrough` owes the scratch back.
|
|
2160
|
+
*
|
|
2161
|
+
* **A glass draw takes the copy even when it does not bend**, since a pane shows what is behind it
|
|
2162
|
+
* either way. A copy that cannot be taken — a mirror, a probe bake — leaves both off, so the pane
|
|
2163
|
+
* shades as ordinary translucency rather than sampling a stand-in. See `glass.ts`.
|
|
2164
|
+
*/
|
|
2165
|
+
private bindSeeThrough;
|
|
2166
|
+
/** Put the scratch back after `bindSeeThrough`: refraction and glass off. */
|
|
2167
|
+
private releaseSeeThrough;
|
|
2118
2168
|
/**
|
|
2119
2169
|
* One draw, one material slot, one uniform slot, however many instances.
|
|
2120
2170
|
*
|
|
@@ -2207,6 +2257,34 @@ export declare class WebGPURenderer implements RendererApi {
|
|
|
2207
2257
|
drawSceneCasters(casters: ShadowCasters): void;
|
|
2208
2258
|
drawShadowCasters(casters: ShadowCasters): void;
|
|
2209
2259
|
/** Close the shadow pass and submit it, so the frame can sample what it wrote. */
|
|
2260
|
+
/**
|
|
2261
|
+
* Add the sun's two glass layers, once, carrying every layer it holds across on `encoder`.
|
|
2262
|
+
*
|
|
2263
|
+
* **Copied rather than re-baked**, for the reason `SunShadowArray.growForGlass` gives: the static
|
|
2264
|
+
* map is the consumer's to bake and may be baked once, and the glass that grows the texture
|
|
2265
|
+
* arrives in the very pass that drew it. Every view of the old texture is stale afterwards, so
|
|
2266
|
+
* every group holding one is rebuilt here — the lit pass's, the volumes', the medium's and the
|
|
2267
|
+
* peel's — and the old texture is destroyed only once this encoder is submitted.
|
|
2268
|
+
*/
|
|
2269
|
+
private growSunForGlass;
|
|
2270
|
+
/** Every group that holds a view of the sun's texture, rebuilt after it has been replaced. */
|
|
2271
|
+
private rebuildSunGroups;
|
|
2272
|
+
/** The sun's tint target, made the first time glass casts and born clear on `encoder`. */
|
|
2273
|
+
private ensureSunTint;
|
|
2274
|
+
/**
|
|
2275
|
+
* Draw the pass's glass twice: where the nearest pane is, and what the panes let through.
|
|
2276
|
+
*
|
|
2277
|
+
* After the opaque casters, on the pass's own encoder. A layer that has held glass is redrawn
|
|
2278
|
+
* even when this pass offered none, so glass that has gone takes its colour with it.
|
|
2279
|
+
*/
|
|
2280
|
+
private flushSunGlass;
|
|
2281
|
+
/** The glass list into a glass depth layer: `casterSink` itself, with glass let through. */
|
|
2282
|
+
private readonly glassDepthSink;
|
|
2283
|
+
/**
|
|
2284
|
+
* The glass list into a tint layer, through the tint pipelines, **culling nothing**: every pane on
|
|
2285
|
+
* a ray counts, whichever way it faces. See the other backend's `glassTintSink`.
|
|
2286
|
+
*/
|
|
2287
|
+
private readonly glassTintSink;
|
|
2210
2288
|
endShadowPass(): void;
|
|
2211
2289
|
/**
|
|
2212
2290
|
* The pool, or null where the profile switched cube shadows off.
|
|
@@ -2227,6 +2305,8 @@ export declare class WebGPURenderer implements RendererApi {
|
|
|
2227
2305
|
private preparedPointLightCount;
|
|
2228
2306
|
/** See `renderer.ts`: built when a world reports its lights, and rebuilt only to grow. */
|
|
2229
2307
|
private pointShadowArray;
|
|
2308
|
+
/** The array glass replaced, destroyed once the round that copied out of it is submitted. */
|
|
2309
|
+
private retiredPointTexture;
|
|
2230
2310
|
private readonly bakeScratch;
|
|
2231
2311
|
/** Said once per renderer; see `updatePointShadows`. */
|
|
2232
2312
|
private warnedNoPointShadowArray;
|
|
@@ -2462,27 +2542,48 @@ export declare class WebGPURenderer implements RendererApi {
|
|
|
2462
2542
|
*/
|
|
2463
2543
|
private rebuildReconGroups;
|
|
2464
2544
|
/**
|
|
2465
|
-
*
|
|
2545
|
+
* Whether a blended draw recorded now lands after the upscale. See `lateRouting.ts`.
|
|
2466
2546
|
*
|
|
2467
|
-
*
|
|
2468
|
-
|
|
2469
|
-
|
|
2547
|
+
* Not during the order-independent replay, which owns its pass and issues into it directly.
|
|
2548
|
+
*/
|
|
2549
|
+
private drawsLate;
|
|
2550
|
+
/**
|
|
2551
|
+
* The command a blended draw records into: the late pool while reconstructing, the frame graph
|
|
2552
|
+
* otherwise. **Late draws record whatever `quality.frameGraph` says**, since the late replay is
|
|
2553
|
+
* the only moment they can land; everything else keeps the path it has.
|
|
2554
|
+
*/
|
|
2555
|
+
private recordBlended;
|
|
2556
|
+
/** The pipelines a blended draw is built for: the reconstructed picture's while late. */
|
|
2557
|
+
private blendedPipelines;
|
|
2558
|
+
/**
|
|
2559
|
+
* The blended draws of a reconstructing frame, over the reconstructed picture at the output size
|
|
2560
|
+
* and unjittered, against the render's depth taken up to that size. Before occlusion, bloom and
|
|
2561
|
+
* the grade, so they are graded exactly as they were when they were drawn into the scene.
|
|
2470
2562
|
*/
|
|
2471
|
-
private
|
|
2563
|
+
private runLate;
|
|
2564
|
+
/** Whether this draw lands in the reconstructed picture. See `lateRouting.ts`. */
|
|
2565
|
+
private tracksMotionNow;
|
|
2472
2566
|
/**
|
|
2473
|
-
*
|
|
2567
|
+
* What this draw's motion is, recorded for the motion pass.
|
|
2474
2568
|
*
|
|
2475
|
-
*
|
|
2476
|
-
*
|
|
2569
|
+
* A mesh rewritten this frame carries its vertex motion whatever else the draw says — under last
|
|
2570
|
+
* frame's model where a mover or a matrix knows it, under this frame's where nothing does. A
|
|
2571
|
+
* mover otherwise carries a rigid draw's last model or a skinned draw's last pose; a matrix
|
|
2572
|
+
* carries a rigid draw's. A draw that says nothing and moved no vertex takes the camera's motion.
|
|
2477
2573
|
*/
|
|
2478
|
-
private
|
|
2479
|
-
/** The pipeline for one vertex stride, built on first sight of it. */
|
|
2480
|
-
private motionPipelineFor;
|
|
2574
|
+
private recordDrawMotion;
|
|
2481
2575
|
/**
|
|
2482
|
-
*
|
|
2576
|
+
* A skinned mover's motion: this frame's palette is the draw's own slot, and last frame's takes a
|
|
2577
|
+
* slot of its own, like any palette a draw binds — so it is uploaded once and nothing overwrites
|
|
2578
|
+
* it before the motion pass reads it. See `SkinPaletteRing`.
|
|
2579
|
+
*/
|
|
2580
|
+
private recordSkinnedMotion;
|
|
2581
|
+
private warnMoverTwice;
|
|
2582
|
+
/**
|
|
2583
|
+
* Where every mover was last frame, into the motion target. See `MotionPass`.
|
|
2483
2584
|
*
|
|
2484
2585
|
* **After everything that draws and before the resolve reads it.** The frame's depth has to be
|
|
2485
|
-
* finished for the equality test to mean anything, and the resolve is what consumes
|
|
2586
|
+
* finished for the pass's equality test to mean anything, and the resolve is what consumes it.
|
|
2486
2587
|
*/
|
|
2487
2588
|
private runMotion;
|
|
2488
2589
|
/**
|
|
@@ -2742,6 +2843,8 @@ export declare class WebGPURenderer implements RendererApi {
|
|
|
2742
2843
|
private recordDraw;
|
|
2743
2844
|
/** Replay one recorded draw into an open pass. */
|
|
2744
2845
|
private replayNode;
|
|
2846
|
+
/** One recorded draw, issued into an open pass. Shared by the graph's replay and `runLate`. */
|
|
2847
|
+
private issueCommand;
|
|
2745
2848
|
private ensurePass;
|
|
2746
2849
|
/**
|
|
2747
2850
|
* The pass a verb will draw into, without flushing what is already recorded.
|
|
@@ -3243,6 +3346,10 @@ export declare class WebGPURenderer implements RendererApi {
|
|
|
3243
3346
|
*
|
|
3244
3347
|
* What it gives up is one frame of history: the frame after a cut has no blur and no temporal
|
|
3245
3348
|
* blend, as the first frame of a session has none. Nothing else is reset.
|
|
3349
|
+
*
|
|
3350
|
+
* **A reconstructing renderer depends on it**: its history is the last shot's, and without this
|
|
3351
|
+
* call a cut blends that shot into the first frames of the next. Nothing detects a cut on the
|
|
3352
|
+
* caller's behalf, deliberately — a fast pan and a cut look alike from here.
|
|
3246
3353
|
*/
|
|
3247
3354
|
cameraCut(): void;
|
|
3248
3355
|
/**
|
|
@@ -3576,6 +3683,16 @@ export declare class WebGPURenderer implements RendererApi {
|
|
|
3576
3683
|
* The occlusion and bloom targets are half size. Both are blurs read back at full size, so a
|
|
3577
3684
|
* full-resolution intermediate buys nothing a bilinear fetch does not already give.
|
|
3578
3685
|
*/
|
|
3686
|
+
/**
|
|
3687
|
+
* The medium's march group, holding the shadow views it reads — built with the composite, and
|
|
3688
|
+
* again when the sun's texture grows its glass layers and every view of the old one is stale.
|
|
3689
|
+
*
|
|
3690
|
+
* **The stand-in has to read as unoccluded and not as absent**, which is `emptyTexture.ts`'s
|
|
3691
|
+
* point and `createLightVolumeBindGroup`'s: `occlusion()` calls any stored depth below the
|
|
3692
|
+
* receiver's a blocker — so a black stand-in would put the whole medium in shadow, which is a
|
|
3693
|
+
* picture rather than an error. `volumeBlank` is the white one-texel texture built for this.
|
|
3694
|
+
*/
|
|
3695
|
+
private buildMediumBindGroup;
|
|
3579
3696
|
private ensureComposite;
|
|
3580
3697
|
/**
|
|
3581
3698
|
* Every bloom stage's uniform block, written once per size rather than once per frame.
|