@woosh/meep-engine 2.117.17 → 2.117.19
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/build/meep.cjs +115 -112
- package/build/meep.min.js +1 -1
- package/build/meep.module.js +115 -112
- package/package.json +1 -1
- package/src/core/collection/map/HashMap.d.ts.map +1 -1
- package/src/core/collection/map/HashMap.js +110 -108
- package/src/engine/graphics/render/frame_graph/RenderGraph.d.ts +6 -9
- package/src/engine/graphics/render/frame_graph/RenderGraph.d.ts.map +1 -1
- package/src/engine/graphics/render/frame_graph/RenderGraph.js +17 -23
- package/src/engine/graphics/render/frame_graph/RenderPass.d.ts +50 -10
- package/src/engine/graphics/render/frame_graph/RenderPass.d.ts.map +1 -1
- package/src/engine/graphics/render/frame_graph/RenderPass.js +1 -0
- package/src/engine/graphics/render/frame_graph/RenderPassNode.d.ts +2 -2
- package/src/engine/graphics/render/frame_graph/RenderPassNode.d.ts.map +1 -1
- package/src/engine/graphics/render/frame_graph/RenderPassNode.js +4 -2
- package/src/engine/graphics/material/manager/ManagedTexture.d.ts +0 -3
- package/src/engine/graphics/material/manager/ManagedTexture.d.ts.map +0 -1
- package/src/engine/graphics/material/manager/ManagedTexture.js +0 -3
- package/src/engine/graphics/material/manager/TextureManager.d.ts +0 -3
- package/src/engine/graphics/material/manager/TextureManager.d.ts.map +0 -1
- package/src/engine/graphics/material/manager/TextureManager.js +0 -3
- package/src/engine/graphics/render/frame_graph/sample/deferred/CopyPass.d.ts +0 -9
- package/src/engine/graphics/render/frame_graph/sample/deferred/CopyPass.d.ts.map +0 -1
- package/src/engine/graphics/render/frame_graph/sample/deferred/CopyPass.js +0 -21
- package/src/engine/graphics/render/frame_graph/sample/deferred/GBufferDrawPass.d.ts +0 -11
- package/src/engine/graphics/render/frame_graph/sample/deferred/GBufferDrawPass.d.ts.map +0 -1
- package/src/engine/graphics/render/frame_graph/sample/deferred/GBufferDrawPass.js +0 -33
- package/src/engine/graphics/render/frame_graph/sample/deferred/LightingPass.d.ts +0 -9
- package/src/engine/graphics/render/frame_graph/sample/deferred/LightingPass.d.ts.map +0 -1
- package/src/engine/graphics/render/frame_graph/sample/deferred/LightingPass.js +0 -23
- package/src/engine/graphics/render/frame_graph/sample/deferred/run.d.ts +0 -2
- package/src/engine/graphics/render/frame_graph/sample/deferred/run.d.ts.map +0 -1
- package/src/engine/graphics/render/frame_graph/sample/deferred/run.js +0 -59
- package/src/engine/graphics/render/frame_graph/sample/meep-v1/ColorDepthPass.d.ts +0 -13
- package/src/engine/graphics/render/frame_graph/sample/meep-v1/ColorDepthPass.d.ts.map +0 -1
- package/src/engine/graphics/render/frame_graph/sample/meep-v1/ColorDepthPass.js +0 -41
- package/src/engine/graphics/render/frame_graph/sample/meep-v1/OutlinePass.d.ts +0 -6
- package/src/engine/graphics/render/frame_graph/sample/meep-v1/OutlinePass.d.ts.map +0 -1
- package/src/engine/graphics/render/frame_graph/sample/meep-v1/OutlinePass.js +0 -10
- package/src/engine/graphics/render/frame_graph/sample/meep-v1/SSAOPass.d.ts +0 -5
- package/src/engine/graphics/render/frame_graph/sample/meep-v1/SSAOPass.d.ts.map +0 -1
- package/src/engine/graphics/render/frame_graph/sample/meep-v1/SSAOPass.js +0 -5
- package/src/engine/graphics/render/frame_graph/sample/meep-v1/render.d.ts +0 -2
- package/src/engine/graphics/render/frame_graph/sample/meep-v1/render.d.ts.map +0 -1
- package/src/engine/graphics/render/frame_graph/sample/meep-v1/render.js +0 -7
|
@@ -1,10 +1,50 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated new syntax does not require a separate data structure, use lambda functions instead
|
|
3
|
+
* @template [DATA=Object<number>]
|
|
4
|
+
* @class
|
|
5
|
+
*/
|
|
6
|
+
export class RenderPass<DATA = any> {
|
|
7
|
+
/**
|
|
8
|
+
*
|
|
9
|
+
* @param [inputs]
|
|
10
|
+
*/
|
|
11
|
+
constructor(inputs?: any);
|
|
12
|
+
/**
|
|
13
|
+
* Used for debug and visualisation
|
|
14
|
+
* @type {string}
|
|
15
|
+
*/
|
|
16
|
+
name: string;
|
|
17
|
+
/**
|
|
18
|
+
*
|
|
19
|
+
* @type {number|RenderPassFlags}
|
|
20
|
+
*/
|
|
21
|
+
flags: number | RenderPassFlags;
|
|
22
|
+
/**
|
|
23
|
+
* Arbitrary dictionary of data
|
|
24
|
+
* @deprecated
|
|
25
|
+
* @type {Object<number>}
|
|
26
|
+
*/
|
|
27
|
+
inputs: any;
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @param {RenderGraphBuilder} builder
|
|
31
|
+
* @returns {DATA} resources/handles that are used by the pass, includes both inputs and outputs
|
|
32
|
+
*/
|
|
33
|
+
setup(builder: RenderGraphBuilder): DATA;
|
|
34
|
+
/**
|
|
35
|
+
* @param {DATA} data
|
|
36
|
+
* @param {RenderPassResources} resources
|
|
37
|
+
* @param {IRenderContext} render_context
|
|
38
|
+
* @returns {void}
|
|
39
|
+
*/
|
|
40
|
+
execute(data: DATA, resources: RenderPassResources, render_context: IRenderContext): void;
|
|
41
|
+
/**
|
|
42
|
+
* Validate render pass internal structure
|
|
43
|
+
* This is an optional method, mainly useful for debugging purposes
|
|
44
|
+
* Default behaviour is to report pass as "valid" (true)
|
|
45
|
+
* @param {function(problem:string)} problem_consumer when returning false, reasons are supplied here
|
|
46
|
+
* @return {boolean} true for valid, false for invalid
|
|
47
|
+
*/
|
|
48
|
+
validate(problem_consumer: any): boolean;
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=RenderPass.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenderPass.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/render/frame_graph/RenderPass.js"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"RenderPass.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/render/frame_graph/RenderPass.js"],"names":[],"mappings":"AAEA;;;;GAIG;AACH;IAsBI;;;OAGG;IACH,0BAQC;IAhCD;;;OAGG;IACH,MAFU,MAAM,CAEK;IAErB;;;OAGG;IACH,OAFU,MAAM,kBAAgB,CAEV;IAGtB;;;;OAIG;IACH,YAAY;IAiBZ;;;;OAIG;IACH,oCAFa,IAAI,CAIhB;IAED;;;;;OAKG;IACH,cALW,IAAI,mEAGF,IAAI,CAIhB;IAED;;;;;;OAMG;IACH,iCAFY,OAAO,CAIlB;CACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenderPassNode.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/render/frame_graph/RenderPassNode.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RenderPassNode.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/render/frame_graph/RenderPassNode.js"],"names":[],"mappings":"AAIA;IAEI;;;OAGG;IACH,kBAAc;IAEd;;;OAGG;IACH,kBAFU,OAAO,CAEQ;IAEzB;;;OAGG;IACH,UAAU;IAEV;;;OAGG;IACH,kBAFU,MAAM,EAAE,CAEI;IAEtB;;;OAGG;IACH,gBAFU,MAAM,EAAE,CAEE;IAEpB;;;OAGG;IACH,iBAFU,MAAM,EAAE,CAEG;IAErB;;;;OAIG;IACH,YAHW,MAAM,GACL,OAAO,CAMlB;IAED;;;;OAIG;IACH,UAHW,MAAM,GACL,OAAO,CAMlB;IAED;;;;OAIG;IACH,WAHW,MAAM,GACL,OAAO,CAMlB;IAED,0BAOC;IAED;;;OAGG;IACH,eAFW,MAAM,UAUhB;IAED;;;OAGG;IACH,eAFY,OAAO,CAIlB;CACJ;0BAvGyB,gBAAgB"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { assert } from "../../../../core/assert.js";
|
|
2
|
+
import { noop } from "../../../../core/function/noop.js";
|
|
2
3
|
import { GraphNode } from "./GraphNode.js";
|
|
3
4
|
|
|
4
5
|
export class RenderPassNode extends GraphNode {
|
|
6
|
+
|
|
5
7
|
/**
|
|
6
8
|
*
|
|
7
|
-
* @type {
|
|
9
|
+
* @type {Function}
|
|
8
10
|
*/
|
|
9
|
-
|
|
11
|
+
execute = noop
|
|
10
12
|
|
|
11
13
|
/**
|
|
12
14
|
*
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ManagedTexture.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/material/manager/ManagedTexture.js"],"names":[],"mappings":"AAAA;CAEC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TextureManager.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/material/manager/TextureManager.js"],"names":[],"mappings":"AAAA;CAEC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export class CopyPass extends RenderPass<any> {
|
|
2
|
-
constructor();
|
|
3
|
-
setup(builder: any): {
|
|
4
|
-
output: any;
|
|
5
|
-
};
|
|
6
|
-
execute(data: any, resources: any, render_context: any): void;
|
|
7
|
-
}
|
|
8
|
-
import { RenderPass } from "../../RenderPass.js";
|
|
9
|
-
//# sourceMappingURL=CopyPass.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CopyPass.d.ts","sourceRoot":"","sources":["../../../../../../../../src/engine/graphics/render/frame_graph/sample/deferred/CopyPass.js"],"names":[],"mappings":"AAEA;;IAGI;;MAUC;IAED,8DAEC;CACJ;2BApB0B,qBAAqB"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { RenderPass } from "../../RenderPass.js";
|
|
2
|
-
|
|
3
|
-
export class CopyPass extends RenderPass {
|
|
4
|
-
name = "Copy"
|
|
5
|
-
|
|
6
|
-
setup(builder) {
|
|
7
|
-
const {input, output} = this.inputs;
|
|
8
|
-
|
|
9
|
-
builder.read(input);
|
|
10
|
-
|
|
11
|
-
const destination = builder.write(output);
|
|
12
|
-
|
|
13
|
-
return {
|
|
14
|
-
output: destination
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
execute(data, resources, render_context) {
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export class GBufferDrawPass extends RenderPass<any> {
|
|
2
|
-
constructor();
|
|
3
|
-
setup(builder: any): {
|
|
4
|
-
albedo: any;
|
|
5
|
-
normal: any;
|
|
6
|
-
position: any;
|
|
7
|
-
};
|
|
8
|
-
execute(data: any, resources: any, render_context: any): void;
|
|
9
|
-
}
|
|
10
|
-
import { RenderPass } from "../../RenderPass.js";
|
|
11
|
-
//# sourceMappingURL=GBufferDrawPass.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GBufferDrawPass.d.ts","sourceRoot":"","sources":["../../../../../../../../src/engine/graphics/render/frame_graph/sample/deferred/GBufferDrawPass.js"],"names":[],"mappings":"AAGA;;IAGI;;;;MAqBC;IAED,8DAEC;CACJ;2BAhC0B,qBAAqB"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { RenderPass } from "../../RenderPass.js";
|
|
2
|
-
import { TextureResourceDescriptor } from "../../resource/TextureResourceDescriptor.js";
|
|
3
|
-
|
|
4
|
-
export class GBufferDrawPass extends RenderPass {
|
|
5
|
-
name = "Draw G-buffer";
|
|
6
|
-
|
|
7
|
-
setup(builder) {
|
|
8
|
-
// ignore inputs
|
|
9
|
-
|
|
10
|
-
const out_albedo = new TextureResourceDescriptor();
|
|
11
|
-
const res_albedo = builder.create("Albedo", out_albedo);
|
|
12
|
-
builder.write(res_albedo);
|
|
13
|
-
|
|
14
|
-
const out_normal = new TextureResourceDescriptor();
|
|
15
|
-
const res_normal = builder.create("Normal", out_normal);
|
|
16
|
-
builder.write(res_normal);
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const out_depth = new TextureResourceDescriptor();
|
|
20
|
-
const res_position = builder.create("Position", out_depth);
|
|
21
|
-
builder.write(res_position);
|
|
22
|
-
|
|
23
|
-
return {
|
|
24
|
-
albedo: res_albedo,
|
|
25
|
-
normal: res_normal,
|
|
26
|
-
position: res_position
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
execute(data,resources, render_context) {
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export class LightingPass extends RenderPass<any> {
|
|
2
|
-
constructor();
|
|
3
|
-
setup(builder: any): {
|
|
4
|
-
output: any;
|
|
5
|
-
};
|
|
6
|
-
execute(data: any, resources: any, render_context: any): void;
|
|
7
|
-
}
|
|
8
|
-
import { RenderPass } from "../../RenderPass.js";
|
|
9
|
-
//# sourceMappingURL=LightingPass.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LightingPass.d.ts","sourceRoot":"","sources":["../../../../../../../../src/engine/graphics/render/frame_graph/sample/deferred/LightingPass.js"],"names":[],"mappings":"AAEA;;IAGI;;MAYC;IAED,8DAEC;CACJ;2BAtB0B,qBAAqB"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { RenderPass } from "../../RenderPass.js";
|
|
2
|
-
|
|
3
|
-
export class LightingPass extends RenderPass {
|
|
4
|
-
name = "Lighting";
|
|
5
|
-
|
|
6
|
-
setup(builder) {
|
|
7
|
-
const { output, normal, albedo, position } = this.inputs;
|
|
8
|
-
|
|
9
|
-
builder.read(normal);
|
|
10
|
-
builder.read(albedo);
|
|
11
|
-
builder.read(position);
|
|
12
|
-
|
|
13
|
-
const destination = builder.write(output);
|
|
14
|
-
|
|
15
|
-
return {
|
|
16
|
-
output: destination
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
execute(data, resources, render_context) {
|
|
21
|
-
// TODO implement
|
|
22
|
-
}
|
|
23
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../../../../../../src/engine/graphics/render/frame_graph/sample/deferred/run.js"],"names":[],"mappings":""}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { RenderGraph } from "../../RenderGraph.js";
|
|
2
|
-
import { TextureResourceDescriptor } from "../../resource/TextureResourceDescriptor.js";
|
|
3
|
-
import { WebGLRenderContext } from "../../webgl/WebGLRenderContext.js";
|
|
4
|
-
import { GBufferDrawPass } from "./GBufferDrawPass.js";
|
|
5
|
-
import { LightingPass } from "./LightingPass.js";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const graph = new RenderGraph();
|
|
9
|
-
|
|
10
|
-
const back_buffer_id = graph.import_resource("Backbuffer", new TextureResourceDescriptor(), "");
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const p_g = new GBufferDrawPass();
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const g_buffer = graph.add(p_g);
|
|
17
|
-
|
|
18
|
-
const p_p = new LightingPass({
|
|
19
|
-
normal: g_buffer.normal,
|
|
20
|
-
albedo: g_buffer.albedo,
|
|
21
|
-
position: g_buffer.position,
|
|
22
|
-
output: back_buffer_id
|
|
23
|
-
});
|
|
24
|
-
graph.add(p_p);
|
|
25
|
-
|
|
26
|
-
function makeContext() {
|
|
27
|
-
const canvas = document.createElement('canvas');
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
canvas.width = 800;
|
|
31
|
-
canvas.height = 600;
|
|
32
|
-
|
|
33
|
-
document.body.appendChild(canvas);
|
|
34
|
-
|
|
35
|
-
const ctx = canvas.getContext("webgl2");
|
|
36
|
-
|
|
37
|
-
return new WebGLRenderContext(ctx);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
const ctx = makeContext();
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
graph.compile();
|
|
44
|
-
console.log(graph.exportToDot());
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
function render() {
|
|
48
|
-
graph.compile();
|
|
49
|
-
|
|
50
|
-
graph.execute(ctx);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
function update() {
|
|
54
|
-
requestAnimationFrame(update);
|
|
55
|
-
|
|
56
|
-
render();
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
update();
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @extends {RenderPass.<{color:number, depth:number}>}
|
|
3
|
-
*/
|
|
4
|
-
export class ColorDepthPass {
|
|
5
|
-
resolution: Vector2;
|
|
6
|
-
setup(builder: any): {
|
|
7
|
-
color: any;
|
|
8
|
-
depth: any;
|
|
9
|
-
};
|
|
10
|
-
execute(data: any, resources: any, render_context: any): void;
|
|
11
|
-
}
|
|
12
|
-
import Vector2 from "../../../../../../core/geom/Vector2.js";
|
|
13
|
-
//# sourceMappingURL=ColorDepthPass.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ColorDepthPass.d.ts","sourceRoot":"","sources":["../../../../../../../../src/engine/graphics/render/frame_graph/sample/meep-v1/ColorDepthPass.js"],"names":[],"mappings":"AAKA;;GAEG;AACH;IACI,oBAAoC;IAEpC;;;MAuBC;IAED,8DAGC;CACJ;oBAvCmB,wCAAwC"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { BinaryDataType } from "../../../../../../core/binary/type/BinaryDataType.js";
|
|
2
|
-
import Vector2 from "../../../../../../core/geom/Vector2.js";
|
|
3
|
-
import { RenderPass } from "../../RenderPass.js";
|
|
4
|
-
import { TextureResourceDescriptor } from "../../resource/TextureResourceDescriptor.js";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @extends {RenderPass.<{color:number, depth:number}>}
|
|
8
|
-
*/
|
|
9
|
-
export class ColorDepthPass extends RenderPass {
|
|
10
|
-
resolution = new Vector2(1024, 724);
|
|
11
|
-
|
|
12
|
-
setup(builder) {
|
|
13
|
-
const color = builder.create("Color", TextureResourceDescriptor.from({
|
|
14
|
-
width: this.resolution.x,
|
|
15
|
-
height: this.resolution.y,
|
|
16
|
-
format: BinaryDataType.Uint8,
|
|
17
|
-
channel_count: 4
|
|
18
|
-
}));
|
|
19
|
-
|
|
20
|
-
builder.write(color);
|
|
21
|
-
|
|
22
|
-
const depth = builder.create("Depth", TextureResourceDescriptor.from({
|
|
23
|
-
width: this.resolution.x,
|
|
24
|
-
height: this.resolution.y,
|
|
25
|
-
format: BinaryDataType.Float32,
|
|
26
|
-
channel_count: 4
|
|
27
|
-
}));
|
|
28
|
-
|
|
29
|
-
builder.write(depth);
|
|
30
|
-
|
|
31
|
-
return {
|
|
32
|
-
color,
|
|
33
|
-
depth
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
execute(data, resources, render_context) {
|
|
38
|
-
const color_texture = resources.get(data.color);
|
|
39
|
-
const depth_texture = resources.get(data.depth);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OutlinePass.d.ts","sourceRoot":"","sources":["../../../../../../../../src/engine/graphics/render/frame_graph/sample/meep-v1/OutlinePass.js"],"names":[],"mappings":"AAEA;;IACI,0BAKC;CACJ;2BAT0B,qBAAqB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SSAOPass.d.ts","sourceRoot":"","sources":["../../../../../../../../src/engine/graphics/render/frame_graph/sample/meep-v1/SSAOPass.js"],"names":[],"mappings":"AAEA;;CAEC;2BAJ0B,qBAAqB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../../../../../../../src/engine/graphics/render/frame_graph/sample/meep-v1/render.js"],"names":[],"mappings":"AAEA,+BAIC"}
|