[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Public WebGL] WebGL Antialiasing



I was wondering if people here could shed some light on the reasoning behind the antialiasing flag in WebGL, namely:

- Why is the flag considered a request which may be ignored?
- Why are you incapable of inspecting or controlling the applied quality level of MSAA?
- Why are you incapable of checking if the request has been satisfied?

My use case is that I'm rendering 3D vector graphics with WebGL. Without anti-aliasing, it looks terrible. But because the scenes are very simple, I could easily go for high levels of MSAA and still get acceptable performance. This is particularly important because on the systems I've tried, "antialiasing: true" also triggers higher quality line rendering (similar to GL_LINE_SMOOTH in traditional OpenGL). And to make it worse, the latest Chrome nightlies have decided to disable anti-aliasing entirely for nVidia chipsets on OS X for security reasons with the driver.

See e.g. http://acko.net/files/mathbox/MathBox.js/examples/BezierSurface.html

These days, anti-aliasing is a big deal in real-time rendering, and there is an entire zoo of techniques to be applied, from post-processing filters like FXAA/MLAA to custom multisample resolvers like SRAA/TXAA/etc. Performance and image quality can vary enormously based on the level of hardware multi-sampling, ranging from awful-but-fast (2xMSAA), to acceptable-and-performant (4+4xCSAA) to gorgeous-but-slow (16xMSAA, 2 or 4xSGSSAA). And on the web, it is more likely than on the desktop that WebGL scenes will be embedded in webpages as small renders, rather than 720p or 1080p scenes where AA is less essential.

At the very least, WebGL developers should have the ability to detect whether antialiasing can actually be applied and to what degree. That is, how many color/depth/stencil samples, how many coverage samples, etc. That way, if the native implementation is insufficient, they can replace it with a custom post-processing filter, possibly in combination with super-resolution rendering. I could easily see myself doing a quick off-screen rendering benchmark to determine optimal settings. Right now I can't, because I'm working blind.

Steven Wittens


-----------------------------------------------------------
You are currently subscribed to public_webgl@khronos.org.
To unsubscribe, send an email to majordomo@khronos.org with
the following command in the body of your email:
unsubscribe public_webgl
-----------------------------------------------------------