Multiple cameras rendering performance

Hello,
I would like to render multiple cameras on the screen, but performance (FPS) is rapidly decreasing.
I discovered that setting a custom low resolution in the post process section of Armory configuration can greatly improve FPS.
image
The problem is that all the cameras use this setting, I’m looking for a way to have different render resolutions for each camera. The main camera will be full screen, but some cameras will be displayed only in a small portion of the screen.
I’m using a Haxe trait to render additional cameras, this piece of code on init :

  	// Create render target for camera
  	cam.renderTarget = kha.Image.createRenderTarget(
  		640,
  		400,
  		kha.graphics4.TextureFormat.RGBA32,
  		kha.graphics4.DepthStencilFormat.NoDepthAndStencil
  	);

Playing with width and height don’t change anything.
Is there a way to dynamically change the render resolution ?
Thanks,
Mokauno

1 Like

Hey,

I think the width and height of the render target actually define the render resolution. One way to achieve dynamic resolution may be to dynamically create a render target of desired width, height and render it.

If you need to have a lower resolution than the target window, then some sort of scaling must be applied to the render target.

1 Like

Hi QC ! thanks for your answer :slight_smile:
The real problem is : I need to render an additionnal camera at a low resolution, ex 300*200, but it will still use the parameter defined globally on the [post process] section (resolution, size). So if I set this parameter at 720, it will use 720 to render a camera at 200. It’s a waste of resource, and a lost in performance.
I would like to adjust this parameter at runtime for each camera. Note I still need a 720 resolution to render the main camera.