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

Re: [Public WebGL] another proposal to temporarily expose some device/driver information only when really needed

On 12/05/03 3:53, Ashley Gullen wrote:
I think this is a great idea and I'm desperate for something like this.  Our engine implements both a WebGL and Canvas 2D renderer, and currently the Canvas 2D renderer is never used in Chrome 18 due to Swiftshader.  I am keen to fall back to Canvas 2D instead of using Swiftshader but there is no way to do that.
Why should you expect the browser's Canvas 2D implementation to perform better than Swiftshader, either power- or speed-wise?
Depending on the use case, that can be plausible. The idea is that Canvas 2D has a much more focused feature set than WebGL, so more specialized code can be used.

Suppose for example that you are developing a mathematical curve plotter that may use WebGL. Then a Canvas 2D version will probably perform at least as well as a WebGL-software-renderer version, and the Canvas2D version will have guaranteed perfect per-primitive anti-aliasing while the WebGL-software-renderer version will typically have either no antialiasing or 2x2 MSAA.
Actually, in the WebGL version, if you want to be able to draw curves with arbitrary thickness regardless of driver capabilities, you'll have ( I guess) to draw rectangles instead of lines, adding significant overhead on a software renderer.

Also, in the Canvas2D version, the browser can draw a whole spline at once, and will interpolate splines, while WebGL only draws triangles and the rest of the work has to be done by the script.