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

Re: [Public WebGL] How to set a canvas backing store to display units?



On Fri, Jun 15, 2012 at 8:57 AM, Ian Hickson <ian@hixie.ch> wrote:
I agree that we should give the authors what they ask for.

If the author writes:

  <canvas id="foo" width="320" height="240">

...and the user's device is 2x-dpi, then they are asking for a 640x480
backing store with a 320x240 coordinate space.

I agree this would be desirable; however it is impossible to implement. In WebGL the rendering coordinate space and the backing store size are not independent and that can't be fixed (efficiently) without changes to OpenGL/DirectX.

Furthermore, the kind of content WebGL is used for usually doesn't need to be rendered at full display resolution to look acceptable. Pixel-doubling the sharp vectors and text commonly rendered in a 2D context looks terrible, but pixel-doubling the more natural 3D scenes WebGL excels at looks fine. In fact, most console games render at less than full display resolution because performance is more important.