@woosh/meep-engine 3.55.0 → 3.56.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/package.json +1 -1
- package/src/engine/ecs/transform/Transform64.d.ts +21 -0
- package/src/engine/ecs/transform/Transform64.d.ts.map +1 -1
- package/src/engine/ecs/transform/Transform64.js +26 -0
- package/src/shade/renderer/Renderer.d.ts +5 -0
- package/src/shade/renderer/Renderer.d.ts.map +1 -1
- package/src/shade/renderer/Renderer.js +25 -2
- package/src/shade/renderer/particles/GPUParticleSystem.d.ts +2 -1
- package/src/shade/renderer/particles/GPUParticleSystem.d.ts.map +1 -1
- package/src/shade/renderer/particles/GPUParticleSystem.js +1 -1
- package/src/shade/renderer/particles/graph_particles_avboit.d.ts +2 -2
- package/src/shade/renderer/particles/graph_particles_avboit.d.ts.map +1 -1
- package/src/shade/renderer/particles/graph_particles_avboit.js +4 -9
- package/src/shade/renderer/postprocess/nss/NSS.d.ts +1 -1
- package/src/shade/renderer/view/GPUViewContext.d.ts +0 -14
- package/src/shade/renderer/view/GPUViewContext.d.ts.map +1 -1
- package/src/shade/renderer/view/GPUViewContext.js +0 -29
- package/src/shade/renderer/view/ViewManager.d.ts +1 -1
- package/src/shade/renderer/view/ViewManager.js +1 -1
- package/src/shade/renderer/volumetrics/GPUViewVolumetrics.d.ts +40 -3
- package/src/shade/renderer/volumetrics/GPUViewVolumetrics.d.ts.map +1 -1
- package/src/shade/renderer/volumetrics/GPUViewVolumetrics.js +660 -583
- package/src/shade/renderer/wind/GPUSceneWind.d.ts +1 -1
- package/src/shade/renderer/volumetrics/VOLUMETRICS_RESOLUTION_Z.d.ts +0 -2
- package/src/shade/renderer/volumetrics/VOLUMETRICS_RESOLUTION_Z.d.ts.map +0 -1
- package/src/shade/renderer/volumetrics/VOLUMETRICS_RESOLUTION_Z.js +0 -1
package/package.json
CHANGED
|
@@ -80,6 +80,27 @@ export const TRANSFORM64_SIZE: number;
|
|
|
80
80
|
* @copyright Company Named Limited (c) 2026
|
|
81
81
|
*/
|
|
82
82
|
export class Transform64 extends Float64Array {
|
|
83
|
+
/**
|
|
84
|
+
* A transform over memory you own: {@link TRANSFORM64_SIZE} elements of `buffer`, starting at
|
|
85
|
+
* `byte_offset`, in the layout described on the class. Nothing is copied and nothing is written - the
|
|
86
|
+
* transform reads whatever the memory holds, so call {@link makeIdentity} first if it does not hold a
|
|
87
|
+
* transform yet.
|
|
88
|
+
*
|
|
89
|
+
* `new Transform64()` is untouched by this: the instance is built by `Float64Array`'s constructor with
|
|
90
|
+
* this class as `new.target`, so it shares the hidden class of an owning transform and every element
|
|
91
|
+
* access stays monomorphic, while our own constructor - and its identity fill - never runs.
|
|
92
|
+
*
|
|
93
|
+
* A buffer that can change length (a resizable `ArrayBuffer` or a growable `SharedArrayBuffer`) is
|
|
94
|
+
* refused: a view over one gets a different hidden class, and mixing those in would make element access
|
|
95
|
+
* on every transform polymorphic. A fixed-length `SharedArrayBuffer` is fine.
|
|
96
|
+
*
|
|
97
|
+
* NOTE: {@link clone} of a view is an ordinary owning transform, not another view.
|
|
98
|
+
*
|
|
99
|
+
* @param {ArrayBuffer|SharedArrayBuffer} buffer fixed-length
|
|
100
|
+
* @param {number} byte_offset multiple of 8, with {@link TRANSFORM64_SIZE} * 8 bytes available after it
|
|
101
|
+
* @returns {Transform64}
|
|
102
|
+
*/
|
|
103
|
+
static view(buffer: ArrayBuffer | SharedArrayBuffer, byte_offset: number): Transform64;
|
|
83
104
|
/**
|
|
84
105
|
* Build a transform from loose components, with {@link matrix} already composed from them
|
|
85
106
|
* @param {number} translation_x
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Transform64.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/transform/Transform64.js"],"names":[],"mappings":"AAUA;;GAEG;AAEH;;;;;;GAMG;AACH,wCAFU,MAAM,CAE2B;AAE3C;;;;;;;GAOG;AACH,6CAFU,MAAM,CAEiC;AAEjD;;;GAGG;AACH,0CAFU,MAAM,CAE8B;AAE9C;;;GAGG;AACH,uCAFU,MAAM,CAE2B;AAE3C;;;GAGG;AACH,+BAFU,MAAM,CAEmB;AASnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH;IAmqBI;;;;;;;;;;;;;OAaG;IACH,2BAZW,MAAM,iBACN,MAAM,iBACN,MAAM,cACN,MAAM,cACN,MAAM,cACN,MAAM,cACN,MAAM,WACN,MAAM,WACN,MAAM,WACN,MAAM,GACJ,WAAW,CAgBvB;IAED;;;;OAIG;IACH,sBAHW,MAAM,EAAE,GAAC,YAAY,GAAC,YAAY,GAChC,WAAW,CAQvB;IAED;;;;OAIG;IACH,4BAFa,WAAW,CAQvB;
|
|
1
|
+
{"version":3,"file":"Transform64.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/transform/Transform64.js"],"names":[],"mappings":"AAUA;;GAEG;AAEH;;;;;;GAMG;AACH,wCAFU,MAAM,CAE2B;AAE3C;;;;;;;GAOG;AACH,6CAFU,MAAM,CAEiC;AAEjD;;;GAGG;AACH,0CAFU,MAAM,CAE8B;AAE9C;;;GAGG;AACH,uCAFU,MAAM,CAE2B;AAE3C;;;GAGG;AACH,+BAFU,MAAM,CAEmB;AASnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH;IAmqBI;;;;;;;;;;;;;;;;;;;OAmBG;IACH,oBAJW,WAAW,GAAC,iBAAiB,eAC7B,MAAM,GACJ,WAAW,CAMvB;IAED;;;;;;;;;;;;;OAaG;IACH,2BAZW,MAAM,iBACN,MAAM,iBACN,MAAM,cACN,MAAM,cACN,MAAM,cACN,MAAM,cACN,MAAM,WACN,MAAM,WACN,MAAM,WACN,MAAM,GACJ,WAAW,CAgBvB;IAED;;;;OAIG;IACH,sBAHW,MAAM,EAAE,GAAC,YAAY,GAAC,YAAY,GAChC,WAAW,CAQvB;IAED;;;;OAIG;IACH,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C,IAAI,CAahB;IAED;;;;OAIG;IACH,gBAHW,WAAW,GACT,IAAI,CAIhB;IAED;;;;;;;;;;OAUG;IACH,sBAJW,WAAW,KACX,WAAW,GACT,IAAI,CAahB;IAED;;;;;OAKG;IACH,qBAcC;IAVG,UAAW;IACX,UAAW;IACX,WAAY;IACZ,WAAY;IAShB;;;;;OAKG;IACH,cAFa,OAAO,CAanB;IAED;;;OAGG;IACH,YAFW,WAAW,QAIrB;IAED;;;OAGG;IACH,SAFa,WAAW,CAQvB;IAED;;;;;OAKG;IACH,cAHW,WAAW,GACT,OAAO,CAInB;IAED;;;;;;OAMG;IACH,QAFa,MAAM,CAwBlB;IAED;;;;;;;OAOG;IACH,0BA0BC;IAED;;;OAGG;IACH,UAFa;QAAC,WAAW,EAAC;YAAC,CAAC,EAAC,MAAM,CAAC;YAAA,CAAC,EAAC,MAAM,CAAC;YAAA,CAAC,EAAC,MAAM,CAAA;SAAC,CAAC;QAAC,QAAQ,EAAC;YAAC,CAAC,EAAC,MAAM,CAAC;YAAA,CAAC,EAAC,MAAM,CAAC;YAAA,CAAC,EAAC,MAAM,CAAC;YAAA,CAAC,EAAC,MAAM,CAAA;SAAC,CAAC;QAAC,KAAK,EAAC;YAAC,CAAC,EAAC,MAAM,CAAC;YAAA,CAAC,EAAC,MAAM,CAAC;YAAA,CAAC,EAAC,MAAM,CAAA;SAAC,CAAA;KAAC,CAqB1I;IAqGL;;;;;;;;OAQG;IACH,wBANU,OAAO,CAMkB;CAjBlC;;kBAIS,MAAM;;sBAr1BH,OAAO,+BAA+B,EAAE,OAAO"}
|
|
@@ -777,6 +777,32 @@ export class Transform64 extends Float64Array {
|
|
|
777
777
|
+ `, scale: [${this.scale_x}, ${this.scale_y}, ${this.scale_z}] }`;
|
|
778
778
|
}
|
|
779
779
|
|
|
780
|
+
/**
|
|
781
|
+
* A transform over memory you own: {@link TRANSFORM64_SIZE} elements of `buffer`, starting at
|
|
782
|
+
* `byte_offset`, in the layout described on the class. Nothing is copied and nothing is written - the
|
|
783
|
+
* transform reads whatever the memory holds, so call {@link makeIdentity} first if it does not hold a
|
|
784
|
+
* transform yet.
|
|
785
|
+
*
|
|
786
|
+
* `new Transform64()` is untouched by this: the instance is built by `Float64Array`'s constructor with
|
|
787
|
+
* this class as `new.target`, so it shares the hidden class of an owning transform and every element
|
|
788
|
+
* access stays monomorphic, while our own constructor - and its identity fill - never runs.
|
|
789
|
+
*
|
|
790
|
+
* A buffer that can change length (a resizable `ArrayBuffer` or a growable `SharedArrayBuffer`) is
|
|
791
|
+
* refused: a view over one gets a different hidden class, and mixing those in would make element access
|
|
792
|
+
* on every transform polymorphic. A fixed-length `SharedArrayBuffer` is fine.
|
|
793
|
+
*
|
|
794
|
+
* NOTE: {@link clone} of a view is an ordinary owning transform, not another view.
|
|
795
|
+
*
|
|
796
|
+
* @param {ArrayBuffer|SharedArrayBuffer} buffer fixed-length
|
|
797
|
+
* @param {number} byte_offset multiple of 8, with {@link TRANSFORM64_SIZE} * 8 bytes available after it
|
|
798
|
+
* @returns {Transform64}
|
|
799
|
+
*/
|
|
800
|
+
static view(buffer, byte_offset) {
|
|
801
|
+
assert.notOk(buffer.resizable === true || buffer.growable === true, 'buffer must be fixed-length');
|
|
802
|
+
|
|
803
|
+
return Reflect.construct(Float64Array, [buffer, byte_offset, TRANSFORM64_SIZE], Transform64);
|
|
804
|
+
}
|
|
805
|
+
|
|
780
806
|
/**
|
|
781
807
|
* Build a transform from loose components, with {@link matrix} already composed from them
|
|
782
808
|
* @param {number} translation_x
|
|
@@ -226,6 +226,10 @@ export class Renderer {
|
|
|
226
226
|
* @return {ViewManager}
|
|
227
227
|
*/
|
|
228
228
|
get views(): ViewManager;
|
|
229
|
+
/**
|
|
230
|
+
* @returns {GPUViewVolumetrics}
|
|
231
|
+
*/
|
|
232
|
+
get volumetrics(): GPUViewVolumetrics;
|
|
229
233
|
/**
|
|
230
234
|
*
|
|
231
235
|
* @return {GraphicsContext}
|
|
@@ -546,6 +550,7 @@ import { MotionBlur } from "./postprocess/motion_blur/MotionBlur.js";
|
|
|
546
550
|
import { DepthOfField } from "./postprocess/dof/raymarch/DepthOfField.js";
|
|
547
551
|
import { DepthOfFieldU } from "./postprocess/dof/gather/DepthOfFieldU.js";
|
|
548
552
|
import { ViewManager } from "./view/ViewManager.js";
|
|
553
|
+
import { GPUViewVolumetrics } from "./volumetrics/GPUViewVolumetrics.js";
|
|
549
554
|
import { GraphicsContext } from "./GraphicsContext.js";
|
|
550
555
|
import Vector2 from "../../core/geom/Vector2.js";
|
|
551
556
|
import { GPUTextureContext } from "./texture/GPUTextureContext.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Renderer.d.ts","sourceRoot":"","sources":["../../../../src/shade/renderer/Renderer.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Renderer.d.ts","sourceRoot":"","sources":["../../../../src/shade/renderer/Renderer.js"],"names":[],"mappings":"AA8IA;IAOI,0BAEC;IAED;;OAEG;IACH,0BAAQ;IAER;;;;;;OAMG;IACH,kDAEC;IAED;;OAEG;IACH,kBAAO;IAYP;;;OAGG;IACH,2BAEC;IAaD,wCAGC;IAED,uCAEC;IAED;;;;OAIG;IACH,wBAFU,yBAAyB,CAEoB;IAEvD;;;;;;;OAOG;IACH,mBAFU,qBAAqB,CAEkB;IAEjD;;;;;OAKG;IACH,mBAFU,oBAAoB,CAEgB;IAE9C;;;OAGG;IACH,QAFU,cAAc,CAEM;IAE9B;;;;;;;;;OASG;IACH,2BAFU,OAAO,CAEiB;IAElC,6BAA4B;IAC5B,8BAA4B;IAC5B;;;;OAIG;IACH,mCAAkC;IAClC;;;;;;;OAOG;IACH,mCAFU,OAAO,CAEyB;IAW1C,oCAIC;IAED,mCAEC;IAYD,oCAIC;IAED,mCAEC;IAED;;;;;;OAMG;IACH,6BAFU,OAAO,CAEmB;IAcpC;;OAEG;IACH,uCAEC;IAyBD,0CAIC;IAED,yCAEC;IAED;;;;;OAKG;IACH,yBAFU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AAkB,EAAE,KAAK;6BAhChB,yBAAyB;0CACZ,gCAAgC;sCAEpC,4BAA4B;qCAD7B,2BAA2B;+BAEjC,6CAA6C;gCAC5C,sCAAsC;2BAhC3C,yCAAyC;6BAFvC,4CAA4C;8BAD3C,2CAA2C;4BAoD7C,uBAAuB;mCAChB,qCAAqC;gCAhExC,sBAAsB;oBAjDlC,4BAA4B;kCA6Gd,gCAAgC;2BA7EvC,2BAA2B;iCA2ErB,0CAA0C;4CA7D/B,+DAA+D;yBA0ClF,yBAAyB;kCAChB,kCAAkC;kCAUlC,wBAAwB;oBAnCtC,0BAA0B;gCAnDd,uCAAuC;uCAyChC,sDAAsD"}
|
|
@@ -114,6 +114,7 @@ import { GPUTextureContext } from "./texture/GPUTextureContext.js";
|
|
|
114
114
|
import { RenderTarget } from "./texture/RenderTarget.js";
|
|
115
115
|
import { View } from "./view/View.js";
|
|
116
116
|
import { ViewManager } from "./view/ViewManager.js";
|
|
117
|
+
import { GPUViewVolumetrics } from "./volumetrics/GPUViewVolumetrics.js";
|
|
117
118
|
|
|
118
119
|
/**
|
|
119
120
|
* @typedef {import("../device/timing/profile/GPUFrameRecorder.js").GPUFrameRecorder} GPUFrameRecorder
|
|
@@ -582,6 +583,23 @@ export class Renderer {
|
|
|
582
583
|
return this.#views;
|
|
583
584
|
}
|
|
584
585
|
|
|
586
|
+
/**
|
|
587
|
+
* The main view's volumetric fog: the froxel grid, its TAA history, and the irradiance clipmap
|
|
588
|
+
* lit particles read. One, like the TAA history, since {@link render} draws one main view; a
|
|
589
|
+
* view of its own would put one on every shadow view as well.
|
|
590
|
+
*
|
|
591
|
+
* Constructed in {@link initialize}.
|
|
592
|
+
* @type {GPUViewVolumetrics | undefined}
|
|
593
|
+
*/
|
|
594
|
+
#volumetrics;
|
|
595
|
+
|
|
596
|
+
/**
|
|
597
|
+
* @returns {GPUViewVolumetrics}
|
|
598
|
+
*/
|
|
599
|
+
get volumetrics() {
|
|
600
|
+
return this.#volumetrics;
|
|
601
|
+
}
|
|
602
|
+
|
|
585
603
|
/**
|
|
586
604
|
* @type {GraphicsContext}
|
|
587
605
|
*/
|
|
@@ -1007,6 +1025,8 @@ export class Renderer {
|
|
|
1007
1025
|
if (this.#nss !== undefined) {
|
|
1008
1026
|
this.#nss.reset_history = true;
|
|
1009
1027
|
}
|
|
1028
|
+
|
|
1029
|
+
this.#volumetrics?.reset_history();
|
|
1010
1030
|
}
|
|
1011
1031
|
|
|
1012
1032
|
/**
|
|
@@ -1635,6 +1655,7 @@ export class Renderer {
|
|
|
1635
1655
|
|
|
1636
1656
|
this.#cameras = new CameraManager(this.device);
|
|
1637
1657
|
this.#views = new ViewManager(graphics, this.#cameras, this.#scenes);
|
|
1658
|
+
this.#volumetrics = new GPUViewVolumetrics(this.device);
|
|
1638
1659
|
|
|
1639
1660
|
const resolution_internal = this.#internal_resolution.asArray();
|
|
1640
1661
|
|
|
@@ -1868,6 +1889,7 @@ export class Renderer {
|
|
|
1868
1889
|
this.#depth_of_field_unreal?.destroy();
|
|
1869
1890
|
this.#restir_di?.destroy();
|
|
1870
1891
|
this.#nss?.destroy();
|
|
1892
|
+
this.#volumetrics?.destroy();
|
|
1871
1893
|
|
|
1872
1894
|
this.#views?.destroy();
|
|
1873
1895
|
this.#scenes?.destroy();
|
|
@@ -2749,7 +2771,7 @@ export class Renderer {
|
|
|
2749
2771
|
limits: graphics.collection_limits,
|
|
2750
2772
|
});
|
|
2751
2773
|
|
|
2752
|
-
// The view's volumetrics: the fog every surface is seen through (participating media ->
|
|
2774
|
+
// The main view's volumetrics: the fog every surface is seen through (participating media ->
|
|
2753
2775
|
// per-froxel lighting -> ray-marched integration), and the froxel irradiance lit particles
|
|
2754
2776
|
// are lit by. Both need the light clusters and shadow atlas. A scene with no volumes records
|
|
2755
2777
|
// no fog and hands the transparency pass a constant LUT that reads as none (transmittance 1,
|
|
@@ -2757,8 +2779,9 @@ export class Renderer {
|
|
|
2757
2779
|
// below is skipped on the same fact.
|
|
2758
2780
|
const has_volumetrics = view_ctx.scene.volumetrics.source.volumes.length > 0;
|
|
2759
2781
|
|
|
2760
|
-
const volumetrics =
|
|
2782
|
+
const volumetrics = this.#volumetrics.graph_update({
|
|
2761
2783
|
graph,
|
|
2784
|
+
view: view_ctx,
|
|
2762
2785
|
light_cluster_data: light_clusters.data,
|
|
2763
2786
|
light_cluster_lookup: light_clusters.lookup,
|
|
2764
2787
|
light_cluster_parameters: light_clusters.parameters,
|
|
@@ -295,7 +295,7 @@ export class GPUParticleSystem {
|
|
|
295
295
|
* @param {number} args.integral graph handle of the integral texture
|
|
296
296
|
* @param {number} args.volumetrics_lut graph handle
|
|
297
297
|
* @param {number} args.volumetrics_metadata graph handle
|
|
298
|
-
* @param {{Y: number, CoCg: number}} args.volumetrics_irradiance graph handles of the froxel
|
|
298
|
+
* @param {{Y: number, CoCg: number, uniform: number}} args.volumetrics_irradiance graph handles of the froxel
|
|
299
299
|
* irradiance volume, what an emitter flagged `EMITTER_FLAG.LIGHTING` is lit by
|
|
300
300
|
* @param {{color: number, norm: number, extinction: number, emission: number}} args.accumulators
|
|
301
301
|
* @returns {{color: number, norm: number, extinction: number, emission: number}} after the draw
|
|
@@ -312,6 +312,7 @@ export class GPUParticleSystem {
|
|
|
312
312
|
volumetrics_irradiance: {
|
|
313
313
|
Y: number;
|
|
314
314
|
CoCg: number;
|
|
315
|
+
uniform: number;
|
|
315
316
|
};
|
|
316
317
|
accumulators: {
|
|
317
318
|
color: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GPUParticleSystem.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/particles/GPUParticleSystem.js"],"names":[],"mappings":"AA4DA;;;;;;;;;;;;;GAaG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6FG;AACH;IAmLI;;;;;;OAMG;IACH,sBANW,MAAM,iBACN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AM,CAAC;YAAC,QAAQ,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAC;QACnD;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC,CAkBjE;IAED;;;;;;;;;;;;;;;;OAgBG;IACH;QAbgG,KAAK,EAA1F,OAAO,2DAA2D,EAAE,UAAU;QACrB,QAAQ,EAAjE,OAAO,2BAA2B,EAAE,cAAc;QACrC,MAAM,EAAnB,MAAM;QACO,aAAa,EAA1B,MAAM;QACO,IAAI,EAAjB,MAAM;QACO,QAAQ,EAArB,MAAM;QACO,eAAe,EAA5B,MAAM;QACO,oBAAoB,EAAjC,MAAM;
|
|
1
|
+
{"version":3,"file":"GPUParticleSystem.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/particles/GPUParticleSystem.js"],"names":[],"mappings":"AA4DA;;;;;;;;;;;;;GAaG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6FG;AACH;IAmLI;;;;;;OAMG;IACH,sBANW,MAAM,iBACN,OAAO,6BAA6B,EAAE,eAAe;QAEpC,QAAQ,GAAzB,MAAM;QACW,sBAAsB,GAAvC,MAAM;OAoBhB;IA1MD;;;OAGG;IACH,UAFU,MAAM,CAEP;IAET;;;;OAIG;IACH,eAFU,OAAO,6BAA6B,EAAE,eAAe,CAEjD;IAEd;;;OAGG;IACH,UAFU,MAAM,CAEP;IAET;;OAEG;IACH,UAFU,eAAe,CAEhB;IAET;;;OAGG;IACH,OAFU,MAAM,CAEN;IAEV;;;OAGG;IACH,MAFU,MAAM,CAEP;IAET;;;OAGG;IACH,qBAFU,MAAM,CAEQ;IAExB;;;;OAIG;IACH,sBAAM;IAEN,yBAAyB;IACzB,0BAAc;IAEd;;;;;;;;;;;OAWG;IACH,SAF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AAM;QAC2C,sBAAsB,EAAvE;YAAC,CAAC,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,CAAA;SAAC;QAEgC,YAAY,EAAtF;YAAC,KAAK,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAC;YAAC,UAAU,EAAE,MAAM,CAAC;YAAC,QAAQ,EAAE,MAAM,CAAA;SAAC;QACjE;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAC,CAwB/E;IAED;;;;;;;;;OASG;IACH,qBAHW,OAAO,8BAA8B,EAAE,eAAe,iBACtD,MAAM,QAehB;IAED;;;;OAIG;IACH,wBAFW,OAAO,8BAA8B,EAAE,eAAe,QAMhE;IAED;;;;;OAKG;IACH,2BAHW,OAAO,8BAA8B,EAAE,eAAe,iBACtD,MAAM,QAMhB;IA6bD;;;;;;;OAOG;IACH;YAFoB,MAAM,GAAE,MAAM;MAgBjC;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,cAFa,QAAQ,mBAAmB,CAAC,CA8BxC;IAED,gBA2BC;;CACJ;;;;;;;;WA/oCa,MAAM;;;;UACN,MAAM;;;;kBACN,MAAM;;;;;cACN,MAAM;;;;;gBAEN,MAAM;;;;;oBAEN,MAAM;;gCAxCY,8BAA8B"}
|
|
@@ -609,7 +609,7 @@ export class GPUParticleSystem {
|
|
|
609
609
|
* @param {number} args.integral graph handle of the integral texture
|
|
610
610
|
* @param {number} args.volumetrics_lut graph handle
|
|
611
611
|
* @param {number} args.volumetrics_metadata graph handle
|
|
612
|
-
* @param {{Y: number, CoCg: number}} args.volumetrics_irradiance graph handles of the froxel
|
|
612
|
+
* @param {{Y: number, CoCg: number, uniform: number}} args.volumetrics_irradiance graph handles of the froxel
|
|
613
613
|
* irradiance volume, what an emitter flagged `EMITTER_FLAG.LIGHTING` is lit by
|
|
614
614
|
* @param {{color: number, norm: number, extinction: number, emission: number}} args.accumulators
|
|
615
615
|
* @returns {{color: number, norm: number, extinction: number, emission: number}} after the draw
|
|
@@ -70,7 +70,7 @@ export function graph_particle_avboit_splat({ graph, camera, warp, depth_texture
|
|
|
70
70
|
* @param {number} params.integral graph handle of the integral texture
|
|
71
71
|
* @param {number} params.volumetrics_lut graph handle
|
|
72
72
|
* @param {number} params.volumetrics_metadata graph handle
|
|
73
|
-
* @param {{Y: number, CoCg: number, uniform
|
|
73
|
+
* @param {{Y: number, CoCg: number, uniform: number}} params.volumetrics_irradiance graph handles of
|
|
74
74
|
* the world-space irradiance clipmap a lit emitter's particles are lit by
|
|
75
75
|
* @param {{color: number, norm: number, extinction: number, emission: number}} params.accumulators to add to
|
|
76
76
|
* @param {GPUTextureView} params.atlas
|
|
@@ -93,7 +93,7 @@ export function graph_particle_avboit_draw({ graph, view_ctx, scene_context, cam
|
|
|
93
93
|
volumetrics_irradiance: {
|
|
94
94
|
Y: number;
|
|
95
95
|
CoCg: number;
|
|
96
|
-
uniform
|
|
96
|
+
uniform: number;
|
|
97
97
|
};
|
|
98
98
|
accumulators: {
|
|
99
99
|
color: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph_particles_avboit.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/particles/graph_particles_avboit.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"graph_particles_avboit.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/particles/graph_particles_avboit.js"],"names":[],"mappings":"AA0CA;;;;;;;;;;;;;;;GAeG;AACH;IARkG,KAAK,EAA5F,OAAO,2DAA2D,EAAE,UAAU;IAC/D,MAAM,EAArB,MAAM;IACoB,kBAAkB,EAA5C,UAAU,MAAM,CAAC;IACF,SAAS,EAAxB,MAAM;IACS,gBAAgB,EAA/B,MAAM;IACS,mBAAmB,EAAlC,MAAM;IACJ,MAAM,CA8ClB;A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AAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAC,CA+H/E"}
|
|
@@ -7,7 +7,6 @@ import {
|
|
|
7
7
|
METRO_L1_IRRADIANCE_STRUCT
|
|
8
8
|
} from "../shader/chunk/spherical_harmonics/l1i/chunk_convert_to_irradiance_sh.js";
|
|
9
9
|
import { STATIC_GRAPHICS_ENGINE_ASSETS } from "../STATIC_GRAPHICS_ENGINE_ASSETS.js";
|
|
10
|
-
import { IRRADIANCE_CLIPMAP_STRUCT } from "../volumetrics/irradiance_clipmap/IRRADIANCE_CLIPMAP_STRUCT.js";
|
|
11
10
|
import {
|
|
12
11
|
PARTICLE_AVBOIT_DRAW_ADDITIVE_PIPELINE,
|
|
13
12
|
PARTICLE_AVBOIT_DRAW_ALPHA_PIPELINE,
|
|
@@ -205,7 +204,7 @@ export function graph_particle_avboit_splat({
|
|
|
205
204
|
* @param {number} params.integral graph handle of the integral texture
|
|
206
205
|
* @param {number} params.volumetrics_lut graph handle
|
|
207
206
|
* @param {number} params.volumetrics_metadata graph handle
|
|
208
|
-
* @param {{Y: number, CoCg: number, uniform
|
|
207
|
+
* @param {{Y: number, CoCg: number, uniform: number}} params.volumetrics_irradiance graph handles of
|
|
209
208
|
* the world-space irradiance clipmap a lit emitter's particles are lit by
|
|
210
209
|
* @param {{color: number, norm: number, extinction: number, emission: number}} params.accumulators to add to
|
|
211
210
|
* @param {GPUTextureView} params.atlas
|
|
@@ -240,6 +239,7 @@ export function graph_particle_avboit_draw({
|
|
|
240
239
|
assert.isNonNegativeInteger(integral, "integral");
|
|
241
240
|
assert.isNonNegativeInteger(volumetrics_irradiance.Y, "volumetrics_irradiance.Y");
|
|
242
241
|
assert.isNonNegativeInteger(volumetrics_irradiance.CoCg, "volumetrics_irradiance.CoCg");
|
|
242
|
+
assert.isNonNegativeInteger(volumetrics_irradiance.uniform, "volumetrics_irradiance.uniform");
|
|
243
243
|
|
|
244
244
|
function execute(data, resources, context) {
|
|
245
245
|
const encoder = context.encoder;
|
|
@@ -249,10 +249,7 @@ export function graph_particle_avboit_draw({
|
|
|
249
249
|
const depth_view = t_depth.obtainView(DEFAULT_DEPTH_TEXTURE_VIEW);
|
|
250
250
|
const linear_sampler = graphics.samplers.obtain(SAMPLER_LINEAR);
|
|
251
251
|
|
|
252
|
-
const irradiance_clipmap_buffer = data.irradiance_uniform
|
|
253
|
-
? resources.get(data.irradiance_uniform)
|
|
254
|
-
: (view_ctx.volumetrics?.irradiance_clipmap?.uniform
|
|
255
|
-
?? encoder.allocateTransientBuffer(GPUBufferUsage.UNIFORM, IRRADIANCE_CLIPMAP_STRUCT.size));
|
|
252
|
+
const irradiance_clipmap_buffer = resources.get(data.irradiance_uniform);
|
|
256
253
|
|
|
257
254
|
const far_field_sh_buffer = scene_context?.lights?.far_field_irradiance_sh
|
|
258
255
|
?? view_ctx.scene?.lights?.far_field_irradiance_sh
|
|
@@ -326,9 +323,7 @@ export function graph_particle_avboit_draw({
|
|
|
326
323
|
pass_data.volumetrics_metadata = pass.read(volumetrics_metadata);
|
|
327
324
|
pass_data.irradiance_Y = pass.read(volumetrics_irradiance.Y);
|
|
328
325
|
pass_data.irradiance_CoCg = pass.read(volumetrics_irradiance.CoCg);
|
|
329
|
-
|
|
330
|
-
pass_data.irradiance_uniform = pass.read(volumetrics_irradiance.uniform);
|
|
331
|
-
}
|
|
326
|
+
pass_data.irradiance_uniform = pass.read(volumetrics_irradiance.uniform);
|
|
332
327
|
pass_data.pool = pass.read(pool);
|
|
333
328
|
pass_data.alive = pass.read(alive);
|
|
334
329
|
pass_data.emitter_database = pass.read(emitter_database);
|
|
@@ -53,7 +53,7 @@ export class NSS {
|
|
|
53
53
|
* @returns {number}
|
|
54
54
|
*/
|
|
55
55
|
static recommended_jitter_sequence_size(upscale_ratio: number): number;
|
|
56
|
-
static "__#
|
|
56
|
+
static "__#200@#preprocess_tensor_descriptor"(render_w: any, render_h: any): TextureResourceDescriptor;
|
|
57
57
|
/**
|
|
58
58
|
* @param {GraphicsContext} graphics
|
|
59
59
|
*/
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
export namespace ViewStats {
|
|
2
|
-
let VisibleMeshes0: number;
|
|
3
|
-
let VisibleMeshlets0: number;
|
|
4
|
-
let VisibleTriangles0: number;
|
|
5
|
-
let VisibleMeshes1: number;
|
|
6
|
-
let VisibleMeshlets1: number;
|
|
7
|
-
let VisibleTriangles1: number;
|
|
8
|
-
}
|
|
9
1
|
/**
|
|
10
2
|
* Represents state of scene rendering from a given point of view
|
|
11
3
|
*/
|
|
@@ -75,11 +67,6 @@ export class GPUViewContext {
|
|
|
75
67
|
* @returns {GPUTypedBuffer}
|
|
76
68
|
*/
|
|
77
69
|
get uniform_buffer(): GPUTypedBuffer;
|
|
78
|
-
/**
|
|
79
|
-
*
|
|
80
|
-
* @returns {GPUViewVolumetrics}
|
|
81
|
-
*/
|
|
82
|
-
get volumetrics(): GPUViewVolumetrics;
|
|
83
70
|
/**
|
|
84
71
|
* Unsafe, be sure you understand what you are doing when using this
|
|
85
72
|
* @param {GPUCameraContext} v
|
|
@@ -138,7 +125,6 @@ export type GraphicsContext = import("../GraphicsContext.js").GraphicsContext;
|
|
|
138
125
|
export type GPUSceneContext = import("../scene/GPUSceneContext.js").GPUSceneContext;
|
|
139
126
|
import { HierarchicalZBuffer } from "../hiz/HierarchicalZBuffer.js";
|
|
140
127
|
import { GPUTypedBuffer } from "../buffer/GPUTypedBuffer.js";
|
|
141
|
-
import { GPUViewVolumetrics } from "../volumetrics/GPUViewVolumetrics.js";
|
|
142
128
|
import { GPUCameraContext } from "../camera/GPUCameraContext.js";
|
|
143
129
|
import { VGeoViewCut } from "../geometry/virtual/runtime/VGeoViewCut.js";
|
|
144
130
|
//# sourceMappingURL=GPUViewContext.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GPUViewContext.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/view/GPUViewContext.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GPUViewContext.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/view/GPUViewContext.js"],"names":[],"mappings":"AAqBA;;GAEG;AACH;IAmOI;;;;;OAKG;IACH,sBAJW,eAAe,SACf,eAAe,UACf,gBAAgB,EAuB1B;IA5PD;;;OAGG;IACH,aAFU,MAAM,CAEE;IAElB;;;OAGG;IACH,OAFU,MAAM,CAEL;IAuBX;;;;OAIG;IACH,mBAHW,MAAM,KACN,MAAM,QAiBhB;IAED;;;;OAIG;IACH,aAHW,MAAM,KACN,MAAM,QAQhB;IAED;;;;OAIG;IACH,kBAHW,MAAM,KACN,MAAM,QAOhB;IAED,wEAAwE;IACxE,2BAAqC;IAErC,6BAA6B;IAC7B,8BAEC;IAQD;;;OAGG;IACH,0BAEC;IAED;;;;OAIG;IACH,mBAHW,MAAM,KACN,MAAM,QAUhB;IAgBD;;;OAGG;IACH,kDAEC;IAdD;;;OAGG;IACH,iDAEC;IAgBD;;;OAGG;IACH,qCAEC;IA4BD;;;OAGG;IACH,mDAEC;IAdD;;;OAGG;IACH,kDAEC;IAyBD;;OAEG;IACH,wCAEC;IAED;;;OAGG;IACH,+BAEC;IAED;;;OAGG;IACH,mEAEC;IA+BD;;;;OAIG;IACH,cAHW,cAAc,GACZ,OAAO,CAWnB;IAED;;;OAGG;IACH,QAFY,MAAM,CAIjB;IAED,wBA6BC;IAGD;;;OAGG;IACH,YAFW,eAAe,QAWzB;IAED;;OAEG;IACH,0BAFW,sBAAsB,QAShC;IAED,gBAgBC;IAGL;;;OAGG;IACH,2BAFU,OAAO,CAEwB;;CANxC;qCA9WY,OAAO,wCAAwC,EAAE,sBAAsB;8BACvE,OAAO,uBAAuB,EAAE,eAAe;8BAC/C,OAAO,6BAA6B,EAAE,eAAe;oCAN9B,+BAA+B;+BAHpC,6BAA6B;iCAC3B,+BAA+B;4BACpC,4CAA4C"}
|
|
@@ -9,7 +9,6 @@ import { GPUTypedBuffer } from "../buffer/GPUTypedBuffer.js";
|
|
|
9
9
|
import { GPUCameraContext } from "../camera/GPUCameraContext.js";
|
|
10
10
|
import { VGeoViewCut } from "../geometry/virtual/runtime/VGeoViewCut.js";
|
|
11
11
|
import { HierarchicalZBuffer } from "../hiz/HierarchicalZBuffer.js";
|
|
12
|
-
import { GPUViewVolumetrics } from "../volumetrics/GPUViewVolumetrics.js";
|
|
13
12
|
import { VIEW_UNIFORM_STRUCT } from "./VIEW_UNIFORM_STRUCT.js";
|
|
14
13
|
|
|
15
14
|
/**
|
|
@@ -20,16 +19,6 @@ import { VIEW_UNIFORM_STRUCT } from "./VIEW_UNIFORM_STRUCT.js";
|
|
|
20
19
|
|
|
21
20
|
let id_counter = 0;
|
|
22
21
|
|
|
23
|
-
export const ViewStats = {
|
|
24
|
-
VisibleMeshes0: 0,
|
|
25
|
-
VisibleMeshlets0: 1,
|
|
26
|
-
VisibleTriangles0: 2,
|
|
27
|
-
// second draw pass (after partial hzb)
|
|
28
|
-
VisibleMeshes1: 3,
|
|
29
|
-
VisibleMeshlets1: 4,
|
|
30
|
-
VisibleTriangles1: 5,
|
|
31
|
-
}
|
|
32
|
-
|
|
33
22
|
/**
|
|
34
23
|
* Represents state of scene rendering from a given point of view
|
|
35
24
|
*/
|
|
@@ -188,20 +177,6 @@ export class GPUViewContext {
|
|
|
188
177
|
return this.#uniform_buffer;
|
|
189
178
|
}
|
|
190
179
|
|
|
191
|
-
/**
|
|
192
|
-
* Per-view volumetric fog (froxel LUTs + integration).
|
|
193
|
-
* @type {GPUViewVolumetrics}
|
|
194
|
-
*/
|
|
195
|
-
#volumetrics;
|
|
196
|
-
|
|
197
|
-
/**
|
|
198
|
-
*
|
|
199
|
-
* @returns {GPUViewVolumetrics}
|
|
200
|
-
*/
|
|
201
|
-
get volumetrics() {
|
|
202
|
-
return this.#volumetrics;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
180
|
|
|
206
181
|
/**
|
|
207
182
|
* What is that we're drawing?
|
|
@@ -299,8 +274,6 @@ export class GPUViewContext {
|
|
|
299
274
|
|
|
300
275
|
this.#previous_camera_state = camera.clone();
|
|
301
276
|
|
|
302
|
-
this.#volumetrics = new GPUViewVolumetrics(this, device);
|
|
303
|
-
|
|
304
277
|
this.#virtual_geometry_cut = new VGeoViewCut({ device, label: this.label });
|
|
305
278
|
|
|
306
279
|
}
|
|
@@ -403,8 +376,6 @@ export class GPUViewContext {
|
|
|
403
376
|
|
|
404
377
|
this.#hierarchical_z_buffer.destroy();
|
|
405
378
|
|
|
406
|
-
this.#volumetrics.destroy();
|
|
407
|
-
|
|
408
379
|
this.#virtual_geometry_cut.destroy();
|
|
409
380
|
}
|
|
410
381
|
}
|
|
@@ -37,7 +37,7 @@ export class ViewManager {
|
|
|
37
37
|
obtain(view: View): GPUViewContext;
|
|
38
38
|
/**
|
|
39
39
|
* Release the GPU context cached for a view, destroying its GPU resources (view uniform
|
|
40
|
-
* buffer, hierarchical-Z buffer,
|
|
40
|
+
* buffer, hierarchical-Z buffer, and the previous-frame camera clone), and drop
|
|
41
41
|
* the cache entry. The cache keys on the View object with no GC path, so a context whose view
|
|
42
42
|
* is gone (e.g. an evicted shadowmap face) must be released explicitly or its buffers leak.
|
|
43
43
|
* No-op if the view was never obtained.
|
|
@@ -110,7 +110,7 @@ export class ViewManager {
|
|
|
110
110
|
|
|
111
111
|
/**
|
|
112
112
|
* Release the GPU context cached for a view, destroying its GPU resources (view uniform
|
|
113
|
-
* buffer, hierarchical-Z buffer,
|
|
113
|
+
* buffer, hierarchical-Z buffer, and the previous-frame camera clone), and drop
|
|
114
114
|
* the cache entry. The cache keys on the View object with no GC path, so a context whose view
|
|
115
115
|
* is gone (e.g. an evicted shadowmap face) must be released explicitly or its buffers leak.
|
|
116
116
|
* No-op if the view was never obtained.
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {import("../../../engine/graphics/render/frame_graph/FrameGraph.js").FrameGraph} FrameGraph
|
|
3
|
+
* @typedef {import("../view/GPUViewContext.js").GPUViewContext} GPUViewContext
|
|
4
|
+
*/
|
|
1
5
|
export class GPUViewVolumetrics {
|
|
2
6
|
/**
|
|
3
7
|
*
|
|
4
|
-
* @param {GPUViewContext} view
|
|
5
8
|
* @param {GPUDevice} device
|
|
6
9
|
*/
|
|
7
|
-
constructor(
|
|
10
|
+
constructor(device: GPUDevice);
|
|
8
11
|
/**
|
|
9
12
|
* @param {boolean} v
|
|
10
13
|
*/
|
|
@@ -13,6 +16,31 @@ export class GPUViewVolumetrics {
|
|
|
13
16
|
* @returns {boolean}
|
|
14
17
|
*/
|
|
15
18
|
get taa_enabled(): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* @param {number} v positive integer
|
|
21
|
+
*/
|
|
22
|
+
set tile_size(v: number);
|
|
23
|
+
/**
|
|
24
|
+
* Size of one froxel in XY, in screen pixels. Smaller is finer fog detail at a cost that grows
|
|
25
|
+
* with the inverse square. The grid is resized on the next update and the TAA history dropped,
|
|
26
|
+
* so the frame after a change starts its accumulation over.
|
|
27
|
+
*
|
|
28
|
+
* The grid's XY extent, `ceil(view resolution / tile_size)`, must stay within the device's
|
|
29
|
+
* `maxTextureDimension3D`.
|
|
30
|
+
* @returns {number}
|
|
31
|
+
*/
|
|
32
|
+
get tile_size(): number;
|
|
33
|
+
/**
|
|
34
|
+
* @param {number} v integer, at least 2 (the depth curve needs a first and a last slice) and at
|
|
35
|
+
* most the device's `maxTextureDimension3D`
|
|
36
|
+
*/
|
|
37
|
+
set resolution_z(v: number);
|
|
38
|
+
/**
|
|
39
|
+
* Number of froxel slices between the camera near and {@link froxel_far}. Cost grows linearly.
|
|
40
|
+
* The grid is resized on the next update and the TAA history dropped, as for {@link tile_size}.
|
|
41
|
+
* @returns {number}
|
|
42
|
+
*/
|
|
43
|
+
get resolution_z(): number;
|
|
16
44
|
/**
|
|
17
45
|
* @param {number} v
|
|
18
46
|
*/
|
|
@@ -25,11 +53,19 @@ export class GPUViewVolumetrics {
|
|
|
25
53
|
* @returns {GPUIrradianceClipmap}
|
|
26
54
|
*/
|
|
27
55
|
get irradiance_clipmap(): GPUIrradianceClipmap;
|
|
56
|
+
/**
|
|
57
|
+
* Drop the TAA history, so the next frame integrates without blending against what came before
|
|
58
|
+
* it. For a cut the grid, the depth curve and the view cannot see: the camera jumped, or the
|
|
59
|
+
* scene changed significantly.
|
|
60
|
+
*/
|
|
61
|
+
reset_history(): void;
|
|
28
62
|
destroy(): void;
|
|
29
63
|
/**
|
|
30
64
|
*
|
|
31
65
|
* @param {Object} options
|
|
32
66
|
* @param {FrameGraph} options.graph
|
|
67
|
+
* @param {GPUViewContext} options.view what the fog is seen from: its resolution sizes the
|
|
68
|
+
* froxel grid, its camera places it, its scene fills it
|
|
33
69
|
* @param {number} options.light_cluster_data
|
|
34
70
|
* @param {number} options.light_cluster_lookup
|
|
35
71
|
* @param {number} options.light_cluster_parameters
|
|
@@ -39,8 +75,9 @@ export class GPUViewVolumetrics {
|
|
|
39
75
|
* @param {import("../global_illumination/lpv/GPULightProbeVolume.js").GPULightProbeVolume} [options.lpv]
|
|
40
76
|
* @returns {{resolved: number, metadata: number, irradiance: {Y: number, CoCg: number, uniform: number}}}
|
|
41
77
|
*/
|
|
42
|
-
graph_update({ graph, light_cluster_data, light_cluster_lookup, light_cluster_parameters, shadowmap_atlas, shader_switches, brick4, lpv, }: {
|
|
78
|
+
graph_update({ graph, view, light_cluster_data, light_cluster_lookup, light_cluster_parameters, shadowmap_atlas, shader_switches, brick4, lpv, }: {
|
|
43
79
|
graph: FrameGraph;
|
|
80
|
+
view: GPUViewContext;
|
|
44
81
|
light_cluster_data: number;
|
|
45
82
|
light_cluster_lookup: number;
|
|
46
83
|
light_cluster_parameters: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GPUViewVolumetrics.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/volumetrics/GPUViewVolumetrics.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GPUViewVolumetrics.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/volumetrics/GPUViewVolumetrics.js"],"names":[],"mappings":"AAuBA;;;GAGG;AAEH;IA0MI;;;OAGG;IACH,+BAuCC;IA/MD;;OAEG;IACH,4BAOC;IAjBD;;OAEG;IACH,2BAEC;IAuCD;;OAEG;IACH,yBAIC;IApBD;;;;;;;;OAQG;IACH,wBAEC;IAoBD;;;OAGG;IACH,4BAMC;IAnBD;;;;OAIG;IACH,2BAEC;IAsCD;;OAEG;IACH,0BAEC;IAZD;;OAEG;IACH,yBAEC;IAwHD;;OAEG;IACH,+CAEC;IAED;;;;OAIG;IACH,sBAEC;IAED,gBAcC;IAsOD;;;;;;;;;;;;;;OAcG;IACH;QAZ+B,KAAK,EAAzB,UAAU;QACc,IAAI,EAA5B,cAAc;QAEE,kBAAkB,EAAlC,MAAM;QACU,oBAAoB,EAApC,MAAM;QACU,wBAAwB,EAAxC,MAAM;QACU,eAAe,EAA/B,MAAM;QACoB,eAAe,GAAzC,eAAe;QACoE,MAAM,GAAzF,OAAO,iDAAiD,EAAE,cAAc;QACkB,GAAG,GAA7F,OAAO,mDAAmD,EAAE,mBAAmB;QAC7E;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE;YAAC,CAAC,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,CAAA;SAAC,CAAA;KAAC,CA6GxG;;CAEJ;yBA3nBY,OAAO,2DAA2D,EAAE,UAAU;6BAC9E,OAAO,2BAA2B,EAAE,cAAc;qCAX1B,8CAA8C;gCAXnD,uCAAuC"}
|