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

Re: [Public WebGL] WebGL NPOT texture support



Glenn

I think you are suggesting, in response to my resample suggestion, that the browsers provide functions that let developers do resampling with high performance but under explicit developer control (i.e. enough params so that there is no 'magic' or inconsistency). Did I get that right? If so I like that even better...

Tony

On Thu, Nov 17, 2011 at 9:34 AM, Glenn Maynard <glenn@zewt.org> wrote:
(merging replies from separate threads)


On Thu, Nov 17, 2011 at 10:11 AM, Benoit Jacob <bjacob@mozilla.com> wrote:
I think I might lean toward adding a WebGL extension for NPOT textures as we already have some extensions that are not well supported on mobile devices anyway; but this is a little bit more dangerous as textures are a basic feature and this opens the door to whole games that wouldn't run at all on mobile devices.

We've had the discussion before, but again I don't think trying to prevent this is the right way to go.  Make it as easy as possible to write code that works on mobile, but don't try to force it; whether to make the tradeoffs needed to support mobile hardware should be the developer's decision.

On Thu, Nov 17, 2011 at 10:24 AM, Tony Parisi <tparisi@gmail.com> wrote:
Wouldn't another option be to have the browser implementation resample any NPOT images? i.e. not do a WebGL extension?

I don't like the idea of trying to handle this "magically".  Texture sampling should return predictable values, not blurred values due to behind-the-scenes image resampling.  It might be useful to make it easier to resample and/or pad images to power-of-two sizes, though I don't know if there's actual demand for that right now.


On Thu, Nov 17, 2011 at 11:43 AM, Morten Nobel-Jørgensen <morten@nobel-joergensen.com> wrote:
You can already rescale you NPOT image using a Canvas2D in your browser.

This doesn't work in general.  The 2D canvas backing store may use premultiplied alpha, which makes it inherently lossy.  For example, if you have bump mapping data in the alpha channel, you'll end up quantizing the RGB channels badly.

Also, 2d canvas doesn't support floating-point textures.

--
Glenn Maynard




--
Tony Parisi                             tparisi@gmail.com
CTO at Large                         415.902.8002
Skype                                     auradeluxe
Follow me on Twitter!             http://twitter.com/auradeluxe
Read my blog at                     http://www.tonyparisi.com/