Search Unity

change frame rate for second Camera

Discussion in 'General Graphics' started by craig4android, May 18, 2019.

  1. craig4android

    craig4android

    Joined:
    May 8, 2019
    Posts:
    124
    hi is it possible to have a second Camera with a very low fps as an overlay for the main camera.

    Actually I figured out how to use 2 Cameras, but I don't know how to reduce the fps for the second one.
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,342
    Two options: Fake it, or use render textures.

    Faking it would mean controlling the update of things visible in the second camera so that it only updates at a certain frame rate. This would mean using coroutines or sleeps in the update scripts for those objects, but the camera would actually render the full frame rate.

    The render texture option would be the overlay camera renders “first”, and to a render texture which is then added to the main camera as a blit. You then control the update of that camera by disabling the camera and calling Render() on it manually in a coroutine or off of some timer in an update.
     
  3. craig4android

    craig4android

    Joined:
    May 8, 2019
    Posts:
    124
    Ty this solved my problem.
    Problem was, I tried to call Render() on a disabled Camera and thought it would render on the screen, but now I added a RenderTexture and it rendered into the Texture, even with camera disabled.