Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Image effects - fog and anti-aliasing

Discussion in 'Web' started by topofsteel, Feb 4, 2016.

  1. topofsteel

    topofsteel

    Joined:
    Dec 2, 2011
    Posts:
    999
    I just discovered adding global fog to my camera disables anti-aliasing. I'm not sure if this is a WebGL specific problem or not. But is there a solution for that? And is there a guide or reference about which effects conflict with others and what order they should be in? Thanks.
     
  2. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    Is this the built-in AA or an ImageEffects-based technique ?
     
  3. topofsteel

    topofsteel

    Joined:
    Dec 2, 2011
    Posts:
    999
  4. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    I haven't looked at how fog is implemented but maybe it's just a matter that the fog is bi-linear filtering the source image, thus blurring the final image. That would explain why AA does not seem to work anymore.

    Have you tried with a post effect-based AA technique so that you can perform AA, then Fog ?
     
  5. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    A bit of experiments confirmed what you are experiencing. Even with a simpler Image Effect, AA will not work anymore.

    We'll investigate and follow up here on this thread.
     
    kenshin likes this.
  6. topofsteel

    topofsteel

    Joined:
    Dec 2, 2011
    Posts:
    999
    Is there an update on this? I am using Forward rendering because of the AA, but not being able to use any image effects is tough!
     
    kenshin likes this.
  7. topofsteel

    topofsteel

    Joined:
    Dec 2, 2011
    Posts:
    999
    @Marco Trivellato

    Can you comment on this, or provide any feedback about the problem? Thanks.
     
  8. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    sorry for the delay, last time I looked at this problem the browsers were missing a webgl2.0-specific extension that we require to get this to work.

    I believe this is not the case anymore so I am going to take a look again so that we can fix it. However, that will fix it in webgl2.0 only and, likely, only in Firefox and Chrome (I need to check the other browers). So for the time being I would recommend to opt for a post-processing based AA technique instead of the built-in one.
     
  9. topofsteel

    topofsteel

    Joined:
    Dec 2, 2011
    Posts:
    999
    No problem, thank you for your reply. Yeah, that's what I've been experimenting with. I haven't needed to deliver a WebGL build yet, but I do port all of my geometry over to see what I can do/how good I can get it to look. Typically I work on standalone builds that I plan to run from my PC, so I can use super sampling and one of the post processing solutions without a problem. But that's really not a solution for WebGL I don't think.
    Can you recommend an AA solution that works well with WebGL and Deferred? Thanks.
     
  10. minev

    minev

    Joined:
    Nov 19, 2014
    Posts:
    34
    Attached scene uses Unity's SMAA from Cinematic Effects package. Worth a try, IMHO:

    Web interior walk AA.png