[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Public WebGL] WebGL NPOT texture support
(merging replies from separate threads)
On Thu, Nov 17, 2011 at 10:11 AM, Benoit Jacob <firstname.lastname@example.org>
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 <email@example.com>
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 <firstname.lastname@example.org>
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.