VTFLib 1.1.2 - NemPosted: Jul 17th, 2005 - 1:59:30 pm

NVidia has recently released an update to their DXT library with several improvements and bug fixes, including the crash happy resizing code. I've updated VTFLib with the new library as well as VTFEdit, improving the WAD conversion tool and adding a batch conversion tool for those of you with large collections to convert. You can download the latest build here; I recommend that anyone who has had problems with the current build and visual quality buffs upgrade ASAP.


1. NoBodyModified: Aug 2nd, 2005 - 4:57:22 pm
Never mind i figured it out, tho im stuck some where else now :p
(unrelated to vtflib)

2. NemPosted: Aug 2nd, 2005 - 9:51:26 pm
No idea what you are talking about. cool

Anyways, next version:
  • Improved .vmt parsing.
  • .vmt editor (basic text editor with syntax checking).
  • File system monitoring (updates tree as you create and delete files etc.).
  • Requests?

3. NoBodyModified: Aug 10th, 2005 - 4:59:54 am
Hmm i have some problems implementing vtflib as a plug in for fragmotion.
could you have a quick look at what i have made so fare to see if im doing somthing wrong when loading the texture, im not shure where im going wrong as im not very good with c++
using ms v c++ 6 by the way.

Im tyring to load a .vtf convert it to rgba8888 and put it in to "ptex", "pszFile" holds the full path to the .vtf.

VTFLib::CVTFFile *VTFFile;
VTFFile = new VTFLib::CVTFFile();

//loades the selected file in to mem

//byte holder for the texture
vlByte *lpImageData = new vlByte [88];
memset(lpImageData, 0, sizeof(vlByte *) * 8Cool;
//i think this should actualy be the count of pszFile instead of 88, but not shure how to do that correctly.

//puts the texture in to lpImageData in RGBA8888 format
VTFFile->ConvertToRGBA8888(VTFFile->GetData(1,1,1), lpImageData, VTFFile->GetWidth(), VTFFile->GetHeight(), VTFFile->GetFormat());

//Feed it to fragmotion
ptex->Create(VTFFile->GetWidth(), VTFFile->GetHeight(), RGBA_8888, VTFFile->GetWidth()*4, lpImageData, 0, 0);
//should proably be ptex = instead of ptex-> but asking you to teatch me how to use the fragmotion sdk would be asking to mutch.

edit: incase you want the actual project

4. NemModified: Aug 10th, 2005 - 10:41:32 am
You might want to look at VTFCmd and VTFEdit for sample code, but anyways, try (from Export() in vtfedit.h):

// initialize
VTFLib::CVTFFile *VTFFile;
VTFFile = new VTFLib::CVTFFile();

// load

// allocate pixel buffer
vlByte *lpImageData = new vlByte[VTFFile->ComputeImageSize( VTFFile->GetWidth(), VTFFile->GetHeight(), IMAGE_FORMAT_RGBA8888)];

// extract pixel data
VTFFile->ConvertToRGBA8888(VTFFile->GetData(0, 0, 0), lpImageData,
VTFFile->GetWidth(), VTFFile->GetHeight(), VTFFile->GetFormat());

// feed it to fragmotion
ptex->Create(VTFFile->GetWidth(), VTFFile->GetHeight(), RGBA_8888,
VTFFile->GetWidth()*4, lpImageData, 0, 0);

// cleanup
delete []lpImageData;
delete VTFFile;

5. NoBodyPosted: Aug 10th, 2005 - 12:11:29 pm
Thanks a bunch, i'll be shure to look a bit hader at the excamples once i get to saving .vtf :)

6. israel4766Posted: Nov 4th, 2005 - 8:13:36 pm
tiros perfec

You must be logged in to post a comment.
New users can register here.
Nem's Tools v2.0 © 2006 Ryan Gregg.
Execution time: 0.043554s; Queries: 17.
dishes served.
Powered by The Wavelength.

Valid XHTML 1.0 Transitional Valid CSS