Merging Textures

ArmA editing, missions, modeling, textures, terrains

Moderators: Lone Wolf, Snake Man

Snake Man
Commander-In-Chief
Posts: 9353
Joined: 2000-07-31 22:01:01
Gaming Interests: ArmA, ArmA 2, Falcon 4.0 and OFP.
Editing Interests: All, I (try) to edit everything.
Location: PMC

Merging Textures

Post by Snake Man » 2007-10-20 05:28:10

In ArmA we should use 1 texture per 1 model. So the old days OFP texturing of 75 textures puzzle of 64x64 res is not proper way anymore, we need to use one texture per model or at least trying to use one, I see some BIS models which use 2 like the UH60 and so on. But great model would be only with one texture. You can use texture size up to 2048x2048 as long as its power of two.

So how to merge those old OFP textures then, or any other texture you wish to use?

Well first of all we use three (or four) utils to merge them, first we use PanTool to combine the textures into one big texture, we use Texview2 to save it into paa/pac format, then we use the export version of O2PE to save our model to old format p3d and finally we use old OFP O2 to merge the textures as new O2PE's merge feature is not working.

Here is the step by step tutorial I put together.

1) In PanTool select File -> New Merged Texture
2) Adjust your windows desktop resolution to high enough so you can drag the MergeTexture window into 2048x2048 if you so choose to do so.
3) Drag and drop all your wanted small textures from the browser into this MergedTexture window and organize them as you see fit.
4) Use File -> Save As... and select texture name + TGA extension. We call it MyTexture.TGA now.
5) Open Texview2, load MyTexture.TGA and choose File -> Save As... and use MyTexture.pac filename.
6) Open the MyTexture.PTM file with your favourite text editor. Edit all addon paths and filenames to be case-sensitive and 100% correct! Edit the ending models[] part to put your p3d name youre going to merge these textures into.
7) Use O2PE export version to save your p3d to the old p3d format with File -> Export -> P3D Old Version... feature (skip this if its already in old p3d format).
8) Use OFP O2 to load up your exported p3d.
9) Select all faces (CTRL-A), then use Surfaces -> Merge Textures, choose MyModel.PTM file. O2 will display nothing at this point. Now check face properties (E) to see if the paths + texture names changed.
10) Repeat 9 to all LODs.
Done.

If there was errors after following those ten steps, then most likely your PTM script file was incorrect, some paths must have been upper/lower case letters or addon path name were wrong etc. That PTM script with is very strict about its configuration, take good care preparing it. You can also run the script as many times you like, it only changes the textures it finds matches for, so if there is errors on the script... nothing happens. Check the unchanged textures from face properties and then search the PTM to check where there is problem and fix it.

Hope this helps someone whos looking into merging textures into ArmA compatible/quality requirement standards :)
PMC Tactical Forum New User Registration please read new info here.

PMC since 1984

Editing knowledge, visit PMC Editing Wiki
The leading, most detailed and comprehensive modification made for the Vietnam War - Vietnam: The Experience homepage
View our videos in PMC Youtube channel

PMC Tactical forum Advanced Search is power.

"ALPHA BLACK TO PAPA BEAR. ALL RUSSIANS ARE TOAST. OVER."

granQ
2nd Lt
Posts: 83
Joined: 2007-04-08 20:18:34

Post by granQ » 2008-04-20 07:42:49

just wanted to say cheers for a excellent tutorial.

David
Recruit
Posts: 61
Joined: 2008-03-11 10:09:37

Post by David » 2008-04-20 17:23:25

Good!

@GranQ

Cool, first time that I'am seeing you here since months!

User avatar
Gnat
1st Lt
Posts: 120
Joined: 2004-01-07 08:46:56

Post by Gnat » 2008-07-02 15:00:34

ARH HA !!!
For a temparary extended desktop size so you can make 2048x2048 .....

Display Properties | Settings | Advanced | Monitor you have a check box "Hide modes that this monitor cannot display".

Uncheck it, and you should now be able to increase your screen resolution further.
I will look crappy no doubt, but good enough to enlarge the Tools main screen and then the working sub-window.

Snake Man
Commander-In-Chief
Posts: 9353
Joined: 2000-07-31 22:01:01
Gaming Interests: ArmA, ArmA 2, Falcon 4.0 and OFP.
Editing Interests: All, I (try) to edit everything.
Location: PMC

Post by Snake Man » 2008-07-02 16:41:19

Pantool doesnt need the 1:1 scale desktop size, the merged texture image is smaller, I have no idea what scale, could it be twice smaller than 1:1 dunno. I usually put just 1600x1200 resolution and I can do 2048x2048 textures just fine it with with alot of space to spare.
PMC Tactical Forum New User Registration please read new info here.

