@driftengine/core 4.4.2 → 4.6.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 +97 -0
- package/README.md +1 -1
- package/dist/geometry/boxCsg.d.ts +28 -0
- package/dist/geometry/boxCsg.js +139 -0
- package/dist/geometry/csg.d.ts +36 -0
- package/dist/geometry/csg.js +329 -0
- package/dist/geometry/meshBuilder.js +13 -0
- package/dist/geometry/meshConcat.js +1 -0
- package/dist/geometry/pixelFont.js +2 -0
- package/dist/geometry/solid.d.ts +61 -0
- package/dist/geometry/solid.js +152 -0
- package/dist/geometry/solidFlat.d.ts +35 -0
- package/dist/geometry/solidFlat.js +428 -0
- package/dist/geometry/solidHarness.d.ts +19 -0
- package/dist/geometry/solidHarness.js +66 -0
- package/dist/geometry/solidNormals.d.ts +17 -0
- package/dist/geometry/solidNormals.js +86 -0
- package/dist/geometry/solidRound.d.ts +41 -0
- package/dist/geometry/solidRound.js +323 -0
- package/dist/geometry/solidWriter.d.ts +16 -0
- package/dist/geometry/solidWriter.js +42 -0
- package/dist/index.d.ts +28 -3
- package/dist/index.js +20 -1
- package/dist/render/backend/api.d.ts +34 -14
- package/dist/render/backend/drawFog.d.ts +26 -0
- package/dist/render/backend/drawFog.js +30 -0
- package/dist/render/backend/materialChanges.d.ts +2 -1
- package/dist/render/backend/materialChanges.js +6 -1
- package/dist/render/backend/webgl2/glassTintPrograms.d.ts +13 -0
- package/dist/render/backend/webgl2/glassTintPrograms.js +38 -0
- package/dist/render/backend/webgl2/instanced.d.ts +24 -5
- package/dist/render/backend/webgl2/instanced.js +72 -15
- package/dist/render/backend/webgl2/renderer.d.ts +201 -16
- package/dist/render/backend/webgl2/renderer.js +596 -224
- package/dist/render/backend/webgpu/buffers.d.ts +29 -1
- package/dist/render/backend/webgpu/buffers.js +61 -4
- package/dist/render/backend/webgpu/depthPass.d.ts +1 -1
- package/dist/render/backend/webgpu/depthPass.js +7 -2
- package/dist/render/backend/webgpu/drawCommand.d.ts +5 -0
- package/dist/render/backend/webgpu/drawCommand.js +1 -0
- package/dist/render/backend/webgpu/flatPass.d.ts +6 -1
- package/dist/render/backend/webgpu/flatPass.js +57 -9
- package/dist/render/backend/webgpu/glassTintPass.d.ts +28 -0
- package/dist/render/backend/webgpu/glassTintPass.js +206 -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/instanceCullPass.d.ts +34 -0
- package/dist/render/backend/webgpu/instanceCullPass.js +144 -0
- package/dist/render/backend/webgpu/instanced.d.ts +23 -2
- package/dist/render/backend/webgpu/instanced.js +41 -4
- package/dist/render/backend/webgpu/latePass.d.ts +30 -0
- package/dist/render/backend/webgpu/latePass.js +140 -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 +3 -13
- package/dist/render/backend/webgpu/renderer.d.ts +271 -64
- package/dist/render/backend/webgpu/renderer.js +1395 -580
- package/dist/render/backend/webgpu/scatterPass.js +2 -1
- package/dist/render/backend/webgpu/sdfTextPass.js +6 -1
- package/dist/render/backend/webgpu/shaders/instanceCull.wgsl.d.ts +18 -0
- package/dist/render/backend/webgpu/shaders/instanceCull.wgsl.js +59 -0
- 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 +22 -3
- package/dist/render/backend/webgpu/surfaceTexturePass.js +78 -39
- package/dist/render/driftLight/bake.d.ts +7 -0
- package/dist/render/driftLight/bake.js +61 -56
- package/dist/render/driftLight/denseField.d.ts +46 -0
- package/dist/render/driftLight/denseField.js +109 -0
- package/dist/render/driftLight/lightField.d.ts +10 -5
- package/dist/render/driftLight/lightField.js +25 -19
- package/dist/render/driftLight/presence.d.ts +50 -0
- package/dist/render/driftLight/presence.js +43 -0
- package/dist/render/driftLight/uniforms.d.ts +3 -3
- package/dist/render/driftLight/uniforms.js +5 -6
- package/dist/render/driftLight/worldLightField.d.ts +41 -0
- package/dist/render/driftLight/worldLightField.js +66 -0
- package/dist/render/fixtureAtlas.d.ts +20 -0
- package/dist/render/fixtureAtlas.js +49 -0
- 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/instanceCull.d.ts +63 -0
- package/dist/render/instanceCull.js +160 -0
- package/dist/render/instances.d.ts +15 -0
- package/dist/render/lightBudget.d.ts +36 -35
- package/dist/render/lightBudget.js +38 -37
- package/dist/render/lightGrid.d.ts +42 -0
- package/dist/render/lightGrid.js +87 -0
- package/dist/render/mesh.d.ts +18 -24
- package/dist/render/mesh.js +51 -68
- package/dist/render/occlusion.d.ts +10 -0
- package/dist/render/occlusion.js +36 -7
- package/dist/render/pointGlassTint.d.ts +59 -0
- package/dist/render/pointGlassTint.js +198 -0
- package/dist/render/pointLightSelection.d.ts +7 -0
- package/dist/render/pointLightSelection.js +29 -4
- 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/rainField.d.ts +13 -0
- package/dist/render/rainField.js +27 -5
- package/dist/render/recon/changeFrames.d.ts +15 -0
- package/dist/render/recon/changeFrames.js +21 -0
- package/dist/render/recon/lateDepth.d.ts +11 -0
- package/dist/render/recon/lateDepth.js +70 -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/recon/resolve.d.ts +34 -4
- package/dist/render/recon/resolve.js +161 -20
- package/dist/render/renderQuality.d.ts +35 -0
- package/dist/render/renderQuality.js +7 -0
- package/dist/render/rendererHarness.js +16 -0
- package/dist/render/sceneTarget.d.ts +9 -1
- package/dist/render/sceneTarget.js +60 -12
- package/dist/render/shaders/depth.d.ts +16 -1
- package/dist/render/shaders/depth.js +94 -15
- package/dist/render/shaders/flat/directionalShadow.js +91 -6
- package/dist/render/shaders/flat/driftLight.d.ts +1 -1
- package/dist/render/shaders/flat/driftLight.js +32 -7
- 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 +9 -3
- 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 +190 -38
- 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 +96 -26
- package/dist/render/shaders/flat/surfaceEffects.d.ts +29 -0
- package/dist/render/shaders/flat/surfaceEffects.js +152 -0
- package/dist/render/shaders/generated/depth.wgsl.d.ts +230 -7
- package/dist/render/shaders/generated/depth.wgsl.js +230 -7
- package/dist/render/shaders/generated/flat.wgsl.d.ts +1644 -1596
- package/dist/render/shaders/generated/flat.wgsl.js +1683 -1621
- 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 +21 -17
- 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/generated/rush.wgsl.d.ts +21 -16
- package/dist/render/shaders/generated/rush.wgsl.js +21 -16
- package/dist/render/shaders/generated/sdfText.wgsl.d.ts +2 -2
- package/dist/render/shaders/generated/sdfText.wgsl.js +2 -2
- package/dist/render/shaders/generated/text.wgsl.d.ts +1 -1
- package/dist/render/shaders/generated/text.wgsl.js +1 -1
- package/dist/render/shaders/gi/driftLight.wgsl.d.ts +1 -1
- package/dist/render/shaders/gi/driftLight.wgsl.js +27 -4
- 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 +69 -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/shaders/recon/resolve.wgsl.d.ts +8 -7
- package/dist/render/shaders/recon/resolve.wgsl.js +161 -27
- package/dist/render/shaders/rush.js +11 -1
- package/dist/render/shaders/sdfText.d.ts +1 -1
- package/dist/render/shaders/sdfText.js +3 -2
- package/dist/render/shaders/text.d.ts +1 -1
- package/dist/render/shaders/text.js +18 -9
- 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/surfaceEffects.d.ts +83 -0
- package/dist/render/surfaceEffects.js +75 -0
- package/dist/render/surfaceScene.d.ts +8 -0
- package/dist/render/surfaceScene.js +8 -0
- package/dist/render/surfaceTexture.d.ts +18 -2
- package/dist/render/surfaceTexture.js +68 -15
- package/dist/render/temporalAa.d.ts +25 -6
- package/dist/render/temporalAa.js +45 -15
- package/dist/render/textureSource.d.ts +30 -0
- package/dist/render/textureSource.js +53 -0
- package/dist/render/translucentQueue.d.ts +6 -0
- package/dist/render/translucentQueue.js +15 -1
- package/dist/render/vertexDefaults.js +2 -0
- package/dist/world/hlod.d.ts +104 -0
- package/dist/world/hlod.js +214 -0
- package/package.json +6 -6
- package/src/geometry/boxCsg.ts +186 -0
- package/src/geometry/csg.ts +384 -0
- package/src/geometry/meshBuilder.ts +15 -0
- package/src/geometry/meshConcat.ts +1 -0
- package/src/geometry/pixelFont.ts +2 -0
- package/src/geometry/solid.ts +189 -0
- package/src/geometry/solidFlat.ts +522 -0
- package/src/geometry/solidHarness.ts +83 -0
- package/src/geometry/solidNormals.ts +103 -0
- package/src/geometry/solidRound.ts +443 -0
- package/src/geometry/solidWriter.ts +58 -0
- package/src/index.ts +61 -1
- package/src/render/backend/api.ts +36 -11
- package/src/render/backend/drawFog.ts +31 -0
- package/src/render/backend/materialChanges.ts +9 -2
- package/src/render/backend/webgl2/glassTintPrograms.ts +58 -0
- package/src/render/backend/webgl2/instanced.ts +80 -14
- package/src/render/backend/webgl2/renderer.ts +700 -250
- package/src/render/backend/webgpu/buffers.ts +92 -5
- package/src/render/backend/webgpu/depthPass.ts +7 -2
- package/src/render/backend/webgpu/drawCommand.ts +6 -0
- package/src/render/backend/webgpu/flatPass.ts +62 -11
- package/src/render/backend/webgpu/glassTintPass.ts +245 -0
- package/src/render/backend/webgpu/gpuDrivenPass.ts +349 -5
- package/src/render/backend/webgpu/instanceCullPass.ts +165 -0
- package/src/render/backend/webgpu/instanced.ts +42 -4
- package/src/render/backend/webgpu/latePass.ts +161 -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 +1671 -670
- package/src/render/backend/webgpu/scatterPass.ts +2 -1
- package/src/render/backend/webgpu/sdfTextPass.ts +6 -1
- package/src/render/backend/webgpu/shaders/instanceCull.wgsl.ts +61 -0
- 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 +91 -51
- package/src/render/driftLight/bake.ts +85 -62
- package/src/render/driftLight/denseField.ts +149 -0
- package/src/render/driftLight/lightField.ts +33 -18
- package/src/render/driftLight/presence.ts +69 -0
- package/src/render/driftLight/uniforms.ts +8 -9
- package/src/render/driftLight/worldLightField.ts +83 -0
- package/src/render/fixtureAtlas.ts +63 -0
- 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/instanceCull.ts +205 -0
- package/src/render/instances.ts +16 -0
- package/src/render/lightBudget.ts +41 -38
- package/src/render/lightGrid.ts +130 -0
- package/src/render/mesh.ts +59 -72
- package/src/render/occlusion.ts +51 -7
- package/src/render/pointGlassTint.ts +250 -0
- package/src/render/pointLightSelection.ts +72 -4
- package/src/render/pointShadowArray.ts +188 -22
- package/src/render/pointShadowMap.ts +41 -0
- package/src/render/rainField.ts +39 -5
- package/src/render/recon/changeFrames.ts +24 -0
- package/src/render/recon/lateDepth.ts +83 -0
- package/src/render/recon/lateRouting.ts +29 -0
- package/src/render/recon/mover.ts +118 -0
- package/src/render/recon/resolve.ts +206 -20
- package/src/render/renderQuality.ts +47 -0
- package/src/render/rendererHarness.ts +16 -0
- package/src/render/sceneTarget.ts +62 -11
- package/src/render/shaders/depth.ts +118 -15
- package/src/render/shaders/flat/directionalShadow.ts +97 -6
- package/src/render/shaders/flat/driftLight.ts +32 -7
- package/src/render/shaders/flat/glassTint.ts +25 -0
- package/src/render/shaders/flat/index.ts +22 -3
- package/src/render/shaders/flat/lampGlass.ts +185 -0
- package/src/render/shaders/flat/main.ts +190 -38
- package/src/render/shaders/flat/pointShadow.ts +2 -0
- package/src/render/shaders/flat/preamble.ts +96 -26
- package/src/render/shaders/flat/surfaceEffects.ts +152 -0
- package/src/render/shaders/generated/depth.wgsl.ts +237 -7
- package/src/render/shaders/generated/flat.wgsl.ts +1685 -1621
- package/src/render/shaders/generated/globalMedium.wgsl.ts +3 -13
- package/src/render/shaders/generated/lightVolume.wgsl.ts +23 -17
- package/src/render/shaders/generated/octahedralResolve.wgsl.ts +30 -0
- package/src/render/shaders/generated/rush.wgsl.ts +21 -16
- package/src/render/shaders/generated/sdfText.wgsl.ts +2 -2
- package/src/render/shaders/generated/text.wgsl.ts +1 -1
- package/src/render/shaders/gi/driftLight.wgsl.ts +27 -4
- 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 +72 -0
- package/src/render/shaders/recon/motion.wgsl.ts +84 -0
- package/src/render/shaders/recon/resolve.wgsl.ts +161 -27
- package/src/render/shaders/rush.ts +11 -1
- package/src/render/shaders/sdfText.ts +3 -2
- package/src/render/shaders/text.ts +18 -9
- package/src/render/shadowCasters.ts +28 -1
- package/src/render/shadowMap.ts +231 -37
- package/src/render/sunGlassTint.ts +86 -0
- package/src/render/surfaceEffects.ts +132 -0
- package/src/render/surfaceScene.ts +16 -0
- package/src/render/surfaceTexture.ts +110 -19
- package/src/render/temporalAa.ts +78 -14
- package/src/render/textureSource.ts +72 -0
- package/src/render/translucentQueue.ts +20 -1
- package/src/render/vertexDefaults.ts +2 -0
- package/src/world/hlod.ts +290 -0
|
@@ -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';
|
|
@@ -54,9 +55,12 @@ import type { Bounds } from '../../../math/bounds.ts';
|
|
|
54
55
|
import { type ComputeDefinition, type ComputeHandle } from '../../compute.ts';
|
|
55
56
|
import type { PassDefinition, PassHandle } from '../../pass.ts';
|
|
56
57
|
import { GpuInstancedBatch } from './instanced.ts';
|
|
57
|
-
import type { MeshInstances } from '../../instances.ts';
|
|
58
|
+
import type { InstancedOptions, MeshInstances } from '../../instances.ts';
|
|
58
59
|
import { LightField } from '../../driftLight/lightField.ts';
|
|
59
60
|
import type { LightFieldOptions, LightFieldSource } from '../../driftLight/lightField.ts';
|
|
61
|
+
import type { DenseLightVolume } from '../../driftLight/denseField.ts';
|
|
62
|
+
import { WorldLightField } from '../../driftLight/worldLightField.ts';
|
|
63
|
+
import type { WorldLightFieldOptions } from '../../driftLight/worldLightField.ts';
|
|
60
64
|
/** Which directional shadow map a pass is filling, matching `renderer.ts`. */
|
|
61
65
|
type ShadowLayer = 'static' | 'static-peel' | 'dynamic';
|
|
62
66
|
export declare class WebGPURenderer implements RendererApi {
|
|
@@ -156,6 +160,8 @@ export declare class WebGPURenderer implements RendererApi {
|
|
|
156
160
|
* caller who passed null gets — rather than reading a slot this frame has already re-let.
|
|
157
161
|
*/
|
|
158
162
|
private skinPaletteSlot;
|
|
163
|
+
/** The palette `skinPaletteSlot` was uploaded from, for a skinned mover to copy. See `Mover`. */
|
|
164
|
+
private skinPaletteData;
|
|
159
165
|
private readonly surface;
|
|
160
166
|
/** The encoder for the frame in flight, or null between frames. */
|
|
161
167
|
private encoder;
|
|
@@ -163,6 +169,27 @@ export declare class WebGPURenderer implements RendererApi {
|
|
|
163
169
|
private readonly meshPresent;
|
|
164
170
|
private pass;
|
|
165
171
|
private readonly pipelines;
|
|
172
|
+
/**
|
|
173
|
+
* The pipelines a reconstructing frame's blended draws are built for: the reconstructed picture's
|
|
174
|
+
* format at one sample, which is where `LatePass` draws them. Aliased to `pipelines` when the
|
|
175
|
+
* world already lands on exactly that, as `overlayPipelines` is.
|
|
176
|
+
*/
|
|
177
|
+
private readonly latePipelines;
|
|
178
|
+
/** The blended draws of a reconstructing frame, drawn after the upscale. See `LatePass`. */
|
|
179
|
+
private latePass;
|
|
180
|
+
/** A late draw asked to refract: `runLate` copies the reconstructed picture before replaying. */
|
|
181
|
+
private lateRefractWanted;
|
|
182
|
+
/** The refraction copy's mip chain, recorded after each copy: what frosted glass reads. */
|
|
183
|
+
private refractMips;
|
|
184
|
+
/**
|
|
185
|
+
* The refraction copy's sampler: filtering, and **between levels as well**, so a frosted pane's
|
|
186
|
+
* level falls smoothly between two blurs rather than stepping from one to the next.
|
|
187
|
+
*/
|
|
188
|
+
private refractSampler;
|
|
189
|
+
/** One glass resolution reused by every draw, so a pane allocates nothing. See `glass.ts`. */
|
|
190
|
+
private readonly glassScratch;
|
|
191
|
+
/** `issueCommand` bound once, so the late replay allocates no closure per frame. */
|
|
192
|
+
private readonly issueBound;
|
|
166
193
|
/**
|
|
167
194
|
* The same pipelines again, built for the canvas, for anything drawn after `endFrame`.
|
|
168
195
|
*
|
|
@@ -489,6 +516,12 @@ export declare class WebGPURenderer implements RendererApi {
|
|
|
489
516
|
* what the layout already declares.
|
|
490
517
|
*/
|
|
491
518
|
private bloomGroups;
|
|
519
|
+
/**
|
|
520
|
+
* The picture the bloom reads, and its size: the scene target, or while reconstructing the
|
|
521
|
+
* resolved picture at the drawing buffer's size. See `rebuildBloomGroups`.
|
|
522
|
+
*/
|
|
523
|
+
private bloomSourceWidth;
|
|
524
|
+
private bloomSourceHeight;
|
|
492
525
|
private frameWidth;
|
|
493
526
|
private frameHeight;
|
|
494
527
|
/**
|
|
@@ -640,13 +673,25 @@ export declare class WebGPURenderer implements RendererApi {
|
|
|
640
673
|
* the *unsharpened* result — sharpening into the history would sharpen a sharpened picture every
|
|
641
674
|
* frame, which is the halo the reference's own clamp exists to prevent, compounded.
|
|
642
675
|
*
|
|
643
|
-
* The motion target is render size and carries a drawn object's own motion where
|
|
644
|
-
* one
|
|
645
|
-
*
|
|
646
|
-
* exact
|
|
676
|
+
* The motion target is render size and carries a drawn object's own motion where the motion pass
|
|
677
|
+
* wrote one — a draw that named its mover, or passed last frame's matrix. Every other texel is
|
|
678
|
+
* cleared, and the resolve takes the camera's motion there, derived from the depth and the
|
|
679
|
+
* reprojection: exact for anything that did not move. See `MotionPass`.
|
|
647
680
|
*/
|
|
648
681
|
private reconHistories;
|
|
649
682
|
private reconHistoryViews;
|
|
683
|
+
/**
|
|
684
|
+
* Each output pixel's flicker record, a pair swapped with the histories: the temporal resolve's
|
|
685
|
+
* anti-flicker, over the reconstruction's own period (`recon/resolve.ts`).
|
|
686
|
+
*/
|
|
687
|
+
private reconFlickers;
|
|
688
|
+
private reconFlickerViews;
|
|
689
|
+
/** Each output pixel's held depth swing, a pair of its own: see `recon/resolve.ts`. */
|
|
690
|
+
private reconSwings;
|
|
691
|
+
private reconSwingViews;
|
|
692
|
+
/** The anti-flicker's rule for the period last asked for, kept so a frame makes none. */
|
|
693
|
+
private reconFlickerPhases;
|
|
694
|
+
private reconFlickerRule;
|
|
650
695
|
private reconWrite;
|
|
651
696
|
private reconHasHistory;
|
|
652
697
|
private reconShown;
|
|
@@ -665,40 +710,24 @@ export declare class WebGPURenderer implements RendererApi {
|
|
|
665
710
|
private reconGroups;
|
|
666
711
|
private reconSharpenGroups;
|
|
667
712
|
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;
|
|
713
|
+
/** The motion pass, made with the reconstruction's targets. See `MotionPass`. */
|
|
714
|
+
private motionPass;
|
|
715
|
+
/** This renderer's identity to a `Mover`. See `claimRendererId`. */
|
|
716
|
+
private readonly moverRenderer;
|
|
717
|
+
/** Frames begun, so a mover can tell last frame from any other. Advanced in `beginFrame`. */
|
|
718
|
+
private moverFrame;
|
|
719
|
+
/** Between `beginFrame` and `endFrame`. A change outside it is the next frame's. */
|
|
720
|
+
private inFrame;
|
|
721
|
+
private warnedMoverTwice;
|
|
696
722
|
/** The scene's own clip transform with the generated shaders' y negation folded in. */
|
|
697
723
|
private readonly motionRaster;
|
|
698
724
|
private reconSizeKey;
|
|
699
725
|
/** Last frame's raw view-projection and its inverse, and the two eyes. */
|
|
700
726
|
private readonly reconPreviousRawViewProj;
|
|
701
727
|
private readonly reconInverseViewProj;
|
|
728
|
+
/** The inverse and the reprojection, multiplied in double precision. See `runReconstruction`. */
|
|
729
|
+
private readonly reconInverse64;
|
|
730
|
+
private readonly reconReprojection64;
|
|
702
731
|
private readonly reconPreviousInverseViewProj;
|
|
703
732
|
private readonly reconEye;
|
|
704
733
|
private readonly reconPreviousEye;
|
|
@@ -826,6 +855,8 @@ export declare class WebGPURenderer implements RendererApi {
|
|
|
826
855
|
/** Said once for the whole renderer. See `refuseOitMultisampled`. */
|
|
827
856
|
private oitMultisampleRefused;
|
|
828
857
|
private oitReplaying;
|
|
858
|
+
/** `uSurfaceScene`, resolved once a pass. See `surfaceScene.ts`. */
|
|
859
|
+
private readonly surfaceScene;
|
|
829
860
|
/** Which buffer the replay is filling, which the pipeline key must carry. */
|
|
830
861
|
private oitMode;
|
|
831
862
|
/**
|
|
@@ -1056,6 +1087,8 @@ export declare class WebGPURenderer implements RendererApi {
|
|
|
1056
1087
|
/** Whether the bound material is seen from both faces. See `SurfaceMaterial.doubleSided`. */
|
|
1057
1088
|
private materialDoubleSided;
|
|
1058
1089
|
createSurfaceTexture(source: TexImageSource, options?: SurfaceTextureOptions): GpuSurfaceTexture;
|
|
1090
|
+
/** Several images of one size as an array's layers. See `RendererApi.createSurfaceTextureArray`. */
|
|
1091
|
+
createSurfaceTextureArray(sources: readonly TexImageSource[], options?: SurfaceTextureOptions): GpuSurfaceTexture;
|
|
1059
1092
|
/**
|
|
1060
1093
|
* GPU textures an `updateSurfaceTexture` replaced, destroyed when the next frame begins.
|
|
1061
1094
|
*
|
|
@@ -1134,6 +1167,13 @@ export declare class WebGPURenderer implements RendererApi {
|
|
|
1134
1167
|
/** How bright the environment the surfaces drawn next reflect is. See `renderer.ts`. */
|
|
1135
1168
|
setEnvironmentGain(gain: number): void;
|
|
1136
1169
|
setSurfaceGrain(amount: number): void;
|
|
1170
|
+
/**
|
|
1171
|
+
* How much of the surfaces drawn next survives a screen-door dither. See `renderer.ts`.
|
|
1172
|
+
*
|
|
1173
|
+
* Written straight into the scratch block rather than through `material()`'s callback, because
|
|
1174
|
+
* this one is called per crossfading region per frame and a closure per call is an allocation.
|
|
1175
|
+
*/
|
|
1176
|
+
setDitherFade(amount: number): void;
|
|
1137
1177
|
/**
|
|
1138
1178
|
* How strong the microscopic relief on the surfaces drawn next is, and how coarse.
|
|
1139
1179
|
*
|
|
@@ -1474,6 +1514,8 @@ export declare class WebGPURenderer implements RendererApi {
|
|
|
1474
1514
|
private readonly waterLayout;
|
|
1475
1515
|
/** The one-pixel stand-in, kept so the water bind group can be rebuilt without one. */
|
|
1476
1516
|
private readonly blankView;
|
|
1517
|
+
/** The blank texel as a one-layer array: the stand-in every surface-texture binding takes. */
|
|
1518
|
+
private readonly blankSurfaceView;
|
|
1477
1519
|
private readonly blankSampler;
|
|
1478
1520
|
/**
|
|
1479
1521
|
* A slot per body, not one buffer rewritten before each draw.
|
|
@@ -1597,8 +1639,39 @@ export declare class WebGPURenderer implements RendererApi {
|
|
|
1597
1639
|
private readonly sdfTextVerts;
|
|
1598
1640
|
private readonly sdfTextFrags;
|
|
1599
1641
|
private readonly sdfTextBindGroups;
|
|
1600
|
-
|
|
1601
|
-
|
|
1642
|
+
/**
|
|
1643
|
+
* The sun's static, moving and peeled maps, as layers of one texture (`shadowMap.ts`). The three
|
|
1644
|
+
* views below are single layers, what each pass attaches; the two here are what is sampled.
|
|
1645
|
+
*/
|
|
1646
|
+
private sunShadowTexture;
|
|
1647
|
+
/** Every layer, for the lit pass, the light volumes and the medium. */
|
|
1648
|
+
private sunArrayView;
|
|
1649
|
+
/**
|
|
1650
|
+
* The static layer alone, as an array, for the peel: it draws into another layer of the same
|
|
1651
|
+
* texture, and a view covering that layer too would put it in two usages in one pass.
|
|
1652
|
+
*/
|
|
1653
|
+
private sunStaticArrayView;
|
|
1654
|
+
/** How many layers the sun's texture holds: its maps, and the two glass layers once glass casts. */
|
|
1655
|
+
private sunLayerCount;
|
|
1656
|
+
/** The glass depth layers, static then moving, once glass has cast. See `growSunForGlass`. */
|
|
1657
|
+
private sunGlassViews;
|
|
1658
|
+
/** The texture a growth replaced, destroyed once the encoder that copied out of it is submitted. */
|
|
1659
|
+
private retiredSunTexture;
|
|
1660
|
+
/** What the sun's light keeps through glass: two `rgba8unorm` layers, made when glass first casts. */
|
|
1661
|
+
private sunTint;
|
|
1662
|
+
/** The tint pass's layouts, per-draw block, groups and pipelines, made when glass first casts. */
|
|
1663
|
+
private glassTint;
|
|
1664
|
+
/** The tint pass open while the glass list is replayed into it. */
|
|
1665
|
+
private tintPass;
|
|
1666
|
+
/** True while the glass list is replayed into a glass depth layer through `casterSink`. */
|
|
1667
|
+
private drawingGlassDepth;
|
|
1668
|
+
/** Whether the open sun pass is the movers' layer, whose glass goes to the moving glass layer. */
|
|
1669
|
+
private shadowLayerIsDynamic;
|
|
1670
|
+
/** The glass tints' sampler: filtering, and between levels, for frost's coarser reads. */
|
|
1671
|
+
private readonly tintSampler;
|
|
1672
|
+
/** The light a tint pass is drawn for: xyz a direction (w 0) or a position (w 1). */
|
|
1673
|
+
private readonly glassLight;
|
|
1674
|
+
private shadowView;
|
|
1602
1675
|
private readonly shadowLayout;
|
|
1603
1676
|
/** The same layout plus the joint palette. See `createDepthBindGroupLayout`. */
|
|
1604
1677
|
private readonly shadowSkinnedLayout;
|
|
@@ -1624,8 +1697,7 @@ export declare class WebGPURenderer implements RendererApi {
|
|
|
1624
1697
|
* read twice — so a profile that switches peeling off gets no map and no pass on either
|
|
1625
1698
|
* backend rather than a map nothing writes.
|
|
1626
1699
|
*/
|
|
1627
|
-
private
|
|
1628
|
-
private readonly peelView;
|
|
1700
|
+
private peelView;
|
|
1629
1701
|
/**
|
|
1630
1702
|
* The movers' own layer: the character, the rope it swings on, and anything else that walks.
|
|
1631
1703
|
*
|
|
@@ -1646,10 +1718,9 @@ export declare class WebGPURenderer implements RendererApi {
|
|
|
1646
1718
|
* and therefore as lit — so nothing looked broken, only empty, which is why it survived the
|
|
1647
1719
|
* port and every gate in it.
|
|
1648
1720
|
*/
|
|
1649
|
-
private
|
|
1650
|
-
private readonly dynamicView;
|
|
1721
|
+
private dynamicView;
|
|
1651
1722
|
/** The peel's own bind groups: `uPeelShadowLayer` at 1, and the static map to peel against. */
|
|
1652
|
-
private
|
|
1723
|
+
private shadowPeelBindGroup;
|
|
1653
1724
|
/**
|
|
1654
1725
|
* The cutout casters' layout, and a bind group per cutout map for each layer, built the first
|
|
1655
1726
|
* time a map casts and kept: a `createBindGroup` per draw is the allocation the house rules forbid.
|
|
@@ -1661,7 +1732,7 @@ export declare class WebGPURenderer implements RendererApi {
|
|
|
1661
1732
|
private readonly cutoutPeelGroups;
|
|
1662
1733
|
private shadowPeelPassUniforms;
|
|
1663
1734
|
private shadowPeelSampler;
|
|
1664
|
-
private
|
|
1735
|
+
private scatterDepthPeelBindGroup;
|
|
1665
1736
|
/** Which layer the open pass is writing, so the sink picks the bindings that match it. */
|
|
1666
1737
|
private shadowLayerIsPeel;
|
|
1667
1738
|
/**
|
|
@@ -1732,6 +1803,10 @@ export declare class WebGPURenderer implements RendererApi {
|
|
|
1732
1803
|
* Built once and held, rather than made per call: it closes over `this` and a fresh one
|
|
1733
1804
|
* every frame would be an allocation in a per-frame path.
|
|
1734
1805
|
*/
|
|
1806
|
+
/** The glass the open shadow pass was offered, kept for its own passes: `glassCasters.ts`. */
|
|
1807
|
+
private readonly glassCasters;
|
|
1808
|
+
/** One resolution every glass caster is read through, so recording one allocates nothing. */
|
|
1809
|
+
private readonly glassCasterScratch;
|
|
1735
1810
|
private readonly casterSink;
|
|
1736
1811
|
/** Said once rather than every frame, because a full ring is a flood otherwise. */
|
|
1737
1812
|
private warnedFull;
|
|
@@ -2016,7 +2091,7 @@ export declare class WebGPURenderer implements RendererApi {
|
|
|
2016
2091
|
*/
|
|
2017
2092
|
drawMesh(mesh: GpuMesh, model: ArrayLike<number>, depthLayer?: number, tint?: Vec3 | null,
|
|
2018
2093
|
/** Where it was last frame. See `RendererApi.drawMesh`, and `runMotion` for what reads it. */
|
|
2019
|
-
previousModel?: ArrayLike<number> | null): void;
|
|
2094
|
+
previousModel?: ArrayLike<number> | Mover | null): void;
|
|
2020
2095
|
/**
|
|
2021
2096
|
* Draw a mesh that lets the world through, at `opacity`.
|
|
2022
2097
|
*
|
|
@@ -2104,9 +2179,11 @@ export declare class WebGPURenderer implements RendererApi {
|
|
|
2104
2179
|
* anyway, because WebGL2 *cannot* and a capability one backend has and the other does not is
|
|
2105
2180
|
* the shape this repository spent a week removing.
|
|
2106
2181
|
*/
|
|
2107
|
-
createInstanced(mesh: GpuMesh, capacity: number): GpuInstancedBatch;
|
|
2108
|
-
/**
|
|
2109
|
-
private
|
|
2182
|
+
createInstanced(mesh: GpuMesh, capacity: number, options?: InstancedOptions): GpuInstancedBatch;
|
|
2183
|
+
/** The device instance culls, built on the first culling draw. See `InstanceCullPass`. */
|
|
2184
|
+
private instanceCulls;
|
|
2185
|
+
/** Counts frames, so a batch knows when its cull slots were last taken. */
|
|
2186
|
+
private cullFrame;
|
|
2110
2187
|
/** Push placement and colour. Only the live prefix; see `GpuInstancedBatch.upload`. */
|
|
2111
2188
|
uploadInstanced(batch: GpuInstancedBatch, data: MeshInstances): void;
|
|
2112
2189
|
/** Draw every live instance, opaque. */
|
|
@@ -2115,6 +2192,18 @@ export declare class WebGPURenderer implements RendererApi {
|
|
|
2115
2192
|
drawTranslucentInstanced(batch: GpuInstancedBatch, data: MeshInstances, opacity: number, options?: TranslucentMeshOptions): void;
|
|
2116
2193
|
/** Release the placement. The mesh is the caller's and is not released. */
|
|
2117
2194
|
disposeInstanced(batch: GpuInstancedBatch): void;
|
|
2195
|
+
/**
|
|
2196
|
+
* Write what a translucent draw shows through it into the material scratch: refraction's bend and
|
|
2197
|
+
* absorption, and glass. Returns whether the frame's copy is there to read, and so whether
|
|
2198
|
+
* `releaseSeeThrough` owes the scratch back.
|
|
2199
|
+
*
|
|
2200
|
+
* **A glass draw takes the copy even when it does not bend**, since a pane shows what is behind it
|
|
2201
|
+
* either way. A copy that cannot be taken — a mirror, a probe bake — leaves both off, so the pane
|
|
2202
|
+
* shades as ordinary translucency rather than sampling a stand-in. See `glass.ts`.
|
|
2203
|
+
*/
|
|
2204
|
+
private bindSeeThrough;
|
|
2205
|
+
/** Put the scratch back after `bindSeeThrough`: refraction and glass off. */
|
|
2206
|
+
private releaseSeeThrough;
|
|
2118
2207
|
/**
|
|
2119
2208
|
* One draw, one material slot, one uniform slot, however many instances.
|
|
2120
2209
|
*
|
|
@@ -2127,6 +2216,12 @@ export declare class WebGPURenderer implements RendererApi {
|
|
|
2127
2216
|
* **What it gives up** against `drawMesh` is skinning and morphing, refused where the variant
|
|
2128
2217
|
* is built, and a per-instance opacity: `opacity` here dims the whole batch.
|
|
2129
2218
|
*/
|
|
2219
|
+
/**
|
|
2220
|
+
* The next of a batch's cull slots this frame, with its cull queued against the current view; null
|
|
2221
|
+
* when the batch has drawn from `MAX_CULL_SLOTS` views already or the frame's job ring is full,
|
|
2222
|
+
* and the draw then takes every instance.
|
|
2223
|
+
*/
|
|
2224
|
+
private takeCullSlot;
|
|
2130
2225
|
private submitInstanced;
|
|
2131
2226
|
/** Upload a base mesh and size its per-instance buffers. See `createGpuScatter`. */
|
|
2132
2227
|
createScatter(base: MeshData, data: InstanceData): GpuScatter;
|
|
@@ -2207,6 +2302,34 @@ export declare class WebGPURenderer implements RendererApi {
|
|
|
2207
2302
|
drawSceneCasters(casters: ShadowCasters): void;
|
|
2208
2303
|
drawShadowCasters(casters: ShadowCasters): void;
|
|
2209
2304
|
/** Close the shadow pass and submit it, so the frame can sample what it wrote. */
|
|
2305
|
+
/**
|
|
2306
|
+
* Add the sun's two glass layers, once, carrying every layer it holds across on `encoder`.
|
|
2307
|
+
*
|
|
2308
|
+
* **Copied rather than re-baked**, for the reason `SunShadowArray.growForGlass` gives: the static
|
|
2309
|
+
* map is the consumer's to bake and may be baked once, and the glass that grows the texture
|
|
2310
|
+
* arrives in the very pass that drew it. Every view of the old texture is stale afterwards, so
|
|
2311
|
+
* every group holding one is rebuilt here — the lit pass's, the volumes', the medium's and the
|
|
2312
|
+
* peel's — and the old texture is destroyed only once this encoder is submitted.
|
|
2313
|
+
*/
|
|
2314
|
+
private growSunForGlass;
|
|
2315
|
+
/** Every group that holds a view of the sun's texture, rebuilt after it has been replaced. */
|
|
2316
|
+
private rebuildSunGroups;
|
|
2317
|
+
/** The sun's tint target, made the first time glass casts and born clear on `encoder`. */
|
|
2318
|
+
private ensureSunTint;
|
|
2319
|
+
/**
|
|
2320
|
+
* Draw the pass's glass twice: where the nearest pane is, and what the panes let through.
|
|
2321
|
+
*
|
|
2322
|
+
* After the opaque casters, on the pass's own encoder. A layer that has held glass is redrawn
|
|
2323
|
+
* even when this pass offered none, so glass that has gone takes its colour with it.
|
|
2324
|
+
*/
|
|
2325
|
+
private flushSunGlass;
|
|
2326
|
+
/** The glass list into a glass depth layer: `casterSink` itself, with glass let through. */
|
|
2327
|
+
private readonly glassDepthSink;
|
|
2328
|
+
/**
|
|
2329
|
+
* The glass list into a tint layer, through the tint pipelines, **culling nothing**: every pane on
|
|
2330
|
+
* a ray counts, whichever way it faces. See the other backend's `glassTintSink`.
|
|
2331
|
+
*/
|
|
2332
|
+
private readonly glassTintSink;
|
|
2210
2333
|
endShadowPass(): void;
|
|
2211
2334
|
/**
|
|
2212
2335
|
* The pool, or null where the profile switched cube shadows off.
|
|
@@ -2227,6 +2350,8 @@ export declare class WebGPURenderer implements RendererApi {
|
|
|
2227
2350
|
private preparedPointLightCount;
|
|
2228
2351
|
/** See `renderer.ts`: built when a world reports its lights, and rebuilt only to grow. */
|
|
2229
2352
|
private pointShadowArray;
|
|
2353
|
+
/** The array glass replaced, destroyed once the round that copied out of it is submitted. */
|
|
2354
|
+
private retiredPointTexture;
|
|
2230
2355
|
private readonly bakeScratch;
|
|
2231
2356
|
/** Said once per renderer; see `updatePointShadows`. */
|
|
2232
2357
|
private warnedNoPointShadowArray;
|
|
@@ -2461,28 +2586,51 @@ export declare class WebGPURenderer implements RendererApi {
|
|
|
2461
2586
|
* called whenever any of them is replaced.
|
|
2462
2587
|
*/
|
|
2463
2588
|
private rebuildReconGroups;
|
|
2589
|
+
/** This frame's jitter and temporal frame, decided where its scene camera is bound. See `bindMeshPass`. */
|
|
2590
|
+
private jitterFrame;
|
|
2464
2591
|
/**
|
|
2465
|
-
*
|
|
2592
|
+
* Whether a blended draw recorded now lands after the upscale. See `lateRouting.ts`.
|
|
2466
2593
|
*
|
|
2467
|
-
*
|
|
2468
|
-
|
|
2469
|
-
|
|
2594
|
+
* Not during the order-independent replay, which owns its pass and issues into it directly.
|
|
2595
|
+
*/
|
|
2596
|
+
private drawsLate;
|
|
2597
|
+
/**
|
|
2598
|
+
* The command a blended draw records into: the late pool while reconstructing, the frame graph
|
|
2599
|
+
* otherwise. **Late draws record whatever `quality.frameGraph` says**, since the late replay is
|
|
2600
|
+
* the only moment they can land; everything else keeps the path it has.
|
|
2601
|
+
*/
|
|
2602
|
+
private recordBlended;
|
|
2603
|
+
/** The pipelines a blended draw is built for: the reconstructed picture's while late. */
|
|
2604
|
+
private blendedPipelines;
|
|
2605
|
+
/**
|
|
2606
|
+
* The blended draws of a reconstructing frame, over the reconstructed picture at the output size
|
|
2607
|
+
* and unjittered, against the render's depth taken up to that size. Before occlusion, bloom and
|
|
2608
|
+
* the grade, so they are graded exactly as they were when they were drawn into the scene.
|
|
2470
2609
|
*/
|
|
2471
|
-
private
|
|
2610
|
+
private runLate;
|
|
2611
|
+
/** Whether this draw lands in the reconstructed picture. See `lateRouting.ts`. */
|
|
2612
|
+
private tracksMotionNow;
|
|
2472
2613
|
/**
|
|
2473
|
-
*
|
|
2614
|
+
* What this draw's motion is, recorded for the motion pass.
|
|
2474
2615
|
*
|
|
2475
|
-
*
|
|
2476
|
-
*
|
|
2616
|
+
* A mesh rewritten this frame carries its vertex motion whatever else the draw says — under last
|
|
2617
|
+
* frame's model where a mover or a matrix knows it, under this frame's where nothing does. A
|
|
2618
|
+
* mover otherwise carries a rigid draw's last model or a skinned draw's last pose; a matrix
|
|
2619
|
+
* carries a rigid draw's. A draw that says nothing and moved no vertex takes the camera's motion.
|
|
2477
2620
|
*/
|
|
2478
|
-
private
|
|
2479
|
-
/** The pipeline for one vertex stride, built on first sight of it. */
|
|
2480
|
-
private motionPipelineFor;
|
|
2621
|
+
private recordDrawMotion;
|
|
2481
2622
|
/**
|
|
2482
|
-
*
|
|
2623
|
+
* A skinned mover's motion: this frame's palette is the draw's own slot, and last frame's takes a
|
|
2624
|
+
* slot of its own, like any palette a draw binds — so it is uploaded once and nothing overwrites
|
|
2625
|
+
* it before the motion pass reads it. See `SkinPaletteRing`.
|
|
2626
|
+
*/
|
|
2627
|
+
private recordSkinnedMotion;
|
|
2628
|
+
private warnMoverTwice;
|
|
2629
|
+
/**
|
|
2630
|
+
* Where every mover was last frame, into the motion target. See `MotionPass`.
|
|
2483
2631
|
*
|
|
2484
2632
|
* **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
|
|
2633
|
+
* finished for the pass's equality test to mean anything, and the resolve is what consumes it.
|
|
2486
2634
|
*/
|
|
2487
2635
|
private runMotion;
|
|
2488
2636
|
/**
|
|
@@ -2742,6 +2890,8 @@ export declare class WebGPURenderer implements RendererApi {
|
|
|
2742
2890
|
private recordDraw;
|
|
2743
2891
|
/** Replay one recorded draw into an open pass. */
|
|
2744
2892
|
private replayNode;
|
|
2893
|
+
/** One recorded draw, issued into an open pass. Shared by the graph's replay and `runLate`. */
|
|
2894
|
+
private issueCommand;
|
|
2745
2895
|
private ensurePass;
|
|
2746
2896
|
/**
|
|
2747
2897
|
* The pass a verb will draw into, without flushing what is already recorded.
|
|
@@ -2953,6 +3103,8 @@ export declare class WebGPURenderer implements RendererApi {
|
|
|
2953
3103
|
* declares nothing behaves exactly as it did before. Read it beside `visible`, which answers the
|
|
2954
3104
|
* other half of the same question.
|
|
2955
3105
|
*/
|
|
3106
|
+
/** Whether a world-space box is wholly behind the declared occluders. See `Renderer.occludedBox`. */
|
|
3107
|
+
occludedBox(min: ArrayLike<number>, max: ArrayLike<number>): boolean;
|
|
2956
3108
|
occluded(bounds: Bounds, model: ReadonlyMat4): boolean;
|
|
2957
3109
|
private readonly passes;
|
|
2958
3110
|
/** Each registered pass's declared reads, as a mask, resolved once at registration. */
|
|
@@ -3137,6 +3289,13 @@ export declare class WebGPURenderer implements RendererApi {
|
|
|
3137
3289
|
beginInset(rect: InsetRect, clearColor: Vec3 | null): number;
|
|
3138
3290
|
/** Give the whole canvas back. Safe to call without a matching `beginInset`. */
|
|
3139
3291
|
endInset(): void;
|
|
3292
|
+
/**
|
|
3293
|
+
* The size of the attachment the open pass draws into: the swap image — the drawing buffer —
|
|
3294
|
+
* in the overlay after the present, the scene's render size in the frame's own pass. A tuple
|
|
3295
|
+
* held once rather than a new array a call.
|
|
3296
|
+
*/
|
|
3297
|
+
private passSize;
|
|
3298
|
+
private readonly passSizeOut;
|
|
3140
3299
|
/**
|
|
3141
3300
|
* Copy a rectangle of the frame into a 2D canvas, pixel for pixel.
|
|
3142
3301
|
*
|
|
@@ -3243,6 +3402,10 @@ export declare class WebGPURenderer implements RendererApi {
|
|
|
3243
3402
|
*
|
|
3244
3403
|
* What it gives up is one frame of history: the frame after a cut has no blur and no temporal
|
|
3245
3404
|
* blend, as the first frame of a session has none. Nothing else is reset.
|
|
3405
|
+
*
|
|
3406
|
+
* **A reconstructing renderer depends on it**: its history is the last shot's, and without this
|
|
3407
|
+
* call a cut blends that shot into the first frames of the next. Nothing detects a cut on the
|
|
3408
|
+
* caller's behalf, deliberately — a fast pan and a cut look alike from here.
|
|
3246
3409
|
*/
|
|
3247
3410
|
cameraCut(): void;
|
|
3248
3411
|
/**
|
|
@@ -3369,8 +3532,12 @@ export declare class WebGPURenderer implements RendererApi {
|
|
|
3369
3532
|
private probeView;
|
|
3370
3533
|
private readonly probeSize;
|
|
3371
3534
|
private readonly probeMipLayout;
|
|
3372
|
-
/** The
|
|
3373
|
-
private
|
|
3535
|
+
/** The fixture atlas — cookies over profiles — built on first use. See `fixtureAtlas.ts`. */
|
|
3536
|
+
private fixtureTexture;
|
|
3537
|
+
private fixtureView;
|
|
3538
|
+
/** The profiles as packed and the cookie images, kept so either can rebuild the atlas. */
|
|
3539
|
+
private iesAtlas;
|
|
3540
|
+
private cookieImages;
|
|
3374
3541
|
/** The scene's DriftLight field, and its two volumes once it is whole. See `createLightField`. */
|
|
3375
3542
|
private lightField;
|
|
3376
3543
|
private driftIndex;
|
|
@@ -3384,10 +3551,7 @@ export declare class WebGPURenderer implements RendererApi {
|
|
|
3384
3551
|
/** The frame's exact lights packed for the traced bake. See `gi/bounceLights.ts`. */
|
|
3385
3552
|
private readonly bounceLights;
|
|
3386
3553
|
private readonly bakeLamps;
|
|
3387
|
-
|
|
3388
|
-
private cookieTexture;
|
|
3389
|
-
private cookieView;
|
|
3390
|
-
/** Tiles in the cookie atlas. 0 is the white placeholder and the whole off path. */
|
|
3554
|
+
/** Cookie tiles in the atlas. 0 is none, and the whole off path. */
|
|
3391
3555
|
private cookieTiles;
|
|
3392
3556
|
/** Rows in that atlas. One until a consumer loads a profile, which is the row of ones. */
|
|
3393
3557
|
private iesRows;
|
|
@@ -3537,11 +3701,30 @@ export declare class WebGPURenderer implements RendererApi {
|
|
|
3537
3701
|
* call a tile fills the row without a canvas in between.
|
|
3538
3702
|
*/
|
|
3539
3703
|
setSpotCookies(images: readonly TexImageSource[]): void;
|
|
3704
|
+
/** Let the atlas go, to be built again from what is in hand the next time it is bound. */
|
|
3705
|
+
private forgetFixtureAtlas;
|
|
3706
|
+
/**
|
|
3707
|
+
* The fixture atlas's view, built from the profiles and cookies in hand if it is not already: the
|
|
3708
|
+
* profiles' rows at the bottom, the cookies' tiles on top. See `renderer.ts` and `fixtureAtlas.ts`.
|
|
3709
|
+
*
|
|
3710
|
+
* **`rgba16float`, not `rgba32float`**: a 32-bit float texture is not filterable in core WebGPU,
|
|
3711
|
+
* and binding one to a filtering sampler takes the whole bind group with it. Both tables want
|
|
3712
|
+
* linear filtering. `RENDER_ATTACHMENT` because `copyExternalImageToTexture` writes through one.
|
|
3713
|
+
*/
|
|
3714
|
+
private fixtureAtlasView;
|
|
3540
3715
|
/**
|
|
3541
3716
|
* Sum a scene's many fixed lights into a DriftLight field. The same contract as
|
|
3542
3717
|
* `Renderer.createLightField`; see `driftLight/lightField.ts`.
|
|
3543
3718
|
*/
|
|
3544
3719
|
createLightField(lights: readonly LightFieldSource[], options?: Omit<LightFieldOptions, 'falloff'>): LightField;
|
|
3720
|
+
/**
|
|
3721
|
+
* Hand a world's DriftLight volume to the renderer: every fixed light of a city, summed offline by
|
|
3722
|
+
* `bakeDenseField`, standing in past the frame's exact choice. Replaces any field made before, of
|
|
3723
|
+
* either kind; the scene calls `field.follow(buffer.complete, ...)` each frame as it would for
|
|
3724
|
+
* `createLightField`, and marks the lights the volume summed `inLightField` so none is counted
|
|
3725
|
+
* twice. See `driftLight/worldLightField.ts`.
|
|
3726
|
+
*/
|
|
3727
|
+
createWorldLightField(volume: DenseLightVolume, options?: WorldLightFieldOptions): WorldLightField;
|
|
3545
3728
|
/** Let go of the field and its volumes; the scene's lights are all exact again. */
|
|
3546
3729
|
disposeLightField(): void;
|
|
3547
3730
|
private forgetLightFieldVolumes;
|
|
@@ -3576,7 +3759,31 @@ export declare class WebGPURenderer implements RendererApi {
|
|
|
3576
3759
|
* The occlusion and bloom targets are half size. Both are blurs read back at full size, so a
|
|
3577
3760
|
* full-resolution intermediate buys nothing a bilinear fetch does not already give.
|
|
3578
3761
|
*/
|
|
3762
|
+
/**
|
|
3763
|
+
* The medium's march group, holding the shadow views it reads — built with the composite, and
|
|
3764
|
+
* again when the sun's texture grows its glass layers and every view of the old one is stale.
|
|
3765
|
+
*
|
|
3766
|
+
* **The stand-in has to read as unoccluded and not as absent**, which is `emptyTexture.ts`'s
|
|
3767
|
+
* point and `createLightVolumeBindGroup`'s: `occlusion()` calls any stored depth below the
|
|
3768
|
+
* receiver's a blocker — so a black stand-in would put the whole medium in shadow, which is a
|
|
3769
|
+
* picture rather than an error. `volumeBlank` is the white one-texel texture built for this.
|
|
3770
|
+
*/
|
|
3771
|
+
private buildMediumBindGroup;
|
|
3579
3772
|
private ensureComposite;
|
|
3773
|
+
/**
|
|
3774
|
+
* One group per source the bloom chain reads, in the order `runBloom` indexes them: the picture
|
|
3775
|
+
* first, then every level. The prefilter reads the picture; the downsample into level `i` reads
|
|
3776
|
+
* level `i - 1`, which is group `i`; the upsample into level `i - 1` reads level `i`, which is
|
|
3777
|
+
* group `i + 1`.
|
|
3778
|
+
*
|
|
3779
|
+
* **While reconstructing the picture is the resolved one**, which `ensureReconstruction` makes
|
|
3780
|
+
* after this runs and rebuilds these over. The scene target is the jittered render then: a bright
|
|
3781
|
+
* thing smaller than a render texel is caught in some phases and missed in others, and its halo,
|
|
3782
|
+
* wide and over everything round it, flashed with it — a night street's panels breathing a few
|
|
3783
|
+
* levels of luma frame to frame. Built at the drawing buffer's size, which `ensureComposite`
|
|
3784
|
+
* already sized the pyramid for.
|
|
3785
|
+
*/
|
|
3786
|
+
private rebuildBloomGroups;
|
|
3580
3787
|
/**
|
|
3581
3788
|
* Every bloom stage's uniform block, written once per size rather than once per frame.
|
|
3582
3789
|
*
|