[Public WebGL] Reason for not allowing generateMipmaps with compressed textures

Won Chun [email protected]
Mon Apr 16 08:13:13 PDT 2012


On Sun, Apr 15, 2012 at 4:02 PM, Florian Bösch <[email protected]> wrote:

>
> I'm guessing that it has been deemed too costly for the driver of OpenGL
> ES implementations to do a readback and decompress, recompress and upload
> in order to generate the mip levels, so the responsibility to do it is
> deferred to the application programmer. We have two choices to do this:
>
> 1) upload all levels as well
> 2) compute the levels on the fly
>
> Unfortunately both of these are somewhat regrettably penalizing for
> mobiles. Desktops (with broadband internet, copious amounts of ram and fast
> processors) have plenty of power to go either of these routes.
>

Well, high-quality texture compression can be quite slow even on desktops.
There is a definite quality/performance tradeoff, and one that you don't
want to defer to the driver. Using GL to do your texture compression is
certainly convenient, but it is suboptimal compared to offline compression.


> Mobiles on the other hand will suffer disproportionately from having to
> transfer all miplevels, and they will equally suffer disproportionately by
> having to compute the miplevels in JS prior to upload. Which is another
> example where a restriction that is irrelevant for PCs is erected while
> avoiding to solve it for mobiles.
>

To put things quantitatively: The mip chain adds roughly 33% more data.
However, this data is highly redundant since it represents an image
pyramid. At least for DXT, I think it would be pretty easy to offset that
33% without too terrible cost in CPU time.

-Won


> On Sun, Apr 15, 2012 at 6:23 PM, Brandon Jones <[email protected]> wrote:
>
>>
>> Just curious about this one, wondering if someone on the list has a
>> good explanation. In Chrome the behavior of generateMipmaps recently
>> changed to fail if the bound texture is compressed. It's my
>> understanding that this was to stay compliant with the ES standard.
>>
>> However, before it was explicitly disallowed (in this ticket:
>> http://code.google.com/p/chromium/issues/detail?id=121476) generating
>> mipmaps on compressed textures seemed to work just fine. So the
>> question is: If we're capable of doing it why go through the trouble
>> of preventing it? Is this another mobile vs. desktop issue?
>>
>> --Brandon
>>
>> -----------------------------------------------------------
>> You are currently subscribed to [email protected]
>> To unsubscribe, send an email to [email protected] with
>> the following command in the body of your email:
>> unsubscribe public_webgl
>> -----------------------------------------------------------
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://khronos.org/pipermail/public_webgl_khronos.org/attachments/20120416/ff41497d/attachment.html>


More information about the public_webgl mailing list