Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Run custom shaders before post processing stack?

Discussion in 'Shaders' started by StrawberryStudios, Nov 11, 2019 at 1:57 AM.

  1. StrawberryStudios

    StrawberryStudios

    Joined:
    Jun 14, 2019
    Posts:
    10
    I am using Unity's post processing stack v.2 as well as my own shaders that I run through OnRenderImage(). At the moment, the custom shaders are ran after the post processing stack. Is there any way to change the rendering order of these two?
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    7,480
    Normally the post processing order is determined by the order of the components on the camera, at least for effects that rely on the OnRenderImage function. However the post processing stack does not use OnRenderImage and instead uses command buffers. If you want to control the order of your effect to be before the post processing stack, you’ll likely want to implement your effect as a custom effect for the post processing stack.
    https://github.com/Unity-Technologies/PostProcessing/wiki/Writing-Custom-Effects
     
    StrawberryStudios likes this.