Search Unity

Which order will image effects be applied in?

Discussion in 'Image Effects' started by ekergraphics, Feb 23, 2018.

  1. ekergraphics

    ekergraphics

    Joined:
    Feb 22, 2017
    Posts:
    257
    We do not use the post processing stack. We use a number of separate assets for things like ambient occlusion, sharpening, etc.

    Now we want the sharpening to be applied after the anti aliasing (an image effect we’re testing), but before the ambient occlusion (as a test).

    How can we achieve this? Is the order in which you add scripts to the camera important, for example?
     
  2. fbayersound

    fbayersound

    Joined:
    Mar 16, 2018
    Posts:
    4
    Yes, the order in which you add your script most often determines the order of the effect, what effects are you using?
     
  3. ekergraphics

    ekergraphics

    Joined:
    Feb 22, 2017
    Posts:
    257
    We're in the process of testing some scripts, so it's going to look like this, plus some anti-aliasing at one point in the future:



    So what you are saying is that the top script will execute first, and the bottom last?
     
    Last edited: Mar 16, 2018
  4. fbayersound

    fbayersound

    Joined:
    Mar 16, 2018
    Posts:
    4
    Generally yes, however in some/ most instances there are other methods developers use to determine or set the order such as command buffers which will override the script order. This is important as some effects need to be rendered before transparent objects or after depending on the effect. This is a major issue with Unity as there are no solid standards and it gets out of hand very quickly. The worst part is if not programmed efficiently some effects re-render the required render targets again by using replacement shaders such as the color buffer etc. That is why the Unity post processing stack is popular as it applies the effects in the correct order and does not replicate rendering the required data needed which is already available for the other effects to work.