Rendering Region of canvas only?

I’m Rendering my scene using BABYLON.Tools.CreateScreenshotUsingRenderTarget(), which is fine, but I’m limited to the resolution that the computer can handle at any given time.

I’m wondering if there’s a way to render only a region at a time, so I can stitch them together later? In other 3D software there’s a camera “FilmBack” that you can shift, allowing you to change the region being displayed without actually changing the rotation etc of the camera - this would do the job if anyone knows how to do something like this?

Otherwise are there any other methods for achieving this?

Thanks

Hello! What kind of camera are you using in your setup?

It’s an ArcRotate camera, but honestly, I’ll use any camera that will get the job done!

Oh ArcRotateCamera is perfect since it has targetScreenOffset: ArcRotateCamera | Babylon.js Documentation (babylonjs.com)

You can use it to “shift” the region being displayed like this: TargetScreenOffset Example | Babylon.js Playground (babylonjs.com) :smiley:

1 Like

Amazing! This looks close.

This actually changes the position of the camera though, so the perspective changes. I’m wondering if there’s either a way to offset this? or a related method? It should be able to move the render window without affecting the perspective.

Hmm @PolygonalSun might have some ideas

Is your goal just to make high resolution screenshots, because if so, you should be able to use the width, height, and precision params to get a quality high res image that way.
Example:

BABYLON.Tools.CreateScreenshotUsingRenderTarget(engine, camera, {width: 2000, height: 2000, precision: 8});

Other than that, the only thing that’d come to mind would be to use a multi-cam approach where you have a primary camera as your main FOV and a secondary one that uses either a modified field of view or closer position to grab closer screenshots. If it’s parented to the primary camera, you should be able to keep the same alpha/beta angles but use the targetScreenOffset to move your screenshot camera.