@naanouff/w3dts-path-tracer 0.0.0-stage → 0.1.18
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/README.md +44 -3
- package/dist/PathTracer2Project.d.ts +17 -0
- package/dist/PathTracer2Project.d.ts.map +1 -0
- package/dist/PathTracerFrameUploadController.d.ts +186 -0
- package/dist/PathTracerFrameUploadController.d.ts.map +1 -0
- package/dist/PathTracerProject.d.ts +19 -0
- package/dist/PathTracerProject.d.ts.map +1 -0
- package/dist/SceneToRayData.d.ts +72 -0
- package/dist/SceneToRayData.d.ts.map +1 -0
- package/dist/bloomSubgraph.d.ts +14 -0
- package/dist/bloomSubgraph.d.ts.map +1 -0
- package/dist/buildPathTracerBvh.d.ts +34 -0
- package/dist/buildPathTracerBvh.d.ts.map +1 -0
- package/dist/buildPathTracerTwoLevel.d.ts +66 -0
- package/dist/buildPathTracerTwoLevel.d.ts.map +1 -0
- package/dist/emissiveTriangles.d.ts +28 -0
- package/dist/emissiveTriangles.d.ts.map +1 -0
- package/dist/fsr1EasuConstants.d.ts +7 -0
- package/dist/fsr1EasuConstants.d.ts.map +1 -0
- package/dist/hybridAtrous.d.ts +25 -0
- package/dist/hybridAtrous.d.ts.map +1 -0
- package/dist/hybridOidn.d.ts +15 -0
- package/dist/hybridOidn.d.ts.map +1 -0
- package/dist/hybridTemporal.d.ts +59 -0
- package/dist/hybridTemporal.d.ts.map +1 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/khronosPathTraceReference.d.ts +143 -0
- package/dist/khronosPathTraceReference.d.ts.map +1 -0
- package/dist/pathTracerBackplate.d.ts +29 -0
- package/dist/pathTracerBackplate.d.ts.map +1 -0
- package/dist/pathTracerBaselineMetrics.d.ts +98 -0
- package/dist/pathTracerBaselineMetrics.d.ts.map +1 -0
- package/dist/pathTracerBounceBudget.d.ts +32 -0
- package/dist/pathTracerBounceBudget.d.ts.map +1 -0
- package/dist/pathTracerCameraLens.d.ts +12 -0
- package/dist/pathTracerCameraLens.d.ts.map +1 -0
- package/dist/pathTracerConstants.d.ts +165 -0
- package/dist/pathTracerConstants.d.ts.map +1 -0
- package/dist/pathTracerDielectric.d.ts +30 -0
- package/dist/pathTracerDielectric.d.ts.map +1 -0
- package/dist/pathTracerEnvMap.d.ts +83 -0
- package/dist/pathTracerEnvMap.d.ts.map +1 -0
- package/dist/pathTracerGraphDefinition.d.ts +11 -0
- package/dist/pathTracerGraphDefinition.d.ts.map +1 -0
- package/dist/pathTracerInteractionEpoch.d.ts +11 -0
- package/dist/pathTracerInteractionEpoch.d.ts.map +1 -0
- package/dist/pathTracerInterleave.d.ts +74 -0
- package/dist/pathTracerInterleave.d.ts.map +1 -0
- package/dist/pathTracerLightFingerprint.d.ts +26 -0
- package/dist/pathTracerLightFingerprint.d.ts.map +1 -0
- package/dist/pathTracerMaterialTable.d.ts +63 -0
- package/dist/pathTracerMaterialTable.d.ts.map +1 -0
- package/dist/pathTracerMaterialTextureArrays.d.ts +58 -0
- package/dist/pathTracerMaterialTextureArrays.d.ts.map +1 -0
- package/dist/pathTracerOidnDenoiser.d.ts +43 -0
- package/dist/pathTracerOidnDenoiser.d.ts.map +1 -0
- package/dist/pathTracerPost.d.ts +137 -0
- package/dist/pathTracerPost.d.ts.map +1 -0
- package/dist/pathTracerRuntimeConfig.d.ts +6 -0
- package/dist/pathTracerRuntimeConfig.d.ts.map +1 -0
- package/dist/pathTracerSceneCache.d.ts +32 -0
- package/dist/pathTracerSceneCache.d.ts.map +1 -0
- package/dist/pathTracerSceneSettings.d.ts +43 -0
- package/dist/pathTracerSceneSettings.d.ts.map +1 -0
- package/dist/progressiveRenderState.d.ts +34 -0
- package/dist/progressiveRenderState.d.ts.map +1 -0
- package/dist/w3dts-path-tracer.es.js +4555 -0
- package/dist/w3dts-path-tracer.umd.js +46 -0
- package/package.json +55 -3
- package/shaders/clear_composite.compute.wgsl +20 -0
- package/shaders/clear_composite_layers.compute.wgsl +32 -0
- package/shaders/clear_path_trace_tile.compute.wgsl +30 -0
- package/shaders/copy_accum.compute.wgsl +15 -0
- package/shaders/denoise.compute.wgsl +88 -0
- package/shaders/denoise_atrous.compute.wgsl +104 -0
- package/shaders/display_grade.wgsl +74 -0
- package/shaders/fsr1_easu_path.compute.wgsl +240 -0
- package/shaders/fsr1_rcas_path.compute.wgsl +84 -0
- package/shaders/hole_fill.compute.wgsl +57 -0
- package/shaders/hybrid_atrous.compute.wgsl +239 -0
- package/shaders/hybrid_copy_aov.compute.wgsl +24 -0
- package/shaders/hybrid_gbuffer.wgsl +150 -0
- package/shaders/hybrid_history_copy.compute.wgsl +35 -0
- package/shaders/hybrid_primary_aov.compute.wgsl +784 -0
- package/shaders/hybrid_taa.compute.wgsl +131 -0
- package/shaders/hybrid_temporal.compute.wgsl +507 -0
- package/shaders/path_trace.compute.wgsl +923 -0
- package/shaders/path_trace_common.wgsl +1738 -0
- package/shaders/pt_bloom.compute.wgsl +91 -0
- package/shaders/pt_bloom_down.compute.wgsl +88 -0
- package/shaders/pt_bloom_up.compute.wgsl +76 -0
- package/shaders/pt_display.frag.wgsl +29 -0
- package/shaders/tile_composite.compute.wgsl +22 -0
- package/shaders/tile_composite_layers.compute.wgsl +86 -0
package/README.md
CHANGED
|
@@ -1,3 +1,44 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
# @naanouff/w3dts-path-tracer
|
|
2
|
+
|
|
3
|
+
WebGPU path tracing passes and denoising, consumed by the hybrid renderer and viewer.
|
|
4
|
+
|
|
5
|
+
## Related docs
|
|
6
|
+
|
|
7
|
+
- [PATH_TRACER_PROGRESSIVE_PLAN.md](../../documentation/domains/renderer-hybride/PATH_TRACER_PROGRESSIVE_PLAN.md) — progressive render sprint (branch `feature/path-tracer-progressive`)
|
|
8
|
+
- [LIGHTMAPPER_EVALUATION.md](../../documentation/domains/rendering/LIGHTMAPPER_EVALUATION.md) — évaluation bake lightmaps / probes sur ce path tracer (pas de sprint)
|
|
9
|
+
- [LIGHT_TRACER_ANALYSIS.md](../../documentation/domains/renderer-hybride/LIGHT_TRACER_ANALYSIS.md)
|
|
10
|
+
- [HYBRID_RASTER_PATHTRACE_PLAN.md](../../documentation/domains/renderer-hybride/HYBRID_RASTER_PATHTRACE_PLAN.md)
|
|
11
|
+
- [readme.md](../../readme.md)
|
|
12
|
+
- [API.md](../../API.md)
|
|
13
|
+
|
|
14
|
+
## Phase 0 baseline metrics
|
|
15
|
+
|
|
16
|
+
`PathTracerFrameUploadController` publishes a live report on `globalThis.__W3DTS_PATH_TRACER_BASELINE__` each tick (camera motion marks the interactive window). In the viewer console:
|
|
17
|
+
|
|
18
|
+
```js
|
|
19
|
+
copy(JSON.stringify(globalThis.__W3DTS_PATH_TRACER_BASELINE__, null, 2))
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Or drive the collector manually:
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
import {
|
|
26
|
+
PathTracerBaselineMetricsCollector,
|
|
27
|
+
formatPathTracerBaselineReport,
|
|
28
|
+
} from '@naanouff/w3dts-path-tracer';
|
|
29
|
+
|
|
30
|
+
const bench = new PathTracerBaselineMetricsCollector();
|
|
31
|
+
bench.start(performance.now());
|
|
32
|
+
bench.tick(globalThis.__W3DTS_PATH_TRACER_PROGRESS__, performance.now());
|
|
33
|
+
console.log(formatPathTracerBaselineReport(bench.report()));
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Metrics: `timeToFirstSampleMs`, `timeToFirstFullCoverageMs`, `timeToConvergedMs`, `interactiveMsPerFrame`, `samplesPerSecond`, `timeToSppMs[64|512]`.
|
|
37
|
+
With the current tile-then-maxSamples scheduler, full viewport coverage (≥1 spp everywhere) only occurs once the last tile has started (often near convergence) — that is the Phase 0 baseline gap vs Light Tracer-style interleave.
|
|
38
|
+
|
|
39
|
+
## Scripts
|
|
40
|
+
|
|
41
|
+
| Command | Description |
|
|
42
|
+
|--------|-------------|
|
|
43
|
+
| `pnpm build` | Vite library build → `dist/` |
|
|
44
|
+
| `pnpm check` | `tsc --noEmit` |
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { AbstractProject, ProjectLoadParams, RenderGraph, Engine } from '../../core/src/index.ts';
|
|
2
|
+
/**
|
|
3
|
+
* Path tracing project for custom GLB loading. Scene starts empty; use Import GLB in the toolbar.
|
|
4
|
+
*/
|
|
5
|
+
export declare class PathTracer2Project extends AbstractProject {
|
|
6
|
+
private logger;
|
|
7
|
+
private engine;
|
|
8
|
+
private readonly uploadController;
|
|
9
|
+
private pathTracerLightEntityId;
|
|
10
|
+
setStudioKeyLightEnabled(enabled: boolean): void;
|
|
11
|
+
constructor();
|
|
12
|
+
protected initializeScene(params: ProjectLoadParams): Promise<void>;
|
|
13
|
+
configureRenderGraph(graph: RenderGraph, _engine: Engine, _view: 'scene' | 'game'): Promise<void>;
|
|
14
|
+
update(_deltaTime: number, _totalTime: number): void;
|
|
15
|
+
updateTime(_h: number): void;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=PathTracer2Project.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PathTracer2Project.d.ts","sourceRoot":"","sources":["../src/PathTracer2Project.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,eAAe,EAKf,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,MAAM,EAEZ,MAAM,sBAAsB,CAAC;AAO9B;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,eAAe;IACrD,OAAO,CAAC,MAAM,CAAwB;IACtC,OAAO,CAAC,MAAM,CAA+B;IAC7C,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAyC;IAC1E,OAAO,CAAC,uBAAuB,CAAuB;IAE/C,wBAAwB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;;cAS9B,eAAe,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IA2B5D,oBAAoB,CACxC,KAAK,EAAE,WAAW,EAClB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,OAAO,GAAG,MAAM,GACtB,OAAO,CAAC,IAAI,CAAC;IAWA,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI;IAKpD,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;CAG7C"}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { IEngineContext } from '../../core/src/index.ts';
|
|
2
|
+
import { PathTracerSceneCache } from './pathTracerSceneCache';
|
|
3
|
+
import { ProgressiveRenderPhase } from './progressiveRenderState';
|
|
4
|
+
/**
|
|
5
|
+
* Pixel size of the path-trace tile grid vs canvas. When `decoupleFromViewport` is false (default),
|
|
6
|
+
* uses `resolutionScale` only — same as Engine graph scale for full-viewport PT projects.
|
|
7
|
+
* When true (hybrid), uses `pathTraceResolutionScale` if set, else `resolutionScale`, always relative to full canvas.
|
|
8
|
+
*/
|
|
9
|
+
export declare function computePathTracerTracePixelDimensions(canvasWidth: number, canvasHeight: number, decoupleFromViewport: boolean): {
|
|
10
|
+
w: number;
|
|
11
|
+
h: number;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Ensures the viewer HUD sees a snapshot when `tick` has not run yet or threw before publishing.
|
|
15
|
+
* Only writes when `globalThis.__W3DTS_PATH_TRACER_PROGRESS__` is still undefined (no per-frame flicker).
|
|
16
|
+
*/
|
|
17
|
+
export declare function ensurePathTracerProgressGlobal(engine: IEngineContext): void;
|
|
18
|
+
/** True while the viewer asked the path tracer to keep the current image and stop sampling. */
|
|
19
|
+
export declare function isPathTracerAccumPaused(): boolean;
|
|
20
|
+
/** Freeze or resume accumulation. The displayed image stays until the camera or the scene changes. */
|
|
21
|
+
export declare function setPathTracerAccumPaused(paused: boolean): void;
|
|
22
|
+
/** Published on `globalThis.__W3DTS_PATH_TRACER_PROGRESS__` for UI (viewer). */
|
|
23
|
+
export interface PathTracerProgressSnapshot {
|
|
24
|
+
/** 0–1 aggregate progress over all tiles and samples. */
|
|
25
|
+
progress: number;
|
|
26
|
+
progressPercent: number;
|
|
27
|
+
samplesDone: number;
|
|
28
|
+
samplesTotal: number;
|
|
29
|
+
tileIndex: number;
|
|
30
|
+
totalTiles: number;
|
|
31
|
+
gridCols: number;
|
|
32
|
+
gridRows: number;
|
|
33
|
+
accumFrameIndex: number;
|
|
34
|
+
maxSamples: number;
|
|
35
|
+
converged: boolean;
|
|
36
|
+
traceThisFrame: boolean;
|
|
37
|
+
progressiveStride: number;
|
|
38
|
+
/** Seconds remaining; `null` if unknown; `0` when converged. */
|
|
39
|
+
estimatedSecondsRemaining: number | null;
|
|
40
|
+
sceneWidth: number;
|
|
41
|
+
sceneHeight: number;
|
|
42
|
+
/** Triangles uploaded this trace frame. */
|
|
43
|
+
triangleCount?: number;
|
|
44
|
+
/** Rough scene triangle count (render queue + instances); if demand exceeds {@link triangleCap}, geometry was dropped. */
|
|
45
|
+
sceneTriangleDemand?: number;
|
|
46
|
+
/** Effective cap this frame (`pathTraceTriangleBudget` or build-time max). */
|
|
47
|
+
triangleCap?: number;
|
|
48
|
+
/** BVH node count when built. */
|
|
49
|
+
bvhNodeCount?: number;
|
|
50
|
+
/** EWMA samples/s (tile×sample units) for ETA; 0 if not yet measured. */
|
|
51
|
+
samplesPerSecond?: number;
|
|
52
|
+
/** Effective triangle cap this frame (`__W3DTS_PATH_TRACER_CONFIG.pathTraceTriangleBudget`). */
|
|
53
|
+
pathTraceTriangleBudget?: number;
|
|
54
|
+
/** Target FPS hint from config (`realtimeTargetFps`); 0 = unused. */
|
|
55
|
+
realtimeTargetFps?: number;
|
|
56
|
+
/** Phase 3 interaction state machine. */
|
|
57
|
+
progressivePhase?: ProgressiveRenderPhase;
|
|
58
|
+
/** True while PathTrace runs with PREVIEW_MODE override. */
|
|
59
|
+
previewMode?: boolean;
|
|
60
|
+
/** Full-frame Bayer interleave. The HUD hides the tile counter while this is set. */
|
|
61
|
+
progressiveSpatial?: boolean;
|
|
62
|
+
/** User pause: no new samples, the current image stays on screen. */
|
|
63
|
+
accumPaused?: boolean;
|
|
64
|
+
/** Still Game frames in hybrid. OIDN runs once this reaches `hybridOidnFrames`. */
|
|
65
|
+
hybridStaticFrames?: number;
|
|
66
|
+
/** Causes of the most recent accumulation reset. */
|
|
67
|
+
lastResetReasons?: readonly PathTracerResetReason[];
|
|
68
|
+
/** Resets per cause since the controller was created or reset. */
|
|
69
|
+
resetCounts?: Readonly<Partial<Record<PathTracerResetReason, number>>>;
|
|
70
|
+
}
|
|
71
|
+
/** Why `resetAccum` was raised on a frame. */
|
|
72
|
+
export type PathTracerResetReason = 'resize' | 'environment' | 'envIntensity' | 'emissiveIntensity' | 'background' | 'scene' | 'camera' | 'cameraInit' | 'shadows' | 'features' | 'tile' | 'lights';
|
|
73
|
+
/**
|
|
74
|
+
* Stateful path tracer GPU uploads; call {@link tick} each frame when the path trace graph is active.
|
|
75
|
+
*/
|
|
76
|
+
export type PathTracerTraceMode = 'beauty' | 'hybridAov';
|
|
77
|
+
export declare class PathTracerFrameUploadController {
|
|
78
|
+
/** Phase 0 progressive-plan baseline; published on `__W3DTS_PATH_TRACER_BASELINE__` each tick. */
|
|
79
|
+
private readonly baselineMetrics;
|
|
80
|
+
/** Phase 1a: skip triangle+BVH rebuild when render-queue fingerprint is unchanged. */
|
|
81
|
+
private readonly sceneCache;
|
|
82
|
+
/**
|
|
83
|
+
* Per graph: scene data + destination buffers of the last triangle/BVH/instance upload.
|
|
84
|
+
* These buffers reach tens of MB; re-uploading them every frame stalls the GPU queue.
|
|
85
|
+
*/
|
|
86
|
+
private readonly uploadedScenePerGraph;
|
|
87
|
+
private readonly lastCameraPosition;
|
|
88
|
+
private readonly lastCameraForward;
|
|
89
|
+
private lastCameraLens;
|
|
90
|
+
private hasLastCamera;
|
|
91
|
+
private readonly lastViewProj;
|
|
92
|
+
private hasHybridViewProj;
|
|
93
|
+
private hybridStaticFrames;
|
|
94
|
+
private hybridBeautyW;
|
|
95
|
+
private hybridBeautyH;
|
|
96
|
+
private lastResetReasons;
|
|
97
|
+
private resetCounts;
|
|
98
|
+
private lastTriangleHash;
|
|
99
|
+
private lastLightHash;
|
|
100
|
+
private hasLightHash;
|
|
101
|
+
private lastEmissiveHash;
|
|
102
|
+
private lastShadowsEnabled;
|
|
103
|
+
private frameIndex;
|
|
104
|
+
/** Full-frame samples in spatial mode. Independent of the current stride. */
|
|
105
|
+
private sppCoverage;
|
|
106
|
+
/** Unique seed per traced pass (uploaded as pathTracerParams[2]). */
|
|
107
|
+
private rngFrame;
|
|
108
|
+
private lastEnableGI;
|
|
109
|
+
private lastEnableAO;
|
|
110
|
+
private lastEnableReflection;
|
|
111
|
+
private lastEnableShadow;
|
|
112
|
+
private pathTracerLightEntityId;
|
|
113
|
+
/** Phase within progressiveFrameStride; trace when phase === 0. */
|
|
114
|
+
private progressivePhase;
|
|
115
|
+
/** When true, trace resolution uses pathTraceResolutionScale (or resolutionScale) vs full canvas; Engine may stay full res (hybrid). */
|
|
116
|
+
private decoupleTraceResolution;
|
|
117
|
+
/** Beauty path trace, or hybrid AOVs (full frame, no Bayer, no FSR). */
|
|
118
|
+
private traceMode;
|
|
119
|
+
/** Bucket index for legacy tile rendering; unused when Phase 2 progressiveSpatial is on. */
|
|
120
|
+
private tileIndex;
|
|
121
|
+
private lastSceneW;
|
|
122
|
+
private lastSceneH;
|
|
123
|
+
/** Phase 2: Bayer phase within stride² and spatial budget controller. */
|
|
124
|
+
private interleavePhase;
|
|
125
|
+
private readonly spatialBudget;
|
|
126
|
+
private lastFrameWallMs;
|
|
127
|
+
/** Phase 3: Interactive → Refining → Converged (+ Denoised later). */
|
|
128
|
+
private readonly progressiveState;
|
|
129
|
+
/**
|
|
130
|
+
* When true, TileComposite skips beauty writes (keep last frame).
|
|
131
|
+
* Not used for live camera orbit — that clears the composite instead so the Game view tracks the lens.
|
|
132
|
+
*/
|
|
133
|
+
private holdDisplayUntilRound;
|
|
134
|
+
private holdRoundStartPhase;
|
|
135
|
+
/** EWMA of "samples" per second for ETA (tile×sample units). */
|
|
136
|
+
private ewmaSamplesPerSec;
|
|
137
|
+
private lastEwmaSampleDone;
|
|
138
|
+
private lastEwmaWallMs;
|
|
139
|
+
/**
|
|
140
|
+
* Last {@link Renderer.getEnvironmentCubemap} used for path miss / IBL when `useEnvCubemap` is on.
|
|
141
|
+
* When HDR / IBL cubemap is swapped, reference changes → reset accumulation (Path Tracer Studio, etc.).
|
|
142
|
+
*/
|
|
143
|
+
private lastEnvironmentCubemap;
|
|
144
|
+
/** Last synced IBL scale; changing it must reset progressive accumulation or the image looks unchanged. */
|
|
145
|
+
private lastEnvIblIntensity;
|
|
146
|
+
/** Last synced emissive radiance and bounce scales. */
|
|
147
|
+
private lastEmissiveIntensity;
|
|
148
|
+
private lastEmissiveBounceScale;
|
|
149
|
+
/** Last transparent-background flag; toggling resets accumulation. */
|
|
150
|
+
private lastTransparentBackground;
|
|
151
|
+
/** Last unlit-mode override (`false` = Khronos unlit, `true` = diffuse relight). */
|
|
152
|
+
private lastUnlitAsDiffuse;
|
|
153
|
+
/** Last uploaded triangle stats (kept on stride-off frames so HUD does not flicker to 0). */
|
|
154
|
+
private lastTriangleStats;
|
|
155
|
+
private readonly matFactorsPad;
|
|
156
|
+
private readonly materialTextureArrays;
|
|
157
|
+
private readonly tileInfoScratch;
|
|
158
|
+
private readonly denoiserParamsScratch;
|
|
159
|
+
private readonly paramsScratch;
|
|
160
|
+
private readonly envEmptyHeader;
|
|
161
|
+
private readonly envWrittenSerial;
|
|
162
|
+
private readonly postParamsScratch;
|
|
163
|
+
private readonly fsrParamsScratch;
|
|
164
|
+
private readonly fsrParamsDataView;
|
|
165
|
+
private readonly fsrEasuFloats;
|
|
166
|
+
constructor();
|
|
167
|
+
/** Directional light entity used for sun color / intensity / shadow flag in the compute shader. */
|
|
168
|
+
setPreferredLightEntity(entityId: number | null): void;
|
|
169
|
+
/**
|
|
170
|
+
* Hybrid Lit + PT: raster at full viewport; path trace uses {@link computePathTracerTracePixelDimensions} with
|
|
171
|
+
* `pathTraceResolutionScale` when set.
|
|
172
|
+
*/
|
|
173
|
+
setDecoupleTraceResolution(value: boolean): void;
|
|
174
|
+
/**
|
|
175
|
+
* `hybridAov` traces the full frame for the raster AOVs: stride 1, no PathTrace / FSR / bloom.
|
|
176
|
+
* Switching mode clears the accumulation so the toolbar spp matches the new buffers.
|
|
177
|
+
*/
|
|
178
|
+
setTraceMode(mode: PathTracerTraceMode): void;
|
|
179
|
+
/** Phase 1a cache stats (rebuild vs hit) for debugging / baseline. */
|
|
180
|
+
getSceneCacheStats(): ReturnType<PathTracerSceneCache['getStats']>;
|
|
181
|
+
resetAccumulationState(): void;
|
|
182
|
+
tick(engine: IEngineContext): void;
|
|
183
|
+
/** Grade + glare. The heavy gather is dispatched only in Converged / Denoised. */
|
|
184
|
+
private uploadDisplayPost;
|
|
185
|
+
}
|
|
186
|
+
//# sourceMappingURL=PathTracerFrameUploadController.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PathTracerFrameUploadController.d.ts","sourceRoot":"","sources":["../src/PathTracerFrameUploadController.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAML,KAAK,cAAc,EACpB,MAAM,sBAAsB,CAAC;AA2C9B,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAsB9D,OAAO,EAGL,KAAK,sBAAsB,EAC5B,MAAM,0BAA0B,CAAC;AA8PlC;;;;GAIG;AACH,wBAAgB,qCAAqC,CACnD,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EACpB,oBAAoB,EAAE,OAAO,GAC5B;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAuC1B;AAoGD;;;GAGG;AACH,wBAAgB,8BAA8B,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI,CA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S;IAC1C,oFAAoF;IACpF,OAAO,CAAC,kBAAkB,CAAS;IAEnC,6FAA6F;IAC7F,OAAO,CAAC,iBAAiB,CAIvB;IAEF,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAmD;IACjF,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAyC;IAC/E,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAuB;IACvD,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAsB;IAC5D,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAmD;IACjF,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAuB;IACtD,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAiC;IAClE,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAoD;IACtF,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAc;IAC/C,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAW;IAC7C,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAe;;IAQ7C,mGAAmG;IACnG,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAItD;;;OAGG;IACH,0BAA0B,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI;IAIhD;;;OAGG;IACH,YAAY,CAAC,IAAI,EAAE,mBAAmB,GAAG,IAAI;IAM7C,sEAAsE;IACtE,kBAAkB,IAAI,UAAU,CAAC,oBAAoB,CAAC,UAAU,CAAC,CAAC;IAIlE,sBAAsB,IAAI,IAAI;IAoC9B,IAAI,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI;IAu2BlC,kFAAkF;IAClF,OAAO,CAAC,iBAAiB;CAkD1B"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { AbstractProject, ProjectLoadParams, RenderGraph, Engine } from '../../core/src/index.ts';
|
|
2
|
+
/**
|
|
3
|
+
* Project that configures the path tracer graph and uploads scene triangles each frame.
|
|
4
|
+
* Resets accumulation when the camera moves, materials change, or shadows toggle.
|
|
5
|
+
*/
|
|
6
|
+
export declare class PathTracerProject extends AbstractProject {
|
|
7
|
+
private logger;
|
|
8
|
+
private engine;
|
|
9
|
+
private readonly uploadController;
|
|
10
|
+
/** Entity id of the directional light created for the path tracer scene; used so inspector edits apply. */
|
|
11
|
+
private pathTracerLightEntityId;
|
|
12
|
+
setStudioKeyLightEnabled(enabled: boolean): void;
|
|
13
|
+
constructor();
|
|
14
|
+
protected initializeScene(params: ProjectLoadParams): Promise<void>;
|
|
15
|
+
configureRenderGraph(graph: RenderGraph, _engine: Engine, _view: 'scene' | 'game'): Promise<void>;
|
|
16
|
+
update(_deltaTime: number, _totalTime: number): void;
|
|
17
|
+
updateTime(_h: number): void;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=PathTracerProject.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PathTracerProject.d.ts","sourceRoot":"","sources":["../src/PathTracerProject.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,eAAe,EAQf,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,MAAM,EAGZ,MAAM,sBAAsB,CAAC;AAO9B;;;GAGG;AACH,qBAAa,iBAAkB,SAAQ,eAAe;IACpD,OAAO,CAAC,MAAM,CAAwB;IACtC,OAAO,CAAC,MAAM,CAA+B;IAC7C,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAyC;IAC1E,2GAA2G;IAC3G,OAAO,CAAC,uBAAuB,CAAuB;IAE/C,wBAAwB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;;cAS9B,eAAe,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IA8H5D,oBAAoB,CACxC,KAAK,EAAE,WAAW,EAClB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,OAAO,GAAG,MAAM,GACtB,OAAO,CAAC,IAAI,CAAC;IAWA,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI;IAKpD,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;CAG7C"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { RenderCommand, InstanceBatch } from '../../core/src/index.ts';
|
|
2
|
+
import { PathTracerBvhResult } from './buildPathTracerBvh';
|
|
3
|
+
export interface PathTracerTextureSlot {
|
|
4
|
+
albedo?: GPUTexture;
|
|
5
|
+
orm?: GPUTexture;
|
|
6
|
+
normal?: GPUTexture;
|
|
7
|
+
emissive?: GPUTexture;
|
|
8
|
+
}
|
|
9
|
+
export interface SceneTriangleData {
|
|
10
|
+
/** Pooled buffer; only the first {@link triangleDataBytes} bytes are valid (upload + hash). */
|
|
11
|
+
data: ArrayBuffer;
|
|
12
|
+
/** Byte length of valid triangle data in {@link data}. */
|
|
13
|
+
triangleDataBytes: number;
|
|
14
|
+
triangleCount: number;
|
|
15
|
+
/** Rough triangle count in scene (draw order); compare to {@link triangleCount} to detect GPU cap truncation. */
|
|
16
|
+
sceneTriangleDemand: number;
|
|
17
|
+
/** Length {@link PATH_TRACER_MAX_TEXTURE_SLOTS}: bit0 albedo, bit1 ORM, bit2 normal, bit3 emissive. */
|
|
18
|
+
textureSlotFlags: Uint32Array;
|
|
19
|
+
/** Length {@link PATH_TRACER_MAX_TEXTURE_SLOTS}; only entries with non-zero flags are used. */
|
|
20
|
+
textureSlots: PathTracerTextureSlot[];
|
|
21
|
+
/** glTF `normalTexture.scale` per bound slot (default 1). */
|
|
22
|
+
matNormalScales: Float32Array;
|
|
23
|
+
/** Per-material records ({@link PATH_TRACER_MATERIAL_FLOATS} floats); triangles store the index. */
|
|
24
|
+
materialTable: Float32Array;
|
|
25
|
+
/** Used records in {@link materialTable} (index 0 = default material). */
|
|
26
|
+
materialCount: number;
|
|
27
|
+
/** At least one material transmits (tinted shadow rays). */
|
|
28
|
+
hasTransmission: boolean;
|
|
29
|
+
/** Number of texture slots assigned this frame (0..{@link PATH_TRACER_MAX_TEXTURE_SLOTS}). */
|
|
30
|
+
texturedMaterialSlotsUsed: number;
|
|
31
|
+
/** CPU BVH over `data`, or null if not built. Flat world BVH, or Phase 1b TLAS+BLAS pack. */
|
|
32
|
+
bvh: PathTracerBvhResult | null;
|
|
33
|
+
/** Phase 1b: packed `PathTracerInstance` records (144 B each), or null if flat BVH. */
|
|
34
|
+
instances: ArrayBuffer | null;
|
|
35
|
+
/** Phase 1b: number of instances in {@link instances}. */
|
|
36
|
+
instanceCount: number;
|
|
37
|
+
/** True when {@link bvh} is a TLAS root over instances (object-space triangles). */
|
|
38
|
+
useTwoLevel: boolean;
|
|
39
|
+
/** Packed emissive header + CDF entries. At least 32 bytes. */
|
|
40
|
+
emissiveCatalog: ArrayBuffer;
|
|
41
|
+
emissiveCount: number;
|
|
42
|
+
emissiveTotalPower: number;
|
|
43
|
+
}
|
|
44
|
+
type MaterialLike = {
|
|
45
|
+
id?: number;
|
|
46
|
+
shadingModel?: string;
|
|
47
|
+
diffuseColor?: ArrayLike<number>;
|
|
48
|
+
diffuseTexture?: GPUTexture;
|
|
49
|
+
metallic?: number;
|
|
50
|
+
roughness?: number;
|
|
51
|
+
/** Present on graph materials. The raster then shades `properties.baseColor`. */
|
|
52
|
+
shaderGraph?: unknown;
|
|
53
|
+
properties?: Map<string, unknown>;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* True when the material's shader graph interprets vertex attribute `COLOR_0` (`[16..19]`) as
|
|
57
|
+
* GProc procedural `MeshMaps` (`concavity, convexity, ao, height`) rather than glTF `COLOR_0` tint.
|
|
58
|
+
*/
|
|
59
|
+
export declare function materialUsesMeshMaps(material: MaterialLike | undefined): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Build triangle list from instance batches (opaque) and the render queue (transparent / BLEND).
|
|
62
|
+
* Phase 1b: object-space triangles + shared mesh BLAS + world TLAS when possible; falls back to
|
|
63
|
+
* a flat world-space BVH if the two-level pack fails.
|
|
64
|
+
*
|
|
65
|
+
* Opaque batches are processed first so that if {@link maxTriangles} is hit,
|
|
66
|
+
* primary geometry is preserved instead of filling the budget with glass/alpha meshes.
|
|
67
|
+
*/
|
|
68
|
+
export declare function buildSceneTriangles(renderQueue: RenderCommand[], instanceBatches?: InstanceBatch[], maxTriangles?: number): SceneTriangleData;
|
|
69
|
+
/** @internal exported for tests — instance record stride. */
|
|
70
|
+
export declare const __PATH_TRACER_INSTANCE_BYTES_FOR_TEST = 144;
|
|
71
|
+
export {};
|
|
72
|
+
//# sourceMappingURL=SceneToRayData.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SceneToRayData.d.ts","sourceRoot":"","sources":["../src/SceneToRayData.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAKL,KAAK,aAAa,EAClB,KAAK,aAAa,EACnB,MAAM,sBAAsB,CAAC;AAS9B,OAAO,EAAmC,KAAK,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAiFjG,MAAM,WAAW,qBAAqB;IACpC,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,GAAG,CAAC,EAAE,UAAU,CAAC;IACjB,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,QAAQ,CAAC,EAAE,UAAU,CAAC;CACvB;AAED,MAAM,WAAW,iBAAiB;IAChC,+FAA+F;IAC/F,IAAI,EAAE,WAAW,CAAC;IAClB,0DAA0D;IAC1D,iBAAiB,EAAE,MAAM,CAAC;IAC1B,aAAa,EAAE,MAAM,CAAC;IACtB,iHAAiH;IACjH,mBAAmB,EAAE,MAAM,CAAC;IAC5B,uGAAuG;IACvG,gBAAgB,EAAE,WAAW,CAAC;IAC9B,+FAA+F;IAC/F,YAAY,EAAE,qBAAqB,EAAE,CAAC;IACtC,6DAA6D;IAC7D,eAAe,EAAE,YAAY,CAAC;IAC9B,oGAAoG;IACpG,aAAa,EAAE,YAAY,CAAC;IAC5B,0EAA0E;IAC1E,aAAa,EAAE,MAAM,CAAC;IACtB,4DA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omDown1", "BloomDown2", "BloomDown3", "BloomDown4", "BloomUp3", "BloomUp2", "BloomUp1", "BloomUp0", "BloomComposite"];
|
|
3
|
+
type GraphResource = GraphDefinitionFile['resources'][number];
|
|
4
|
+
type GraphPass = GraphDefinitionFile['passes'][number];
|
|
5
|
+
export declare function createBloomSubgraph(options: {
|
|
6
|
+
input: string;
|
|
7
|
+
output: string;
|
|
8
|
+
relativeSizeRef?: 'graph' | 'canvas';
|
|
9
|
+
}): {
|
|
10
|
+
resources: GraphResource[];
|
|
11
|
+
passes: GraphPass[];
|
|
12
|
+
};
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=bloomSubgraph.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bloomSubgraph.d.ts","sourceRoot":"","sources":["../src/bloomSubgraph.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAGhE,eAAO,MAAM,wBAAwB,mJAW3B,CAAC;AAIX,KAAK,aAAa,GAAG,mBAAmB,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAC9D,KAAK,SAAS,GAAG,mBAAmB,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC;AAmEvD,wBAAgB,mBAAmB,CAAC,OAAO,EAAE;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;CACtC,GAAG;IAAE,SAAS,EAAE,aAAa,EAAE,CAAC;IAAC,MAAM,EAAE,SAAS,EAAE,CAAA;CAAE,CA8BtD"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file buildPathTracerBvh.ts
|
|
3
|
+
* @description CPU-side binary BVH over path-tracer triangle soup.
|
|
4
|
+
* Interior nodes: left/right are child node indices.
|
|
5
|
+
* Triangle leaves: left = 0x80000000 | count (1–4), right = first triangle.
|
|
6
|
+
* Triangles are reordered so each leaf is a contiguous range. `permutation[newIndex] = oldIndex`.
|
|
7
|
+
*/
|
|
8
|
+
/** Previous one-triangle leaf marker. No longer written; instance leaves still use 0xfffffffe. */
|
|
9
|
+
export declare const PATH_TRACER_BVH_LEAF_SENTINEL = 4294967295;
|
|
10
|
+
/** High bit set on a triangle leaf. Count is the low bits. Distinct from 0xfffffffe (instance leaf). */
|
|
11
|
+
export declare const PATH_TRACER_BVH_TRI_LEAF_BIT = 2147483648;
|
|
12
|
+
export declare const PATH_TRACER_BVH_MAX_LEAF_TRIS = 4;
|
|
13
|
+
export declare const PATH_TRACER_BVH_BIN_COUNT = 16;
|
|
14
|
+
export declare function pathTracerTriangleLeafWord(count: number): number;
|
|
15
|
+
export declare function isPathTracerTriangleLeaf(left: number): boolean;
|
|
16
|
+
export interface PathTracerBvhResult {
|
|
17
|
+
/** Number of BVH nodes written. */
|
|
18
|
+
nodeCount: number;
|
|
19
|
+
/** Index of the root node (not always 0 — last interior written at top level). */
|
|
20
|
+
rootIndex: number;
|
|
21
|
+
/** 32 bytes per node: bmin(vec3)+left(u32), bmax(vec3)+right(u32). */
|
|
22
|
+
nodes: ArrayBuffer;
|
|
23
|
+
/**
|
|
24
|
+
* Present for triangle BLASes. `permutation[newIndex] = oldIndex`.
|
|
25
|
+
* The triangle float buffer passed to the builder is already in this order.
|
|
26
|
+
*/
|
|
27
|
+
permutation?: Uint32Array;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Build a binned-SAH BVH. Leaves hold 1–4 contiguous triangles.
|
|
31
|
+
* Reorders `triangleFloats` in place. Returns null if triangleCount === 0.
|
|
32
|
+
*/
|
|
33
|
+
export declare function buildPathTracerBvhFromTriangles(triangleFloats: Float32Array, triangleCount: number): PathTracerBvhResult | null;
|
|
34
|
+
//# sourceMappingURL=buildPathTracerBvh.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildPathTracerBvh.d.ts","sourceRoot":"","sources":["../src/buildPathTracerBvh.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,kGAAkG;AAClG,eAAO,MAAM,6BAA6B,aAAa,CAAC;AAExD,wGAAwG;AACxG,eAAO,MAAM,4BAA4B,aAAa,CAAC;AAEvD,eAAO,MAAM,6BAA6B,IAAI,CAAC;AAC/C,eAAO,MAAM,yBAAyB,KAAK,CAAC;AAK5C,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEhE;AAED,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE9D;AAED,MAAM,WAAW,mBAAmB;IAClC,mCAAmC;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,kFAAkF;IAClF,SAAS,EAAE,MAAM,CAAC;IAClB,sEAAsE;IACtE,KAAK,EAAE,WAAW,CAAC;IACnB;;;OAGG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B;AAwDD;;;GAGG;AACH,wBAAgB,+BAA+B,CAC7C,cAAc,EAAE,YAAY,EAC5B,aAAa,EAAE,MAAM,GACpB,mBAAmB,GAAG,IAAI,CAqS5B"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { mat4 } from 'gl-matrix';
|
|
2
|
+
import { PathTracerBvhResult } from './buildPathTracerBvh';
|
|
3
|
+
import { PATH_TRACER_INSTANCE_BYTES, PATH_TRACER_MAX_INSTANCES } from './pathTracerConstants';
|
|
4
|
+
/** TLAS leaf: `left` sentinel; `right` = instance index. */
|
|
5
|
+
export declare const PATH_TRACER_BVH_INSTANCE_LEAF = 4294967294;
|
|
6
|
+
export { PATH_TRACER_INSTANCE_BYTES, PATH_TRACER_MAX_INSTANCES };
|
|
7
|
+
export interface PathTracerMeshBlasEntry {
|
|
8
|
+
/** Object-space triangle floats (triCount × FLOATS_PER_TRIANGLE). */
|
|
9
|
+
triangleFloats: Float32Array;
|
|
10
|
+
triCount: number;
|
|
11
|
+
bvh: PathTracerBvhResult;
|
|
12
|
+
/** Object-space AABB of the mesh (from BLAS root). */
|
|
13
|
+
bmin: Float32Array;
|
|
14
|
+
bmax: Float32Array;
|
|
15
|
+
}
|
|
16
|
+
export interface PathTracerInstanceBuild {
|
|
17
|
+
worldFromObject: mat4;
|
|
18
|
+
objectFromWorld: mat4;
|
|
19
|
+
triBase: number;
|
|
20
|
+
triCount: number;
|
|
21
|
+
blasRootLocal: number;
|
|
22
|
+
blasNodes: ArrayBuffer;
|
|
23
|
+
blasNodeCount: number;
|
|
24
|
+
/** World AABB for TLAS. */
|
|
25
|
+
worldMin: Float32Array;
|
|
26
|
+
worldMax: Float32Array;
|
|
27
|
+
}
|
|
28
|
+
/** Transform an AABB by a mat4 (column-major), expanding to the image of all 8 corners. */
|
|
29
|
+
export declare function transformAabbByMat4(world: mat4 | Float32Array | number[], bmin: ArrayLike<number>, bmax: ArrayLike<number>, outMin: Float32Array, outMax: Float32Array): void;
|
|
30
|
+
/**
|
|
31
|
+
* Remap a BLAS into a destination node buffer at `nodeBase`, offsetting child indices and
|
|
32
|
+
* leaf triangle indices by `triBase`.
|
|
33
|
+
*/
|
|
34
|
+
export declare function packBlasIntoNodes(dest: ArrayBuffer, nodeBase: number, src: PathTracerBvhResult, triBase: number): number;
|
|
35
|
+
/**
|
|
36
|
+
* Build a TLAS over instance world AABBs. Leaves use {@link PATH_TRACER_BVH_INSTANCE_LEAF}.
|
|
37
|
+
* Nodes are written at the start of `nodesBuf` (indices 0..nodeCount-1).
|
|
38
|
+
*/
|
|
39
|
+
export declare function buildPathTracerTlas(instances: Array<{
|
|
40
|
+
worldMin: Float32Array;
|
|
41
|
+
worldMax: Float32Array;
|
|
42
|
+
}>, nodesBuf: ArrayBuffer, maxNodes: number): PathTracerBvhResult | null;
|
|
43
|
+
/** Pack GPU instance records (144 B each). */
|
|
44
|
+
export declare function packPathTracerInstances(instances: Array<{
|
|
45
|
+
worldFromObject: mat4;
|
|
46
|
+
objectFromWorld: mat4;
|
|
47
|
+
triBase: number;
|
|
48
|
+
triCount: number;
|
|
49
|
+
blasRoot: number;
|
|
50
|
+
}>): ArrayBuffer;
|
|
51
|
+
/**
|
|
52
|
+
* Build object-space BLAS for a triangle float slice (already object-space).
|
|
53
|
+
* Returns null if empty.
|
|
54
|
+
*/
|
|
55
|
+
export declare function buildMeshBlasFromObjectTriangles(triangleFloats: Float32Array, triCount: number): PathTracerMeshBlasEntry | null;
|
|
56
|
+
/**
|
|
57
|
+
* Assemble TLAS + packed BLASes into one node buffer.
|
|
58
|
+
* Layout: [TLAS nodes ...][BLAS0 ...][BLAS1 ...]
|
|
59
|
+
* Instance `blasRoot` values are absolute indices into the packed buffer.
|
|
60
|
+
*/
|
|
61
|
+
export declare function assembleTwoLevelBvh(instanceBuilds: PathTracerInstanceBuild[]): {
|
|
62
|
+
bvh: PathTracerBvhResult;
|
|
63
|
+
instancesBuffer: ArrayBuffer;
|
|
64
|
+
instanceCount: number;
|
|
65
|
+
} | null;
|
|
66
|
+
//# sourceMappingURL=buildPathTracerTwoLevel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildPathTracerTwoLevel.d.ts","sourceRoot":"","sources":["../src/buildPathTracerTwoLevel.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAQ,MAAM,WAAW,CAAC;AACvC,OAAO,EAGL,KAAK,mBAAmB,EACzB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAEL,0BAA0B,EAC1B,yBAAyB,EAC1B,MAAM,uBAAuB,CAAC;AAE/B,4DAA4D;AAC5D,eAAO,MAAM,6BAA6B,aAAa,CAAC;AAIxD,OAAO,EAAE,0BAA0B,EAAE,yBAAyB,EAAE,CAAC;AAEjE,MAAM,WAAW,uBAAuB;IACtC,qEAAqE;IACrE,cAAc,EAAE,YAAY,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAA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jB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC,GACD,WAAW,CAgBb;AAED;;;GAGG;AACH,wBAAgB,gCAAgC,CAC9C,cAAc,EAAE,YAAY,EAC5B,QAAQ,EAAE,MAAM,GACf,uBAAuB,GAAG,IAAI,CAehC;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,cAAc,EAAE,uBAAuB,EAAE,GACxC;IACD,GAAG,EAAE,mBAAmB,CAAC;IACzB,eAAe,EAAE,WAAW,CAAC;IAC7B,aAAa,EAAE,MAAM,CAAC;CACvB,GAAG,IAAI,CAkEP"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Emissive triangle catalog for next-event estimation.
|
|
3
|
+
* One entry per triangle whose emissive luminance is above zero.
|
|
4
|
+
* With a TLAS the positions stay in object space and the area is measured in world space.
|
|
5
|
+
*/
|
|
6
|
+
/** Flat BVH: the triangle is already in world space and has no instance. */
|
|
7
|
+
export declare const PATH_TRACER_EMISSIVE_INSTANCE_NONE = 4294967295;
|
|
8
|
+
export interface EmissiveInstanceSpan {
|
|
9
|
+
triBase: number;
|
|
10
|
+
triCount: number;
|
|
11
|
+
/** Column-major world-from-object matrix. */
|
|
12
|
+
worldFromObject: ArrayLike<number>;
|
|
13
|
+
}
|
|
14
|
+
export interface EmissiveCatalog {
|
|
15
|
+
/** Header (16) plus `count` entries (16). At least 32 bytes. */
|
|
16
|
+
bytes: ArrayBuffer;
|
|
17
|
+
count: number;
|
|
18
|
+
totalPower: number;
|
|
19
|
+
}
|
|
20
|
+
/** Area pdf π Y(Le) / Φ. Same for every triangle of a given factor, whatever its area. */
|
|
21
|
+
export declare function emissiveAreaPdf(factorY: number, totalPower: number): number;
|
|
22
|
+
/**
|
|
23
|
+
* Packs the emissive catalog. `instances === null` means a flat world-space triangle buffer.
|
|
24
|
+
*/
|
|
25
|
+
export declare function buildEmissiveCatalog(triangles: Float32Array, triangleCount: number, instances: readonly EmissiveInstanceSpan[] | null): EmissiveCatalog;
|
|
26
|
+
/** Quantized count + total power. A change restarts accumulation. */
|
|
27
|
+
export declare function hashEmissiveCatalog(count: number, totalPower: number): number;
|
|
28
|
+
//# sourceMappingURL=emissiveTriangles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"emissiveTriangles.d.ts","sourceRoot":"","sources":["../src/emissiveTriangles.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,4EAA4E;AAC5E,eAAO,MAAM,kCAAkC,aAAa,CAAC;AAM7D,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,6CAA6C;IAC7C,eAAe,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;CACpC;AAED,MAAM,WAAW,eAAe;IAC9B,gEAAgE;IAChE,KAAK,EAAE,WAAW,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;CACpB;AAMD,0FAA0F;AAC1F,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAG3E;AAiFD;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,YAAY,EACvB,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,SAAS,oBAAoB,EAAE,GAAG,IAAI,GAChD,eAAe,CAmCjB;AAOD,qEAAqE;AACrE,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAM7E"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FSR 1.0 EASU constants (FsrEasuCon) — same formulas as AMD FidelityFX FSR v1.
|
|
3
|
+
* @see https://github.com/GPUOpen-Effects/FidelityFX-FSR
|
|
4
|
+
*/
|
|
5
|
+
/** Packs con0–con3 as 16 floats for WGSL `vec4<f32>` × 4. */
|
|
6
|
+
export declare function computeFsrEasuCon(inputViewportPxX: number, inputViewportPxY: number, inputTexturePxX: number, inputTexturePxY: number, outputPxX: number, outputPxY: number, out?: Float32Array): Float32Array;
|
|
7
|
+
//# sourceMappingURL=fsr1EasuConstants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fsr1EasuConstants.d.ts","sourceRoot":"","sources":["../src/fsr1EasuConstants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,6DAA6D;AAC7D,wBAAgB,iBAAiB,CAC/B,gBAAgB,EAAE,MAAM,EACxB,gBAAgB,EAAE,MAAM,EACxB,eAAe,EAAE,MAAM,EACvB,eAAe,EAAE,MAAM,EACvB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,GAAG,CAAC,EAAE,YAAY,GACjB,YAAY,CAoBd"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CPU mirror of the hybrid SVGF à-trous weights and iteration counts.
|
|
3
|
+
*/
|
|
4
|
+
/** Separable B3-spline tap. `offset` is in -2..2. */
|
|
5
|
+
export declare function hybridAtrousB3(offset: number): number;
|
|
6
|
+
export interface HybridAtrousTap {
|
|
7
|
+
dx: number;
|
|
8
|
+
dy: number;
|
|
9
|
+
depthDelta: number;
|
|
10
|
+
gradDot: number;
|
|
11
|
+
normalDot: number;
|
|
12
|
+
lumaDelta: number;
|
|
13
|
+
variance: number;
|
|
14
|
+
history: number;
|
|
15
|
+
hitDelta?: number;
|
|
16
|
+
hitT?: number;
|
|
17
|
+
}
|
|
18
|
+
/** One unnormalized SVGF weight. σ_l opens from 4 to 8 while history is shorter than 8. */
|
|
19
|
+
export declare function hybridAtrousWeight(tap: HybridAtrousTap): number;
|
|
20
|
+
/** Weights divided by their sum. An empty set stays empty. */
|
|
21
|
+
export declare function hybridAtrousNormalized(taps: readonly HybridAtrousTap[]): number[];
|
|
22
|
+
export type HybridAtrousSignal = 'shadow' | 'reflection' | 'gi' | 'lightVis';
|
|
23
|
+
/** How many à-trous iterations this signal keeps. Later passes copy it unchanged. */
|
|
24
|
+
export declare function hybridAtrousIterations(signal: HybridAtrousSignal, softShadowDeg: number, roughness?: number): number;
|
|
25
|
+
//# sourceMappingURL=hybridAtrous.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hybridAtrous.d.ts","sourceRoot":"","sources":["../src/hybridAtrous.ts"],"names":[],"mappings":"AAAA;;GAEG;AASH,qDAAqD;AACrD,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAGrD;AAED,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAMD,2FAA2F;AAC3F,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,eAAe,GAAG,MAAM,CAa/D;AAED,8DAA8D;AAC9D,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,SAAS,eAAe,EAAE,GAAG,MAAM,EAAE,CAKjF;AAED,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG,YAAY,GAAG,IAAI,GAAG,UAAU,CAAC;AAE7E,qFAAqF;AACrF,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,kBAAkB,EAC1B,aAAa,EAAE,MAAM,EACrB,SAAS,SAAI,GACZ,MAAM,CAMR"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rest-pose OIDN gate for the hybrid view, and the octahedral normal decode
|
|
3
|
+
* that matches `encode_oct` in `hybrid_gbuffer.wgsl`.
|
|
4
|
+
*/
|
|
5
|
+
/** Frames the camera must stay still before the hybrid OIDN runs. */
|
|
6
|
+
export declare const HYBRID_OIDN_FRAMES_DEFAULT = 256;
|
|
7
|
+
/** Inverse of `encode_oct` (octahedral, z sign folded into xy). */
|
|
8
|
+
export declare function decodeHybridOctNormal(ex: number, ey: number): [number, number, number];
|
|
9
|
+
/** Packed octahedral xy in `.xy` → uint8 RGBA (0.5 + 0.5 n) for OIDN. */
|
|
10
|
+
export declare function hybridOctNormalToBytes(data: Float32Array, width: number, height: number): Uint8ClampedArray;
|
|
11
|
+
/** Next still-frame count. A camera move or an accumulation reset starts over at 0. */
|
|
12
|
+
export declare function nextHybridStaticFrames(current: number, viewChanged: boolean, reset: boolean): number;
|
|
13
|
+
/** True when the hybrid view has been still long enough and is not already denoised. */
|
|
14
|
+
export declare function hybridOidnConverged(staticFrames: number, oidnFrames: number | undefined, alreadyDenoised: boolean): boolean;
|
|
15
|
+
//# sourceMappingURL=hybridOidn.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hybridOidn.d.ts","sourceRoot":"","sources":["../src/hybridOidn.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,qEAAqE;AACrE,eAAO,MAAM,0BAA0B,MAAM,CAAC;AAE9C,mEAAmE;AACnE,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAStF;AAED,yEAAyE;AACzE,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,YAAY,EAClB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,GACb,iBAAiB,CAYnB;AAED,uFAAuF;AACvF,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,OAAO,EACpB,KAAK,EAAE,OAAO,GACb,MAAM,CAGR;AAED,wFAAwF;AACxF,wBAAgB,mBAAmB,CACjC,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,eAAe,EAAE,OAAO,GACvB,OAAO,CAOT"}
|