Search Unity

Disable Post Processing on shader generated via Amplify Shader Editor

Discussion in 'Shaders' started by rustofelees, Jul 10, 2019.

  1. rustofelees

    rustofelees

    Joined:
    Apr 22, 2013
    Posts:
    24
    I have a fragment shader that was generated using Amplify Shader. Objects that use this shader are currently affected by the Post Processing stack. Is there a change I can make to the shader so that the post processing stack is disabled for objects that utilize this shader
     
  2. Invertex

    Invertex

    Joined:
    Nov 7, 2013
    Posts:
    896
    Post processing happens "post" rendering of scene objects, it's a screen-space process, not per-object, otherwise performance would be terrible.

    Depending on your needs for the rendered objects, you could try setting the render queue to 5000 on the material to see if the Overlay queue will happen after postprocessing, but I feel like it probably doesn't.

    The other option would be to render those specific objects after post processing has been done, or have them on their own layer that only a second child camera of the main cam that has no PP on it will render.
     
  3. rustofelees

    rustofelees

    Joined:
    Apr 22, 2013
    Posts:
    24
    Thanks for the reply Invertex. I tried setting the queue to be larger and can verify that doesn't work. Could you provide more info on how to render specific objects after post processing? Seems it might be my last option beyond using a second camera (which i would like to avoid if possible).
     
  4. Invertex

    Invertex

    Joined:
    Nov 7, 2013
    Posts:
    896
    There isn't really another option I'm aware of short of making a post process script the renders a list of objects after all the other post processing has happened.

    Your simplest solution is just the secondary camera option. What kind of objects are you trying to avoid having post processing on? If it's just UI, a secondary camera is common for that and isn't as expensive as you might think it will be.
     
  5. rustofelees

    rustofelees

    Joined:
    Apr 22, 2013
    Posts:
    24
    It is in fact UI objects (mesh renderers) that I'm trying to render without post processing. It's possible to use a second camera, but I'm trying to avoid that route as the tools will be distributed to multiple teams who may or may not already have a second/third camera setup for such things. It would be more ideal to just have them work under the hood without having to determine which teams need the second camera.
     
  6. Invertex

    Invertex

    Joined:
    Nov 7, 2013
    Posts:
    896
    Is there a reason they need to be mesh renderers? Could they not be sprite renderers with a custom sprite shape and then used in your canvas? As canvas rendered assets won't be affected by the post processing.
     
  7. rustofelees

    rustofelees

    Joined:
    Apr 22, 2013
    Posts:
    24
    in this case, they do need to be mesh renderers as most of them have dimensionality to them (they're more than just 2D sprites).