# 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:** 1

<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:** [May 27, 2025, 5:03am UTC](https://forum.babylonjs.com/t/feedback-on-frame-graphs/58672/1 "2025-05-27T05:03:07Z")

</div>

Testing frame graphs, some early feedback so far:

a) needs side effects. I’m not sure if its me only, in any case, I did not see it in the doc.

```auto
import "@babylonjs/core/Engines/Extensions/engine.multiRender.js"
import "@babylonjs/core/Engines/WebGPU/Extensions/engine.multiRender.js"

```

b) es6 imports are pretty long and kinda different from usual, not sure if its worth fixing

```auto
import { FrameGraphCascadedShadowGeneratorTask } from "@babylonjs/core/FrameGraph/Tasks/Rendering/csmShadowGeneratorTask.js";

```

compared to

```auto
import { DirectionalLight } from "@babylonjs/core/Lights/directionalLight.js";

```

c) `objectList` in the tasks needs input of `FrameGraphObjectList` type. An incorrect assignment `objectList = [sphere];` does not throw a warning, instead log throws `mesh undefined in _checkReadiness blah blah` which doesn’t help.

d) In the case where a frame graph replaces scene render loop, there is no support for user interactions, ie, keyboard pointers etc. I understand only a few observables are supported but I can’t envision a modern scenario where a user only needs to see and not interact in some way/fashion. In any case, my testing bottlenecked due to this.

Hope it helps.

---

