@babylonjs/smart-filters 0.3.8-alpha → 0.3.10-alpha

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 (45) hide show
  1. package/dist/blocks/outputBlock.d.ts +4 -6
  2. package/dist/blocks/outputBlock.d.ts.map +1 -1
  3. package/dist/blocks/outputBlock.js +29 -24
  4. package/dist/blocks/outputBlock.js.map +1 -1
  5. package/dist/blocks/{copyBlock.shader.d.ts → outputBlock.shader.d.ts} +1 -1
  6. package/dist/blocks/outputBlock.shader.d.ts.map +1 -0
  7. package/dist/blocks/{copyBlock.shader.js → outputBlock.shader.js} +1 -1
  8. package/dist/blocks/outputBlock.shader.js.map +1 -0
  9. package/dist/blocks/shaderBlock.js +3 -3
  10. package/dist/blocks/shaderBlock.js.map +1 -1
  11. package/dist/connection/connectionPoint.d.ts.map +1 -1
  12. package/dist/connection/connectionPoint.js +2 -1
  13. package/dist/connection/connectionPoint.js.map +1 -1
  14. package/dist/index.d.ts +0 -1
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.js +0 -1
  17. package/dist/index.js.map +1 -1
  18. package/dist/runtime/renderTargetGenerator.d.ts.map +1 -1
  19. package/dist/runtime/renderTargetGenerator.js +3 -5
  20. package/dist/runtime/renderTargetGenerator.js.map +1 -1
  21. package/dist/smartFilter.d.ts +5 -0
  22. package/dist/smartFilter.d.ts.map +1 -1
  23. package/dist/smartFilter.js +3 -0
  24. package/dist/smartFilter.js.map +1 -1
  25. package/dist/utils/renderTargetUtils.d.ts +7 -7
  26. package/dist/utils/renderTargetUtils.d.ts.map +1 -1
  27. package/dist/utils/renderTargetUtils.js +8 -9
  28. package/dist/utils/renderTargetUtils.js.map +1 -1
  29. package/package.json +1 -1
  30. package/src/blocks/outputBlock.ts +37 -30
  31. package/src/blocks/shaderBlock.ts +3 -3
  32. package/src/connection/connectionPoint.ts +3 -1
  33. package/src/index.ts +0 -1
  34. package/src/runtime/renderTargetGenerator.ts +3 -4
  35. package/src/smartFilter.ts +12 -0
  36. package/src/utils/renderTargetUtils.ts +9 -10
  37. package/dist/blocks/copyBlock.d.ts +0 -57
  38. package/dist/blocks/copyBlock.d.ts.map +0 -1
  39. package/dist/blocks/copyBlock.js +0 -64
  40. package/dist/blocks/copyBlock.js.map +0 -1
  41. package/dist/blocks/copyBlock.shader.d.ts.map +0 -1
  42. package/dist/blocks/copyBlock.shader.js.map +0 -1
  43. package/src/blocks/copyBlock.ts +0 -77
  44. /package/src/blocks/{copyBlock.fragment.glsl → outputBlock.fragment.glsl} +0 -0
  45. /package/src/blocks/{copyBlock.shader.ts → outputBlock.shader.ts} +0 -0
@@ -2,7 +2,7 @@ import type { InitializationData, SmartFilter } from "../smartFilter";
2
2
  import { ConnectionPointType } from "../connection/connectionPointType.js";
3
3
  import { BaseBlock } from "./baseBlock.js";
4
4
  import type { Nullable } from "@babylonjs/core/types";
5
- import type { ThinRenderTargetTexture } from "@babylonjs/core/Materials/Textures/thinRenderTargetTexture";
5
+ import type { RenderTargetWrapper } from "@babylonjs/core/Engines/renderTargetWrapper";
6
6
  /**
7
7
  * The output block of a smart filter.
8
8
  *
@@ -18,19 +18,17 @@ export declare class OutputBlock extends BaseBlock {
18
18
  * Input connection point of the output block.
19
19
  * This takes a texture as input.
20
20
  */
21
- readonly input: import("..").ConnectionPoint<ConnectionPointType.Texture>;
21
+ readonly input: import("../connection/connectionPoint").ConnectionPoint<ConnectionPointType.Texture>;
22
22
  /**
23
- * If supplied, the Smart Filter will render into this texture. Otherwise, it renders
23
+ * If supplied, the Smart Filter will render into this RenderTargetWrapper. Otherwise, it renders
24
24
  * into the the canvas or WebGL context the ThinEngine is using for rendering.
25
25
  */
26
- renderTargetTexture: Nullable<ThinRenderTargetTexture>;
27
- private _copyBlock;
26
+ renderTargetWrapper: Nullable<RenderTargetWrapper>;
28
27
  /**
29
28
  * Create a new output block.
30
29
  * @param smartFilter - The smart filter this block belongs to
31
30
  */
32
31
  constructor(smartFilter: SmartFilter);
33
- private _getCopyBlock;
34
32
  /**
35
33
  * Prepares all blocks for runtime by traversing the graph.
36
34
  */
