12

For example, on a page like this one, in Safari 7 it's antialiased, but in Firefox 29 (OS X 10.9) it's not.

Firefox does seem to have the capability to antialias. If I set the about:config setting "webgl.msaa-force" to "true", then it is antialiased.

Is there any way to make Firefox antialias for my particular webpage, without relying on the user to mess with their about:config?

I'm using three.js, and it has an "antialias" flag, but it seems to only make a difference on Safari, not Firefox.

1 Answer 1

10

The short answer is "no".

It's up the browser whether or not to support anti aliasing. Many drivers crash with antialiasing under certain conditions so browsers often disable antialiasing on those machines.

Note that the antialias flag is true by default. In other words the default for WebGL is to antialias though it's still up to the browser. Specifically setting antialias to true could at most act as a hint (hey, I really want antialiasing please) but I know of no browsers that use it as a hint. They generally turn antialiasing on if they can.

On the other hand, setting antialias to false does specifically mean "do NOT antialias".

You can try to do anti-aliasing yourself. For example you can render at a higher resolution and using CSS to display the canvas smaller in which case the browser will most likely bilinear interpolation when compositing your WebGL into the page. You could also render to a texture and then apply some kind of anti-aliasing filter to it when rendering it to the canvas.

7
  • 3
    Interesting. It looks like Firefox has a GPU blacklist, and on the Mac they blacklist (wiki.mozilla.org/Blocklisting/Blocked_Graphics_Drivers) "All NVIDIA&Intel hardware", plus "all ATI cards except for AMD Radeon HD 6490M and ATI Radeon HD 4670", and on top of that the blacklist has issues with dual-GPU systems! So basically Firefox on the Mac supports AA in theory, but except for the early-2011 15" MacbookPro and a couple of 2009/2010 iMacs, it really doesn't. That's disappointing. I wonder if they plan to ever un-blacklist any other cards. May 8, 2014 at 0:48
  • I'd guess that's basically up to Apple. When Apple fixes their drivers Firefox will likely turn on antialiasing for those machines. Chrome's blacklist is here. The fact that the lists a probably different is most likely based on the way each browser does it's graphics. Different ways of using the drivers show different bugs.
    – gman
    May 8, 2014 at 7:38
  • Actually, the bug reports I've read seem to indicate that the difference in blacklists is due to collaboration or workload issues, not technical ones. The WebGL wiki says "The rules in these blacklists and whitelists are currently browser-specific, although work is underway to share them between browsers." Clearly there are more than 2 graphics cards in the Mac world that have working antialiasing. May 8, 2014 at 21:59
  • 1
    It's not just about "working anti-aliasing". The issue is can you crash the driver. Apps that use anti-aliasing try their best not to crash. But Web pages are different. Browsers have to do their best to not let some random webpage take the browser down or the OS. So, when they find bugs in drivers they have to find a workaround. Often that work around is to disable anti-aliasing. I hope I'm making sense. An App will find a way not to trigger the bug. The browsers will also try to find a way but unlike an app they don't control what people do with WebGL.
    – gman
    May 9, 2014 at 16:23
  • 2
    BTW: This is why Multiple Render Targets (MRTs) are not currently available on Mac for WebGL. It's easy to crash the driver. MRTs work on Mac under certain conditions and native games and apps that use MRTs don't trigger those conditions but random webpages running WebGL can/could easily trigger those conditions so sadly, until Apple fixes the drivers or until browser find some other workaround they can't enable MRTs on Macs :(
    – gman
    May 9, 2014 at 16:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.