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

Re: [Public WebGL] Compressed textures.

On Sun, May 30, 2010 at 23:14, Steve Baker <steve@sjbaker.org> wrote:
> That's true in conventional graphics systems.  But in the world of the
> browser, I either have to use JavaScript to S-L-O-W-L-Y interconvert
> them (I hope nobody advocates that position!)

Nobody discussed about doing heavy compression or decompression in Javascript.

> the losses are taken (just try compressing normal maps with a regular
> RGB photo compressor!) (..)
> JPEG is utterly useless as a texture format (...) were the texels may not even represent "color".
> (...) in an era of ubiquitous shaders.

Nobody forces you to use JPEG for everything, for normal maps it might
not make sense indeed.
JPEGs are okay for diffuse textures and interoperability with web
content though, perhaps it makes them not "utterly useless".

> PNG is a great file format as far as it goes.  You get non-lossy RGBA
> with one byte per color component.  But the resulting files are a lot
> bigger than either DDS or JPEG

PNG can be used to store paletted, one, two or three component images
as well, not only RGBA ; so that's not entirely true.

> DXT-compressed files are tiny - smaller even
> than JPEG in many cases.

Nope, DXT will give you 4:1 compression ratio for a 3-component image
typically, both JPEG and PNG can achieve much better ratios even with
the most conservative settings.
For 1-component images, PNG type 1 can give as small if not smaller
files than DXT1.

> They also make a great "wire" format - and
> they are the only game in town for GPU compression.

DXTn are not the only game in town, especially on ES devices.
In the not-so-distant future ETC1 and ETC2 compressed formats are
likely to become widely supported, without the IP issues of DXTn.

> Expecting the driver to compress PNG (or god-help-us, JPEG) into DXT is
> a bad idea -

Nobody expects the driver to compress PNG (or god-help-us, JPEG) into DXT.

> You can store maps with floating point texels,

Floating point textures are not mandatory in ES therefore not
supported in WebGL afaik.

> 3D maps, cube-maps, depth maps, shadow maps...you
> name it.  You get to select between all of the commonly supported DXT
> formats.

You can save any of those above in a PNG with just the number of
components you need.
Or use your own format with "tiny headers" and ArrayBuffer if you like.

> So: If .dds is unusable for IP/patent reasons then we should come up
> with something very similar and support it in WebGL.  Ideally, that
> would be in 1.0 - but I'll take "later" if that's all I can get.

Yes, that's what it was all about.


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: