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

Re: [Public WebGL] Behavior of WebGL canvas when it can't make a backbuffer of the requested size?



> On Wed, Nov 3, 2010 at 11:17 PM, Cedric Vivier <cedricv@neonux.com> wrote:

> If I have a 9 monitor setup and I stretch the window across all 9
> 1280x1024
> monitors and my max back buffer is 2048 then I get a 2048x128 backbuffer?
> That doesn't seem like the result I want. Most of the time I want the
> largest resolution I can get.

Well, I guess it depends on WHY the underlying system can't do what you
ask.  Generally it's because it's out of memory - not because there is
some underlying coordinate system limitation preventing the width being
more than some number of pixels.

That being the case, if (let's say) the system only has 1.2M pixels of
backbuffer storage available and you ask for a 11,520 x 1024 - your
choices are a 1280x1024 (your preference) or something like a 3840x341
which preserves your aspect ratio.  Your way will produce perfectly sharp
vertical detail and ungodly horrible 9 pixel long horizontal blurring.  My
way would produce something a 3x3 isotropic blurring.  My result will
definitely look better GIVEN THAT the system rescales the backbuffer to
fit the canvas, as proposed.

If the system would NOT rescale the back buffer to fit the canvas - then
maybe I'd agree with you - but that's not what is proposed here.

> If your app needs a 1.0 scale ratio then query the max backbuffer size and
> then set the size of the canvas appropriately. Only about 4 of the last 60
> 3d apps I've written would have needed this. Most of my apps in WebGL pick
> a fixed backbuffer size and let the canvas scale automatically.

If you don't get back what you ask for - and if the WebGL specification
says nothing about the aspect ratio of what you get back - then I can't
imagine any way for an application that wants to minimise the blurring
artifacts to guess what to ask for in order to get what it needs.

> It seems like it's better to do the best thing for the majority of apps.
> Those few apps that need a 1.0 scale ratio can do what they need to force
> it.

I don't think there are many apps that would prefer a horizontal blur and
vertical sharpness (or vice-versa) over a scheme that spreads the blur in
both directions equally.  In terms of picture quality, it's absolutely no
contest!



-----------------------------------------------------------
You are currently subscribed to public_webgl@khronos.org.
To unsubscribe, send an email to majordomo@khronos.org with
the following command in the body of your email: