[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 18/06/2012 10:26, Mark Callow wrote:

The OpenGL {,ES} specifications use the "window coordinates" to describe the space after viewport transformation. The spec. for Viewport says that <x> and <y> specify the location of the lower-left in window-coordinates and <width> and <height> give the width and height of the viewport. As I have pointed out before those <x> and <y> are translated to the origin of the window on the screen.
There is language in the FBO section to explicitly map window-coordinates to pixels for renderbuffer and to texels for texture attachments.

This all says that window coordinates != pixels. They are the coordinates of whatever "window" GL is rendering to. In the case of a canvas, I would maintain that window coordinates == css pixels and the above change is deviating from OpenGL {,ES}.

I have to correct myself. Although my search for a definition of "window coordinates" in the specs failed to find anything, in subsequent reading I did find at the very start of 2.12.1 language that states that the viewport width and height are in pixels.