CreateScreenshotUsingRenderTarget
sometimes gets stuck in an endless loop waiting for texture to become ready:
const texture = new RenderTargetTexture("screenShot", targetTextureSize, scene, false, false, 0, false, Texture.BILINEAR_SAMPLINGMODE, undefined, enableStencilBuffer, undefined, undefined, undefined, samples);
...
const renderWhenReady = () => {
console.debug('renderWhenReady', texture.isReadyForRendering(), camera.isReady(true))
if (texture.isReadyForRendering() && camera.isReady(true)) {
...
}
else {
setTimeout(renderWhenReady, 16);
}
}
This prints renderWhenReady false true
endlessly. But it’s intermittent - I haven’t been able to replicate in a PG.