Incidental effect from dds textures

Blitz3D Forums/Blitz3D Programming/Incidental effect from dds textures

GrumpyOldMan(Posted 2006) [#1]
Hi All

I was working on a LOD system and I came across an undocumented feature that comes with the .dds loader (at least on my system). If you have a texture with a fuzzy alpha map ie a soft border between black and white and saved as a dxt3 or dxt5 .dds file, load it with texture flag set at 4 ie for masked texture, the dds loader seems to be doing the best it can to accomodate the alpha map and gives a smooth, curved line around the unmasked area rather than the pixellated chunkiness we all recognise.

Sorry if this is old news I'm shouting about but I'M EXCITED because now I can have smooth quad sprites WITHOUT zorder problems. YAHOO!!!!

Cheers

GrumpyOldMan


Mustang(Posted 2006) [#2]
It's hardly undocumented... DXTC (masked) alpha test just works that way - pixel is either on or off and the border looks "splinish":

http://www.flipcode.com/cgi-bin/fcarticles.cgi?show=63120

http://en.wikipedia.org/wiki/S3TC


Tom(Posted 2006) [#3]
Am I going crazy, or did I not post a reply to this earlier?


Barliesque(Posted 2006) [#4]
Are you going crazy? ...read your own signature. (Tisk, tisk...)


Tom(Posted 2006) [#5]
I sure did post, and my website logs show my demo was accessed quite a few times from this thread yesterday, so something's amiss :)

1 example:
/dds_alpha.zip
Http Code: 200 Date: Sep 19 16:25:39 Http Version: HTTP/1.1 Size in Bytes: 249276
Referer: http://www.blitzbasic.com/Community/posts.php?topic=63461
Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; ru) Opera 8.50


Anyways, I'd made a demo to show off a similar trick with the alpha in DDS texture: www.tomspeed.com/dds_alpha.zip

You'll need to put .decls & .DLL into your userlibs folder. Use cursor up/down to adjust the Alpha comparison reference value. The DDS texture has a smooth gradient alpha, but if you load it with the masked flag, you can set the alpha 'cut-off' value and it makes for a nice dissolve effect.


Damien Sturdy(Posted 2006) [#6]
The website lost a few posts overnight.

Puki must have hacked it.