Yeah, I really want to improve the AA. The built-in AA only supports 4 samples. In testing, it didn't seem to do much. My research suggested most apps like this handle it at the shader level, and we just haven't gotten to perfecting them all.
Yes, WebGL's built in antialiasing is MSAA, not supersampling. MSAA only affects the edges of triangles. It doesn't help aliasing introduced by shaders at all.
Supersampling is easy to implement, just set the canvas size to a multiple of the viewport size and scale it down with CSS. It will help with all forms of aliasing, however it gets very slow very quickly. Shader aliasing is better solved analytically whenever possible.
One trick that you can use when aliasing is difficult to solve is to use supersampling but only when the scene is static. Google Maps WebGL does this. While you are dragging the map it is aliased. As soon as you stop dragging and the map becomes stationary, it renders 16 frames with subpixel offsets and blends them together to produce one supersampled frame (this is better than resizing the canvas because it can be interrupted in the middle if the user starts dragging again). This doesn't work for dynamic games but it might be suitable for your application with a lot of static content.
modeless|1 year ago
Supersampling is easy to implement, just set the canvas size to a multiple of the viewport size and scale it down with CSS. It will help with all forms of aliasing, however it gets very slow very quickly. Shader aliasing is better solved analytically whenever possible.
One trick that you can use when aliasing is difficult to solve is to use supersampling but only when the scene is static. Google Maps WebGL does this. While you are dragging the map it is aliased. As soon as you stop dragging and the map becomes stationary, it renders 16 frames with subpixel offsets and blends them together to produce one supersampled frame (this is better than resizing the canvas because it can be interrupted in the middle if the user starts dragging again). This doesn't work for dynamic games but it might be suitable for your application with a lot of static content.
benshumaker0|1 year ago