Search Unity

Camera Stacking Alternative in URP

Discussion in 'Universal Render Pipeline' started by tomglenn, Oct 10, 2019.

  1. tomglenn

    tomglenn

    Joined:
    Aug 3, 2015
    Posts:
    28
    Hi folks,

    I've scoured the internet for alternatives to camera stacking for a 3D space game I'm creating and I'm coming up empty.

    The effect I am trying to pull off is that of extremely far away objects such as a planet or sun, far objects such as space stations and nearby objects such as asteroids/cargo containers etc.

    In the built-in renderer I would achieve this (and others appear to have done the same) via camera stacking, with a near, far and back camera setup - each rendering their respective layered objects and having the cameras replicate the players rotation but translating at different speed multipliers.

    I'm aware that since LWRP/URP camera stacking is no longer an option (at least for now) but I am hoping someone can help me figure out an alternative way of achieving the same or similar effect.

    It seems none of the popular engines (Unity, Unreal, Godot etc) support camera stacking anymore, so there MUST be another way of solving this problem?

    Any and all help is very much appreciated.
     
  2. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    I have been thinking about this, but my UNTESTED solution would be either to render to texture farfield, or just renderpass smaller version of the far scene in their own layer. Especially for planet game, using smaller model is already a trick to do.
     
  3. tomglenn

    tomglenn

    Joined:
    Aug 3, 2015
    Posts:
    28
    Thanks for the response. In Godot I have achieved a solution similar to the one you're mentioning (with the help of some great folks over at the Godot forums I should add), whereby i'm rendering a seperate viewport to a render texture on a canvas overlay and using the screen alpha channel to only show the "far" view where there is nothing in the main camera view.

    e.g:
    upload_2019-10-11_0-3-49.png

    I'm not sure how I would do the same in Unity. Any pointers would be very useful.

    As for the small planet model option, I would have to place the model very close to the player to achieve the desired effect (a large looking planet in the background of the scene) and then it would start intersecting with nearby objects like asteroids.
     
  4. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    Use renderpasses, they showed a FPS example that fit that constrain, they made it so that the gun don't intersect geometry, in your case you probably need to shift lighting too. Also very close to the player ... it's all relative size, planet don't have to be that small.

     
    BourbonBristles and noio like this.
  5. horeaper

    horeaper

    Joined:
    Oct 30, 2013
    Posts:
    46
    I remembered in a recent video they said URP Camera Stacking will be available in 2019.3. But on the roadmap page, it's still in "Short Term: Roughly next 6 months"
     
  6. shiena

    shiena

    Joined:
    May 19, 2017
    Posts:
    44
  7. blascoburguillos

    blascoburguillos

    Joined:
    Oct 28, 2020
    Posts:
    5
    >Use renderpasses

    I've tried with URP... also seems not to work in VR