@woosh/meep-engine 2.117.17 → 2.117.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.
Files changed (34) hide show
  1. package/package.json +1 -1
  2. package/src/engine/graphics/render/frame_graph/RenderGraph.d.ts +6 -9
  3. package/src/engine/graphics/render/frame_graph/RenderGraph.d.ts.map +1 -1
  4. package/src/engine/graphics/render/frame_graph/RenderGraph.js +17 -23
  5. package/src/engine/graphics/render/frame_graph/RenderPass.d.ts +50 -10
  6. package/src/engine/graphics/render/frame_graph/RenderPass.d.ts.map +1 -1
  7. package/src/engine/graphics/render/frame_graph/RenderPass.js +1 -0
  8. package/src/engine/graphics/render/frame_graph/RenderPassNode.d.ts +2 -2
  9. package/src/engine/graphics/render/frame_graph/RenderPassNode.d.ts.map +1 -1
  10. package/src/engine/graphics/render/frame_graph/RenderPassNode.js +4 -2
  11. package/src/engine/graphics/render/frame_graph/sample/deferred/CopyPass.d.ts +0 -9
  12. package/src/engine/graphics/render/frame_graph/sample/deferred/CopyPass.d.ts.map +0 -1
  13. package/src/engine/graphics/render/frame_graph/sample/deferred/CopyPass.js +0 -21
  14. package/src/engine/graphics/render/frame_graph/sample/deferred/GBufferDrawPass.d.ts +0 -11
  15. package/src/engine/graphics/render/frame_graph/sample/deferred/GBufferDrawPass.d.ts.map +0 -1
  16. package/src/engine/graphics/render/frame_graph/sample/deferred/GBufferDrawPass.js +0 -33
  17. package/src/engine/graphics/render/frame_graph/sample/deferred/LightingPass.d.ts +0 -9
  18. package/src/engine/graphics/render/frame_graph/sample/deferred/LightingPass.d.ts.map +0 -1
  19. package/src/engine/graphics/render/frame_graph/sample/deferred/LightingPass.js +0 -23
  20. package/src/engine/graphics/render/frame_graph/sample/deferred/run.d.ts +0 -2
  21. package/src/engine/graphics/render/frame_graph/sample/deferred/run.d.ts.map +0 -1
  22. package/src/engine/graphics/render/frame_graph/sample/deferred/run.js +0 -59
  23. package/src/engine/graphics/render/frame_graph/sample/meep-v1/ColorDepthPass.d.ts +0 -13
  24. package/src/engine/graphics/render/frame_graph/sample/meep-v1/ColorDepthPass.d.ts.map +0 -1
  25. package/src/engine/graphics/render/frame_graph/sample/meep-v1/ColorDepthPass.js +0 -41
  26. package/src/engine/graphics/render/frame_graph/sample/meep-v1/OutlinePass.d.ts +0 -6
  27. package/src/engine/graphics/render/frame_graph/sample/meep-v1/OutlinePass.d.ts.map +0 -1
  28. package/src/engine/graphics/render/frame_graph/sample/meep-v1/OutlinePass.js +0 -10
  29. package/src/engine/graphics/render/frame_graph/sample/meep-v1/SSAOPass.d.ts +0 -5
  30. package/src/engine/graphics/render/frame_graph/sample/meep-v1/SSAOPass.d.ts.map +0 -1
  31. package/src/engine/graphics/render/frame_graph/sample/meep-v1/SSAOPass.js +0 -5
  32. package/src/engine/graphics/render/frame_graph/sample/meep-v1/render.d.ts +0 -2
  33. package/src/engine/graphics/render/frame_graph/sample/meep-v1/render.d.ts.map +0 -1
  34. package/src/engine/graphics/render/frame_graph/sample/meep-v1/render.js +0 -7
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "description": "Fully featured ECS game engine written in JavaScript",
6
6
  "type": "module",
7
7
  "author": "Alexander Goldring",
8
- "version": "2.117.17",
8
+ "version": "2.117.18",
9
9
  "main": "build/meep.module.js",
10
10
  "module": "build/meep.module.js",
