Search Unity

Correct way to render Camera in VR-PostProcess

Discussion in 'Universal Render Pipeline' started by Mese96, Feb 12, 2020.

  1. Mese96

    Mese96

    Joined:
    Jul 23, 2013
    Posts:
    40
    I want to have a post effect (PPv2) which uses the default rendered camera image and a second one which is rendered with a different CullingMask.
    In the past I did a manual Camera.Render() but this is a recursive call and forbidden in the SRP.
    What is the most straight forward way to do an equivalent.
    Had it working on the Default pipeline as well as the HDRP. Just the URP is complicated/unclear.

    I tried to use a second camera which is rendering to a render texture.
    This resulted in doubled pictures on each eye, so the coordinates are not set up properly.
    What is the correct way to sample the manually rendered texture ?
    (And is there anything special in setting up the Render texture ?)

    Thanks in advance for any help or insight
     
  2. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    584
    In URP you can use UniversalRenderPipeline.RenderSingleCamera to render standalone cameras.

    If you are rendering to a render texture you can disable stereo for that camera and it should work.
     
  3. Mese96

    Mese96

    Joined:
    Jul 23, 2013
    Posts:
    40
    But how to get the ScriptableRenderContext needed as parameter ?
    (Inside the Post Process)

    But then would the image not be stereo :D
    Basically I need to render the VR Cam two times with different Settings and use both rendered pictures in a PostProcess.