@@ -1 +1 @@
1
- {"version":3,"file":"outputBlock.d.ts","sourceRoot":"","sources":["../../src/blocks/outputBlock.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAG3C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,4DAA4D,CAAC;AAG1G;;;;;GAKG;AACH,qBAAa,WAAY,SAAQ,SAAS;IACtC;;OAEG;IACH,OAAuB,SAAS,SAAiB;IAEjD;;;OAGG;IACH,SAAgB,KAAK,4DAA6D;IAElF;;;OAGG;IACI,mBAAmB,EAAE,QAAQ,CAAC,uBAAuB,CAAC,CAAQ;IAErE,OAAO,CAAC,UAAU,CAAmB;IAErC;;;OAGG;gBACS,WAAW,EAAE,WAAW;IAMpC,OAAO,CAAC,aAAa;IASrB;;OAEG;IACa,iBAAiB,IAAI,IAAI;IAQzC;;OAEG;IACa,oBAAoB,IAAI,IAAI;IAQ5C;;;;OAIG;IACa,qCAAqC,CACjD,kBAAkB,EAAE,kBAAkB,EACtC,WAAW,EAAE,OAAO,GACrB,IAAI;CA0BV"}
1
+ {"version":3,"file":"outputBlock.d.ts","sourceRoot":"","sources":["../../src/blocks/outputBlock.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAC;AAMvF;;;;;GAKG;AACH,qBAAa,WAAY,SAAQ,SAAS;IACtC;;OAEG;IACH,OAAuB,SAAS,SAAiB;IAEjD;;;OAGG;IACH,SAAgB,KAAK,uFAA6D;IAElF;;;OAGG;IACI,mBAAmB,EAAE,QAAQ,CAAC,mBAAmB,CAAC,CAAQ;IAEjE;;;OAGG;gBACS,WAAW,EAAE,WAAW;IAIpC;;OAEG;IACa,iBAAiB,IAAI,IAAI;IAQzC;;OAEG;IACa,oBAAoB,IAAI,IAAI;IAQ5C;;;;OAIG;IACa,qCAAqC,CACjD,kBAAkB,EAAE,kBAAkB,EACtC,WAAW,EAAE,OAAO,GACrB,IAAI;CAmBV"}
@@ -1,8 +1,8 @@
1
1
  import { ConnectionPointType } from "../connection/connectionPointType.js";
2
2
  import { BaseBlock } from "./baseBlock.js";
3
- import { CopyBlock } from "./copyBlock.js";
4
- import { ShaderRuntime } from "../runtime/shaderRuntime.js";
3
+ import { Binding, ShaderRuntime } from "../runtime/shaderRuntime.js";
5
4
  import { registerFinalRenderCommand } from "../utils/renderTargetUtils.js";
5
+ import { shaderProgram, uniforms } from "./outputBlock.shader.js";
6
6
  /**
7
7
  * The output block of a smart filter.
8
8
  *
@@ -22,18 +22,10 @@ export class OutputBlock extends BaseBlock {
22
22
  */
23
23
  this.input = this._registerInput("input", ConnectionPointType.Texture);
24
24
  /**
25
- * If supplied, the Smart Filter will render into this texture. Otherwise, it renders
25
+ * If supplied, the Smart Filter will render into this RenderTargetWrapper. Otherwise, it renders
26
26
  * into the the canvas or WebGL context the ThinEngine is using for rendering.
27
27
  */
28
- this.renderTargetTexture = null;
29
- this._copyBlock = null;
30
- }
31
- _getCopyBlock() {
32
- if (!this._copyBlock) {
33
- this._copyBlock = new CopyBlock(this.smartFilter, "CopyToOutputBlock");
34
- }
35
- this._copyBlock.input.runtimeData = this.input.runtimeData;
36
- return this._copyBlock;
28
+ this.renderTargetWrapper = null;
37
29
  }
38
30
  /**
39
31
  * Prepares all blocks for runtime by traversing the graph.
@@ -63,27 +55,40 @@ export class OutputBlock extends BaseBlock {
63
55
  generateCommandsAndGatherInitPromises(initializationData, finalOutput) {
64
56
  var _a;
65
57
  // In the case that this OutputBlock is directly connected to a texture InputBlock, we must
66
- // insert a CopyBlock to copy the texture to the render target texture.
67
- if ((_a = this.input.connectedTo) === null || _a === void 0 ? void 0 : _a.ownerBlock.isInput) {
68
- const copyBlock = this._getCopyBlock();
58
+ // use a shader to copy the texture to the render target texture.
59
+ if (((_a = this.input.connectedTo) === null || _a === void 0 ? void 0 : _a.ownerBlock.isInput) && this.input.runtimeData) {
69
60
  const runtime = initializationData.runtime;
70
- const shaderBlockRuntime = new ShaderRuntime(runtime.effectRenderer, copyBlock.getShaderProgram(), copyBlock.getShaderBinding());
61
+ const shaderBlockRuntime = new ShaderRuntime(runtime.effectRenderer, shaderProgram, new OutputShaderBinding(this.input.runtimeData));
71
62
  initializationData.initializationPromises.push(shaderBlockRuntime.onReadyAsync);
72
63
  runtime.registerResource(shaderBlockRuntime);
73
- registerFinalRenderCommand(this.renderTargetTexture, runtime, this, shaderBlockRuntime);
64
+ registerFinalRenderCommand(this.renderTargetWrapper, runtime, this, shaderBlockRuntime);
74
65
  super.generateCommandsAndGatherInitPromises(initializationData, finalOutput);
75
66
  }
76
- else {
77
- // We aren't connected to an input block, remove our copy block if we have one.
78
- if (this._copyBlock) {
79
- this.smartFilter.removeBlock(this._copyBlock);
80
- this._copyBlock = null;
81
- }
82
- }
83
67
  }
84
68
  }
85
69
  /**
86
70
  * The class name of the block.
87
71
  */
88
72
  OutputBlock.ClassName = "OutputBlock";
73
+ /**
74
+ * Shader binding to use when the OutputBlock is directly connected to a texture InputBlock.
75
+ */
76
+ class OutputShaderBinding extends Binding {
77
+ /**
78
+ * Creates a new shader binding instance.
79
+ * @param inputTexture - defines the input texture to copy
80
+ */
81
+ constructor(inputTexture) {
82
+ super();
83
+ this._inputTexture = inputTexture;
84
+ }
85
+ /**
86
+ * Binds all the required data to the shader when rendering.
87
+ * @param effect - defines the effect to bind the data to
88
+ * @internal
89
+ */
90
+ bind(effect) {
91
+ effect.setTexture(this.getRemappedName(uniforms.input), this._inputTexture.value);
92
+ }
93
+ }
89
94
  //# sourceMappingURL=outputBlock.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"outputBlock.js","sourceRoot":"","sources":["../../src/blocks/outputBlock.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAG5D,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAE3E;;;;;GAKG;AACH,MAAM,OAAO,WAAY,SAAQ,SAAS;IAoBtC;;;OAGG;IACH,YAAY,WAAwB;QAChC,KAAK,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;QAnBjC;;;WAGG;QACa,UAAK,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,mBAAmB,CAAC,OAAO,CAAC,CAAC;QAElF;;;WAGG;QACI,wBAAmB,GAAsC,IAAI,CAAC;QAWjE,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;IAC3B,CAAC;IAEO,aAAa;QACjB,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC;YACnB,IAAI,CAAC,UAAU,GAAG,IAAI,SAAS,CAAC,IAAI,CAAC,WAAW,EAAE,mBAAmB,CAAC,CAAC;QAC3E,CAAC;QACD,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC;QAE3D,OAAO,IAAI,CAAC,UAAU,CAAC;IAC3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AAC,KAAK,CAAC,CAAC;IACtF,CAAC;CACJ"}
@@ -10,4 +10,4 @@ export declare const shaderProgram: ShaderProgram;
10
10
  export declare const uniforms: {
11
11
  input: string;
12
12
  };
13
- //# sourceMappingURL=copyBlock.shader.d.ts.map
13
+ //# sourceMappingURL=outputBlock.shader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"outputBlock.shader.d.ts","sourceRoot":"","sources":["../../src/blocks/outputBlock.shader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,aAsB3B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,QAAQ;;CAEpB,CAAC"}
@@ -31,4 +31,4 @@ export const shaderProgram = {
31
31
  export const uniforms = {
32
32
  input: "input",
33
33
  };
34
- //# sourceMappingURL=copyBlock.shader.js.map
34
+ //# sourceMappingURL=outputBlock.shader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"outputBlock.shader.js","sourceRoot":"","sources":["../../src/blocks/outputBlock.shader.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAkB;IACxC,MAAM,EAAE,SAAS;IACjB,QAAQ,EAAE;QACN,OAAO,EAAE;;qCAEoB;QAC7B,gBAAgB,EAAE,SAAS;QAC3B,gBAAgB,EAAE,QAAQ;QAC1B,SAAS,EAAE;YACP;gBACI,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE;;;;;;;qBAOD;aACR;SACJ;KACJ;CACJ,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG;IACpB,KAAK,EAAE,OAAO;CACjB,CAAC"}
@@ -4,7 +4,7 @@ import { ConnectionPointType } from "../connection/connectionPointType.js";
4
4
  import { createCommand } from "../command/command.js";
5
5
  import { DisableableBlock } from "./disableableBlock.js";
6
6
  import { undecorateSymbol } from "../utils/shaderCodeUtils.js";
7
- import { getRenderTarget, registerFinalRenderCommand } from "../utils/renderTargetUtils.js";
7
+ import { getRenderTargetWrapper, registerFinalRenderCommand } from "../utils/renderTargetUtils.js";
8
8
  /**
9
9
  * This is the base class for all shader blocks.
10
10
  *
@@ -80,10 +80,10 @@ export class ShaderBlock extends DisableableBlock {
80
80
  initializationData.initializationPromises.push(shaderBlockRuntime.onReadyAsync);
81
81
  runtime.registerResource(shaderBlockRuntime);
82
82
  if (finalOutput) {
83
- registerFinalRenderCommand(initializationData.outputBlock.renderTargetTexture, runtime, this, shaderBlockRuntime);
83
+ registerFinalRenderCommand(initializationData.outputBlock.renderTargetWrapper, runtime, this, shaderBlockRuntime);
84
84
  }
85
85
  else {
86
- const renderTarget = getRenderTarget((_a = this.output.runtimeData) === null || _a === void 0 ? void 0 : _a.value, this.getClassName());
86
+ const renderTarget = getRenderTargetWrapper((_a = this.output.runtimeData) === null || _a === void 0 ? void 0 : _a.value, this.getClassName());
87
87
  runtime.registerCommand(createCommand(`${this.getClassName()}.render`, this, () => {
88
88
  shaderBlockRuntime.renderToTexture(renderTarget);
89
89
  }));
@@ -1 +1 @@
1
- {"version":3,"file":"shaderBlock.js","sourceRoot":"","sources":["../../src/blocks/shaderBlock.ts"],"names":[],"mappings":"AACA,OAAO,2DAA2D,CAAC;AAMnE,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAE5F;;;;;;GAMG;AACH,MAAM,OAAgB,WAAY,SAAQ,gBAAgB;IAyBtD;;OAEG;IACH,IAAW,YAA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,CAAC,CAAC,CAAC,CAErD;IAED;;;;;OAKG;IACH,IAAW,SAAS,IAAI,aAAa,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAExD;IAED;;;;OAIG;IACI,uBAAuB,CAAC,KAAK,EAAE,eAAe,CAAC,CAAC,CAAC,GAAG,iCAAiC;IAwB5F;;;;OAIG;IACI,YAAY,CAAC,eAAe,EAAE,eAAe,CAAC,CAAC,CAAC;IAIvD;;;;OAIG;IACI,SAAS,CAAC,KAAK,EAAE,eAAe,CAAC,CAAC,CAAC,GAAG,IAAI;IAmBjD;;;OAGG;IACI,cAAc,CAAC,QAAQ,EAAE,eAAe,CAAC,CAAC,CAAC,GAAG,IAAI;IAczD;;OAEG;IACI,sBAAsB,IAAI,IAAI;IAQrC;;OAEG;IACI,oBAAoB,IAAI,IAAI;CAStC"}
@@ -125,8 +125,9 @@ export class ConnectionPoint {
125
125
  }
126
126
  // Remove the connection point from the list of endpoints
127
127
  this._endpoints.splice(index, 1);
128
- // Empty at the same time the connectedTo property of the other connection point
128
+ // Connections are double-linked - remove the reference back to this connection point from the one we just disconnected from
129
129
  endpoint._connectedTo = null;
130
+ endpoint.runtimeData = null;
130
131
  }
131
132
  /**
132
133
  * Disconnects this point from all its endpoints.
@@ -1 +1 @@
1
- {"version":3,"file":"connectionPoint.js","sourceRoot":"","sources":["../../src/connection/connectionPoint.ts"],"names":[],"mappings":"AACA,OAAO,EACH,iCAAiC,EACjC,4BAA4B,GAC/B,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAUzE;;;;;;;;;GASG;AACH,MAAM,OAAO,eAAe;IA0CxB;;;;;;;OAOG;IACH,YACI,IAAY,EACZ,UAAqB,EACrB,IAAO,EACP,SAAmC,EACnC,qBAA+C,IAAI;QAjCvD;;WAEG;QACI,gBAAW,GAAqB,IAAI,CAAC;QAE5C;;;;WAIG;QACI,gBAAW,GAA6B,IAAI,CAAC;QAEpD;;WAE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AAC,KAAK,CAAC,CAAC;QAC5B,+EAA+E;QAC/E,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC;IAC9B,CAAC;IAED;;;OAGG;IACI,cAAc,CAAC,QAA4B;QAC9C,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QAChD,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE,CAAC;YACf,OAAO;QACX,CAAC;QAED,yDAAyD;QACzD,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QAEjC,4HAA4H;QAC5H,QAAQ,CAAC,YAAY,GAAG,IAAI,CAAC;QAC7B,QAAQ,CAAC,WAAW,GAAG,IAAI,CAAC;IAChC,CAAC;IAED;;OAEG;IACI,sBAAsB;QACzB,iBAAiB;QACjB,IAAI,QAAwC,CAAC;QAC7C,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YACrC,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;QAClC,CAAC;IACL,CAAC;IAED;;OAEG;IACI,oBAAoB;QACvB,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;YACpB,IAAI,CAAC,WAAW,GAAG,EAAoB,CAAC;QAC5C,CAAC;QAED,KAAK,MAAM,QAAQ,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACpC,QAAQ,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;QAC5C,CAAC;IACL,CAAC;CACJ"}
package/dist/index.d.ts CHANGED
@@ -15,7 +15,6 @@ export { InputBlock, type InputBlockEditorData } from "./blocks/inputBlock.js";
15
15
  export { type AnyInputBlock } from "./blocks/inputBlock.js";
16
16
  export { ShaderBlock } from "./blocks/shaderBlock.js";
17
17
  export { AggregateBlock } from "./blocks/aggregateBlock.js";
18
- export { CopyBlock } from "./blocks/copyBlock.js";
19
18
  export { ShaderBinding, ShaderRuntime } from "./runtime/shaderRuntime.js";
20
19
  export { type ShaderProgram, injectDisableUniform } from "./utils/shaderCodeUtils.js";
21
20
  export { type IDisableableBlock } from "./blocks/disableableBlock.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAEjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;AACpF,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAChF,OAAO,EACH,iCAAiC,EACjC,4BAA4B,GAC/B,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAEnE,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,KAAK,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC/E,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC1E,OAAO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AAM,wBAAwB,CAAC;AAC/E,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC1E,OAAO,EAAE,KAAK,aAAa,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AACtF,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEtE,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAC7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAE3E,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAC9E,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC"}
package/dist/index.js CHANGED
@@ -15,7 +15,6 @@ export { InputBlock } from "./blocks/inputBlock.js";
15
15
  export {} from "./blocks/inputBlock.js";
16
16
  export { ShaderBlock } from "./blocks/shaderBlock.js";
17
17
  export { AggregateBlock } from "./blocks/aggregateBlock.js";
18
- export { CopyBlock } from "./blocks/copyBlock.js";
19
18
  export { ShaderBinding, ShaderRuntime } from "./runtime/shaderRuntime.js";
20
19
  export { injectDisableUniform } from "./utils/shaderCodeUtils.js";
21
20
  export {} from "./blocks/disableableBlock.js";
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAkB,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,eAAe,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C,CAAC;AAC9E,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"renderTargetGenerator.d.ts","sourceRoot":"","sources":["../../src/runtime/renderTargetGenerator.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAqBtE;;GAEG;AACH,qBAAa,qBAAqB;IAC9B,OAAO,CAAC,SAAS,CAAU;IAC3B,OAAO,CAAC,iBAAiB,CAAsC;IAC/D,OAAO,CAAC,kBAAkB,CAAC;IAE3B;;;OAGG;gBACS,QAAQ,UAAO;IAM3B;;OAEG;IACH,IAAW,iBAAiB,WAE3B;IAED;;;;OAIG;IACI,iBAAiB,CAAC,WAAW,EAAE,WAAW,EAAE,kBAAkB,EAAE,kBAAkB;IAqDzF,OAAO,CAAC,qBAAqB;IAe7B,OAAO,CAAC,WAAW;IAgCnB,OAAO,CAAC,eAAe;IAoBvB;;;;;;OAMG;IACH,OAAO,CAAC,cAAc;CAyCzB"}
1
+ {"version":3,"file":"renderTargetGenerator.d.ts","sourceRoot":"","sources":["../../src/runtime/renderTargetGenerator.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAqBtE;;GAEG;AACH,qBAAa,qBAAqB;IAC9B,OAAO,CAAC,SAAS,CAAU;IAC3B,OAAO,CAAC,iBAAiB,CAAsC;IAC/D,OAAO,CAAC,kBAAkB,CAAC;IAE3B;;;OAGG;gBACS,QAAQ,UAAO;IAM3B;;OAEG;IACH,IAAW,iBAAiB,WAE3B;IAED;;;;OAIG;IACI,iBAAiB,CAAC,WAAW,EAAE,WAAW,EAAE,kBAAkB,EAAE,kBAAkB;IAqDzF,OAAO,CAAC,qBAAqB;IAe7B,OAAO,CAAC,WAAW;IAgCnB,OAAO,CAAC,eAAe;IAoBvB;;;;;;OAMG;IACH,OAAO,CAAC,cAAc;CAwCzB"}
@@ -129,7 +129,6 @@ export class RenderTargetGenerator {
129
129
  * @returns The render target texture
130
130
  */
131
131
  _createTexture(runtime, smartFilter, ratio) {
132
- var _a;
133
132
  const engine = runtime.engine;
134
133
  // We are only rendering full screen post process without depth or stencil information
135
134
  const setup = {
@@ -141,10 +140,9 @@ export class RenderTargetGenerator {
141
140
  // Get the smartFilter output size - either from the output block's renderTargetTexture or the engine's render size
142
141
  let outputWidth;
143
142
  let outputHeight;
144
- const renderTargetTextureSize = (_a = smartFilter.outputBlock.renderTargetTexture) === null || _a === void 0 ? void 0 : _a.getSize();
145
- if (renderTargetTextureSize) {
146
- outputWidth = renderTargetTextureSize.width;
147
- outputHeight = renderTargetTextureSize.height;
143
+ if (smartFilter.outputBlock.renderTargetWrapper) {
144
+ outputWidth = smartFilter.outputBlock.renderTargetWrapper.width;
145
+ outputHeight = smartFilter.outputBlock.renderTargetWrapper.height;
148
146
  }
149
147
  else {
150
148
  outputWidth = engine.getRenderWidth(true);
@@ -1 +1 @@
1
- {"version":3,"file":"renderTargetGenerator.js","sourceRoot":"","sources":["../../src/runtime/renderTargetGenerator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,uBAAuB,EAAE,MAAM,+DAA+D,CAAC;AAKxG,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAiB3E;;GAEG;AACH,MAAM,OAAO,qBAAqB;IAK9B;;;OAGG;IACH,YAAY,QAAQ,GAAG,IAAI;QACvB,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,iBAAiB,GAAG,IAAI,GAAG,EAAE,CAAC;QACnC,IAAI,CAAC,kBAAkB,GAAG,CAAC,CAAC;IAChC,CAAC;IAED;;OAEG;IACH,IAAW,iBAAiB;QACxB,OAAO,IAAI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AmB,CAAC,KAAK,CAAC;YAChE,YAAY,GAAG,WAAW,CAAC,WAAW,CAAC,mBAAmB,CAAC,MAAM,CAAC;QACtE,CAAC;aAAM,CAAC;YACJ,WAAW,GAAG,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;YAC1C,YAAY,GAAG,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;QAChD,CAAC;QACD,MAAM,IAAI,GAAG;YACT,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC;YACtC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,YAAY,GAAG,KAAK,CAAC;SAC3C,CAAC;QAEF,oCAAoC;QACpC,MAAM,iBAAiB,GAAG,IAAI,uBAAuB,CAAC,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;QAC3E,OAAO,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,CAAC;QAE5C,6DAA6D;QAC7D,iBAAiB,CAAC,KAAK,GAAG,CAAC,CAAC;QAC5B,iBAAiB,CAAC,KAAK,GAAG,CAAC,CAAC;QAE5B,OAAO,iBAAiB,CAAC;IAC7B,CAAC;CACJ"}
@@ -8,6 +8,7 @@ import { OutputBlock } from "./blocks/outputBlock.js";
8
8
  import { InternalSmartFilterRuntime } from "./runtime/smartFilterRuntime.js";
9
9
  import { RenderTargetGenerator } from "./runtime/renderTargetGenerator.js";
10
10
  import type { IEditorData } from "@babylonjs/shared-ui-components/nodeGraphSystem/interfaces/nodeLocationInfo";
11
+ import type { IDisposable } from "./IDisposable";
11
12
  /**
12
13
  * Data passed to the initialize function of the blocks.
13
14
  */
@@ -26,6 +27,10 @@ export type InitializationData = {
26
27
  * The list of promises to wait for during the initialization step.
27
28
  */
28
29
  readonly initializationPromises: Promise<void>[];
30
+ /**
31
+ * Resources that need to be disposed when the runtime is disposed.
32
+ */
33
+ readonly disposableResources: IDisposable[];
29
34
  };
30
35
  /**
31
36
  * The smart filter class is the main class of the smart filter module.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MAAM,IAAI,GAAG,IAAI;CAoB7D"}
@@ -98,6 +98,7 @@ export class SmartFilter {
98
98
  runtime,
99
99
  outputBlock: this.outputBlock,
100
100
  initializationPromises: [],
101
+ disposableResources: [],
101
102
  };
102
103
  this._workWithAggregateFreeGraph(() => {
103
104
  this.outputBlock.prepareForRuntime();
@@ -115,6 +116,8 @@ export class SmartFilter {
115
116
  throw new Error("Initialization promises timed out");
116
117
  }
117
118
  }
119
+ // Register the resources to dispose when the runtime is disposed
120
+ initializationData.disposableResources.forEach((resource) => runtime.registerResource(resource));
118
121
  return runtime;
119
122
  }
120
123
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"smartFilter.js","sourceRoot":"","sources":["../src/smartFilter.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAC7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAG5D;;GAEG;AACH,MAAM,qBAAqB,GAAG,KAAK,CAAC;AAsBpC;;;;;;GAMG;AACH,MAAM,OAAO,WAAW;IA6BpB;;;OAGG;IACH,YAAY,IAAY;QAfxB;;WAEG;QACI,aAAQ,GAAqB,IAAI,CAAC;QAEzC;;WAEG;QACI,eAAU,GAA0B,IAAI,CAAC;QAQ5C,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QAEjB,IAAI,CAAC,eAAe,GAAG,IAAI,KAAK,EAAa,CAAC;QAC9C,IAAI,CAAC,WAAW,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;QACzC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC;IACzC,CAAC;IAED;;OAEG;IACH,IAAW,cAAc;QACrB,OAAO,IAAI,CAAC,eAAe,CAAC;IAChC,CAAC;IAED;;OAEG;IACI,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,CAAC;QAED,iEAAiE;QACjE,kBAAkB,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,OAAO,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,CAAC;QAEjG,OAAO,OAAO,CAAC;IACnB,CAAC;IAED;;;;OAIG;IACI,2BAA2B,CAAC,IAAgB;QAC/C,MAAM,qBAAqB,GAAqB,EAAE,CAAC;QAEnD,6BAA6B;QAC7B,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,KAAgB,EAAE,UAAkB,EAAE,EAAE;YAChE,IAAI,KAAK,YAAY,cAAc,EAAE,CAAC;gBAClC,KAAK,CAAC,qBAAqB,CAAC,qBAAqB,CAAC,CAAC;YACvD,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC;YACD,wBAAwB;YACxB,IAAI,EAAE,CAAC;QACX,CAAC;gBAAS,CAAC;YACP,oDAAoD;YACpD,KAAK,MAAM,KAAK,IAAI,qBAAqB,EAAE,CAAC;gBACxC,KAAK,CAAC,uBAAuB,EAAE,CAAC;YACpC,CAAC;QACL,CAAC;IACL,CAAC;CACJ"}
@@ -1,24 +1,24 @@
1
1
  import type { RenderTargetWrapper } from "@babylonjs/core/Engines/renderTargetWrapper";
2
- import type { ThinRenderTargetTexture } from "@babylonjs/core/Materials/Textures/thinRenderTargetTexture";
3
2
  import type { Nullable } from "@babylonjs/core/types";
4
3
  import type { BaseBlock } from "../blocks/baseBlock";
5
4
  import type { ShaderRuntime } from "../runtime/shaderRuntime";
6
5
  import type { InternalSmartFilterRuntime } from "../runtime/smartFilterRuntime";
6
+ import type { ThinRenderTargetTexture } from "@babylonjs/core/Materials/Textures/thinRenderTargetTexture.js";
7
7
  /**
8
- * Tries to get a renderTarget from a renderTargetTexture, throws an error if it fails.
9
- * @param renderTargetTexture - The renderTargetTexture to get the renderTarget from.
8
+ * Tries to get a renderTargetWrapper from a ThinRenderTargetTexture, and throws an error if it fails.
9
+ * @param renderTargetTexture - The ThinRenderTargetTexture to get the renderTarget from.
10
10
  * @param callerName - The name of the component calling this one, used for a more descriptive error message.
11
- * @returns - The renderTarget or throws an Error if it fails.
11
+ * @returns - The renderTarget or it throws an Error if it fails.
12
12
  */
13
- export declare function getRenderTarget(renderTargetTexture: Nullable<ThinRenderTargetTexture>, callerName: string): RenderTargetWrapper;
13
+ export declare function getRenderTargetWrapper(renderTargetTexture: Nullable<ThinRenderTargetTexture>, callerName: string): RenderTargetWrapper;
14
14
  /**
15
15
  * Registers the final command of the command queue - the one that draws to either the canvas or
16
16
  * renderTargetTexture.
17
- * @param renderTargetTexture - If non-null, the render target texture to render to, otherwise the command will
17
+ * @param renderTargetWrapper - If non-null, the RenderTargetWrapper to render to, otherwise the command will
18
18
  * render to the canvas.
19
19
  * @param runtime - The smart filter runtime to use.
20
20
  * @param commandOwner - The owner of the command.
21
21
  * @param shaderBlockRuntime - The shader block runtime to use.
22
22
  */
23
- export declare function registerFinalRenderCommand(renderTargetTexture: Nullable<ThinRenderTargetTexture>, runtime: InternalSmartFilterRuntime, commandOwner: BaseBlock, shaderBlockRuntime: ShaderRuntime): void;
23
+ export declare function registerFinalRenderCommand(renderTargetWrapper: Nullable<RenderTargetWrapper>, runtime: InternalSmartFilterRuntime, commandOwner: BaseBlock, shaderBlockRuntime: ShaderRuntime): void;
24
24
  //# sourceMappingURL=renderTargetUtils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"renderTargetUtils.d.ts","sourceRoot":"","sources":["../../src/utils/renderTargetUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAC;AACvF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,4DAA4D,CAAC;AAC1G,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAEhF;;;;;GAKG;AACH,wBAAgB,eAAe,CAC3B,mBAAmB,EAAE,QAAQ,CAAC,uBAAuB,CAAC,EACtD,UAAU,EAAE,MAAM,GACnB,mBAAmB,CAMrB;AAED;;;;;;;;GAQG;AACH,wBAAgB,0BAA0B,CACtC,mBAAmB,EAAE,QAAQ,CAAC,uBAAuB,CAAC,EACtD,OAAO,EAAE,0BAA0B,EACnC,YAAY,EAAE,SAAS,EACvB,kBAAkB,EAAE,aAAa,GAClC,IAAI,CAgBN"}
1
+ {"version":3,"file":"renderTargetUtils.d.ts","sourceRoot":"","sources":["../../src/utils/renderTargetUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAC;AACvF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAChF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,+DAA+D,CAAC;AAE7G;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAClC,mBAAmB,EAAE,QAAQ,CAAC,uBAAuB,CAAC,EACtD,UAAU,EAAE,MAAM,GACnB,mBAAmB,CAMrB;AAED;;;;;;;;GAQG;AACH,wBAAgB,0BAA0B,CACtC,mBAAmB,EAAE,QAAQ,CAAC,mBAAmB,CAAC,EAClD,OAAO,EAAE,0BAA0B,EACnC,YAAY,EAAE,SAAS,EACvB,kBAAkB,EAAE,aAAa,GAClC,IAAI,CAeN"}
@@ -1,11 +1,11 @@
1
1
  import { createCommand } from "../command/command.js";
2
2
  /**
3
- * Tries to get a renderTarget from a renderTargetTexture, throws an error if it fails.
4
- * @param renderTargetTexture - The renderTargetTexture to get the renderTarget from.
3
+ * Tries to get a renderTargetWrapper from a ThinRenderTargetTexture, and throws an error if it fails.
4
+ * @param renderTargetTexture - The ThinRenderTargetTexture to get the renderTarget from.
5
5
  * @param callerName - The name of the component calling this one, used for a more descriptive error message.
6
- * @returns - The renderTarget or throws an Error if it fails.
6
+ * @returns - The renderTarget or it throws an Error if it fails.
7
7
  */
8
- export function getRenderTarget(renderTargetTexture, callerName) {
8
+ export function getRenderTargetWrapper(renderTargetTexture, callerName) {
9
9
  const renderTarget = renderTargetTexture === null || renderTargetTexture === void 0 ? void 0 : renderTargetTexture.renderTarget;
10
10
  if (!renderTarget) {
11
11
  throw new Error(`${callerName} could not get a renderTarget it needed.`);
@@ -15,18 +15,17 @@ export function getRenderTarget(renderTargetTexture, callerName) {
15
15
  /**
16
16
  * Registers the final command of the command queue - the one that draws to either the canvas or
17
17
  * renderTargetTexture.
18
- * @param renderTargetTexture - If non-null, the render target texture to render to, otherwise the command will
18
+ * @param renderTargetWrapper - If non-null, the RenderTargetWrapper to render to, otherwise the command will
19
19
  * render to the canvas.
20
20
  * @param runtime - The smart filter runtime to use.
21
21
  * @param commandOwner - The owner of the command.
22
22
  * @param shaderBlockRuntime - The shader block runtime to use.
23
23
  */
24
- export function registerFinalRenderCommand(renderTargetTexture, runtime, commandOwner, shaderBlockRuntime) {
24
+ export function registerFinalRenderCommand(renderTargetWrapper, runtime, commandOwner, shaderBlockRuntime) {
25
25
  const commandOwnerClassName = commandOwner.getClassName();
26
- if (renderTargetTexture) {
27
- const renderTarget = getRenderTarget(renderTargetTexture, commandOwnerClassName);
26
+ if (renderTargetWrapper) {
28
27
  runtime.registerCommand(createCommand(`${commandOwnerClassName}.renderToFinalTexture`, commandOwner, () => {
29
- shaderBlockRuntime.renderToTexture(renderTarget);
28
+ shaderBlockRuntime.renderToTexture(renderTargetWrapper);
30
29
  }));
31
30
  }
32
31
  else {
@@ -1 +1 @@
1
- {"version":3,"file":"renderTargetUtils.js","sourceRoot":"","sources":["../../src/utils/renderTargetUtils.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAKtD;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAC3B,mBAAsD,EACtD,UAAkB;IAElB,MAAM,YAAY,GAAG,mBAAmB,aAAnB,mBAAmB,uBAAnB,mBAAmB,CAAE,YAAY,CAAC;IACvD,IAAI,CAAC,YAAY,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,GAAG,UAAU,0CAA0C,CAAC,CAAC;IAC7E,CAAC;IACD,OAAO,YAAY,CAAC;AACxB,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,0BAA0B,CACtC,mBAAsD,EACtD,OAAmC,EACnC,YAAuB,EACvB,kBAAiC;IAEjC,MAAM,qBAAqB,GAAG,YAAY,CAAC,YAAY,EAAE,CAAC;IAC1D,IAAI,mBAAmB,EAAE,CAAC;QACtB,MAAM,YAAY,GAAG,eAAe,CAAC,mBAAmB,EAAE,qBAAqB,CAAC,CAAC;QACjF,OAAO,CAAC,eAAe,CACnB,aAAa,CAAC,GAAG,qBAAqB,uBAAuB,EAAE,YAAY,EAAE,GAAG,EAAE;YAC9E,kBAAkB,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;QACrD,CAAC,CAAC,CACL,CAAC;IACN,CAAC;SAAM,CAAC;QACJ,OAAO,CAAC,eAAe,CACnB,aAAa,CAAC,GAAG,qBAAqB,iBAAiB,EAAE,YAAY,EAAE,GAAG,EAAE;YACxE,kBAAkB,CAAC,cAAc,EAAE,CAAC;QACxC,CAAC,CAAC,CACL,CAAC;IACN,CAAC;AACL,CAAC"}
1
+ {"version":3,"file":"renderTargetUtils.js","sourceRoot":"","sources":["../../src/utils/renderTargetUtils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAMtD;;;;;GAKG;AACH,MAAM,UAAU,sBAAsB,CAClC,mBAAsD,EACtD,UAAkB;IAElB,MAAM,YAAY,GAAG,mBAAmB,aAAnB,mBAAmB,uBAAnB,mBAAmB,CAAE,YAAY,CAAC;IACvD,IAAI,CAAC,YAAY,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,GAAG,UAAU,0CAA0C,CAAC,CAAC;IAC7E,CAAC;IACD,OAAO,YAAY,CAAC;AACxB,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,0BAA0B,CACtC,mBAAkD,EAClD,OAAmC,EACnC,YAAuB,EACvB,kBAAiC;IAEjC,MAAM,qBAAqB,GAAG,YAAY,CAAC,YAAY,EAAE,CAAC;IAC1D,IAAI,mBAAmB,EAAE,CAAC;QACtB,OAAO,CAAC,eAAe,CACnB,aAAa,CAAC,GAAG,qBAAqB,uBAAuB,EAAE,YAAY,EAAE,GAAG,EAAE;YAC9E,kBAAkB,CAAC,eAAe,CAAC,mBAAmB,CAAC,CAAC;QAC5D,CAAC,CAAC,CACL,CAAC;IACN,CAAC;SAAM,CAAC;QACJ,OAAO,CAAC,eAAe,CACnB,aAAa,CAAC,GAAG,qBAAqB,iBAAiB,EAAE,YAAY,EAAE,GAAG,EAAE;YACxE,kBAAkB,CAAC,cAAc,EAAE,CAAC;QACxC,CAAC,CAAC,CACL,CAAC;IACN,CAAC;AACL,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@babylonjs/smart-filters",
3
- "version": "0.3.8-alpha",
3
+ "version": "0.3.10-alpha",
4
4
  "description": "Babylon.js Smart Filter core",
5
5
  "author": {
6
6
  "name": "Sebastien VANDENBERGHE"
@@ -1,11 +1,13 @@
1
1
  import type { InitializationData, SmartFilter } from "../smartFilter";
2
2
  import { ConnectionPointType } from "../connection/connectionPointType.js";
3
3
  import { BaseBlock } from "./baseBlock.js";
4
- import { CopyBlock } from "./copyBlock.js";
5
- import { ShaderRuntime } from "../runtime/shaderRuntime.js";
4
+ import { Binding, ShaderRuntime } from "../runtime/shaderRuntime.js";
6
5
  import type { Nullable } from "@babylonjs/core/types";
7
- import type { ThinRenderTargetTexture } from "@babylonjs/core/Materials/Textures/thinRenderTargetTexture";
6
+ import type { RenderTargetWrapper } from "@babylonjs/core/Engines/renderTargetWrapper";
8
7
  import { registerFinalRenderCommand } from "../utils/renderTargetUtils.js";
8
+ import type { RuntimeData } from "../connection/connectionPoint";
9
+ import type { Effect } from "@babylonjs/core/Materials/effect";
10
+ import { shaderProgram, uniforms } from "./outputBlock.shader.js";
9
11
 
10
12
  /**
11
13
  * The output block of a smart filter.
@@ -26,12 +28,10 @@ export class OutputBlock extends BaseBlock {
26
28
  public readonly input = this._registerInput("input", ConnectionPointType.Texture);
27
29
 
28
30
  /**
29
- * If supplied, the Smart Filter will render into this texture. Otherwise, it renders
31
+ * If supplied, the Smart Filter will render into this RenderTargetWrapper. Otherwise, it renders
30
32
  * into the the canvas or WebGL context the ThinEngine is using for rendering.
31
33
  */
32
- public renderTargetTexture: Nullable<ThinRenderTargetTexture> = null;
33
-
34
- private _copyBlock: CopyBlock | null;
34
+ public renderTargetWrapper: Nullable<RenderTargetWrapper> = null;
35
35
 
36
36
  /**
37
37
  * Create a new output block.
@@ -39,17 +39,6 @@ export class OutputBlock extends BaseBlock {
39
39
  */
40
40
  constructor(smartFilter: SmartFilter) {
41
41
  super(smartFilter, "output");
42
-
43
- this._copyBlock = null;
44
- }
45
-
46
- private _getCopyBlock(): CopyBlock {
47
- if (!this._copyBlock) {
48
- this._copyBlock = new CopyBlock(this.smartFilter, "CopyToOutputBlock");
49
- }
50
- this._copyBlock.input.runtimeData = this.input.runtimeData;
51
-
52
- return this._copyBlock;
53
42
  }
54
43
 
55
44
  /**
@@ -84,28 +73,46 @@ export class OutputBlock extends BaseBlock {
84
73
  finalOutput: boolean
85
74
  ): void {
86
75
  // In the case that this OutputBlock is directly connected to a texture InputBlock, we must
87
- // insert a CopyBlock to copy the texture to the render target texture.
88
- if (this.input.connectedTo?.ownerBlock.isInput) {
89
- const copyBlock = this._getCopyBlock();
76
+ // use a shader to copy the texture to the render target texture.
77
+ if (this.input.connectedTo?.ownerBlock.isInput && this.input.runtimeData) {
90
78
  const runtime = initializationData.runtime;
91
79
 
92
80
  const shaderBlockRuntime = new ShaderRuntime(
93
81
  runtime.effectRenderer,
94
- copyBlock.getShaderProgram(),
95
- copyBlock.getShaderBinding()
82
+ shaderProgram,
83
+ new OutputShaderBinding(this.input.runtimeData)
96
84
  );
97
85
  initializationData.initializationPromises.push(shaderBlockRuntime.onReadyAsync);
98
86
  runtime.registerResource(shaderBlockRuntime);
99
87
 
100
- registerFinalRenderCommand(this.renderTargetTexture, runtime, this, shaderBlockRuntime);
88
+ registerFinalRenderCommand(this.renderTargetWrapper, runtime, this, shaderBlockRuntime);
101
89
 
102
90
  super.generateCommandsAndGatherInitPromises(initializationData, finalOutput);
103
- } else {
104
- // We aren't connected to an input block, remove our copy block if we have one.
105
- if (this._copyBlock) {
106
- this.smartFilter.removeBlock(this._copyBlock);
107
- this._copyBlock = null;
108
- }
109
91
  }
110
92
  }
111
93
  }
94
+
95
+ /**
96
+ * Shader binding to use when the OutputBlock is directly connected to a texture InputBlock.
97
+ */
98
+ class OutputShaderBinding extends Binding {
99
+ private readonly _inputTexture: RuntimeData<ConnectionPointType.Texture>;
100
+
101
+ /**
102
+ * Creates a new shader binding instance.
103
+ * @param inputTexture - defines the input texture to copy
104
+ */
105
+ constructor(inputTexture: RuntimeData<ConnectionPointType.Texture>) {
106
+ super();
107
+ this._inputTexture = inputTexture;
108
+ }
109
+
110
+ /**
111
+ * Binds all the required data to the shader when rendering.
112
+ * @param effect - defines the effect to bind the data to
113
+ * @internal
114
+ */
115
+ public override bind(effect: Effect): void {
116
+ effect.setTexture(this.getRemappedName(uniforms.input), this._inputTexture.value);
117
+ }
118
+ }
@@ -10,7 +10,7 @@ import { ConnectionPointType } from "../connection/connectionPointType.js";
10
10
  import { createCommand } from "../command/command.js";
11
11
  import { DisableableBlock } from "./disableableBlock.js";
12
12
  import { undecorateSymbol } from "../utils/shaderCodeUtils.js";
13
- import { getRenderTarget, registerFinalRenderCommand } from "../utils/renderTargetUtils.js";
13
+ import { getRenderTargetWrapper, registerFinalRenderCommand } from "../utils/renderTargetUtils.js";
14
14
 
15
15
  /**
16
16
  * This is the base class for all shader blocks.
@@ -123,13 +123,13 @@ export abstract class ShaderBlock extends DisableableBlock {
123
123
 
124
124
  if (finalOutput) {
125
125
  registerFinalRenderCommand(
126
- initializationData.outputBlock.renderTargetTexture,
126
+ initializationData.outputBlock.renderTargetWrapper,
127
127
  runtime,
128
128
  this,
129
129
  shaderBlockRuntime
130
130
  );
131
131
  } else {
132
- const renderTarget = getRenderTarget(
132
+ const renderTarget = getRenderTargetWrapper(
133
133
  this.output.runtimeData?.value as ThinRenderTargetTexture,
134
134
  this.getClassName()
135
135
  );
@@ -182,8 +182,10 @@ export class ConnectionPoint<U extends ConnectionPointType = ConnectionPointType
182
182
 
183
183
  // Remove the connection point from the list of endpoints
184
184
  this._endpoints.splice(index, 1);
185
- // Empty at the same time the connectedTo property of the other connection point
185
+
186
+ // Connections are double-linked - remove the reference back to this connection point from the one we just disconnected from
186
187
  endpoint._connectedTo = null;
188
+ endpoint.runtimeData = null;
187
189
  }
188
190
 
189
191
  /**
package/src/index.ts CHANGED
@@ -21,7 +21,6 @@ export { InputBlock, type InputBlockEditorData } from "./blocks/inputBlock.js";
21
21
  export { type AnyInputBlock } from "./blocks/inputBlock.js";
22
22
  export { ShaderBlock } from "./blocks/shaderBlock.js";
23
23
  export { AggregateBlock } from "./blocks/aggregateBlock.js";
24
- export { CopyBlock } from "./blocks/copyBlock.js";
25
24
  export { ShaderBinding, ShaderRuntime } from "./runtime/shaderRuntime.js";
26
25
  export { type ShaderProgram, injectDisableUniform } from "./utils/shaderCodeUtils.js";
27
26
  export { type IDisableableBlock } from "./blocks/disableableBlock.js";
@@ -199,10 +199,9 @@ export class RenderTargetGenerator {
199
199
  // Get the smartFilter output size - either from the output block's renderTargetTexture or the engine's render size
200
200
  let outputWidth: number;
201
201
  let outputHeight: number;
202
- const renderTargetTextureSize = smartFilter.outputBlock.renderTargetTexture?.getSize();
203
- if (renderTargetTextureSize) {
204
- outputWidth = renderTargetTextureSize.width;
205
- outputHeight = renderTargetTextureSize.height;
202
+ if (smartFilter.outputBlock.renderTargetWrapper) {
203
+ outputWidth = smartFilter.outputBlock.renderTargetWrapper.width;
204
+ outputHeight = smartFilter.outputBlock.renderTargetWrapper.height;
206
205
  } else {
207
206
  outputWidth = engine.getRenderWidth(true);
208
207
  outputHeight = engine.getRenderHeight(true);
@@ -9,6 +9,7 @@ import { InternalSmartFilterRuntime } from "./runtime/smartFilterRuntime.js";
9
9
  import { RenderTargetGenerator } from "./runtime/renderTargetGenerator.js";
10
10
  import { AggregateBlock } from "./blocks/aggregateBlock.js";
11
11
  import type { IEditorData } from "@babylonjs/shared-ui-components/nodeGraphSystem/interfaces/nodeLocationInfo";
12
+ import type { IDisposable } from "./IDisposable";
12
13
 
13
14
  /**
14
15
  * How long to wait for shader compilation and texture loading to complete before erroring out.
@@ -23,16 +24,23 @@ export type InitializationData = {
23
24
  * The current smart filter runtime the block is being initialized for.
24
25
  */
25
26
  readonly runtime: InternalSmartFilterRuntime;
27
+
26
28
  /**
27
29
  * The output block of the smart filter.
28
30
  * This is used to determine if a block is linked to the output block so that we can prevent an
29
31
  * extra render pass.
30
32
  */
31
33
  readonly outputBlock: OutputBlock;
34
+
32
35
  /**
33
36
  * The list of promises to wait for during the initialization step.
34
37
  */
35
38
  readonly initializationPromises: Promise<void>[];
39
+
40
+ /**
41
+ * Resources that need to be disposed when the runtime is disposed.
42
+ */
43
+ readonly disposableResources: IDisposable[];
36
44
  };
37
45
 
38
46
  /**
@@ -165,6 +173,7 @@ export class SmartFilter {
165
173
  runtime,
166
174
  outputBlock: this.outputBlock,
167
175
  initializationPromises: [],
176
+ disposableResources: [],
168
177
  };
169
178
 
170
179
  this._workWithAggregateFreeGraph(() => {
@@ -188,6 +197,9 @@ export class SmartFilter {
188
197
  }
189
198
  }
190
199
 
200
+ // Register the resources to dispose when the runtime is disposed
201
+ initializationData.disposableResources.forEach((resource) => runtime.registerResource(resource));
202
+
191
203
  return runtime;
192
204
  }
193
205
 
@@ -1,18 +1,18 @@
1
1
  import type { RenderTargetWrapper } from "@babylonjs/core/Engines/renderTargetWrapper";
2
- import type { ThinRenderTargetTexture } from "@babylonjs/core/Materials/Textures/thinRenderTargetTexture";
3
2
  import type { Nullable } from "@babylonjs/core/types";
4
3
  import { createCommand } from "../command/command.js";
5
4
  import type { BaseBlock } from "../blocks/baseBlock";
6
5
  import type { ShaderRuntime } from "../runtime/shaderRuntime";
7
6
  import type { InternalSmartFilterRuntime } from "../runtime/smartFilterRuntime";
7
+ import type { ThinRenderTargetTexture } from "@babylonjs/core/Materials/Textures/thinRenderTargetTexture.js";
8
8
 
9
9
  /**
10
- * Tries to get a renderTarget from a renderTargetTexture, throws an error if it fails.
11
- * @param renderTargetTexture - The renderTargetTexture to get the renderTarget from.
10
+ * Tries to get a renderTargetWrapper from a ThinRenderTargetTexture, and throws an error if it fails.
11
+ * @param renderTargetTexture - The ThinRenderTargetTexture to get the renderTarget from.
12
12
  * @param callerName - The name of the component calling this one, used for a more descriptive error message.
13
- * @returns - The renderTarget or throws an Error if it fails.
13
+ * @returns - The renderTarget or it throws an Error if it fails.
14
14
  */
15
- export function getRenderTarget(
15
+ export function getRenderTargetWrapper(
16
16
  renderTargetTexture: Nullable<ThinRenderTargetTexture>,
17
17
  callerName: string
18
18
  ): RenderTargetWrapper {
@@ -26,24 +26,23 @@ export function getRenderTarget(
26
26
  /**
27
27
  * Registers the final command of the command queue - the one that draws to either the canvas or
28
28
  * renderTargetTexture.
29
- * @param renderTargetTexture - If non-null, the render target texture to render to, otherwise the command will
29
+ * @param renderTargetWrapper - If non-null, the RenderTargetWrapper to render to, otherwise the command will
30
30
  * render to the canvas.
31
31
  * @param runtime - The smart filter runtime to use.
32
32
  * @param commandOwner - The owner of the command.
33
33
  * @param shaderBlockRuntime - The shader block runtime to use.
34
34
  */
35
35
  export function registerFinalRenderCommand(
36
- renderTargetTexture: Nullable<ThinRenderTargetTexture>,
36
+ renderTargetWrapper: Nullable<RenderTargetWrapper>,
37
37
  runtime: InternalSmartFilterRuntime,
38
38
  commandOwner: BaseBlock,
39
39
  shaderBlockRuntime: ShaderRuntime
40
40
  ): void {
41
41
  const commandOwnerClassName = commandOwner.getClassName();
42
- if (renderTargetTexture) {
43
- const renderTarget = getRenderTarget(renderTargetTexture, commandOwnerClassName);
42
+ if (renderTargetWrapper) {
44
43
  runtime.registerCommand(
45
44
  createCommand(`${commandOwnerClassName}.renderToFinalTexture`, commandOwner, () => {
46
- shaderBlockRuntime.renderToTexture(renderTarget);
45
+ shaderBlockRuntime.renderToTexture(renderTargetWrapper);
47
46
  })
48
47
  );
49
48
  } else {
@@ -1,57 +0,0 @@
1
- import type { Effect } from "@babylonjs/core/Materials/effect";
2
- import type { SmartFilter } from "../smartFilter";
3
- import { ConnectionPointType } from "../connection/connectionPointType.js";
4
- import { ShaderBlock } from "./shaderBlock.js";
5
- import { ShaderBinding } from "../runtime/shaderRuntime.js";
6
- import type { RuntimeData } from "../connection/connectionPoint";
7
- /**
8
- * The shader bindings for the Copy block.
9
- */
10
- export declare class CopyShaderBinding extends ShaderBinding {
11
- private readonly _inputTexture;
12
- /**
13
- * Creates a new shader binding instance for the copy block.
14
- * @param parentBlock - The parent block
15
- * @param inputTexture - defines the input texture to copy
16
- */
17
- constructor(parentBlock: CopyBlock, inputTexture: RuntimeData<ConnectionPointType.Texture>);
18
- /**
19
- * Binds all the required data to the shader when rendering.
20
- * @param effect - defines the effect to bind the data to
21
- * @internal
22
- */
23
- bind(effect: Effect): void;
24
- }
25
- /**
26
- * A block responsible for copying a texture to the output.
27
- *
28
- * This might be helpful to duplicate a texture if necessary.
29
- *
30
- * It simply takes a texture as input and outputs it to another texture or to the main canvas.
31
- */
32
- export declare class CopyBlock extends ShaderBlock {
33
- /**
34
- * The class name of the block.
35
- */
36
- static ClassName: string;
37
- /**
38
- * The input connection point of the block.
39
- */
40
- readonly input: import("../connection/connectionPoint").ConnectionPoint<ConnectionPointType.Texture>;
41
- /**
42
- * The shader program (vertex and fragment code) to use to render the block
43
- */
44
- static ShaderCode: import("..").ShaderProgram;
45
- /**
46
- * Create a new copy block.
47
- * @param smartFilter - The smart filter this block belongs to.
48
- * @param name -The friendly name of the block.
49
- */
50
- constructor(smartFilter: SmartFilter, name: string);
51
- /**
52
- * Get the class instance that binds all the required data to the shader (effect) when rendering.
53
- * @returns The class instance that binds the data to the effect
54
- */
55
- getShaderBinding(): ShaderBinding;
56
- }
57
- //# sourceMappingURL=copyBlock.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"copyBlock.d.ts","sourceRoot":"","sources":["../../src/blocks/copyBlock.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAE/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAGjE;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,aAAa;IAChD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA2C;IAEzE;;;;OAIG;gBACS,WAAW,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,CAAC,mBAAmB,CAAC,OAAO,CAAC;IAK1F;;;;OAIG;IACa,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;CAG7C;AAED;;;;;;GAMG;AACH,qBAAa,SAAU,SAAQ,WAAW;IACtC;;OAEG;IACH,OAAuB,SAAS,SAAe;IAE/C;;OAEG;IACH,SAAgB,KAAK,uFAA6D;IAElF;;OAEG;IACH,OAAuB,UAAU,6BAAiB;IAElD;;;;OAIG;gBACS,WAAW,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM;IAIlD;;;OAGG;IACI,gBAAgB,IAAI,aAAa;CAK3C"}
@@ -1,64 +0,0 @@
1
- import { ConnectionPointType } from "../connection/connectionPointType.js";
2
- import { ShaderBlock } from "./shaderBlock.js";
3
- import { ShaderBinding } from "../runtime/shaderRuntime.js";
4
- import { shaderProgram, uniforms } from "./copyBlock.shader.js";
5
- /**
6
- * The shader bindings for the Copy block.
7
- */
8
- export class CopyShaderBinding extends ShaderBinding {
9
- /**
10
- * Creates a new shader binding instance for the copy block.
11
- * @param parentBlock - The parent block
12
- * @param inputTexture - defines the input texture to copy
13
- */
14
- constructor(parentBlock, inputTexture) {
15
- super(parentBlock);
16
- this._inputTexture = inputTexture;
17
- }
18
- /**
19
- * Binds all the required data to the shader when rendering.
20
- * @param effect - defines the effect to bind the data to
21
- * @internal
22
- */
23
- bind(effect) {
24
- effect.setTexture(this.getRemappedName(uniforms.input), this._inputTexture.value);
25
- }
26
- }
27
- /**
28
- * A block responsible for copying a texture to the output.
29
- *
30
- * This might be helpful to duplicate a texture if necessary.
31
- *
32
- * It simply takes a texture as input and outputs it to another texture or to the main canvas.
33
- */
34
- export class CopyBlock extends ShaderBlock {
35
- /**
36
- * Create a new copy block.
37
- * @param smartFilter - The smart filter this block belongs to.
38
- * @param name -The friendly name of the block.
39
- */
40
- constructor(smartFilter, name) {
41
- super(smartFilter, name);
42
- /**
43
- * The input connection point of the block.
44
- */
45
- this.input = this._registerInput("input", ConnectionPointType.Texture);
46
- }
47
- /**
48
- * Get the class instance that binds all the required data to the shader (effect) when rendering.
49
- * @returns The class instance that binds the data to the effect
50
- */
51
- getShaderBinding() {
52
- const input = this._confirmRuntimeDataSupplied(this.input);
53
- return new CopyShaderBinding(this, input);
54
- }
55
- }
56
- /**
57
- * The class name of the block.
58
- */
59
- CopyBlock.ClassName = "CopyBlock";
60
- /**
61
- * The shader program (vertex and fragment code) to use to render the block
62
- */
63
- CopyBlock.ShaderCode = shaderProgram;
64
- //# sourceMappingURL=copyBlock.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"copyBlock.js","sourceRoot":"","sources":["../../src/blocks/copyBlock.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAE5D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEhE;;GAEG;AACH,MAAM,OAAO,iBAAkB,SAAQ,aAAa;IAGhD;;;;OAIG;IACH,YAAY,WAAsB,EAAE,YAAsD;QACtF,KAAK,CAAC,WAAW,CAAC,CAAC;QACnB,IAAI,CAAC,aAAa,GAAG,YAAY,CAAC;IACtC,CAAC;IAED;;;;OAIG;IACa,IAAI,CAAC,MAAc;QAC/B,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IACtF,CAAC;CACJ;AAED;;;;;;GAMG;AACH,MAAM,OAAO,SAAU,SAAQ,WAAW;IAgBtC;;;;OAIG;IACH,YAAY,WAAwB,EAAE,IAAY;QAC9C,KAAK,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;QAhB7B;;WAEG;QACa,UAAK,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,mBAAmB,CAAC,OAAO,CAAC,CAAC;IAclF,CAAC;IAED;;;OAGG;IACI,gBAAgB;QACnB,MAAM,KAAK,GAAG,IAAI,CAAC,2BAA2B,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAE3D,OAAO,IAAI,iBAAiB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC9C,CAAC;;AAhCD;;GAEG;AACoB,mBAAS,GAAG,WAAW,AAAd,CAAe;AAO/C;;GAEG;AACoB,oBAAU,GAAG,aAAa,AAAhB,CAAiB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"copyBlock.shader.d.ts","sourceRoot":"","sources":["../../src/blocks/copyBlock.shader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,aAsB3B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,QAAQ;;CAEpB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"copyBlock.shader.js","sourceRoot":"","sources":["../../src/blocks/copyBlock.shader.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAkB;IACxC,MAAM,EAAE,SAAS;IACjB,QAAQ,EAAE;QACN,OAAO,EAAE;;qCAEoB;QAC7B,gBAAgB,EAAE,SAAS;QAC3B,gBAAgB,EAAE,QAAQ;QAC1B,SAAS,EAAE;YACP;gBACI,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE;;;;;;;qBAOD;aACR;SACJ;KACJ;CACJ,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG;IACpB,KAAK,EAAE,OAAO;CACjB,CAAC"}
@@ -1,77 +0,0 @@
1
- import type { Effect } from "@babylonjs/core/Materials/effect";
2
-
3
- import type { SmartFilter } from "../smartFilter";
4
- import { ConnectionPointType } from "../connection/connectionPointType.js";
5
- import { ShaderBlock } from "./shaderBlock.js";
6
- import { ShaderBinding } from "../runtime/shaderRuntime.js";
7
- import type { RuntimeData } from "../connection/connectionPoint";
8
- import { shaderProgram, uniforms } from "./copyBlock.shader.js";
9
-
10
- /**
11
- * The shader bindings for the Copy block.
12
- */
13
- export class CopyShaderBinding extends ShaderBinding {
14
- private readonly _inputTexture: RuntimeData<ConnectionPointType.Texture>;
15
-
16
- /**
17
- * Creates a new shader binding instance for the copy block.
18
- * @param parentBlock - The parent block
19
- * @param inputTexture - defines the input texture to copy
20
- */
21
- constructor(parentBlock: CopyBlock, inputTexture: RuntimeData<ConnectionPointType.Texture>) {
22
- super(parentBlock);
23
- this._inputTexture = inputTexture;
24
- }
25
-
26
- /**
27
- * Binds all the required data to the shader when rendering.
28
- * @param effect - defines the effect to bind the data to
29
- * @internal
30
- */
31
- public override bind(effect: Effect): void {
32
- effect.setTexture(this.getRemappedName(uniforms.input), this._inputTexture.value);
33
- }
34
- }
35
-
36
- /**
37
- * A block responsible for copying a texture to the output.
38
- *
39
- * This might be helpful to duplicate a texture if necessary.
40
- *
41
- * It simply takes a texture as input and outputs it to another texture or to the main canvas.
42
- */
43
- export class CopyBlock extends ShaderBlock {
44
- /**
45
- * The class name of the block.
46
- */
47
- public static override ClassName = "CopyBlock";
48
-
49
- /**
50
- * The input connection point of the block.
51
- */
52
- public readonly input = this._registerInput("input", ConnectionPointType.Texture);
53
-
54
- /**
55
- * The shader program (vertex and fragment code) to use to render the block
56
- */
57
- public static override ShaderCode = shaderProgram;
58
-
59
- /**
60
- * Create a new copy block.
61
- * @param smartFilter - The smart filter this block belongs to.
62
- * @param name -The friendly name of the block.
63
- */
64
- constructor(smartFilter: SmartFilter, name: string) {
65
- super(smartFilter, name);
66
- }
67
-
68
- /**
69
- * Get the class instance that binds all the required data to the shader (effect) when rendering.
70
- * @returns The class instance that binds the data to the effect
71
- */
72
- public getShaderBinding(): ShaderBinding {
73
- const input = this._confirmRuntimeDataSupplied(this.input);
74
-
75
- return new CopyShaderBinding(this, input);
76
- }
77
- }