FTEX generator
19 years 3 weeks ago #13988
by Jasper
---
If there is hope it lies with the demo scene.
PSO and FTEX tools: pointless.net/eoc/
Replied by Jasper on topic FTEX generator
I've got to dash off to my parents for the weekend, so i'm running this off rather fast...
Reversing .pso:
Ok, as far as I know you take a lightwave file and feed it into the converter.exe, which then produces a .pso file, and .lbm files for the textures.
Questions:
Do you feed is a seperate .lws for each LOD? or are all LOD's in one file?
Is there always 3 LOD's?
Does all 3 LOD's end up as 3 .PSO's? or in one?
I think the best way to go about it will be to:
Create a .lws contain a cube with opposite corners at (1,1,1) and (-1,-1,-1), i.e. a 2x2x2 cube centered around (0,0,0). With each face textured with the same texture, all 3 LOD's if needed to be identical.
Convert this to .pso.
Create a 2nd .lws with the same cube, and a different texture for each face, each texture should have the text showing the surface normal(?i think thats the right term) for that face.
e.g. the top face should be textured with a texture called "plus_y" and the text "+y" on it (Assuming +y is "up" in .lws), the bottom face with "minus_y", and the text "-y", same for +x, -x, +z, and -z etc.
convert this to a seperate .pso.
Then create a 3rd .lws same as the 2nd, except instead of a 2x2x2 cube, streatch the cube out to a rectangle with the same 2x2 end faces, and 2x4 sides with it's long axis in a known axis (dosn't matter which axis, as long as we know what it is). e.g. if the 2x2 ends are +x and -x then we know that that long axis is the x axis.
convert that to the 3rd pso.
with those 3 we can work out the co-ordinate system, by looking at how it's placed the textures, and assuming it makes each face be a pair of triangles (no idea how it would convert it really)
I don't have lightwave, but if someone who does could create the 3 .pso's (or tell me why what i'm trying won't work), and send them to me, i can start pokeing around in them.
I don't have any expirence with trying to extract meshes, but i suspect the hard bit will be working out what format of floating point they are using to store the co-ordinates.
I know some people who work(ed) on the openfx open source modeler, so they may be able to help me.
Reversing .pso:
Ok, as far as I know you take a lightwave file and feed it into the converter.exe, which then produces a .pso file, and .lbm files for the textures.
Questions:
Do you feed is a seperate .lws for each LOD? or are all LOD's in one file?
Is there always 3 LOD's?
Does all 3 LOD's end up as 3 .PSO's? or in one?
I think the best way to go about it will be to:
Create a .lws contain a cube with opposite corners at (1,1,1) and (-1,-1,-1), i.e. a 2x2x2 cube centered around (0,0,0). With each face textured with the same texture, all 3 LOD's if needed to be identical.
Convert this to .pso.
Create a 2nd .lws with the same cube, and a different texture for each face, each texture should have the text showing the surface normal(?i think thats the right term) for that face.
e.g. the top face should be textured with a texture called "plus_y" and the text "+y" on it (Assuming +y is "up" in .lws), the bottom face with "minus_y", and the text "-y", same for +x, -x, +z, and -z etc.
convert this to a seperate .pso.
Then create a 3rd .lws same as the 2nd, except instead of a 2x2x2 cube, streatch the cube out to a rectangle with the same 2x2 end faces, and 2x4 sides with it's long axis in a known axis (dosn't matter which axis, as long as we know what it is). e.g. if the 2x2 ends are +x and -x then we know that that long axis is the x axis.
convert that to the 3rd pso.
with those 3 we can work out the co-ordinate system, by looking at how it's placed the textures, and assuming it makes each face be a pair of triangles (no idea how it would convert it really)
I don't have lightwave, but if someone who does could create the 3 .pso's (or tell me why what i'm trying won't work), and send them to me, i can start pokeing around in them.
I don't have any expirence with trying to extract meshes, but i suspect the hard bit will be working out what format of floating point they are using to store the co-ordinates.
I know some people who work(ed) on the openfx open source modeler, so they may be able to help me.
---
If there is hope it lies with the demo scene.
PSO and FTEX tools: pointless.net/eoc/
Please Log in or Create an account to join the conversation.
19 years 3 weeks ago #13989
by Jasper
Can you post the paths and filenames for the files under the eoc directory (assuming your starting with the same files that ship with Epic/TS)?
I'll play with them on monday and see what's happening.
---
If there is hope it lies with the demo scene.
PSO and FTEX tools: pointless.net/eoc/
Replied by Jasper on topic FTEX generator
Originally posted by cambragol
Hi Jasper,
I tried genftex on several nebula background from TS. Namely 'Far North' and 'Xuxuan'. Far North seemed to display perfectly with only the ftc files. Xuxuan on the other hand, was all white, unless I included the ftu files. Then it appeared normally. strange.
Can you post the paths and filenames for the files under the eoc directory (assuming your starting with the same files that ship with Epic/TS)?
I'll play with them on monday and see what's happening.
---
If there is hope it lies with the demo scene.
PSO and FTEX tools: pointless.net/eoc/
Please Log in or Create an account to join the conversation.
19 years 3 weeks ago #13990
by cambragol
Replied by cambragol on topic FTEX generator
Here is the path for Xuxuan:
I:\Independence War 2 - Edge of Chaos\mods\MS_Mod_Nebula\models\xu_xuan
files are all named 'hoffers_wake_nebula_#.iff'
And for far north:
I:\Independence War 2 - Edge of Chaos\mods\MS_Mod_Nebula\models\farnorth
Same file names as xuxuan.
I will keep poking around see if I notice anything else
I:\Independence War 2 - Edge of Chaos\mods\MS_Mod_Nebula\models\xu_xuan
files are all named 'hoffers_wake_nebula_#.iff'
And for far north:
I:\Independence War 2 - Edge of Chaos\mods\MS_Mod_Nebula\models\farnorth
Same file names as xuxuan.
I will keep poking around see if I notice anything else
Please Log in or Create an account to join the conversation.
- Second Chance
- Offline
- King of Space
19 years 3 weeks ago #13991
by Second Chance
Replied by Second Chance on topic FTEX generator
Well. Sounds like things may be about to get interesting.
First, about the texture generator; extremely cool, Jasper! That is one fantastic contribution to the community. Using IFF files to change the game graphics is just plain sucky. Especially if you want to make large-scale changes. So kudos for resolving that issue. Out of curiosity; did you get your info from the Texture File Format document in the EoC SDK or did you figure it out on your own? Either way, nice job.
Now, as for the idea of a Lightwave object extractor; that would be even more extremely cool! So here's the quick and dirty on how the Lightwave system works: Lightwave is somewhat unique in it's program architecture. The polygon construction/manipulating phase of 3D modeling and animation has been extracted from the normal workflow into it's own separate environment. This is the Lightwave Modeler program. It's sole purpose is to create and manipulate polygons and vertices and assign individual polygons to named surfacing groups for texturing. Modeler only ever works with one single mesh object at a time (say, one wing of a ship). This is important, because in general models are constructed from groups of multiple mesh objects (either modified primitives or spline-cage patches). In most 3D programs these multiple objects are all happily juggled in the same environment (along with texture materials, lighting, particle systems, animation keys, etc.) to show a complete complex object (say, an entire textured ship with engine lighting and animation). In Lightwave this function is handled by the program called Layout. Layout's purpose is to gather the individual mesh objects created in Modeler into groups and scenes and texture, light and animate them.
So, the single mesh object files that are created in modeler are Lightwave Objects (.lwo files) and the collections of meshes, textures and lights assembled in Layout are Lightwave Scenes (.lws files). Incidentally, .lws files are nothing more than text files that Layout uses to store what you've done visually in a compact format, and can be opened in notepad.
The files we need to deal with are the .lwo files. These are the files that get processed into .pso objects in the converter. However (and probably fortunately), since Lightwave has extracted the polygon and vertex information into a filetype separate from all other 3D information, it means that there's that much less info that needs to be recovered from the .pso file. Basically, the only info in an .lwo object file is vertex number and position data, polygon number and vertex assignments and polygon surface name assignments. (The exact information about what's contained in an .lwo object file and how it's stored can be had from the Lightwave SDK.)
The EoC game-level LOD system is irrelevant to what you're trying to accomplish, though. The LODs are set up in Layout and consist of nothing more than several versions of the same .lwo object with varying polygon counts that are arranged and connected to special Layout objects called nulls that the game can be made aware of. Each LOD is a separate .lwo object, and are unrelated outside of Layout. So just treat every .lwo object as separate and distinct from every other. Whether it's part of the LOD system or not.
It's probably worth noting at this point that Lightwave versions 5.6 and below use a unique (and annoyingly weird) planar texture mapping method that is incompatible with, basically, everything. Making correctly-textured object conversions from other common 3D model formats (using generic multi-format converters) impossible. And any games that were made with these earlier versions won't accept .lwo objects from later versions of Lightwave. In version 6.0, Lightwave changed it's primary surface texturing format to the standard UVW mapping technique (although the old style is still an option). Because of this, beginning with version 6.5, Lightwave includes a built-in exporter to save objects in the old 5.6 and earlier format. Looking at the 5.6 exporter plugin code in the Lightwave SDK would probably be helpful.
If this is something you think you want to take on (and I hope it is), your best bet would to be to get a hold of the Lightwave SDK (the 5.6 SDK if possible, or how 5.6 objects are exported from Lightwave if not), have a look at the file format and go from there. Using the actual SDK will take the frustrating guesswork out of figuring out the .lwo file format.
As an aside (and I don't want to get anyone's hopes up too high), if Jasper can understand the .lwo object file format well enough to convert a .pso back to an .lwo, it also means he may be able to write a Lightwave specific converter that can correctly interpret properly textured common 3D object formats (such as .3ds) into .lwo objects with proper polygon surface naming. Meaning; you would be able to model and texture your ships in any modeling package that exports to the common format he chooses and never need to use Lightwave for texture processing again. But this would require he also learn how UVW mapping works in typical 3D packages and the unique way that textures are applied to surface names in Lightwave 5.6 objects.
That's a lot to ask, but it is possible.
mailto:second_chance@cox.net
The Ultimate Guide To Modding: I-War 2 - Edge Of Chaos
cartoons.sev.com.au/index.php?catid=4
.
First, about the texture generator; extremely cool, Jasper! That is one fantastic contribution to the community. Using IFF files to change the game graphics is just plain sucky. Especially if you want to make large-scale changes. So kudos for resolving that issue. Out of curiosity; did you get your info from the Texture File Format document in the EoC SDK or did you figure it out on your own? Either way, nice job.
Now, as for the idea of a Lightwave object extractor; that would be even more extremely cool! So here's the quick and dirty on how the Lightwave system works: Lightwave is somewhat unique in it's program architecture. The polygon construction/manipulating phase of 3D modeling and animation has been extracted from the normal workflow into it's own separate environment. This is the Lightwave Modeler program. It's sole purpose is to create and manipulate polygons and vertices and assign individual polygons to named surfacing groups for texturing. Modeler only ever works with one single mesh object at a time (say, one wing of a ship). This is important, because in general models are constructed from groups of multiple mesh objects (either modified primitives or spline-cage patches). In most 3D programs these multiple objects are all happily juggled in the same environment (along with texture materials, lighting, particle systems, animation keys, etc.) to show a complete complex object (say, an entire textured ship with engine lighting and animation). In Lightwave this function is handled by the program called Layout. Layout's purpose is to gather the individual mesh objects created in Modeler into groups and scenes and texture, light and animate them.
So, the single mesh object files that are created in modeler are Lightwave Objects (.lwo files) and the collections of meshes, textures and lights assembled in Layout are Lightwave Scenes (.lws files). Incidentally, .lws files are nothing more than text files that Layout uses to store what you've done visually in a compact format, and can be opened in notepad.
The files we need to deal with are the .lwo files. These are the files that get processed into .pso objects in the converter. However (and probably fortunately), since Lightwave has extracted the polygon and vertex information into a filetype separate from all other 3D information, it means that there's that much less info that needs to be recovered from the .pso file. Basically, the only info in an .lwo object file is vertex number and position data, polygon number and vertex assignments and polygon surface name assignments. (The exact information about what's contained in an .lwo object file and how it's stored can be had from the Lightwave SDK.)
The EoC game-level LOD system is irrelevant to what you're trying to accomplish, though. The LODs are set up in Layout and consist of nothing more than several versions of the same .lwo object with varying polygon counts that are arranged and connected to special Layout objects called nulls that the game can be made aware of. Each LOD is a separate .lwo object, and are unrelated outside of Layout. So just treat every .lwo object as separate and distinct from every other. Whether it's part of the LOD system or not.
It's probably worth noting at this point that Lightwave versions 5.6 and below use a unique (and annoyingly weird) planar texture mapping method that is incompatible with, basically, everything. Making correctly-textured object conversions from other common 3D model formats (using generic multi-format converters) impossible. And any games that were made with these earlier versions won't accept .lwo objects from later versions of Lightwave. In version 6.0, Lightwave changed it's primary surface texturing format to the standard UVW mapping technique (although the old style is still an option). Because of this, beginning with version 6.5, Lightwave includes a built-in exporter to save objects in the old 5.6 and earlier format. Looking at the 5.6 exporter plugin code in the Lightwave SDK would probably be helpful.
If this is something you think you want to take on (and I hope it is), your best bet would to be to get a hold of the Lightwave SDK (the 5.6 SDK if possible, or how 5.6 objects are exported from Lightwave if not), have a look at the file format and go from there. Using the actual SDK will take the frustrating guesswork out of figuring out the .lwo file format.
As an aside (and I don't want to get anyone's hopes up too high), if Jasper can understand the .lwo object file format well enough to convert a .pso back to an .lwo, it also means he may be able to write a Lightwave specific converter that can correctly interpret properly textured common 3D object formats (such as .3ds) into .lwo objects with proper polygon surface naming. Meaning; you would be able to model and texture your ships in any modeling package that exports to the common format he chooses and never need to use Lightwave for texture processing again. But this would require he also learn how UVW mapping works in typical 3D packages and the unique way that textures are applied to surface names in Lightwave 5.6 objects.
That's a lot to ask, but it is possible.
mailto:second_chance@cox.net
The Ultimate Guide To Modding: I-War 2 - Edge Of Chaos
cartoons.sev.com.au/index.php?catid=4
.
Please Log in or Create an account to join the conversation.
19 years 3 weeks ago #13992
by cambragol
Replied by cambragol on topic FTEX generator
Hi Jasper.
I checked a little further and found that I was a little wrong in my previous description. The compressed textures are working fine when both the ftc and ftu files are used, but not when only the ftc file is used. But that doesn't really help because including the ftu file adds about 400% to the size of the textures.
I checked a little further and found that I was a little wrong in my previous description. The compressed textures are working fine when both the ftc and ftu files are used, but not when only the ftc file is used. But that doesn't really help because including the ftu file adds about 400% to the size of the textures.
Please Log in or Create an account to join the conversation.
19 years 3 weeks ago #13995
by Shane
Replied by Shane on topic FTEX generator
Lightwave allows users to create LScripts (small 'mods' which create or alter the way tools are utilized). Because scripting require some knowledge of the file format, the .lwo files are well understood. Here's a couple of links to LWO file format:
www.gameprog.it/?resource=83
astronomy.swin.edu.au/~pbourke/d ... lightwave/
www.gameprog.it/?resource=83
astronomy.swin.edu.au/~pbourke/d ... lightwave/
Please Log in or Create an account to join the conversation.