@forgeax/engine-render 0.1.19 → 0.1.20
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/dist/.tsbuildinfo +1 -1
- package/dist/assembly/factory.d.ts +16 -5
- package/dist/assembly/factory.d.ts.map +1 -1
- package/dist/{chunk-RJRUS55L.mjs → chunk-4XINDLAY.mjs} +267 -186
- package/dist/chunk-4XINDLAY.mjs.map +1 -0
- package/dist/{chunk-YTQ5C7YQ.mjs → chunk-CDTWTHZR.mjs} +176 -8
- package/dist/chunk-CDTWTHZR.mjs.map +1 -0
- package/dist/{chunk-IPXCABEP.mjs → chunk-M2MP4ZOU.mjs} +2 -2
- package/dist/chunk-M2MP4ZOU.mjs.map +1 -0
- package/dist/{chunk-LOSO4CTV.mjs → chunk-TBQJOK2L.mjs} +67 -3
- package/dist/chunk-TBQJOK2L.mjs.map +1 -0
- package/dist/components/light-helpers.d.ts.map +1 -1
- package/dist/components/spot-light.d.ts +12 -0
- package/dist/components/spot-light.d.ts.map +1 -1
- package/dist/construct-renderer.mjs +2281 -164
- package/dist/construct-renderer.mjs.map +1 -1
- package/dist/device/gpu-residency.d.ts +19 -2
- package/dist/device/gpu-residency.d.ts.map +1 -1
- package/dist/errors/render.d.ts +69 -1
- package/dist/errors/render.d.ts.map +1 -1
- package/dist/gpu-usage.d.ts +2 -0
- package/dist/gpu-usage.d.ts.map +1 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +3 -3
- package/dist/internal.mjs +1 -1
- package/dist/light-buffer-layout.d.ts +20 -12
- package/dist/light-buffer-layout.d.ts.map +1 -1
- package/dist/pbr-pipeline.d.ts +6 -3
- package/dist/pbr-pipeline.d.ts.map +1 -1
- package/dist/pipeline/standard-forward-lane.d.ts.map +1 -1
- package/dist/pipeline/standard-pipeline.d.ts.map +1 -1
- package/dist/pipeline/standard-profile.d.ts +13 -0
- package/dist/pipeline/standard-profile.d.ts.map +1 -1
- package/dist/record/frame-lighting.d.ts +2 -0
- package/dist/record/frame-lighting.d.ts.map +1 -1
- package/dist/record/frame-snapshot.d.ts +37 -1
- package/dist/record/frame-snapshot.d.ts.map +1 -1
- package/dist/record/frame-targets.d.ts.map +1 -1
- package/dist/record/frame.d.ts +3 -2
- package/dist/record/frame.d.ts.map +1 -1
- package/dist/record/gpu-timing.d.ts +32 -0
- package/dist/record/gpu-timing.d.ts.map +1 -0
- package/dist/record/main-pass-material.d.ts +1 -1
- package/dist/record/main-pass-material.d.ts.map +1 -1
- package/dist/record/render-context.d.ts +5 -1
- package/dist/record/render-context.d.ts.map +1 -1
- package/dist/record/shadow-pass.d.ts.map +1 -1
- package/dist/record/typed-frame-graph.d.ts +11 -3
- package/dist/record/typed-frame-graph.d.ts.map +1 -1
- package/dist/render-contract.d.ts +66 -1
- package/dist/render-contract.d.ts.map +1 -1
- package/dist/render-data.d.ts +10 -6
- package/dist/render-data.d.ts.map +1 -1
- package/dist/render-pipeline.d.ts +36 -0
- package/dist/render-pipeline.d.ts.map +1 -1
- package/dist/render-system-extract.d.ts +55 -3
- package/dist/render-system-extract.d.ts.map +1 -1
- package/dist/render-system.d.ts +7 -1
- package/dist/render-system.d.ts.map +1 -1
- package/dist/renderer-inspect.d.ts +29 -0
- package/dist/renderer-inspect.d.ts.map +1 -0
- package/dist/scene/render-scene.d.ts.map +1 -1
- package/dist/temporal/frame.d.ts +44 -0
- package/dist/temporal/frame.d.ts.map +1 -0
- package/dist/temporal/index.mjs +3 -3
- package/dist/typed-render-graph-primitives.d.ts +6 -1
- package/dist/typed-render-graph-primitives.d.ts.map +1 -1
- package/dist/typed-shadow-atlas.d.ts +10 -0
- package/dist/typed-shadow-atlas.d.ts.map +1 -0
- package/dist/typed-shadow-passes.d.ts.map +1 -1
- package/dist/volume/capability.d.ts +57 -0
- package/dist/volume/capability.d.ts.map +1 -0
- package/dist/volume/component.d.ts +61 -0
- package/dist/volume/component.d.ts.map +1 -0
- package/dist/volume/extract.d.ts +11 -0
- package/dist/volume/extract.d.ts.map +1 -0
- package/dist/volume/inspection.d.ts +38 -0
- package/dist/volume/inspection.d.ts.map +1 -0
- package/dist/volume/passes.d.ts +38 -0
- package/dist/volume/passes.d.ts.map +1 -0
- package/dist/volume/recovery.d.ts +38 -0
- package/dist/volume/recovery.d.ts.map +1 -0
- package/dist/volume/resources.d.ts +57 -0
- package/dist/volume/resources.d.ts.map +1 -0
- package/dist/volume/temporal.d.ts +35 -0
- package/dist/volume/temporal.d.ts.map +1 -0
- package/package.json +20 -20
- package/src/__tests__/ktx2-basis-gpu-consumer.dawn.test.ts +14 -14
- package/src/__tests__/mesh-buffer-usage-surface.unit.test.ts +1 -1
- package/src/__tests__/render-error-code-owner.test-d.ts +5 -0
- package/src/__tests__/renderer-factory-material-contract.unit.test.ts +28 -0
- package/src/__tests__/renderer-frame-transaction.integration.test.ts +1 -1
- package/src/__tests__/skinned-shadow-caster.test.ts +21 -0
- package/src/__tests__/standard-profile-oracle.unit.test.ts +7 -5
- package/src/__tests__/volume-optics-oracle.unit.test.ts +85 -0
- package/src/__tests__/volumetric-fog-budget-recovery.integration.test.ts +655 -0
- package/src/__tests__/volumetric-fog-component.unit.test.ts +71 -0
- package/src/__tests__/volumetric-fog-composite-stage-readback.dawn.test.ts +376 -0
- package/src/__tests__/volumetric-fog-errors.unit.test.ts +51 -0
- package/src/__tests__/volumetric-fog-inspection.unit.test.ts +77 -0
- package/src/__tests__/volumetric-fog-light-capability.unit.test.ts +19 -0
- package/src/__tests__/volumetric-fog-light-consumers.integration.test.ts +18 -0
- package/src/__tests__/volumetric-fog-light-errors.unit.test.ts +17 -0
- package/src/__tests__/volumetric-fog-light-topology.unit.test.ts +21 -0
- package/src/__tests__/volumetric-fog-light-transaction.integration.test.ts +53 -0
- package/src/__tests__/volumetric-fog-m9-watcher.integration.test.ts +27 -0
- package/src/__tests__/volumetric-fog-point-light-owner.integration.test.ts +44 -0
- package/src/__tests__/volumetric-fog-point-spot-accumulation.integration.test.ts +49 -0
- package/src/__tests__/volumetric-fog-point-spot-contract.unit.test.ts +28 -0
- package/src/__tests__/volumetric-fog-point-spot-lkg.integration.test.ts +65 -0
- package/src/__tests__/volumetric-fog-point-spot-selection.integration.test.ts +49 -0
- package/src/__tests__/volumetric-fog-point-spot-temporal.unit.test.ts +55 -0
- package/src/__tests__/volumetric-fog-projector-contract.unit.test.ts +22 -0
- package/src/__tests__/volumetric-fog-projector-inspection.unit.test.ts +12 -0
- package/src/__tests__/volumetric-fog-projector-surface-volume.integration.test.ts +11 -0
- package/src/__tests__/volumetric-fog-projector-transaction.integration.test.ts +26 -0
- package/src/__tests__/volumetric-fog-recovery.integration.test.ts +47 -0
- package/src/__tests__/volumetric-fog-selected-light-resolution.integration.test.ts +63 -0
- package/src/__tests__/volumetric-fog-spot-closure.integration.test.ts +26 -0
- package/src/__tests__/volumetric-fog-spot-contract.test-d.ts +21 -0
- package/src/__tests__/volumetric-fog-spot-contract.unit.test.ts +27 -0
- package/src/__tests__/volumetric-fog-spot-frame-optics.integration.test.ts +14 -0
- package/src/__tests__/volumetric-fog-spot-optics.integration.test.ts +29 -0
- package/src/__tests__/volumetric-fog-stage-readback.dawn.test.ts +550 -0
- package/src/__tests__/volumetric-fog-temporal-selected-light.unit.test.ts +33 -0
- package/src/__tests__/volumetric-fog-temporal.unit.test.ts +45 -0
- package/src/__tests__/volumetric-fog-topology.unit.test.ts +237 -0
- package/src/__tests__/volumetric-fog-transparent.integration.test.ts +27 -0
- package/src/assembly/factory.ts +271 -15
- package/src/components/light-helpers.ts +4 -0
- package/src/components/spot-light.ts +22 -3
- package/src/device/gpu-residency.ts +168 -58
- package/src/errors/render.ts +119 -1
- package/src/gpu-usage.ts +2 -0
- package/src/index.ts +38 -1
- package/src/light-buffer-layout.ts +59 -26
- package/src/pbr-pipeline.ts +33 -10
- package/src/pipeline/standard-forward-lane.ts +20 -0
- package/src/pipeline/standard-pipeline.ts +20 -0
- package/src/pipeline/standard-profile.ts +23 -0
- package/src/record/frame-lighting.ts +103 -89
- package/src/record/frame-snapshot.ts +41 -1
- package/src/record/frame-targets.ts +6 -2
- package/src/record/frame.ts +908 -5
- package/src/record/gpu-timing.ts +224 -0
- package/src/record/main-pass-material.ts +6 -2
- package/src/record/render-context.ts +5 -0
- package/src/record/shadow-pass.ts +87 -38
- package/src/record/typed-frame-graph.ts +143 -8
- package/src/render-contract.ts +72 -0
- package/src/render-data.ts +50 -22
- package/src/render-pipeline.ts +44 -0
- package/src/render-system-extract.ts +329 -3
- package/src/render-system.ts +79 -0
- package/src/renderer-inspect.ts +66 -0
- package/src/scene/render-scene.ts +2 -0
- package/src/temporal/frame.ts +128 -0
- package/src/transmission/__tests__/standard-transmission.dawn.test.ts +2 -3
- package/src/typed-render-graph-primitives.ts +32 -2
- package/src/typed-shadow-atlas.ts +17 -0
- package/src/typed-shadow-passes.ts +6 -5
- package/src/volume/capability.ts +173 -0
- package/src/volume/component.ts +110 -0
- package/src/volume/extract.ts +21 -0
- package/src/volume/inspection.ts +78 -0
- package/src/volume/passes.ts +680 -0
- package/src/volume/recovery.ts +86 -0
- package/src/volume/resources.ts +236 -0
- package/src/volume/temporal.ts +89 -0
- package/dist/chunk-IPXCABEP.mjs.map +0 -1
- package/dist/chunk-LOSO4CTV.mjs.map +0 -1
- package/dist/chunk-RJRUS55L.mjs.map +0 -1
- package/dist/chunk-YTQ5C7YQ.mjs.map +0 -1
|
@@ -63,7 +63,7 @@ import type { MaterialRenderState, RenderPipelineAsset } from '@forgeax/engine-t
|
|
|
63
63
|
import type { MeshGpuHandles } from '../device/gpu-residency';
|
|
64
64
|
import type { SkylightBindGroupResources } from '../ibl/skylight-bind-group';
|
|
65
65
|
import type { InstanceBufferCacheEntry } from '../instance-buffer-cache';
|
|
66
|
-
import type { CameraSnapshot } from '../render-contract';
|
|
66
|
+
import type { CameraSnapshot, VolumetricFogFrameContext } from '../render-contract';
|
|
67
67
|
import type { RenderPipeline as RenderPipelineDef, RenderPipelineFrame } from '../render-pipeline';
|
|
68
68
|
import type {
|
|
69
69
|
DispatchEntry,
|
|
@@ -73,6 +73,13 @@ import type {
|
|
|
73
73
|
SpotLightSnapshot,
|
|
74
74
|
} from '../render-system-extract';
|
|
75
75
|
import type { ShadowAtlas } from '../shadow-atlas';
|
|
76
|
+
import type {
|
|
77
|
+
TemporalFrame,
|
|
78
|
+
TemporalFrameInput,
|
|
79
|
+
TemporalFrameTransaction,
|
|
80
|
+
} from '../temporal/frame';
|
|
81
|
+
import type { VolumetricFogInspection } from '../volume/inspection';
|
|
82
|
+
import type { VolumeTemporalSignature } from '../volume/temporal';
|
|
76
83
|
|
|
77
84
|
/**
|
|
78
85
|
* feat-20260608-create-app-param-surface-trim / M1 / D-8 (q8 user lock):
|
|
@@ -255,6 +262,12 @@ export interface RenderFrameState {
|
|
|
255
262
|
graphGeneration: number;
|
|
256
263
|
/** Number of successfully submitted TAA frames; failed attempts do not advance it. */
|
|
257
264
|
successfulTemporalFrameIndex?: number;
|
|
265
|
+
/** The renderer-owned accepted-submit temporal fact consumed by consumers. */
|
|
266
|
+
temporalFrame?: TemporalFrame;
|
|
267
|
+
/** The sole transaction that advances temporal history after queue.submit. */
|
|
268
|
+
readonly temporalFrameTransaction: TemporalFrameTransaction;
|
|
269
|
+
/** Staged input is consumed only by the graph submit owner. */
|
|
270
|
+
temporalFrameInput: TemporalFrameInput | undefined;
|
|
258
271
|
/** Optional graph resource lookup used by low-level record helpers and tests. */
|
|
259
272
|
perFrameGraph?: {
|
|
260
273
|
readonly getColorTargetDescriptor: (key: string) => ResolvedColorTargetDescriptor | undefined;
|
|
@@ -274,6 +287,33 @@ export interface RenderFrameState {
|
|
|
274
287
|
/** The sole compiled owner for compute, copy, feature, and raster work. */
|
|
275
288
|
compiledFrameGraph: CompiledRenderGraph<RenderPipelineFrame> | null;
|
|
276
289
|
compiledFrameGraphTopologyKey: string | null;
|
|
290
|
+
/**
|
|
291
|
+
* Last-known-good graph held while a volume topology candidate is tested.
|
|
292
|
+
* The candidate is promoted only after its command buffer is submitted;
|
|
293
|
+
* failed encoding/finish/submit restores this graph and its topology key.
|
|
294
|
+
*/
|
|
295
|
+
volumetricFogPreviousGraph: CompiledRenderGraph<RenderPipelineFrame> | null;
|
|
296
|
+
volumetricFogPreviousGraphKey: string | null;
|
|
297
|
+
volumetricFogCandidateGraph: CompiledRenderGraph<RenderPipelineFrame> | null;
|
|
298
|
+
/** Two renderer-owned parameter slots; only the pending slot is writable. */
|
|
299
|
+
volumetricFogParamsBuffers: [Buffer | null, Buffer | null];
|
|
300
|
+
/** Candidate parameter slot, promoted only after queue submission succeeds. */
|
|
301
|
+
volumetricFogParamsPendingSlot: 0 | 1 | null;
|
|
302
|
+
/** Parameter slot consumed by the last accepted volume frame. */
|
|
303
|
+
volumetricFogParamsAcceptedSlot: 0 | 1 | null;
|
|
304
|
+
/** CPU copy of the accepted parameter payload for degraded-frame staging. */
|
|
305
|
+
volumetricFogAcceptedParams: Float32Array | undefined;
|
|
306
|
+
/** CPU copy of the current candidate payload before submit. */
|
|
307
|
+
volumetricFogPendingParams: Float32Array | undefined;
|
|
308
|
+
/** Last candidate/accepted volume projection exposed through inspect(). */
|
|
309
|
+
volumetricFogInspection: VolumetricFogInspection;
|
|
310
|
+
/** Accepted volume POD/context retained while a later candidate degrades. */
|
|
311
|
+
volumetricFogAccepted: import('../render-system-extract').ExtractedVolumetricFog | undefined;
|
|
312
|
+
volumetricFogAcceptedContext: VolumetricFogFrameContext | undefined;
|
|
313
|
+
/** Accepted graph identity and ping-pong slot for temporal volume history. */
|
|
314
|
+
volumetricFogHistoryGraph: CompiledRenderGraph<RenderPipelineFrame> | null;
|
|
315
|
+
volumetricFogHistorySlot: 0 | 1 | null;
|
|
316
|
+
volumetricFogHistorySignature: VolumeTemporalSignature | null;
|
|
277
317
|
readonly retiredCompiledFrameGraphs: Set<CompiledRenderGraph<RenderPipelineFrame>>;
|
|
278
318
|
/** Physical outputs projected by typed graph passes for downstream observers. */
|
|
279
319
|
currentFrameObservationSource: FrameObservationSource | undefined;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { RhiCanvasContext, Texture, TextureView } from '@forgeax/engine-rhi';
|
|
2
2
|
import type { RenderGraphExecutionPhase } from '../render-contract';
|
|
3
3
|
import type { ExtractedLights } from '../render-system-extract';
|
|
4
|
+
import { resolveDirectionalShadowAtlasGrid } from '../typed-shadow-atlas';
|
|
4
5
|
import { configureSurface, type PipelineState, type RenderSystemInternals } from './render-context';
|
|
5
6
|
|
|
6
7
|
export function graphExecutionPhase(passName: string): RenderGraphExecutionPhase {
|
|
@@ -114,14 +115,17 @@ export function resolveShadowMapSize(
|
|
|
114
115
|
const requested = lights.shadowMapSize;
|
|
115
116
|
if (!(requested !== undefined && requested > 0)) return requested;
|
|
116
117
|
const cascades = Math.max(1, Math.min(4, Math.round(lights.cascadeCount ?? 1)));
|
|
117
|
-
const
|
|
118
|
+
const atlasGrid = resolveDirectionalShadowAtlasGrid(cascades);
|
|
118
119
|
const maxDimension = internals.device.limits.maxTextureDimension2D;
|
|
119
120
|
if (!(maxDimension > 0)) return Math.floor(requested);
|
|
120
121
|
const depthTextureDimension =
|
|
121
122
|
internals.device.caps?.backendKind === 'wgpu-webgl2'
|
|
122
123
|
? Math.max(1, Math.floor(maxDimension / 2))
|
|
123
124
|
: maxDimension;
|
|
124
|
-
const maxPerTile = Math.max(
|
|
125
|
+
const maxPerTile = Math.max(
|
|
126
|
+
1,
|
|
127
|
+
Math.floor(depthTextureDimension / Math.max(atlasGrid.columns, atlasGrid.rows)),
|
|
128
|
+
);
|
|
125
129
|
return Math.max(1, Math.min(Math.floor(requested), maxPerTile));
|
|
126
130
|
}
|
|
127
131
|
|