PMC since 1984

Editing knowledge, visit PMC Editing Wiki
The leading, most detailed and comprehensive modification made for the Vietnam War - Vietnam: The Experience homepage
View our videos in PMC Youtube channel

PMC Tactical forum Advanced Search is power.

"ALPHA BLACK TO PAPA BEAR. ALL RUSSIANS ARE TOAST. OVER."

User avatar
Gnat
1st Lt
Posts: 120
Joined: 2004-01-07 08:46:56

Post by Gnat » 2008-07-03 00:04:56

Yes, but as some people have already pointed out, most LCD monitors are 16XX by 1050 ..... the 1050 means it *just* misses allowing you to do 2048 height.

User avatar
Gnat
1st Lt
Posts: 120
Joined: 2004-01-07 08:46:56

Post by Gnat » 2008-07-03 12:32:10

Hmmmmm .... bloody thing wont work
No errors, but I'm not getting any change in texture references

Couple questions;
- Do I have to have OFP O2 Buldozer running as well?
- You still use Select-All even if not all texture are being merged (yet)?
- Does the;
mergedpath="APath";
get changed too? If so to what?

Used PTM file http://members.iinet.net.au/~nrspence/A ... exture.ptm

Snake Man
Commander-In-Chief
Posts: 9353
Joined: 2000-07-31 22:01:01
Gaming Interests: ArmA, ArmA 2, Falcon 4.0 and OFP.
Editing Interests: All, I (try) to edit everything.
Location: PMC

Post by Snake Man » 2008-07-03 13:30:32

This is the ptm file for my latest merge, the bdomek_ruina model in VTE.

Code: Select all

class inftexmerge {
	class PanTool1 {
		class items {
			class item00000 {
				x=0.000000;
				y=0.000000;
				w=512.000000;
				h=512.000000;
				scale=0.000000;
				name="vte_objects\t\domek_ruina1.pac";
				angle=0.000000;
			};
		};
		w=1024.000000;
		h=1024.000000;
		alpha=0.000000;
		file="Bdomek_ruina_co.paa";

		models[]=
		{
			"MyModel.p3d"
		};
		mergedpath="APath";
	};
};
Naturally the many textures removed only to show you one example.

I actually forgot to write the models[] part but apparently it works fine without the specific case sensitive p3d name, go figure.

By looking your example ptm file:

Code: Select all

name="P:\rktsu33\blue\newbot.pac";
It needs to be changed to:

Code: Select all

name="rktsu33\blue\newbot.pac";
to work. Try it out :)
PMC Tactical Forum New User Registration please read new info here.

PMC since 1984

Editing knowledge, visit PMC Editing Wiki
The leading, most detailed and comprehensive modification made for the Vietnam War - Vietnam: The Experience homepage
View our videos in PMC Youtube channel

PMC Tactical forum Advanced Search is power.

"ALPHA BLACK TO PAPA BEAR. ALL RUSSIANS ARE TOAST. OVER."

User avatar
Gnat
1st Lt
Posts: 120
Joined: 2004-01-07 08:46:56

Post by Gnat » 2008-07-03 14:12:02

BINGO ! Thx SM

Now i just got a transparent seam to get rid of :evil:

Snake Man
Commander-In-Chief
Posts: 9353
Joined: 2000-07-31 22:01:01
Gaming Interests: ArmA, ArmA 2, Falcon 4.0 and OFP.
Editing Interests: All, I (try) to edit everything.
Location: PMC

Post by Snake Man » 2008-07-22 10:39:24

Today I was merging textures for the BIS model bpanelak, there were two issues (besides some bad rvmat values).

First issue was some crack in the ceiling:

Image

Any ideas what might cause these seams to appear in the model just by merging textures?

Another error is the transparent alpha channel stuff:

Image

Is it wrong to merge transparent and non transparent textures together, or is there another reason why these window textures are messed up? Is it because the transparent textures are in _CO named texture, do they have to have some other name like _CA used for transparent stuff?

Any experienced tips would be much appreciated.
PMC Tactical Forum New User Registration please read new info here.

PMC since 1984

Editing knowledge, visit PMC Editing Wiki
The leading, most detailed and comprehensive modification made for the Vietnam War - Vietnam: The Experience homepage
View our videos in PMC Youtube channel

PMC Tactical forum Advanced Search is power.

"ALPHA BLACK TO PAPA BEAR. ALL RUSSIANS ARE TOAST. OVER."

User avatar
Gnat
1st Lt
Posts: 120
Joined: 2004-01-07 08:46:56

Post by Gnat » 2008-07-22 11:29:37

a) If the merged textures dont completely fill the selected size (1024x1024 or 2048x etc) then the "unused" space typically becomes transparent.
b) If the model is using a "looping" texture (ie the edge of the texture loops back and continues covering the selected area)

