[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 Tue, Jun 12, 2012 at 10:32 PM, Mark Callow <callow_mark@hicorp.co.jp> wrote:

On 13/06/2012 12:40, Jeff Russell wrote:
I hope calls to gl.viewport and gl.scissor refer to backing store pixels, i.e. what you're actually rendering, and not some other space.

In OpenGL {,ES} the coordinates for Viewport and Scissor are expressed in the space of the client area of the host window. In most (all?) cases the scale from client pixels to device pixels is 1.0 but there is almost always a translation from client pixels to device pixels.

Because setting a viewport for the backbuffer of a given size should match setting the viewport for an fbo of the same size. So should reading the pixels. With antiAlias: false the should be no difference between rendering to a 320x200 backbuffer or a 320x200 fbo of the same format.