# Feedback on frame graphs

**URL:** <https://forum.babylonjs.com/t/feedback-on-frame-graphs/58672>\
**Category:** Questions\
**Created:** [May 27, 2025, 5:03am UTC](https://forum.babylonjs.com/t/feedback-on-frame-graphs/58672 "2025-05-27T05:03:07Z")\
**Posts on this page:** 20\
**Page:** 3

<div class="post-metadata">

**Author:** ![phaselock](https://avatars.discourse-cdn.com/v4/letter/p/da6949/32.png) [@phaselock](https://forum.babylonjs.com/u/phaselock)\
**Post date:** [September 5, 2025, 3:35am UTC](https://forum.babylonjs.com/t/feedback-on-frame-graphs/58672/41 "2025-09-05T03:35:32Z")

</div>

Correct. The problem stems from bad vertex code, regardless of frame graph or not **AND** only when rendering multiple materials to the same mesh. 👍

_This statement probably doesn’t sum it up correctly, but what the heck._ 🤮

---

<div class="post-metadata">

**Author:** ![phaselock](https://avatars.discourse-cdn.com/v4/letter/p/da6949/32.png) [@phaselock](https://forum.babylonjs.com/u/phaselock)\
**Post date:** [September 5, 2025, 4:45am UTC](https://forum.babylonjs.com/t/feedback-on-frame-graphs/58672/42 "2025-09-05T04:45:14Z")

</div>

My custom frame graph task works in webgl but webgpu complains, there are a whole bunch of errors and I isolated the key.

a) Repro: [Babylon.js Playground](https://playground.babylonjs.com/#UOETKO)

Comment out `this.createTestPass();` at line 118, the error does not show. Is there a limit to how many effect wrappers can be declared in a custom task for webgpu or somesuch?

b) Repro: [Babylon.js Playground](https://playground.babylonjs.com/#Z8SC1X)

Seems like webgpu does not like ping pong textures even in a js loop, getting a whole bunch of invalid renders stemming from `context._effectRenderer.render(customPass, tex[index])` in `pass.setExecuteFunc`.

Snipped the logs below.

```auto
BJS - [12:37:51]: WebGPU uncaptured error (2): [object GPUValidationError] - [Invalid ShaderModule "fragment"] is invalid.
 - While validating fragment stage ([Invalid ShaderModule "fragment"], entryPoint: "main").
 - While validating fragment state.
 - While calling [Device "BabylonWebGPUDevice31"].CreateRenderPipeline([RenderPipelineDescriptor ""RenderPipeline_rgba16float_depth32float_samples1_textureState0""]).

(anonymous) @ webgpuEngine.ts:714Understand this warning
(index):1 [Invalid ShaderModule "fragment"] is invalid.
 - While validating fragment stage ([Invalid ShaderModule "fragment"], entryPoint: "main").
 - While validating fragment state.
 - While calling [Device "BabylonWebGPUDevice31"].CreateRenderPipeline([RenderPipelineDescriptor ""RenderPipeline_rgba16float_depth32float_samples1_textureState0""]).
Understand this warning
logger.ts:107 BJS - [12:37:51]: WebGPU uncaptured error (3): [object GPUValidationError] - [Invalid RenderPipeline "RenderPipeline_rgba16float_depth32float_samples1_textureState0"] is invalid.
 - While encoding [RenderPassEncoder "tex0 - RenderPass"].SetPipeline([Invalid RenderPipeline "RenderPipeline_rgba16float_depth32float_samples1_textureState0"]).
 - While finishing [CommandEncoder "render"].

Debug group stack:
 > "render target pass (tex0)"

(anonymous) @ webgpuEngine.ts:714Understand this warning
logger.ts:107 BJS - [12:37:51]: WebGPU uncaptured error (4): [object GPUValidationError] - [Invalid CommandBuffer from CommandEncoder "render"] is invalid.
 - While calling [Queue].Submit([[CommandBuffer from CommandEncoder "upload"], [Invalid CommandBuffer from CommandEncoder "render"]])

```

Is there a recommended workaround? I’ve tried super ugly ones but none worked. 😕

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [September 5, 2025, 10:35am UTC](https://forum.babylonjs.com/t/feedback-on-frame-graphs/58672/43 "2025-09-05T10:35:32Z")

</div>

> [@phaselock](#):
>
> Comment out `this.createTestPass();` at line 118, the error does not show. Is there a limit to how many effect wrappers can be declared in a custom task for webgpu or somesuch?

You have two closing `}` in:

```auto
        BABYLON.ShaderStore.ShadersStoreWGSL["testFragmentShader"] = `
			@fragment
			fn main(input : FragmentInputs) -> FragmentOutputs {
				fragmentOutputs.color = vec4f(1.);
			}
        }`;

```

> [@phaselock](#):
>
> b) Repro: [Babylon.js Playground](https://playground.babylonjs.com/#Z8SC1X)
> 
> Seems like webgpu does not like ping pong textures even in a js loop, getting a whole bunch of invalid renders stemming from `context._effectRenderer.render(customPass, tex[index])` in `pass.setExecuteFunc`.

Once the double `}` is fixed, there are no more errors in your PG.

---

<div class="post-metadata">

**Author:** ![phaselock](https://avatars.discourse-cdn.com/v4/letter/p/da6949/32.png) [@phaselock](https://forum.babylonjs.com/u/phaselock)\
**Post date:** [September 5, 2025, 11:24am UTC](https://forum.babylonjs.com/t/feedback-on-frame-graphs/58672/44 "2025-09-05T11:24:58Z")

</div>

> [@Evgeni\_Popov](#):
>
> You have two closing `}` in:

Bloody hell ! 🤦 Thanks for the catch! My god, I’m blind!!

What’s a recommended tool for debugging wgsl shaders? I’m using `engine.dbgShowShaderCode = true;` but the dump is excessive. Eg: on local dev, I’m getting

```auto
BJS - [19:22:20]: WebGPU uncaptured error (1): [object GPUValidationError] - Error while parsing WGSL: :989:1 error: struct member color not found
fragmentOutputs.color= vec4f(0.,0.,0.,1.0);
^^^^^^^^^^^^^^^^^^^^^
 - While calling [Device "BabylonWebGPUDevice0"].CreateShaderModule([ShaderModuleDescriptor ""fragment""]).

```

but the previous shader is a line fragment.fx and it works fine w/o frame graph. So it couldn’t have been from said fx. W/o a better tool, I’m flying blind here. Any recommendations?

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [September 5, 2025, 1:38pm UTC](https://forum.babylonjs.com/t/feedback-on-frame-graphs/58672/45 "2025-09-05T13:38:18Z")

</div>

I also use `engine.dbgShowShaderCode` when such errors occur…

I will try to pass the name of the shader being compiled to the underlying WebGPU APIs, in order to make it easier to identify the cause of the error.

---

<div class="post-metadata">

**Author:** ![Pryme8](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/pryme8/32/7212_2.png) [@Pryme8](https://forum.babylonjs.com/u/Pryme8)\
**Post date:** [September 5, 2025, 3:33pm UTC](https://forum.babylonjs.com/t/feedback-on-frame-graphs/58672/46 "2025-09-05T15:33:15Z")

</div>

I never knew about `dbgShowShaderCode` that is going to be so useful.

---

<div class="post-metadata">

**Author:** ![phaselock](https://avatars.discourse-cdn.com/v4/letter/p/da6949/32.png) [@phaselock](https://forum.babylonjs.com/u/phaselock)\
**Post date:** [September 6, 2025, 3:17am UTC](https://forum.babylonjs.com/t/feedback-on-frame-graphs/58672/47 "2025-09-06T03:17:20Z")

</div>

webgl: [Babylon.js Playground](https://playground.babylonjs.com/#HHQTTU)  
`needDepthPrePass` vs `FrameGraphGeometryRendererTask` in webgl  
Repro: [https://playground.babylonjs.com/#CG7I9R#1](https://playground.babylonjs.com/#CG7I9R#1)  
`needDepthPrePass` vs `FrameGraphGeometryRendererTask` in webgpu

Identical pg, console throws same error as the previous post about `struct member color not found fragmentOutputs.color= vec4f(0.,0.,0.,1.0);` wai?

edit: also similar error if using `MaterialPlugin` in webgpu with `needDepthPrePass=true`

_GPU error log could not have been more obscure._ 🙄

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [September 6, 2025, 1:31pm UTC](https://forum.babylonjs.com/t/feedback-on-frame-graphs/58672/48 "2025-09-06T13:31:23Z")

</div>

> [@phaselock](#):
>
> wai?

no 🙂

**needDepthPrePass** is not compatible with the geometry renderer task, so I’ll have to figure out how to get rid of this error…

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [September 6, 2025, 3:37pm UTC](https://forum.babylonjs.com/t/feedback-on-frame-graphs/58672/49 "2025-09-06T15:37:57Z")

</div>

This PR will fix the problem:

> <https://github.com/BabylonJS/Babylon.js/pull/17133>
>
> See https://forum.babylonjs.com/t/feedback-on-frame-graphs/58672/47

---

<div class="post-metadata">

**Author:** ![phaselock](https://avatars.discourse-cdn.com/v4/letter/p/da6949/32.png) [@phaselock](https://forum.babylonjs.com/u/phaselock)\
**Post date:** [September 10, 2025, 6:12am UTC](https://forum.babylonjs.com/t/feedback-on-frame-graphs/58672/50 "2025-09-10T06:12:55Z")

</div>

Thanks! Tested in v8.26.1, all is wai! Cheers!

---

<div class="post-metadata">

**Author:** ![phaselock](https://avatars.discourse-cdn.com/v4/letter/p/da6949/32.png) [@phaselock](https://forum.babylonjs.com/u/phaselock)\
**Post date:** [September 16, 2025, 6:12am UTC](https://forum.babylonjs.com/t/feedback-on-frame-graphs/58672/51 "2025-09-16T06:12:27Z")

</div>

I did a perf test with [stress scene](https://forum.babylonjs.com/t/seedborn-beta-is-launched/31379/62) in Seedborn against frame graph in webgl2. The frame graph should be a 1 for 1 match against `scene.render()`, with the exception that the `FrameGraphCascadedShadowGeneratorTask` is using `shadowMaxZ` instead of `autoCalcDepthBounds`.

 ![perf_test_160925_vs_frame graph](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/c/5/c51bda5b4329279ca09deee9145b3d50943ebf92.jpeg)

a) No visible change or improvement, similar result as past.  
b) Hovering aroung 40fps.  
c) Definite improvement in the latest ffox release.  
d) Hovering aroung 30fps

It seems my frame graph is not as performant as I thought it was. Nothing jumps out at me from the profiler. Is there a way to perf chk each pass in the frame graph? Or did I miss some optimization flags?

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [September 16, 2025, 10:38am UTC](https://forum.babylonjs.com/t/feedback-on-frame-graphs/58672/52 "2025-09-16T10:38:14Z")

</div>

I’m a little surprised by these figures, because the frame graph version shouldn’t be slower than the standard `scene.render` code path, as long as both versions do the same thing.

You could use Spector and compare the two snapshots to see if there are any additional renderings in the case of the frame graph. You could also try comparing a performance snapshot (in Chrome dev tools) between the two versions. Maybe something will show up…

---

<div class="post-metadata">

**Author:** ![phaselock](https://avatars.discourse-cdn.com/v4/letter/p/da6949/32.png) [@phaselock](https://forum.babylonjs.com/u/phaselock)\
**Post date:** [September 19, 2025, 8:25am UTC](https://forum.babylonjs.com/t/feedback-on-frame-graphs/58672/53 "2025-09-19T08:25:47Z")

</div>

Many thanks for helping hunt down the issue. Updated my latest perf compare against the same stress scene in Seedborn in webgl2.

 ![perf_test_190925_vs_frame graph](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/d/4/d45c2128d73dfdf50d0d8debd9d670958c49d38a.jpeg)

Kudos to @Evgeni_Popov for all the hard work put into frame graphs! 👏

For me, the primary lesson learnt: lights interaction with frame graph tasks work a little different from the usual `scene.render` case. I’m happy with how stuff turned out in the end, its really satisfying when the hard work pays off.

---

<div class="post-metadata">

**Author:** ![phaselock](https://avatars.discourse-cdn.com/v4/letter/p/da6949/32.png) [@phaselock](https://forum.babylonjs.com/u/phaselock)\
**Post date:** [September 19, 2025, 9:27am UTC](https://forum.babylonjs.com/t/feedback-on-frame-graphs/58672/54 "2025-09-19T09:27:48Z")

</div>

Repro: [https://playground.babylonjs.com/#9YU4C5#104](https://playground.babylonjs.com/#9YU4C5#104)

Run the repro. Disposing the instance does not update the shadows in frame graph. The csm task and the render task are using the same `objectList`. wai?

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [September 19, 2025, 1:57pm UTC](https://forum.babylonjs.com/t/feedback-on-frame-graphs/58672/55 "2025-09-19T13:57:15Z")

</div>

Thanks for reporting, another bug fixed 🙂

> <https://github.com/BabylonJS/Babylon.js/pull/17176>
>
> See https://forum.babylonjs.com/t/feedback-on-frame-graphs/58672/54

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [September 26, 2025, 7:14pm UTC](https://forum.babylonjs.com/t/feedback-on-frame-graphs/58672/56 "2025-09-26T19:14:45Z")

</div>

Unassigned @Evgeni\_Popov on September 26, 2025, 7:14pm UTC



---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [October 8, 2025, 4:55pm UTC](https://forum.babylonjs.com/t/feedback-on-frame-graphs/58672/57 "2025-10-08T16:55:51Z")

</div>

> [@phaselock](#):
>
> I forgot to ask: what is the equivalent of `effectRenderer.render(effectWrapper,outputTexture)` using framegraph textures, ie, the internal textures managed by the `FrameGraphTextureManager`?
> 
> Reason: I managed to port a custom post process to `FrameGraphTask`. Under the hood, its using rtts for the ping pong textures and `context._effectRenderer.render(effectWrapper,outputTexture)` in the `pass.setExecuteFunc`. I could not find an equivalent from the api that renders to the internal texture direct so as to leverage the benefit of the texture manager.
> 
> Do I need to submit a PR/feature request?

I didn’t forget!

Here’s an example on how to use a ping/pong texture to implement a onion skin renderer (see the `FrameGraphOnionSkinObjectRendererTask` class - it’s heavily based on the TAA renderer task implementation):

> **[Babylon.js Playground](https://playground.babylonjs.com/#YKE002)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL and WebGPU 3D scenes

I will use this example in the doc to explain how to create a custom rendering task as well as how history textures work, but you can maybe find something useful from it even without the doc.

---

<div class="post-metadata">

**Author:** ![phaselock](https://avatars.discourse-cdn.com/v4/letter/p/da6949/32.png) [@phaselock](https://forum.babylonjs.com/u/phaselock)\
**Post date:** [October 9, 2025, 1:31pm UTC](https://forum.babylonjs.com/t/feedback-on-frame-graphs/58672/58 "2025-10-09T13:31:27Z")

</div>

Thanks! Haven’t looked too closely but initial thoughts here:

a) I’d skimmed the taa class b4 but never realized the history textures meant ping pong textures. Is there any particular reason for the nomenclature? It might be a source of confusion for future devs.

b) It appears the ping pong is handled per frame, ie, ping tex for frame _n_, pong tex for frame _n+1_. My use case requires the ping/pong in 1 frame for N times where N is a low number. Like I said, haven’t looked too closely but wondering if its possible.

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [October 9, 2025, 2:34pm UTC](https://forum.babylonjs.com/t/feedback-on-frame-graphs/58672/59 "2025-10-09T14:34:24Z")

</div>

> [@phaselock](#):
>
> a) I’d skimmed the taa class b4 but never realized the history textures meant ping pong textures. Is there any particular reason for the nomenclature? It might be a source of confusion for future devs.

Yes, “history texture” is the name used by other engines, as there may be more than two textures. The ping/pong texture is a special case of history texture with two textures. I will make sure to clarify this in the documentation.

> [@phaselock](#):
>
> b) It appears the ping pong is handled per frame, ie, ping tex for frame _n_, pong tex for frame _n+1_. My use case requires the ping/pong in 1 frame for N times where N is a low number. Like I said, haven’t looked too closely but wondering if its possible.

That’s not possible at the moment, but I’ll see how it can be handled.

---

<div class="post-metadata">

**Author:** ![phaselock](https://avatars.discourse-cdn.com/v4/letter/p/da6949/32.png) [@phaselock](https://forum.babylonjs.com/u/phaselock)\
**Post date:** [November 5, 2025, 6:58am UTC](https://forum.babylonjs.com/t/feedback-on-frame-graphs/58672/60 "2025-11-05T06:58:57Z")

</div>

> [@Evgeni\_Popov](#):
>
> I will make sure to clarify this in the documentation.

ok, no worries!

> [@Evgeni\_Popov](#):
>
> That’s not possible at the moment, but I’ll see how it can be handled.

This is not a high priority, understand the frame graph needs to cater first to inbuilt processes and native designed workflows rather than custom user processes.

[Previous page](https://forum.babylonjs.com/t/feedback-on-frame-graphs/58672.md?page=2)
