BaldEagle Tools - LODEditor

Home      LODEditor       Theater Building Utilities       Models

 

LODEditor Help & Tutorials

LOD Editor Tutorial

Textures

By

Rick "Dragon" Prior

 

Introduction:

Textures are not a new concept within the Falcon community as we have been manipulating them for some time. You can find some great articles on how to do this all over the place. HCPookie has a good tutorial on how to remap portions of a model to a new texture layout so I will not go into all of that. What this tutorial will do is explain how the textures are used within a LOD and also explain the use of the Texture Sets.

 

Textures:

If you load up the MiG-21 LOD (2835) and look at the information on the LOD page, you will see that there are 6 textures used within this LOD and they are located at offset 43116 (bytes from the Root Node). If you were to load up the Koreaobj.lod file with a HEX editor and jump to the texture offset, you would find:

1128

21

23

24

10

41

This is what we will call the Texture Table. It works very much like the Vectors or dColor Normals in that any time a node references a texture, it will use an index into this table. Example: index 0 would be texture 1128, index 1 would be 21, and so on.

The difference between the Vector Table and the Texture Table is that the Texture Table can not be changed by a DOF, SubTree or any other node. It is constant as defined by the Root Node.

If you were to bring up 77.CP, you will see that it is using a Texture, 0(1128). The 0 is the index number and the number of parenthesis is the actual texture number. You can change the texture by selecting a new one from the pull down menu. Keep in mind, you can only choose from the textures that are within the Texture Table!

Lets say that you want to make a new MiG-21 squadron. You would first have to create all the data files to support it (CT and Unit records), make a new Parent Record and Append a copy of the MiG-21 LOD. (All this will be discussed in more depth in later articles).

Now you take the MiG-21 texture (1128) and make a new Skin for the new squadron and append that to the Koreaobj.tex file. Let's just say that new texture number is 1200. Now, you bring up the new LOD with LE and edit the 1128 to 1200 in the main entry page for the new LOD. That is all you have to do as the entire LOD uses an index of 0 for the first texture.

 

Texture Sets:

Some models use the Texture Set feature. This basically puts multiple Texture Tables within each LOD. The Parent record is where you find the field for the Texture Sets and in most cases it is set to 1. (At this time, I believe the field is labeled "Textures"). The F-16 is a good example of the use of texture sets: It has 6 texture sets. If you pull up the F-16 Parent record, you will see the 6. If you pull up a F-16 LOD, you will see 60 for the number of textures. If you divide 60 by 6, you get 10 textures per texture set.

Now, within a LOD that is utilizing Texture Sets, a reference from a draw node to a texture will NOT exceed the number of textures within a Texture Set. That means for the F-16, it will only make reference to the first 10 textures. Within the Falcon program, it will determine which Texture Set to use and adjust the sets accordingly. This is what happens for the different Squadrons of F-16's. The Falcon EXE determines which Texture Set to use.

 

Adding Textures:

Now that you know how the textures are stored, you can see what it would take to add a texture. First off, you need to make room in the LOD to accommodate a new texture number at the end of the Texture Table. This means moving the end portion to make room. Then, you have to update the number of textures in the root node and finally, you have to update the LOD pointers within the HDR file.

Fortunately, you can do all this from the program. If you need another texture, simply get to the LOD you want to add a texture to and click the Texture button. On the right, you will see a Add Texture button. Just enter the texture number in the box and hit the Add button. You will then have to go to any polygon you want to map to that new texture and change the Texture field along with the texture mappings.

NOTE: If you are adding a texture to a LOD that is using Texture Sets, you have to add a texture for each Texture Set! That means if you are adding a texture to the F16, you need to add 6 of them! Also, you have to update the order since the first 11 will be Texture Set #1! Be careful adding textures to LODs with Texture Sets. (Future releases will make working with Texture Sets automatic).