A) + B) can mean the texture no longer "loops" and the transpaent area of the merged texture now covers the remaining (invisible) area of the surface.

Another sign this is happen is you suddenly get one texture bleeding into another. Similar reason to about, except this time its not transparent area adjacent to the intented texture, its another different texture that sits beside it in the merged textures.

Sorry, can't help with the other problem. I typically never mix transparent textures and standard textures. Hence why I may not see it.
BTW, BIS generally use the same rule.

Snake Man
Commander-In-Chief
Posts: 9353
Joined: 2000-07-31 22:01:01
Gaming Interests: ArmA, ArmA 2, Falcon 4.0 and OFP.
Editing Interests: All, I (try) to edit everything.
Location: PMC

Post by Snake Man » 2008-07-22 13:48:20

Okay so I'll try to keep transparent textures separate from the normal ones.

Also, would it be easy to re-texture the model when you have one (main) texture left, to fix that crack on the ceiling for example? Or what would be the correct fixing method here?
PMC Tactical Forum New User Registration please read new info here.

PMC since 1984

Editing knowledge, visit PMC Editing Wiki
The leading, most detailed and comprehensive modification made for the Vietnam War - Vietnam: The Experience homepage
View our videos in PMC Youtube channel

PMC Tactical forum Advanced Search is power.

"ALPHA BLACK TO PAPA BEAR. ALL RUSSIANS ARE TOAST. OVER."

User avatar
Gnat
1st Lt
Posts: 120
Joined: 2004-01-07 08:46:56

Post by Gnat » 2008-07-23 11:33:45

Redoing the texture overlay again on the model I think is the only real way to fix those problem areas .... or if you know where in your merged texture its using the transparent section, manually fill the transparent area with more of the same texture.
I did the latter because I only had a very thin transparent section. Just extended the main texture a few more pixels and I was done.

Snake Man
Commander-In-Chief
Posts: 9353
Joined: 2000-07-31 22:01:01
Gaming Interests: ArmA, ArmA 2, Falcon 4.0 and OFP.
Editing Interests: All, I (try) to edit everything.
Location: PMC

Post by Snake Man » 2008-08-07 09:49:21

Today I continued my VTE objects texture merging which I've been doing for past... for so long that I'm numb already. I discovered something very very cool.

I used PanTool (because Synides method is otherwise great but the damn atlas tool messes textures up too many times) in normal 1024x768 desktop resolution as I wasnt expecting these textures to require me to change my desktop to fit 2048 merged texture size. Then by accident I moved the merged texture image too far out of the pantool screen... what happened?

Well there was small slider appearing into the bottom of the screen, then I moved the image more further... and discovered that hell yeah baby I can resize the merged texture window to 2048 size even without increasing my desktop resolution to fit the merged texture in pantool at one time!

Image

And now some scrolling of the merged texture window... and we can increase its size the same as we would have high resolution in windows desktop!

Image

Very cool :)

Edit: of course that method only works for horizontal adjustment, so you can do what I did in the screenshots 2048x1024 texture, you cant do (or at least I cannot adjust it) for 2048x2048 resolution.
PMC Tactical Forum New User Registration please read new info here.

PMC since 1984

Editing knowledge, visit PMC Editing Wiki
The leading, most detailed and comprehensive modification made for the Vietnam War - Vietnam: The Experience homepage
View our videos in PMC Youtube channel

PMC Tactical forum Advanced Search is power.

"ALPHA BLACK TO PAPA BEAR. ALL RUSSIANS ARE TOAST. OVER."

Snake Man
Commander-In-Chief
Posts: 9353
Joined: 2000-07-31 22:01:01
Gaming Interests: ArmA, ArmA 2, Falcon 4.0 and OFP.
Editing Interests: All, I (try) to edit everything.
Location: PMC

Post by Snake Man » 2008-08-15 12:42:59

Another small issue I came about, was that of course those long path + filenames will be cut short by OFP O2. So now I usually do this following change;

Lets say your PTM file for the texture goes like this:

Code: Select all

			class item00037 {
				x=1984.000000;
				y=256.000000;
				w=64.000000;
				h=128.000000;
				scale=0.000000;
				name="vte_air\data\m1a1_driv_darktrubka.paa";
				angle=0.000000;
			};
Now I take O2PE and mass name all texture paths, so they are removed. You'll do this by adding 'vte_air\data\*' and to replace that with just '*' when the path disappears, do this for all paths you got there. Then simply do to this ptm file edit removing the path all together, it will look like this after editing:

Code: Select all

			class item00037 {
				x=1984.000000;
				y=256.000000;
				w=64.000000;
				h=128.000000;
				scale=0.000000;
				name="m1a1_driv_darktrubka.paa";
				angle=0.000000;
			};
