Create Screenshot Using Render Target and GUI

v5 is wrong too, the problem is that the aspect ratio returned by the engine is not right when the GUI is regenerated.

This fixes it for 5.0:
https://playground.babylonjs.com/#PE7MU2#18

Regarding 4.2 I don’t know, the code of CreateScreenshotUsingRenderTarget I have extracted is from 5.0 and there may be some other changes in the lib that makes it fail (using linkWithMesh fails in 4.2). That will be near impossible to know what, though…

3 Likes