Search Unity

Question How malleable can SRP do? Can I use three consecutive cameras in scene?

Discussion in 'Universal Render Pipeline' started by Chengqi-Li, Aug 21, 2022.

  1. Chengqi-Li

    Chengqi-Li

    Joined:
    Mar 11, 2016
    Posts:
    6
    I'm using URP, Unity version 2019.4.25f1c1 or 2021.3.8f1c1. I don't have a lot of experiences in write custom SRP. Anything in this post could be inaccurate or impractical, correct me if I'm wrong.

    I want to make a variant of the 2D Renderer that suits my needs. Basically three consecutive cameras, each uses the result from the last. Following is the scheme. scheme.png
    I know it's a brave one. And I'm describing this problem in a overly detailed way. However, I'm only look for general solutions, or just directions. Randomly toss me some nouns, or websites is more than enough for me.

    In the age of BiRP, I usually use GrabPass in shader to generate distortion effects or blur effects. However, that's not possible in URP. SampleSceneColor samples limited to opaque texture, and I'm making a 2D game that uses tons of SpriteRenderer. To bad opaques will not do.

    Thanks for your time reading.
     
  2. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,055
    You can simply use camera stacking in the URP to do this.

    In shader graph you can use scene color/opaque texture as a grab pass as well. That way you can probably do the post processing in a plane instead of a whole camera!
     
  3. JesOb

    JesOb

    Joined:
    Sep 3, 2012
    Posts:
    1,109
    or just use URP built in render features
     
    DevDunk likes this.