User Tools

Site Tools


arma:texturing:merging_textures

This is an old revision of the document!


Merging Textures

This is the OFP addon porting really. Make sure you read the section fixing tutorial also, which is necessary after you have merged your textures.

Merging textures is done easily by using PAnTool and OFP O2. What you do is create one big merged texture in pantool and then use O2 to change the p3d model. More of this below…

Manual PTM file creation

PTM file is what the old OFP O2 will read to merge textures in the p3d file automatically.

I've been checking your textures carefully and I think probably just one 2048×2048 file will do for all the tank however, if you decide to do merge them you should do it in steps and not all at the same time since you have two problems, 1 there are away too many texture files and 2 they have many different sizes.

If you decide to merge them I think you should merge them by groups (sizes) first and than in the end join all of them.

Texture Merge tool in O2. 13 separate M4A1 textures into 2 larger textures, 1 is 2048×1024, the other is 2048×2048. They sound large, but from what I've read and heard, it'll better than 13 separate textures.

Basically, you merge all of the textures manually (using Photoshop or whatever), making sure to retain the ^2 dimensions (in my case, with the textures being quite hi-res to begin with, using 2048 and 1024 pixels as my dimensions). Then you have to write a .PTM file, that O2 uses to remap the existing UV Maps, onto the new larger texture.

class inftexmerge {
class object01 {
class items {

class item00000
{
x=0.000000; 
y=0.000000; 
w=512.000000; 
h=256.000000;
scale=0.000000; 
name="SJB_M4TEST\tex\fixorb.pac"; 
angle=0.000000; 
};

class item00001
{
x=0.000000; 
y=0.000000; 
w=512.000000; 
h=256.000000;
scale=0.000000; 
name="SJB_M4TEST\tex\fixorb.pac"; 
angle=0.000000; 
};

class item00002 
{
x=0.000000;
y=256.000000;
w=512.000000;
h=256.000000;
scale=0.000000;
name="SJB_M4TEST\tex\ris.pac";
angle=0.000000;
};

class item00003 
{
x=0.000000;
y=512.000000;
w=512.000000;
h=512.000000;
scale=0.000000;
name="SJB_M4TEST\tex\Stuffed.pac";
angle=0.000000;
};

class item00004 
{
x=512.000000;
y=0.000000;
w=256.000000;
h=512.000000;
scale=0.000000;
name="SJB_M4TEST\tex\30magPolyM4.pac";
angle=0.000000;
};

class item00005 
{
x=512.000000;
y=512.000000;
w=512.000000;
h=512.000000;
scale=0.000000;
name="SJB_M4TEST\tex\right.pac";
angle=0.000000;
};

class item00006 
{
x=1024.000000;
y=0.000000;
w=1024.000000;
h=1024.000000;
scale=0.000000;
name="SJB_M4TEST\tex\ANPEQ2a.pac";
angle=0.000000;
};
};

w=2048.000000; 
h=1024.000000; 
alpha=0.000000; 
file="SJB_M4TEST\tex\M4_Part1.paa";

models[]=
{
"SJB_M4A1_proxy.p3d" 
};
mergedpath="C:\O2_Viewer\SJB_M4TEST\tex"; 
};
};

And

