Search Unity

How to setup URP to support a project that is both 2D & 3D?

Discussion in 'Universal Render Pipeline' started by kheper, Jul 20, 2021.

  1. kheper

    kheper

    Joined:
    Jul 21, 2014
    Posts:
    12
    I am working on a project that I (regrettably at this point) migrated to use the universal render pipeline. My project has some scenes that are 2D using sprites and other scenes in 3D. My 2D scenes look great with my default 2D render pipeline setup. However, all the models in my 3D scene are flat grey shapes. This is easy to fix, just change to a 3D render pipeline. However, this messes up my sprites in my 2D scene. What is the right approach to this problem?

    The only info I can find on this is: https://docs.unity3d.com/Manual/srp-setting-render-pipeline-asset.html . However, this seems like a crude solution. I also have no clue how this will help workflow as I change between scenes. Do I have to change my render settings every time I switch between 2d & 3d scenes? Surely this is a common issue faced that has a better solution?
     
    NotaNaN likes this.
  2. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,526
    I think you will need to switch back to the old renderer until unity allows both 2d and 3d render in URP to be used together ( by camera stacking for example )
     
  3. kheper

    kheper

    Joined:
    Jul 21, 2014
    Posts:
    12
    That is unfortunate as I needed to take advantage of shaders and other URP features. Hmm, I guess I will continue to poke around and see if I can find a solution. I was hoping the 'Renderer' property on the camera would work but it doesn't seem to do anything when I switch between 2D & 3D. I am currently using a Render Asset with a 2D & 3D renderer in the render list. I can change the 'default' to get things to work but not sure how to do this in the scene itself.
     
  4. april_4_short

    april_4_short

    Joined:
    Jul 19, 2021
    Posts:
    489
    The easiest way... MIGHT be to use orthographic and perspective Cinemachine cameras... and switch between them as needed.

    But I'd suggest asking @Gregoryl as he knows more than anyone about how that might (or might not) solve your problems.
     
  5. TekillaSunrize

    TekillaSunrize

    Joined:
    May 8, 2022
    Posts:
    4
    Hello,

    Facing same problem here... @kheper any updates on this?
     
  6. Thomukas1

    Thomukas1

    Joined:
    Sep 29, 2014
    Posts:
    31
    Please an update on this
     
  7. kheper

    kheper

    Joined:
    Jul 21, 2014
    Posts:
    12
    Sorry, I never found a solution and moved onto another project. Good luck!
     
  8. ktmarine1999

    ktmarine1999

    Joined:
    Jan 30, 2014
    Posts:
    11
    This should work in Unity 2022 not sure with prior versions.

    You nee A 2D Render and a 3D Render.
    In you Render Pipeline Asset Make sure both Renders are there.
    upload_2023-9-15_23-39-39.png

    In your 2D scenes for the Main Camera select the 2D Render as your Render.


    In your 3d scenes select the 3D render as the Render.
     

    Attached Files:

    iboj1234 and oluf_a like this.