Search Unity

  1. Unity 2019.1 is now released.
    Dismiss Notice

Game Window Guides when rendering to a RenderTexture

Discussion in 'Cinemachine' started by RobO_HB, Nov 27, 2018.

  1. RobO_HB

    RobO_HB

    Joined:
    Sep 16, 2013
    Posts:
    6
    Hello,

    Our game's main camera currently renders to a RenderTexture before actually being displayed on the screen (for reasons that are beyond the scope of this question - assume for the purposes of this question that it has to be that way). I have set up a Brain, a Clear Shot camera, and some Virtual Cameras. When I select a Virtual Camera in the hierarchy, even with Game Window Guides checked, I do not get any on-screen guides.

    I've tracked the problem to this check in CinemachineComposerEditor.OnGUI():

    Code (CSharp):
    1. if (brain == null || brain.OutputCamera.activeTexture != null)
    2.     return;
    If I remove the second part of that check in my local version of CinemachineComposerEditor.cs (Library\PackageCache\com.unity.cinemachine@2.2.7\Editor\Editors\CinemachineComposerEditor.cs), I get the on-screen guides when I select a Virtual Camera in the hierarchy, as I want. However, actually altering Cinemachine files to expose this is not really an option - due to the nature of how packages are included via the new Package Manager I would have no way to roll out that change to the rest of the team via source control. Besides that, I also don't want to start having a local version of Cinemachine that diverges from the "real" package that is available.

    Is there any way to enable Game Window Guides on a camera that is rendered to a RenderTexture? Is there a particular reason why drawing the guides explicitly bails out if the camera is rendering to a texture?
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    2,357
    This check is there to prevent game window guides from showing up in picture-on-picture type applications, where render textures are used, and game widow guides are inappropriate. We could probably refine this logic so that your use-case is supported. Thanks for letting us know!

    Until a change is released for this, your only option is to modify the CM source directly. You could do this directly in the CM cache on the machines where this feature is needed.
     
    Last edited: Nov 29, 2018
  3. RobO_HB

    RobO_HB

    Joined:
    Sep 16, 2013
    Posts:
    6
    Hi Gregory,

    Thanks for the info. I'll try to come up with some reasonable way to roll out local CM cache changes to the team members who need it.

    Rob