Is it possible to set different framerates when using multiple monitors?

I am working on a big simulator project that uses 4 screens. A big 4K main one, and 3 other smaller ones. They’re meant to represent windows that show the same environment all around the user, but rendering this much of the environment does pose some challenges regarding the performance of my application.

However, most of the time, the attention of the user will be fixated on the main screen. My question is: Is it possible to run the other 3 monitors at a lower FPS than the main one.

I want the physics calculations and stuff to run at the highest rate (that of the main monitor, ideally 60FPS). The other cameras can run at a lower pace, lets say 30FPS.

My current hardware is unable to run all monitors at 60FPS, so if they have to go slower anyways, i’d rather guide this effect to where the user is least focussed.

Naturally, I am also looking into other optimalisation options, I’m just interested in whether or not this is possible.

I don’t believe this is possible with Unity. You can set the entire application’s framerate, but individual camera framerate is probably out of your hands.

However, you could try manually rendering your cameras in a multi-frame loop- rendering a camera on frame 0, then another on frame 1, then another on frame 2, etc. This would basically be rendering each camera at 1/3 of the normal framerate, if you have 3 additional cameras. You could do this in a coroutine, basically rendering your other monitors in a cyclical cycle each frame using something like a manual Camera.Render() call.

Here is some untested code that might help

using UnityEngine;
using System.Collections;

class CyclicRenderer : Monobehaviour
{

    int lastRenderedCamera = 0;
    public Camera[] additionalCameras;

    IEnumerator Start()
    {
        yield return new WaitForEndOfFrame();
        
        additionalCameras[lastRenderedCamera].Render();

        lastRenderedCamera++;
        lastRenderedCamera = lastRenderedCamera >= additionalCameras.Length ? 0 : lastRenderedCamera;

        yield return Start();
    }
}

With some tweaking you might be able to set individual camera framerates, maybe by adding a custom controller to each camera that makes it render a set amount of times per second. However they would need to be out-of-sync in order to maximize the application speed, as if all additional cameras render at the same time it could cause lag spikes.

Hi, thanks for replying.
We have since solved it. We’re using a script that renders the side cameras alternatingly (if you just render them at a fixed framerate then the frames on which the displays would be updated would take longer than the frames that they don’t, which looks jarring. So right now, the display on the left is updated every even frame, and the right one every odd frame).

For anybody looking for a similar solution: This is our script:

using System.Collections;
using UnityEngine;

[RequireComponent(typeof(Camera))]
public class RenderCamAtDifferentFPS : MonoBehaviour
{
    Camera m_cam;
    public bool m_offset;

    private void Start()
    {
        m_cam = GetComponent<Camera>();

        // only enable alternating if there's a pair of side-screens detected
        enabled = Display.displays.Length >= 4;
        Debug.LogFormat("Found {0} connected displays. Alternating side-cameras is {1}!", Display.displays.Length, enabled);
    }

    private void LateUpdate()
    {
        if (m_cam == null)
            return;

        m_cam.enabled = Time.frameCount % 2 == (m_offset == true ? 0 : 1);
    }
}