11
11
  "exports": {
@@ -14,12 +14,6 @@ export class RenderGraph {
14
14
  * @type {string}
15
15
  */
16
16
  name: string;
17
- /**
18
- *
19
- * @type {RenderPass[]}
20
- * @private
21
- */
22
- private __passes;
23
17
  /**
24
18
  *
25
19
  * @type {RenderPassNode[]}
@@ -98,10 +92,12 @@ export class RenderGraph {
98
92
  is_valid_resource(id: any): boolean;
99
93
  /**
100
94
  * @template T
101
- * @param {RenderPass<T>} pass
102
- * @returns {T} resources/handles returned by {@link RenderPass#setup}
95
+ * @param {string} name
96
+ * @param {T} data
97
+ * @param {function(data:T, resources: RenderPassResources, context:IRenderContext):void} execute
98
+ * @returns {RenderGraphBuilder}
103
99
  */
104
- add<T_3>(pass: RenderPass<T_3>): T_3;
100
+ add<T_3>(name: string, data: T_3, execute: any): RenderGraphBuilder;
105
101
  /**
106
102
  * Perform validation, useful for debugging
107
103
  * Typically done before compilation
@@ -124,4 +120,5 @@ export class RenderGraph {
124
120
  }
125
121
  import { ResourceEntry } from "./ResourceEntry.js";
126
122
  import { ResourceNode } from "./ResourceNode.js";
123
+ import { RenderGraphBuilder } from "./RenderGraphBuilder.js";
127
124
  //# sourceMappingURL=RenderGraph.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"RenderGraph.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/render/frame_graph/RenderGraph.js"],"names":[],"mappings":"AAQA;;;GAGG;AACH;IAoCI;;;OAGG;IACH,mBAFW,MAAM,EAOhB;IA5CD;;;;OAIG;IACH,MAFU,MAAM,CAEN;IAEV;;;;OAIG;IACH,iBAAc;IAEd;;;;OAIG;IACH,qBAAkB;IAElB;;;;OAIG;IACH,yBAAsB;IAEtB;;;;OAIG;IACH,4BAAyB;IAazB;;;;OAIG;IACH,qBAHW,MAAM,sBAahB;IAED;;;;OAIG;IACH,oBAHW,MAAM,qBAmBhB;IAED;;;;OAIG;IACH,qBAHW,MAAM,KAKhB;IAED;;;;OAIG;IACH,2BAHW,MAAM,2BAWhB;IAED;;;;;OAKG;IACH,6BAYC;IAED;;;;;;OAMG;IACH,4BAeC;IAED;;;;OAIG;IACH,oBAHW,MAAM,GACJ,MAAM,CAkBlB;IAED;;;;;;OAMG;IACH,2BALW,MAAM,wDAGJ,MAAM,CAUlB;IAED;;;OAGG;IACH,4BAHa,OAAO,CAQnB;IAED;;;;OAIG;IACH,qCA0BC;IAED;;;;;;OAMG;IACH,iEAFa,OAAO,CAOnB;IAED,gBA6FC;IAED;;;OAGG;IACH,uCA2CC;IAED;;;OAGG;IACH,eAFY,MAAM,CAiEjB;CACJ;8BAxd6B,oBAAoB;6BACrB,mBAAmB"}
1
+ {"version":3,"file":"RenderGraph.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/render/frame_graph/RenderGraph.js"],"names":[],"mappings":"AAQA;;;GAGG;AACH;IA6BI;;;OAGG;IACH,mBAFW,MAAM,EAOhB;IArCD;;;;OAIG;IACH,MAFU,MAAM,CAEN;IAEV;;;;OAIG;IACH,qBAAkB;IAElB;;;;OAIG;IACH,yBAAsB;IAEtB;;;;OAIG;IACH,4BAAyB;IAazB;;;;OAIG;IACH,qBAHW,MAAM,sBAahB;IAED;;;;OAIG;IACH,oBAHW,MAAM,qBAmBhB;IAED;;;;OAIG;IACH,qBAHW,MAAM,KAKhB;IAED;;;;OAIG;IACH,2BAHW,MAAM,2BAWhB;IAED;;;;;OAKG;IACH,6BAYC;IAED;;;;;;OAMG;IACH,4BAeC;IAED;;;;OAIG;IACH,oBAHW,MAAM,GACJ,MAAM,CAkBlB;IAED;;;;;;OAMG;IACH,2BALW,MAAM,wDAGJ,MAAM,CAUlB;IAED;;;OAGG;IACH,4BAHa,OAAO,CAQnB;IAED;;;;;;OAMG;IACH,eALW,MAAM,4BAGJ,kBAAkB,CA2B9B;IAED;;;;;;OAMG;IACH,iEAFa,OAAO,CAOnB;IAED,gBA6FC;IAED;;;OAGG;IACH,uCA2CC;IAED;;;OAGG;IACH,eAFY,MAAM,CAiEjB;CACJ;8BAld6B,oBAAoB;6BACrB,mBAAmB;mCAJb,yBAAyB"}
@@ -18,13 +18,6 @@ export class RenderGraph {
18
18
  */
19
19
  name = "";
20
20
 
21
- /**
22
- *
23
- * @type {RenderPass[]}
24
- * @private
25
- */
26
- __passes = [];
27
-
28
21
  /**
29
22
  *
30
23
  * @type {RenderPassNode[]}
@@ -218,10 +211,19 @@ export class RenderGraph {
218
211
 
219
212
  /**
220
213
  * @template T
221
- * @param {RenderPass<T>} pass
222
- * @returns {T} resources/handles returned by {@link RenderPass#setup}
214
+ * @param {string} name
215
+ * @param {T} data
216
+ * @param {function(data:T, resources: RenderPassResources, context:IRenderContext):void} execute
217
+ * @returns {RenderGraphBuilder}
223
218
  */
224
- add(pass) {
219
+ add(name, data, execute) {
220
+ assert.isString(name, 'name');
221
+
222
+ assert.defined(data, 'data');
223
+ assert.notNull(data, 'data');
224
+ assert.isObject(data, 'data');
225
+
226
+ assert.isFunction(execute, 'execute');
225
227
 
226
228
  const pass_nodes = this.__pass_nodes;
227
229
 
@@ -229,24 +231,16 @@ export class RenderGraph {
229
231
  const node = new RenderPassNode();
230
232
 
231
233
  node.id = pass_nodes.length;
232
- node.name = pass.name;
233
- node.pass = pass;
234
+ node.name = name;
235
+ node.execute = execute;
234
236
 
235
237
  pass_nodes.push(node);
236
238
 
237
239
  builder.init(this, node);
238
240
 
239
- const result = pass.setup(builder);
240
-
241
- assert.defined(result, 'result');
242
- assert.notNull(result, 'result');
243
- assert.isObject(result, 'result');
244
-
245
- this.__passes.push(pass);
246
-
247
- node.data = result;
241
+ node.data = data;
248
242
 
249
- return result;
243
+ return builder;
250
244
  }
251
245
 
252
246
  /**
@@ -389,7 +383,7 @@ export class RenderGraph {
389
383
  resources.init(this, node);
390
384
 
391
385
  // execute pass
392
- node.pass.execute(node.data, resources, context);
386
+ node.execute(node.data, resources, context);
393
387
 
394
388
  const resource_entries = this.__resource_registry;
395
389
  const resource_entry_count = resource_entries.length;
@@ -1,10 +1,50 @@
1
- export class RenderPass<DATA extends { [key: string]: number }> {
2
-
3
- name: string
4
-
5
- setup(builder: RenderGraphBuilder): DATA
6
-
7
- execute(data: DATA, resource: RenderPassResources, render_context: IRenderContext): void
8
-
9
- validate(problem_consumer: (string) => any): boolean
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;;;GAGG;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
+ {"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,6 +1,7 @@
1
1
  const DEFAULT_FLAGS = 0;
2
2
 
3
3
  /**
4
+ * @deprecated new syntax does not require a separate data structure, use lambda functions instead
4
5
  * @template [DATA=Object<number>]
5
6
  * @class
6
7
  */
@@ -1,9 +1,9 @@
1
1
  export class RenderPassNode extends GraphNode {
2
2
  /**
3
3
  *
4
- * @type {RenderPass|null}
4
+ * @type {Function}
5
5
  */
6
- pass: RenderPass | null;
6
+ execute: Function;
7
7
  /**
8
8
  *
9
9
  * @type {boolean}
@@ -1 +1 @@
1
- {"version":3,"file":"RenderPassNode.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/render/frame_graph/RenderPassNode.js"],"names":[],"mappings":"AAGA;IACI;;;OAGG;IACH,MAFU,aAAW,IAAI,CAEb;IAEZ;;;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;0BAtGyB,gBAAgB"}
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 {RenderPass|null}
9
+ * @type {Function}
8
10
  */
9
- pass = null;
11
+ execute = noop
10
12
 
11
13
  /**
12
14
  *
@@ -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,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=run.d.ts.map
@@ -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,6 +0,0 @@
1
- export class OutlinePass extends RenderPass<any> {
2
- constructor();
3
- setup(builder: any): void;
4
- }
5
- import { RenderPass } from "../../RenderPass.js";
6
- //# sourceMappingURL=OutlinePass.d.ts.map
@@ -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,10 +0,0 @@
1
- import { RenderPass } from "../../RenderPass.js";
2
-
3
- export class OutlinePass extends RenderPass {
4
- setup(builder) {
5
- const { depth } = this.inputs;
6
- const depth_source = builder.read(depth);
7
-
8
-
9
- }
10
- }
@@ -1,5 +0,0 @@
1
- export class SSAOPass extends RenderPass<any> {
2
- constructor();
3
- }
4
- import { RenderPass } from "../../RenderPass.js";
5
- //# sourceMappingURL=SSAOPass.d.ts.map
@@ -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,5 +0,0 @@
1
- import { RenderPass } from "../../RenderPass.js";
2
-
3
- export class SSAOPass extends RenderPass {
4
-
5
- }
@@ -1,2 +0,0 @@
1
- export function render(): void;
2
- //# sourceMappingURL=render.d.ts.map
@@ -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"}
@@ -1,7 +0,0 @@
1
- import { ColorDepthPass } from "./ColorDepthPass.js";
2
-
3
- export function render() {
4
- const pass_g_buffer = new ColorDepthPass();
5
-
6
-
7
- }