Hi Karl.

It's a long time since I've look at the contents of FLT files, but I vaguely 
remember them being organised as records, where each record contains a type-id 
and a record length.  If FLT format hasn't changed dramatically, then it should 
be possible (in C/C++) to write a program that can examine each record in turn 
looking for texture records with a filename ending ".rgb\0" or ".rgba\0".  

If you keep the filename part of your textures consistent, and just change the 
extension when you convert them, then you're simply changing ".rgb\0" for 
".dds\0" in the FLT files.

See http://www.presagis.com/files/standards/OpenFlight16.4.pdf


However, I'd be tempted to try a quick and dirty test first by ignoring the FLT 
specification.  Instead, treat the files as binary and  search for ".rgb\0" and 
replace with ".dds\0".  Then test the files just in case ".rgb\0" caught some 
binary data.

I wrote a simple FLT parser about 12 years ago in C for OpenGL which was able 
to pick out geometry with textures, so I think all of this is do-able without 
using OSG and without the FLT API.


If I remember my *nix correctly then you can "see" the occurencies of rgb 
with...
cat file.FLT | strings | grep -i rgb

Good luck,
Gary.



>------------------------------
>
>Message: 6
>Date: Fri, 25 Jan 2013 07:54:47 -0500
>From: "Cary, Karl A." <karl.a.c...@saic.com>
>To: "OpenSceneGraph Users" <osg-users@lists.openscenegraph.org>
>Subject: [osg-users] Method for Converting FLT files to use DDS
        Textures
>Message-ID:
>       <a7dd40477b3bac4a8c606c67b53b70a307404...@0015-its-exmb12.us.saic.com>
>Content-Type: text/plain; charset="us-ascii"
>
>This isn't a direct OSG question, but one I was hoping people on this list 
>might be able to >help out with. We have several thousand FLT files that use 
>rgbs as textures. Unfortunately >we can't convert these to ive or osgb files 
>as they are shared with another application that >is not made in OSG and only 
>supports FLT files. However, both can support FLT files using >DDS textures to 
>allow for texture compression. Through testing we have shown a large 
>>improvement by doing this, so we want to go that route.
>
> 
>
>The issue is how to convert all of these FLT files over. We can easily batch 
>convert all of >the textures, that is not a problem. The issue is updating the 
>FLT files themselves to tell >them to point to the dds texture instead of the 
>rgb texture. Having someone manually open up >each file and edit the texture 
>names is VERY time consuming. Does anyone know of an easy way >we could do 
>this through scripting or a custom converter or something else? The files will 
>>stay named the same except for the .rgb will become .dds.
>
> 
>
>Thanks in advance.
>
> 
>
>Karl Cary
>
>SAIC
>
>Software Developer
>
>301-227-5656


_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to