[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 Mon, Jun 18, 2012 at 7:05 PM, Mark Callow <callow_mark@hicorp.co.jp> wrote:

On 19/06/2012 10:57, Gregg Tavares (çç) wrote:


On Mon, Jun 18, 2012 at 6:23 PM, Mark Callow <callow_mark@hicorp.co.jp> wrote:


{Open,Web}GL are resolution independent APIs.

Not they aren't. As has been pointed out several times now. gl_FragCoord, gl_PointSize, glLineWidth are not resolution independent nor are glViewport nor glScissor
Obviously you wrote that before reading the rest of my message.



Â
The behavior described above is not "just work(ing)". It is broken. It is going to make many WebGL programs look like shit.

The majority of WebGL programs only need to know the pixel size of the drawing buffer in order to set the viewport. If the viewport was set automatically from the canvas size (with css pixels converted to device pixels by the implementation) then that majority of apps would truly "just work".

Any apps that use gl_Fragcoord, gl_PointSize or glLineWidth would break.
That's why I wrote "majority".


Â

The remaining apps, those doing computations with gl_fragCoord, using point size, line width or scissor would need to query the size of the drawing buffer in order to get their computations correct. They need to do that today.

No they don't. Otherwise none of them would be working and yet we have thousands of WebGL pages working just fine
Yes they do. If they do not, even if CSS pixels == device pixels, when drawing buffer.wh != canvas.wh they will work incorrectly and, of course, they work incorrectly when CSS pixels != device pixels which is what got this whole discussion started.

I still think you are trying to make broken applications magically work.

Show me a broken app.
Â

Regards

ÂÂÂ -Mark