PDA

View Full Version : Anyone using COMPRESSED_RGBA_S3TC_DXT1_EXT?



PkK
11-28-2008, 10:15 AM
Does anyone here use the DXT1 RGBA format?

How popular ist it compared to DXT1 RGB, DXT3 RGBA and DXT5 RGBA?

Philipp

Jan
11-28-2008, 12:59 PM
For RGBA i think DXT5 is the most popular.

Dark Photon
12-02-2008, 08:27 AM
Does anyone here use the DXT1 RGBA format?
How popular ist it compared to DXT1 RGB, DXT3 RGBA and DXT5 RGBA?
Yes, and no idea how popular it is with various games/engines. If you only need all-or-nothing transparency in your texels, DXT1 RGBA is fine, but (as usual) you need to use premultiplied alpha.

Why DXT1 RGBA over DXT5? 0.5 byte/texel vs. 1 byte/texel.

PkK
12-07-2008, 04:41 AM
Do you think it was a wise choice to make the color of transaprent texels black in DXT1? Would you prefer it to be an average of neigbouring non-transparent texels?

Dark Photon
12-13-2008, 06:41 PM
Do you think it was a wise choice to make the color of transaprent texels black in DXT1?
Yes.

Would you prefer it to be an average of neigbouring non-transparent texels?
No. The flood fill/avg of neighboring non-trans thing doesn't really solve the problem.

If nothing else, I'd highly recommend reading Tom Forsyth's article here:

http://home.comcast.net/~tom_forsyth/blog.wiki.html#[[Premultiplied alpha]]

Here's few more related articles, if you're interested:

* Fun with Premultiplied Alpha (Jim Blinn, Dirty Pixels) (http://www.elsevier.com/wps/find/bookdescription.cws_home/680541/description#description)
* Projective Alpha Colour (Philip Willis) (http://www.cs.bath.ac.uk/pubdb/download.php?resID=196)
* Compositing Digital Images (Porter/Duff) (http://keithp.com/~keithp/porterduff/)

PkK
12-14-2008, 08:17 AM
Do you think it was a wise choice to make the color of transaprent texels black in DXT1?
Yes.

Would you prefer it to be an average of neigbouring non-transparent texels?
No. The flood fill/avg of neighboring non-trans thing doesn't really solve the problem.

If nothing else, I'd highly recommend reading Tom Forsyth's article here:

http://home.comcast.net/~tom_forsyth/blog.wiki.html#[[Premultiplied alpha]]


Well he's advocating premultiplied alpha. On the other hand the reality is that most people don't use premultipied alpha and for those the avg of neighbouring nontransparent texels would improve the situation.
Not using premultiplied alpha works for the most common things developers want to do. Only DXT1 breaks for them. Maybe both formats should have been made from DXT1 (as they did with DXT2/DXT3 and DXT4/DXT5), with one using black for transparent texels, to be used by those that use premultiplied alpha, and one that does the averaging, for those that use ordinary alpha.

Philipp

Xmas
12-15-2008, 03:02 AM
Well he's advocating premultiplied alpha. On the other hand the reality is that most people don't use premultipied alpha and for those the avg of neighbouring nontransparent texels would improve the situation.
Not using premultiplied alpha works for the most common things developers want to do. Only DXT1 breaks for them.
Simple fix: change the source blend factor.

Dark Photon
12-16-2008, 06:16 PM
Maybe both formats should have been made from DXT1 (as they did with DXT2/DXT3 and DXT4/DXT5), with one using black for transparent texels, to be used by those that use premultiplied alpha, and one that does the averaging, for those that use ordinary alpha.
Hey, if you think you might have another solution that extends, by all means spec it out and post it, and maybe the vendors will add support!


Not using premultiplied alpha works for the most common things developers want to do.

Hmm, maybe. If the app is low fidelity with little or no multi-layer blending, probably doesn't make a hill of beans difference what you do.

But if you start doing multi-layer compositing/blending (e.g. particle systems, etc.) and are shooting for fidelity, you bang your head hard on this pretty quickly with the conventional ALPHA/ONE_MINUS_ALPHA blends. And that's with no texture compression (e.g. DXT1) in the picture at all. Of course this has been well known for decades. DXT1 is yet another context where the solution is to just use pre-multiplied alpha. Easy change, no big deal.

If you don't need it for whatever reason (low fidelity, no compositing, etc.), don't worry about it.

As Xmas said, the source blend factor is the culprit. Rendering is all about cheats and short-cuts, so just do what you gotta do to get the level of fidelity you need.