Hi friends,
in my project i’m using babylonjs 5.23.0 and i can’t upgrade engine to a more recent version for a problem with CreateScreenshotUsingRenderTarget function;
I think the problem cames from version 5.27.0 to current version, because of changes in #13040 Don't alter the scene's active cameras in the middle of taking a scre… by carolhmj · Pull Request #13040 · BabylonJS/Babylon.js · GitHub
I use a specific camera for screenshots (camerascreenshot) and i set layermask in meshes and cameras to handle visibility.
I made an example here: https://playground.babylonjs.com/#VET9Q9
Hitting ‘space’, the generated .png image is correct if engine 4.2.1 is loaded, not with latest engine.
Correct result image should include only “bloc.000”(layermask 0x2) and “suzanne.000”(0x1) meshes for camerascreenshot(0x3); All other meshes with layermask 0x4 there shouldn’t be.
correct screenshot from 4.2.1 engine
wrong screenshot from latest version (5.39.0)
P.S.: in PG it would be useful to be able to choose between different versions, not just the latest one…