Search Unity

A way to remove FXAA from World Space Canvas?

Discussion in 'Image Effects' started by AcidSheep, Apr 11, 2018.

  1. AcidSheep

    AcidSheep

    Joined:
    Apr 13, 2015
    Posts:
    19
    Hi!

    I have a problem using Post Anti Aliasing in my game. There is some geometry in the scene and World Space UI Elements on top of my Characters & VR Controllers.

    The FXAA gives great results for the geometry but makes the Text of the UI Elements much too blurry. (I understand that the behavior of FXAA is to analyze the pixels and smooth out hard edges - and UI Text is, of course, creating a lot of contrast in the image)

    Without adding additional cameras to the scene - is there a way to disable/mask out the text so that FXAA is only applied to the screen areas around the text?
    (My idea was to put some "invisible" planes in front of the text with some kind of shader that could tell the Image Effects not to apply it's magic in those regions - but I don't know how to do that)

    Any help on the subject is greatly appreciated!!

    Regards,
    Martin
     
    MilenaRocha likes this.
  2. Cleverlie

    Cleverlie

    Joined:
    Dec 23, 2013
    Posts:
    219
    I have the same problem, it would be nice if we can somehow exclude the world canvas from the AA postprocess
     
  3. Cleverlie

    Cleverlie

    Joined:
    Dec 23, 2013
    Posts:
    219
    I actually have a solution, I know this thread is very old but it might be useful for anyone out there with the same problem.

    just create a children camera of your camera, then on the main camera exclude the UI layer and in the child camera make it render ONLY the UI layer, also set it's clear flags to "Don't clear" so it keeps the depth buffer.

    then in the child camera don't use any FXAA effects, this will make the main camera render the world except the stuff in the UI layer (you should put your world canvas in the UI layer) with any post effects you want, and then the child camera render on top of that (btw set the depth of the child camera to something higher than the main one).

    The child camera will render the world canvas without any post effects and AA applied.
     
  4. ghjk

    ghjk

    Joined:
    Dec 4, 2012
    Posts:
    1
    Thank you, very good tip!