<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:** [May 27, 2025, 9:32am UTC](https://forum.babylonjs.com/t/feedback-on-frame-graphs/58672/2 "2025-05-27T09:32:47Z")

</div>

Thank for your feedback!

> [@phaselock](#):
>
> needs side effects. I’m not sure if its me only, in any case, I did not see it in the doc

I will add these imports in `FrameGraph.ts`.

> [@phaselock](#):
>
> es6 imports are pretty long and kinda different from usual, not sure if its worth fixing

`FrameGraphCascadedShadowGeneratorTask` is probably the longest name you’ll find in the frame graph framework, but `FrameGraphCSMTask` wouldn’t have been very appropriate, since the generator is called `CascadedShadowGenerator`. I don’t think names like this are a problem, though (?)

> [@phaselock](#):
>
> `objectList` in the tasks needs input of `FrameGraphObjectList` type. An incorrect assignment `objectList = [sphere];` does not throw a warning, instead log throws `mesh undefined in _checkReadiness blah blah` which doesn’t help.

You probably test in Javascript and not Typescript? With Typescript, you should have an error if you don’t use the right type. In Javascript, you can pass anything you want to any function, it’s not specific to frame graph.

> [@phaselock](#):
>
> In the case where a frame graph replaces scene render loop, there is no support for user interactions, ie, keyboard pointers etc

Setting `scene.cameraToUseForPointers = yourCamera` should fix it (see [Babylon.js docs](https://doc.babylonjs.com/features/featuresDeepDive/frameGraph/frameGraphBasicConcepts/#use-a-frame-graph-instead-of-the-scene-render-loop)). If not, can you provide a PG so that I can have a look?

---

<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:** [May 27, 2025, 11:03am UTC](https://forum.babylonjs.com/t/feedback-on-frame-graphs/58672/3 "2025-05-27T11:03:08Z")

</div>

> [@Evgeni\_Popov](#):
>
> I will add these imports

Awesome, thanks!

> [@Evgeni\_Popov](#):
>
> I don’t think names like this are a problem, though

Not a huge biggie, just that it wasn’t as intuitive. The local npm package didn’t have the js file with the same name, I had to do some educated guessing.

> [@Evgeni\_Popov](#):
>
> If not, can you provide a PG so that I can have a look?

repro: [Babylon.js Playground](https://playground.babylonjs.com/#DTD5UV)

I see, the problem is against gpu picker not against the pointer obs. hmm…

Also, another feedback. If its not too much, pls demonstrate an example against customRenderTargets for frame graph? I was trying to test the [water shader](https://playground.babylonjs.com/#UNGKGD#7) against frame graph but can’t seem to pipe the refraction texture from the fg to the shader material. Logs complaining about `textures[1].isReady` or some such?

---

<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:** [May 27, 2025, 11:47am UTC](https://forum.babylonjs.com/t/feedback-on-frame-graphs/58672/4 "2025-05-27T11:47:50Z")

</div>

> [@phaselock](#):
>
> I see, the problem is against gpu picker not against the pointer obs. hmm…

Yes, GPU picker is not compatible yet with frame graph, I added it to my todo list: [Frame Graph implementation · Issue #17294 · BabylonJS/Babylon.js · GitHub](https://github.com/BabylonJS/Babylon.js/issues/17294)

> [@phaselock](#):
>
> Also, another feedback. If its not too much, pls demonstrate an example against customRenderTargets for frame graph? I was trying to test the [water shader](https://playground.babylonjs.com/#UNGKGD#7) against frame graph but can’t seem to pipe the refraction texture from the fg to the shader material

This example should help:

> **[Babylon.js docs](https://doc.babylonjs.com/features/featuresDeepDive/frameGraph/frameGraphExamples/frameGraphExampleTransmission/)**

The refraction texture you generate should be connected to the **dependencies** input of the `ObjectRenderer` task which is going to use the texture. Then, on javascript side, use `nodeRenderGraph.onBuildObservable` to retrieve the texture and set it as the refraction texture for your material (line 146+ in the PG of the example above).

---

<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:** [May 27, 2025, 7:08pm UTC](https://forum.babylonjs.com/t/feedback-on-frame-graphs/58672/5 "2025-05-27T19:08:31Z")

</div>

GPU picker support in frame graphs:

> <https://github.com/BabylonJS/Babylon.js/pull/16682>
>
> See https://forum.babylonjs.com/t/feedback-on-frame-graphs/58672/4
> 
> I also did… a few more changes, see https://forum.babylonjs.com/t/autocalcdepthboundsrefreshrate-in-frame-graph-task/58671/2

This PG will work once the PR is merged:

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

---

<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:** [May 28, 2025, 4:02am UTC](https://forum.babylonjs.com/t/feedback-on-frame-graphs/58672/6 "2025-05-28T04:02:37Z")

</div>

> [@Evgeni\_Popov](#):
>
> This example should help:

Oh, I missed this example. Yes, it helps, thanks!

I’m not sure if its my gpu only (GeForce RTX 4060). Using the example pg, with the inspector open I aggressively resized the PG many times (drag middle separator). Occasionally, **my screen** goes white. Now that I’ve managed to get it once, its fairly consistent to repro. ss below.

 ![webgl2_context lost](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/0/8/08d17cbd286a09c692eaa565b98c038594172828.jpeg)

It affects all other PG tabs. Reload solves the problem. It seems like rebuilding the frame graph crashes the context? I’m not sure how serious this could be in userland but I do not recall this happening with `scene.render`? Also, it would help if someone else can repro on their device.

---

<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:** [May 28, 2025, 7:40am UTC](https://forum.babylonjs.com/t/feedback-on-frame-graphs/58672/7 "2025-05-28T07:40:09Z")

</div>

The `geometryViewDepthTexture` of the `FrameGraphGeometryRendererTask`/nrge node is supposed to generate a depth from view. Looking in the inspector, all I see are flat red material used for rendering the texture, there does not seem to be any depth info even when I create many meshes into the distance. Is this wai? I’ve tried the `geometryScreenDepthTexture` as well, its better but still not correct. The far bg is still all red. The best I got is to apply a post with a circle of confusion but it doesn’t seem right.

How should I get the equivalent of the `depthRenderer's depthMap` from the frame graph?

---

<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:** [May 28, 2025, 10:17am UTC](https://forum.babylonjs.com/t/feedback-on-frame-graphs/58672/8 "2025-05-28T10:17:50Z")

</div>

> [@phaselock](#):
>
> Occasionally, **my screen** goes white. Now that I’ve managed to get it once, its fairly consistent to repro. ss below.

I can reproduce (only in WebGL), I’ve added it to my todo list.

> [@phaselock](#):
>
> Looking in the inspector, all I see are flat red material used for rendering the texture, there does not seem to be any depth info even when I create many meshes into the distance. Is this wai?

Yes. The depth in the geometry view depth map is the Z coordinate in camera view space, which ranges from near to far plane (camera minZ/maxZ). So, most values will be \> 1, meaning the texture will appear full red in the inspector. Regarding the geometry screen depth map, far bg being red is expected, as screen depth is between 0 and 1, 1 corresponding to the far clip plane.

Here’s an example of using the geometry screen depth map:

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

> [@phaselock](#):
>
> How should I get the equivalent of the `depthRenderer's depthMap` from the frame graph?

Depth rendering generates view depth values, normalized by performing `(viewDepth - minZ)/(maxZ)`.

There is currently no equivalent to the default depth map, because we don’t typically use the value “as-is” and because linearized view depth is not generated by the geometry/pre-pass renderer, which the geometry renderer task aims to replace.

Do you have a use case where the linearized view depth value is used without being converted back to view depth or screen depth?

---

<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:** [May 29, 2025, 9:25am UTC](https://forum.babylonjs.com/t/feedback-on-frame-graphs/58672/9 "2025-05-29T09:25:56Z")

</div>

> [@Evgeni\_Popov](#):
>
> Do you have a use case where the linearized view depth value is used without being converted back to view depth or screen depth?

Its fine, now that I know how the `geometryViewDepthTexture` works, I can modify my shader. Case in point, I think I have ported the stylized water shader to frame graph version successfully. It was using `depthRenderer's depthMap` in the default, with the `geometryViewDepthTexture`, I simply normalize it in the shader.

default: [https://playground.babylonjs.com/#UNGKGD#7](https://playground.babylonjs.com/#UNGKGD#7)  
frame graph: [https://playground.babylonjs.com/#UNGKGD#300](https://playground.babylonjs.com/#UNGKGD#300)

Now if you look at the scene perf with the inspector, the fg’s does not have activeMeshes. Even if I set `alwaysSelectAsActiveMesh = true;`. Is this 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:** [May 30, 2025, 11:08am UTC](https://forum.babylonjs.com/t/feedback-on-frame-graphs/58672/10 "2025-05-30T11:08:45Z")

</div>

Yes, a number of statistics of the inspector don’t yet work with frame graphs (active meshes, some counters under “Frame Steps Duration”), it’s something on my todo list.

---

<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:** [May 30, 2025, 11:26am UTC](https://forum.babylonjs.com/t/feedback-on-frame-graphs/58672/11 "2025-05-30T11:26:08Z")

</div>

Another one, `autoCalcDepthBounds` does not seem to be working in csm with frame graphs.

original: [Babylon.js Playground](https://playground.babylonjs.com/#HCVIDA)  
repro: [https://playground.babylonjs.com/#HCVIDA#8](https://playground.babylonjs.com/#HCVIDA#8)

comment/uncomment `csmTask.autoCalcDepthBounds = true;`, there doesn’t seem to be any difference.

---

<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:** [May 30, 2025, 11:58am UTC](https://forum.babylonjs.com/t/feedback-on-frame-graphs/58672/12 "2025-05-30T11:58:48Z")

</div>

Good point, added to the to-do list!

---

<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:** [June 3, 2025, 6:23am UTC](https://forum.babylonjs.com/t/feedback-on-frame-graphs/58672/13 "2025-06-03T06:23:30Z")

</div>

> [@Evgeni\_Popov](#):
>
> GPU picker support in frame graphs

Tested in v8.10.0, works now. Thanks!

---

<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:** [June 3, 2025, 4:33pm UTC](https://forum.babylonjs.com/t/feedback-on-frame-graphs/58672/14 "2025-06-03T16:33:40Z")

</div>

This PR will fix `autoCalcDepthBounds`:

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

---

<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:** [June 4, 2025, 3:49am UTC](https://forum.babylonjs.com/t/feedback-on-frame-graphs/58672/15 "2025-06-04T03:49:20Z")

</div>

> [@Evgeni\_Popov](#):
>
> This PR will fix `autoCalcDepthBounds`:

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

An existing csm cannot co-exist with frame graph csm, console throws `Error: Active camera not set`. In [v8.10.0](https://playground.babylonjs.com/?version=8.10.0#HCVIDA#9), both csm and csmTask works together altho the csmTask will override csm. 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:** [June 4, 2025, 6:55am UTC](https://forum.babylonjs.com/t/feedback-on-frame-graphs/58672/16 "2025-06-04T06:55:48Z")

</div>

You need to pass the camera to the CSM builder to fix the error (but there is no need to create a CSM manually when using a scene-level frame graph, as it will never be used / the shadowmap will never be generated):

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

In any case, I will create another PR in the next few days to improve the handling of `autoCalcDepthBounds`, which will allow this error to be removed without modifying the constructor.

---

<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:** [July 7, 2025, 8:07am UTC](https://forum.babylonjs.com/t/feedback-on-frame-graphs/58672/17 "2025-07-07T08:07:37Z")

</div>

> [@Evgeni\_Popov](#):
>
> In any case, I will create another PR in the next few days to improve the handling of `autoCalcDepthBounds`, which will allow this error to be removed without modifying the constructor.

Tested in v8.14.0, working now! Thanks!

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

Testing instances vs frame graph. When passing an instance into the object list, both the root mesh and instance show in the color texture. I presume there should be a way to exclude the root mesh? Also, same question could be extended to thin instances, ie, how to render a specific thin instance to a texture for frame graph?

edit: I forgot to ask. Is there a workflow for the case of custom effect renderers? can I create custom frame graph wrappers/classes for interfacing into the scene frame graph? or will the build process complain?

---

<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:** [July 7, 2025, 2:34pm UTC](https://forum.babylonjs.com/t/feedback-on-frame-graphs/58672/18 "2025-07-07T14:34:35Z")

</div>

> [@phaselock](#):
>
> When passing an instance into the object list, both the root mesh and instance show in the color texture. I presume there should be a way to exclude the root mesh?

This PR will fix the bug (the root mesh should not be displayed if it’s not in the mesh list):

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

> [@phaselock](#):
>
> Also, same question could be extended to thin instances, ie, how to render a specific thin instance to a texture for frame graph?

Thin instances are part of a mesh: if a mesh is in a frame graph object list, its thin instances will be displayed. It’s not specific to frame graphs, it’s the same thing if you add a mesh with thin instances to a `RTT.renderList`: all thin instances of the mesh will be displayed in the RTT.

> [@phaselock](#):
>
> edit: I forgot to ask. Is there a workflow for the case of custom effect renderers? can I create custom frame graph wrappers/classes for interfacing into the scene frame graph? or will the build process complain?

You can create frame graph tasks yourself, that you can add to a frame graph. You can take model on existing tasks (under `FrameGraph/Tasks/`) to write your own tasks, and I plan to make an example to demonstrate how to write a custom task / node render graph.

---

<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:** [August 27, 2025, 8:51am UTC](https://forum.babylonjs.com/t/feedback-on-frame-graphs/58672/19 "2025-08-27T08:51:44Z")

</div>

I don’t have a consistent repro due to its nature but it does happen.

What I did:  
a) create a basic framegraph setup as in doc. The default pg with sphere will do.  
b) create action manager on the sphere and add triggers on pointerover/out. In my case, I was playing around with dynamic captures with the fg. sample trigger code below:

```auto
BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPointerOverTrigger, function () {
    if (mesh!==undefined){
        caplist.meshes = [mesh];
        frameGraph.build();
    }
}

```

c) make sure the frame graph is built and running, ie, sphere triggers etc.  
d) change to another tab, ie, make the PG tab inactive, sry, can’t provide a specific duration.  
e) change back to the tab, and immediately mouse-over the sphere to trigger `frameGraph.build()`. You might get the webgl context lost as my below ss shows (feels similar to the context lost case reported earlier in this thread?, shrugs…). Sometimes the browser recovers but sometimes not. For me, the whole screen flashes white/black and the tab just freezes and I lose the PG+codes.

 ![fg_context_lost](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/4/e/4e7a689e877b8cc54860950ca123038051e4aaff.jpeg)

---

<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:** [August 27, 2025, 12:55pm UTC](https://forum.babylonjs.com/t/feedback-on-frame-graphs/58672/20 "2025-08-27T12:55:50Z")

</div>

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?

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