Search Unity

Bug Custom post processing and Camera stacking

Discussion in 'General Graphics' started by AcidArrow, Jan 5, 2023.

  1. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,789
    Is this a bug or has something changed? (I don't see anything relevant in the upgrade guide).

    It seems having 1 camera with a OnPre / OnPostRender postFX script and then another camera on top (with Depth clear), no longer works for built in in 2022 and 2023 and console keeps spamming this:
    Is this a bug, or is this setup not supposed to work any more?
     
  2. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,789
  3. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,789
    Also, I'm not sure why it says it's specific to iOS, I can also recreate the issue on Standalone.
     
  4. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,789
  5. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,789
  6. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,789
    If a Unity developer passes by, I would be interested to know if restructuring the post effect stack around commandbuffers would likely make camera stacking work.

    It is a non trivial amount of work and I don't want to spend the time just to find out that it's still not working properly.
     
  7. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,789
    upload_2024-3-29_21-12-54.png
    ...

    I got proposed a workaround that doesn't work. I was told to add something that also blits to null in the stacked camera, but now the bottom camera doesn't show in the final image.
     
  8. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,789
    I'm fully open to suggestions at this point.

    I have one camera with an OnPreRender and OnPostRender that does a bunch of blits and then a blit to null.

    Then I have a camera that renders on top that has some of our own GUI elements.

    If I attempt to rework this, what method would work?

    I'm using built-in and have used this method since Unity 4, and it stopped working in 2022+, and I'm not sure what approach is supposed to work in modern Unity.