How to remove the content of the UtilityLayerRenderer when using screenshot

Hi, babylonjs forum.

When upgrading the babylonjs to the latest version, I found the content of the UtilityLayerRenderer will be added when using CreateScreenshotUsingRenderTarget

v7.50.0

v6.49.0

Here is the PG:

How can I remove the content of the UtilityLayerRenderer when using CreateScreenshotUsingRenderTarget?

You can set false for UtilityLayerRenderer.shouldRender before taking the screenshot, and reset it to true afterwards:

2 Likes