UsingRenderTarget Does not work for Layer

When taking screenshots using the CreatScreenshotUsingRenderTarget, the background image with a Layer was not captured

You can do it this way:

I found another way
pseudo code:

const rtt = new BABYLON.RenderTargetTexture("screenShot", { width: engine.getRenderWidth(), height: engine.getRenderHeight() }, scene);
rtt.renderList = scene.meshes;

//layer set up
var layer = new BABYLON.Layer('','', scene, true);
//RTT adds renderTargetTextures to the layer

Please review:

Yes, it’s also a way to handle layers in the screenshot function. But if you want to support all features (like GUI) in your screenshots, it’s simpler to use the outputRenderTarget property of an additional camera.

Okay, okay, I learned it