# Snapshot Rendering stops under certain conditions

**URL:** <https://forum.babylonjs.com/t/snapshot-rendering-stops-under-certain-conditions/63365>\
**Category:** Bugs\
**Created:** [May 11, 2026, 7:30am UTC](https://forum.babylonjs.com/t/snapshot-rendering-stops-under-certain-conditions/63365 "2026-05-11T07:30:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![syuilo](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/syuilo/32/49788_2.png) [@syuilo](https://forum.babylonjs.com/u/syuilo)\
**Post date:** [May 11, 2026, 7:30am UTC](https://forum.babylonjs.com/t/snapshot-rendering-stops-under-certain-conditions/63365/1 "2026-05-11T07:30:07Z")

</div>

Under certain conditions, Snapshot Rendering stops working and can never be re-enabled. In some cases, it also causes rendering glitches such as materials being swapped with others.

There are probably multiple conditions that can cause SR to stop or trigger rendering glitches, and they have not been fully identified yet. However, I discovered one of them and created a repro.

repro: [https://playground.babylonjs.com/#JCB9JF](https://playground.babylonjs.com/#JCB9JF)

This repro does not reproduce the material swapping issue, but it does reproduce the problem where SR stops working and can never be re-enabled again.

As described in the documentation, this repro calls `disableSnapshotRendering` when a canvas resize is detected, and then calls `enableSnapshotRendering` shortly afterward.

The scene contains a moving cube so that the SR state is easy to observe (its movement is reflected only when SR is disabled).

Additionally, `enableSnapshotRendering` is exported to `window` so that SR can also be re-enabled manually.

Now, if resizing is performed continuously, eventually SR remains disabled permanently, and even if `enableSnapshotRendering` is called again afterward, it never becomes active again.

Please see the attached video for details.

Thank you for maintaining this great framework!

---

<div class="post-metadata">

**Author:** ![syuilo](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/syuilo/32/49788_2.png) [@syuilo](https://forum.babylonjs.com/u/syuilo)\
**Post date:** [May 11, 2026, 9:01am UTC](https://forum.babylonjs.com/t/snapshot-rendering-stops-under-certain-conditions/63365/2 "2026-05-11T09:01:01Z")

</div>

Here is another repro: [https://playground.babylonjs.com/#JCB9JF#2](https://playground.babylonjs.com/#JCB9JF#2)

---

<div class="post-metadata">

**Author:** ![Cedric](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/cedric/32/2742_2.png) [@Cedric](https://forum.babylonjs.com/u/Cedric)\
**Post date:** [May 11, 2026, 10:15am UTC](https://forum.babylonjs.com/t/snapshot-rendering-stops-under-certain-conditions/63365/3 "2026-05-11T10:15:29Z")

</div>

cc @Evgeni_Popov

---

<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 11, 2026, 11:53am UTC](https://forum.babylonjs.com/t/snapshot-rendering-stops-under-certain-conditions/63365/4 "2026-05-11T11:53:52Z")

</div>

Hi @syuilo, thanks for the detailed repro and the video — that made it very easy to confirm.

This is an engine bug. Internally, `WebGPUSnapshotRendering` temporarily switches `_mode` to `STANDARD` while it’s recording the bundle list (it’s restored to the user-requested mode at `endFrame`). If `disableSnapshotRendering()` lands while a recording is still in flight (very easy under continuous resizes), `_mode` stays at `STANDARD`, and the next `enableSnapshotRendering()` saves `STANDARD` as the “intended” mode — at which point the engine permanently falls back to `STANDARD` for the rest of the session. That matches what you observed: `engine.snapshotRendering === true` but `engine.snapshotRenderingMode === 0`.

The same race had been fixed for `engine.snapshotRenderingReset()` in #15633, but the protection was missing on the `enabled` setter.

Fix is opened here: [Fix snapshot rendering permanently falling back to STANDARD mode when disable interrupts an in-progress recording by Popov72 · Pull Request #18444 · BabylonJS/Babylon.js · GitHub](https://github.com/BabylonJS/Babylon.js/pull/18444).

Workaround until it lands: debounce your resize-driven disable/enable so they don’t fire during the snapshot recording window (a `setTimeout(..., 100)` or `requestAnimationFrame` debounce on the resize handler is usually enough).

Thanks again for the great bug report!

---

<div class="post-metadata">

**Author:** ![syuilo](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/syuilo/32/49788_2.png) [@syuilo](https://forum.babylonjs.com/u/syuilo)\
**Post date:** [May 11, 2026, 11:59am UTC](https://forum.babylonjs.com/t/snapshot-rendering-stops-under-certain-conditions/63365/5 "2026-05-11T11:59:04Z")

</div>

Thank you for detailed explanation and the quick fix!