class inftexmerge {
class object01 {
class items {

class item00000
{
x=0.000000; 
y=0.000000; 
w=1024.000000; 
h=512.000000;
scale=0.000000; 
name="SJB_M4TEST\tex\foregrip.pac"; 
angle=0.000000; 
};

class item00001
{
x=1024.000000; 
y=0.000000; 
w=512.000000; 
h=512.000000;
scale=0.000000; 
name="SJB_M4TEST\tex\stuffed2A.pac"; 
angle=0.000000; 
};

class item00002 
{
x=1536.000000;
y=0.000000;
w=512.000000;
h=512.000000;
scale=0.000000;
name="SJB_M4TEST\tex\stuffed2B.pac";
angle=0.000000;
};

class item00003 
{
x=0.000000;
y=512.000000;
w=1024.000000;
h=1024.000000;
scale=0.000000;
name="SJB_M4TEST\tex\regStockM4.pac";
angle=0.000000;
};

class item00004 
{
x=1024.000000;
y=512.000000;
w=1024.000000;
h=1024.000000;
scale=0.000000;
name="SJB_M4TEST\tex\recPolyM4.pac";
angle=0.000000;
};

class item00005 
{
x=0.000000;
y=1536.000000;
w=512.000000;
h=256.000000;
scale=0.000000;
name="SJB_M4TEST\tex\carryPolyM4.pac";
angle=0.000000;
};

class item00006 
{
x=512.000000;
y=1536.000000;
w=512.000000;
h=512.000000;
scale=0.000000;
name="SJB_M4TEST\tex\cranePolyM4.pac";
angle=0.000000;
};

class item00007 
{
x=1024.000000;
y=1536.000000;
w=256.000000;
h=512.000000;
scale=0.000000;
name="SJB_M4TEST\tex\vertPolyM4.pac";
angle=0.000000;
};
};

w=2048.000000; 
h=2048.000000; 
alpha=0.000000; 
file="SJB_M4TEST\tex\M4_Part2.pac";

models[]=
{
"SJB_M4A1_proxy.p3d" 
};
mergedpath="C:\O2_Viewer\SJB_M4TEST\tex"; 
};
};

Those are my two example .PTM files I used.
X = The top left point of the texture (where it starts)
Y = The height of the two left point defined in X
W = How wide the texture is (in pixels)
H = How high it is (again, in pixels)

The above .PTM file stuff is case sensitive.

The normal maps, as well as the cfgmaterials working. edit the values in cfgmaterials to make the 'shine' less intense in most circumstances.

Source Jackal326 in BIS forum topic.

UV Editor

Panda[PL] said on BIS forums: Guys you can merge 2 or 4 textures into one in the UV editor now! Open it up, use “filter by main texture” to select first texture, then scale it by half. While scalling you can pick which point will be preserved - pick upper left corner. Select next texture, pick upper righht corner. Then you can add 2 more using lower corners and save. Merge the 4 textures in any program (including paint) and make a .paa. Just filter the faces to find the ones using old 4 textures one by one and make them use new texture.

PanTool

Scars09 said on BIS forums: merging textures is a method to get many small textures to one big. you texture in o2 with the small ones. when you done, you open up pantool “file\new merged texture”. you will get a new, empty 2048×2048 texture. you the can drag and drop all your small textures in the new big one and place them to fit in as many as possible. then you save the merged texture. this will not only generate the texture but also a skriptfile. this file contains the textures use and where they are placed in the merged one. then you open up o2 again and execute the script with “surface\merge textures”. this has to be done for any textured lod´s of the model.

That was the skript generated by pantool (dont look on the sizes, script was used with textures twice as big as shown in the picture) merged single textures dont perform as good as merged unwrapped textures, but better the all the single textures as a single files. the skript usually needs some tweaking, you have to add the correct path and the model name, just open it with editor and check if everything is ok. this have to be done manually cause pantool didnt know the model or the path, its just a texture tool.

In my example i posted above the modelname was gunb the mainfolder sc9_egunb on the drive h:\ texturepath in my case was “sc9_egunb\texturename.paa” modelpath in my case “sc9_egunb\gunb.p3d” mergedpath=“h:\”; the texture often is generated as a tga, use pantool to make a .paa or .pac out of it.

In O2, select all the parts of the model, open up the face properties and check if “allow merging textures” is hooked. Then run the PTM script.

Tips

Skaven said this: You should do texture merging in steps and not all at the same time since you have two problems:
1) there are away too many texture files
2) they have many different sizes.

If you decide to merge them I think you should merge them by groups (sizes) first and than in the end join all of them.

arma/texturing/merging_textures.1209695684.txt.gz · Last modified: 2008-05-02 02:34 by snakeman