Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question URP 2Cameras 500fps to 40fps

Discussion in 'General Discussion' started by TinMRD, Dec 2, 2023.

  1. TinMRD

    TinMRD

    Joined:
    Apr 1, 2018
    Posts:
    3
    Hi I am making an inventory in Unity URP 2022.3.4f1 LTS and thaught it wuld be cool to have a representation of the character in a viewport rect displayed over the Main camera. But soon incountred a masive decrese in fps from 500 to 20. The picture below shows my game with viewport rect camera on left, main camera in the middle and rendertexture on raw image to the right. upload_2023-12-2_20-8-14.png
    My first thaught was that its just realy expensive to render 2 cameras at the same time but i couldent se the reason for it to even be a thing if the diffrence was that huge, So i found sume promising posts but nothing worked for me not even an imige with a render texture solved my problem so i made a new project (not in URP but same version. This verks perfecktly still a bit heavy but i think thats fine in the inventory for now(500 - 380)fps.
    this picture has the same layout as the one in URP but sume random other model. I tried diffrent models in the URP project to with no sucsess even a whole new scene but diddent matter so i don't think i changed anny factory setting. upload_2023-12-2_20-5-57.png
    Now i want it to work in URP and i have tested CameraStacking but thats not the efect I am after altho the fps is good. i whant the ViewPort Rect path whithout render texture since im planing to raycast onto the charackter for sume equipment manipulation.
    In both projects i used the same simple script so rotate the model.
    upload_2023-12-2_20-14-59.png
    Wuld love sume help! =)

    URP , Viewport Rect , Camera , CameraStacking , RenderTexture , Bad Preformance , Bad fps , Multiple Cameras , 2 Cameras
     
    Last edited: Dec 2, 2023
  2. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,027
    Why not just use another character mesh instead of two cameras? That would solve both the performance issues and also still let you use raycasts.
     
  3. TinMRD

    TinMRD

    Joined:
    Apr 1, 2018
    Posts:
    3
    I thaught about that to or maby just deactivate the main camera and use another camera for the moment, but that wuld make you feal a bid disconected from the character i fear. I whant the whole inventory to be semi transparent making you able to see your surrundings still.