Now you dont have to worry about too long path+file names when running the merge textures in OFP O2.
PMC Tactical Forum New User Registration please read new info here.

PMC since 1984

Editing knowledge, visit PMC Editing Wiki
The leading, most detailed and comprehensive modification made for the Vietnam War - Vietnam: The Experience homepage
View our videos in PMC Youtube channel

PMC Tactical forum Advanced Search is power.

"ALPHA BLACK TO PAPA BEAR. ALL RUSSIANS ARE TOAST. OVER."

Snake Man
Commander-In-Chief
Posts: 9353
Joined: 2000-07-31 22:01:01
Gaming Interests: ArmA, ArmA 2, Falcon 4.0 and OFP.
Editing Interests: All, I (try) to edit everything.
Location: PMC

Post by Snake Man » 2008-08-15 13:08:32

Another neat thing I discovered was that if you want to merge two or more textures at once, you dont have to consequently run each and every of the PTM files, you can just create one ptm with all the texture merge info.

Here is how my ptm 1 looks (naturally edited to be shorter/better example):

Code: Select all

class inftexmerge {
	class PanTool1 {
		class items {
			class item00000 {
				x=0.000000;
				y=256.000000;
				w=256.000000;
				h=256.000000;
				scale=0.000000;
				name="uh1cgsite.paa";
				angle=0.000000;
			};
		};
		w=2048.000000;
		h=1024.000000;
		alpha=0.000000;
		file="Uh1gs_alpha_ca.paa";

		models[]=
		{
			"MyModel.p3d"
		};
		mergedpath="APath";
	};
};
Now, thats familiar PTM for everyone, right. OK.

Then I have my ptm 2 file that looks like this:

Code: Select all

class inftexmerge {
	class PanTool1 {
		class items {
			class item00000 {
				x=0.000000;
				y=0.000000;
				w=512.000000;
				h=256.000000;
				scale=0.000000;
				name="uh1cbsid.pac";
				angle=0.000000;
			};
		};
		w=2048.000000;
		h=1024.000000;
		alpha=0.000000;
		file="Uh1gs_co.paa";

		models[]=
		{
			"MyModel.p3d"
		};
		mergedpath="APath";
	};
};
So how do we merge these two PTM files together, so we dont have to run them separetely in O2 then?

Well you need to look the classnames which are all so familiar from OFP and ArmA configs to us by now, so we'll just add another class PanTool1 there, calling it PanTool2, here is my complete and working merged PTM file for two textures:

Code: Select all

class inftexmerge {
	class PanTool1 {
		class items {
			class item00000 {
				x=0.000000;
				y=256.000000;
				w=256.000000;
				h=256.000000;
				scale=0.000000;
				name="uh1cgsite.paa";
				angle=0.000000;
			};
		};
		w=2048.000000;
		h=1024.000000;
		alpha=0.000000;
		file="Uh1gs_alpha_ca.paa";

		models[]=
		{
			"MyModel.p3d"
		};
		mergedpath="APath";
	};
	class PanTool2 {
		class items {
			class item00000 {
				x=0.000000;
				y=0.000000;
				w=512.000000;
				h=256.000000;
				scale=0.000000;
				name="uh1cbsid.pac";
				angle=0.000000;
			};
		};
		w=2048.000000;
		h=1024.000000;
		alpha=0.000000;
		file="Uh1gs_co.paa";

		models[]=
		{
			"MyModel.p3d"
		};
		mergedpath="APath";
	};
};
As you can see I only copy pasted the second textures class PanTool1 right after the first textures class, then naming it differently so there is no conflict, I used name PanTool2.

Of course one could argue that it takes more time to edit this merged ptm file than to just use two (or more) ptm's in O2... but let me tell you, if you have lets say three textures and 7 LODs plus view gunner, pilot and cargo... that is alot of PTM's to be ran on all of those LODs while you could run just one.

If I didn't explain this clearly or someone has some questions, feel free to ask :)
PMC Tactical Forum New User Registration please read new info here.

PMC since 1984

Editing knowledge, visit PMC Editing Wiki
The leading, most detailed and comprehensive modification made for the Vietnam War - Vietnam: The Experience homepage
View our videos in PMC Youtube channel

PMC Tactical forum Advanced Search is power.

"ALPHA BLACK TO PAPA BEAR. ALL RUSSIANS ARE TOAST. OVER."

User avatar
Gnat
1st Lt
Posts: 120
Joined: 2004-01-07 08:46:56

Post by Gnat » 2008-08-16 02:32:19

Nice finds thank SM !!

Who is online

Users browsing this forum: No registered users and 0 guests