Possible to render a scene that is clipped by a UI element?

I did get a simple demo of a viewport working: Babylon.js Playground but I can’t see how to get that viewport into a UI element (inside a UI ScrollViewer).

So I went down the screenshots route and have got this far: https://playground.babylonjs.com/#G9JIJS#2 (if you open the console and run it you will see it log out the screenshot data and hit the debugger. If you change scene.activeCamera = camera//_mesh_preview_screenshots to scene.activeCamera = camera_mesh_preview_screenshots then the correct screenshot data is produced.)

But I am stuck on this issue where the BABYLON.Tools.CreateScreenshot function seems to ignore the camera you pass to it: Screenshot tool does not seem to respect camera argument?

For now I will write a script that produces all the screenshot previews I need and then manually copy them into the code like this: https://playground.babylonjs.com/#G9JIJS#3 to produce the desired result: