Search Unity

Run custom shaders before post processing stack?

Discussion in 'Shaders' started by MSoderberg, Nov 11, 2019.

  1. MSoderberg

    MSoderberg

    Joined:
    Jun 14, 2019
    Posts:
    20
    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:
    12,352
    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
     
    zznowisee and MSoderberg like this.