feersum.endjinn 6 Posted March 21, 2004 This is first version of PNG2PAC, only thing actually missing is GUI with preview and actual PNG support Current version reads 32 bpp TGA files (RLE compressed files are supported). This small command-line tool uses NVidia's DXT texture compression library, which gives superior quality compared to Texview while files are still same size. Visual C++ source code is provided, no GUI features are used so probably this can be ported to other compilers as C++ Builder quite easily. Download it here Download GUI version here NVidia DXT library can be downloaded from NVIdia developer pages Share this post Link to post Share on other sites
kegetys 2 Posted March 21, 2004 Here's some comparsion shots for texture quality: Texview generated texture in-game nVidia(PNG2PAC) generated texture in-game The latter is pretty close to the original while the texview generated one clearly has worse quality in different colorshades with dithering visible. Share this post Link to post Share on other sites
BraTTy 0 Posted March 21, 2004 Hmm ,I didn't realize the conversion process could alter the quality of your textures.I been using O2 to convert...any comparison from that? Share this post Link to post Share on other sites
feersum.endjinn 6 Posted March 21, 2004 Probably O2's texture conversion is based on newer code than Texview but I haven't made any tests if quality is better. Share this post Link to post Share on other sites
suma 8 Posted March 21, 2004 This small command-line tool uses NVidia's DXT texture compression library, which gives superior quality compared to Texview while files are still same size. Good observation - yes we noticed this as well, and we will be providing a better texture compression quality with OFP2 tools. I am glad your utility will make texture quality improved for OFP addon makers right now, as our current internal utility with the improved quality is not suitable for release. Goog job. One more hint: if I recall it correctly, nVidia sources are based on assumption decompression is done in 16-b color space as opposed to 32-b. This leads to unnecessary artifacts when compressing smooth gradiens, and it can be avoided by adapting the source code. Some older nVidia cards really peformed decompression this way, so you will see no improvents on them, but cards of other vendors, and recent nVidia cards as well, perform decompression in 32-b space - you can learn more about this on many web sites, including Epic Games web site. Share this post Link to post Share on other sites
dm 9 Posted March 21, 2004 Excellent work feer, very very handy! Kudos to you my friend Share this post Link to post Share on other sites
feersum.endjinn 6 Posted March 21, 2004 One more hint: if I recall it correctly, nVidia sources are based on assumption decompression is done in 16-b color space as opposed to 32-b. This leads to unnecessary artifacts when compressing smooth gradiens, and it can be avoided by adapting the source code. Some older nVidia cards really peformed decompression this way, so you will see no improvents on them, but cards of other vendors, and recent nVidia cards as well, perform decompression in 32-b space - you can learn more about this on many web sites, including Epic Games web site. Unfortunately nVidia only provides source code to older version of DXT compression tools which is different codebase (and not actually even written by nVidia), but I'm hopeful that these issues are addressed in binary-only library since latest release is just couple of weeks old. Now it seems OFP itself recognizes few additional texture formats like DXT2-DXT5, is there support for these formats since using DXT3 or DXT5 would help really cutting down size of textures with more than 1 bit of alpha channel in VRAM. OFP recognizes headers 0xFF02-0xFF05 but when trying use those formats it will display some error message ("invalid texture format (VRAM)" if I remember correctly) and crash OFP back to desktop. Share this post Link to post Share on other sites
Master_Chief 0 Posted March 22, 2004 wow this is awsome! it actually gets rid of the pixilated crappy texview textures and preserves the original colors. However the lack of a gui will make it super tedious to use for regular texturing. Share this post Link to post Share on other sites
suma 8 Posted March 22, 2004 Quote[/b] ]Now it seems OFP itself recognizes few additional texture formats like DXT2-DXT5 Unfortunatelly, while DXT2-DXT5 (alpha DXT compression)are "recognized", they are not supported and they are not working in OFP1, as their implementation was not finished from our side at that time. Share this post Link to post Share on other sites
suma 8 Posted March 22, 2004 Quote[/b] ]Unfortunately nVidia only provides source code to older version of DXT compression tools which is different codebase (and not actually even written by nVidia), but I'm hopeful that these issues are addressed in binary-only library since latest release is just couple of weeks old. You may also want to try DirectX compression functions. The quality of compresion is very good with DX9 SDK, the usage is quite simple (if you are familiar with DirectX) and they handle 32-bit interpolation. Share this post Link to post Share on other sites
bn880 5 Posted March 22, 2004 Great, and source code provided, excellent for people who want to learn something from it. Share this post Link to post Share on other sites
feersum.endjinn 6 Posted March 22, 2004 Great, and source code provided, excellent for people who want to learn something from it. Â Well, at least it is great example of how to not write code: for example compression code there would get you failed grade at any university course dealing with data compression. Brute force algorithm for finding longest match is really bad, it takes about 90 seconds to compress 512x256 texture on my AMD 1600+ Share this post Link to post Share on other sites
bn880 5 Posted March 22, 2004 Bah, University, this is the real world! Share this post Link to post Share on other sites
suma 8 Posted March 22, 2004 Quote[/b] ]... compression code there would get you failed ... I think you cry well, but on the wrong tomb - the brute force code used is the code found on nVidia web site. Share this post Link to post Share on other sites
SelectThis 0 Posted March 22, 2004 Excellant work feersum! This will certainly help improve the quality of all addons. PS. Iain Banks fan? - I love his books SelectThis Share this post Link to post Share on other sites
Pathy 0 Posted March 22, 2004 Great work, and saves time in having to make a texture, convert it, test it to find out how the colours are,then go back and edit the texture...always a nightmare. Any chance of a new version with a user friendly GUI in the near future though? Share this post Link to post Share on other sites
feersum.endjinn 6 Posted March 23, 2004 Quote[/b] ]... compression code there would get you failed  ... I think you cry well, but on the wrong tomb - the brute force code used is the code found on nVidia web site.  Code I'm talking about is one written by me in "compress.cpp", which is used to compress non-DXT1 textures. It's slowest LZ77 implementation I've seen so far, maybe I should be proud of myself nVidias DXT library on the other hand is really fast. Share this post Link to post Share on other sites
feersum.endjinn 6 Posted March 23, 2004 And since you've been asking, I made small GUI. Download it here. It also gives access to some of the effects provided by nVidias library but most of them aren't that useful, exception being maybe different mipmap filtering options and dithering. I'm no Windows programming guru, so there's no preview option or support for some of more fancy features found in nVidia library and code is somewhat unstable (won't run at all when compiled on Debug configuration, something to do with different local heaps and callbacks from DXT library not liking each other)... But it writes out valid .paa's 99% of the time so that's enough for me Share this post Link to post Share on other sites
dm 9 Posted March 23, 2004 Either way, it does an excellent job. Nice work mate (still) Share this post Link to post Share on other sites
Footmunch 0 Posted March 23, 2004 I'm no Windows programming guru, so there's no preview option or support for some of more fancy features found in nVidia library and code is somewhat unstable (won't run at all when compiled on Debug configuration, something to do with different local heaps and callbacks from DXT library not liking each other)... This may help the mem management - right click on the PAA project, select properties, and in C/C++ -> CodeGeneration, set the Runtime Library to Multi-Threaded. This makes sure that all the libs get their own local heap. BTW - Use Of Weapons is excellent. Share this post Link to post Share on other sites
norsu 180 Posted March 23, 2004 Some of you (for example I) may get error messages about missing dll-files when using the GUI-version. You can download them from here http://mesadx.home.att.net/MDX_Download.html (just click the download dlls button, everything else is unrelated). Share this post Link to post Share on other sites
feersum.endjinn 6 Posted March 23, 2004 First release was missing one MS Visual C++ runtime DLL, but I updated archive this morning and it should work now without any additional .DLL hunting. Share this post Link to post Share on other sites
Master_Chief 0 Posted March 23, 2004 what difference do the mipmap filters make? what is the default one? Share this post Link to post Share on other sites