Jump to content

Photo
- - - - -

Merge textures function in o2


  • Please log in to reply
2 replies to this topic

#1 feersum.endjinn

feersum.endjinn

    Gunnery Sergeant

  • Members
  • 522 posts

Posted 14 May 2004 - 16:17

This isn't much of a tutorial, but might be still help for some modellers...

"Merge textures" function is used in O2 to combine several small textures into larger one. Having one big 512x512 texture instead of four separate 256x256 textures gives better performance in modern graphics cards, since texture state change is relatively expensive operation for GPU.

How to do it? First, select all faces in LOD which you want to perform merge function on, basically you usually just select all faces. Then select "Merge Textures" under Surfaces menu. Now, all references to textures listed in merge script should be changed to your merged texture.

O2 does not combine textures for you - this is something you currently must do yourself, including writing down coordinates which texture can be found in which position in larger merged texture. O2 only remaps your models UV coordinates so that all single texture references are changed into proper UV coordinates in merged texture. It is bit time consuming work, but writing merge script is a lot easier than doing all this work manually. You might also find it easier to merge few textures at time.

Note also that all texture mapping types aren't always suitable for merging - especially gizmo mapping can be problematic unless UV coordinate wrapover is aligned exactly at face edge.

Dschulle (author of PaNTool) is researching possibility of including feature into PaNTool which would allow you to merge textures using drag&drop GUI and automatically generate script for O2 to use.

Get example project from here

Example merge script (mergedemo.ptm):
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class inftexmerge {
class object01 {
class items {
class item00000 {
x=0.000000;
y=0.000000;
w=256.000000;
h=256.000000;
scale=0.000000;
name="mergedemo\side1.paa";
angle=0.000000;
};
class item00001 {
x=256.000000;
y=0.000000;
w=256.000000;
h=256.000000;
scale=0.000000;
name="mergedemo\side2.paa";
angle=0.000000;
};
class item00002 {
x=0.000000;
y=256.000000;
w=256.000000;
h=256.000000;
scale=0.000000;
name="mergedemo\side3.paa";
angle=0.000000;
};
class item00003 {
x=256.000000;
y=256.000000;
w=256.000000;
h=256.000000;
scale=0.000000;
name="mergedemo\side4.paa";
angle=0.000000;
};
};
w=512.000000;
h=512.000000;
alpha=0.000000;
file="mergedemo\merged_sides.paa";

models[]=
{
"object01.p3d"
};
mergedpath="v:\mergedemo";
};
};
[/QUOTE]

Special thanks for Suma for quick response when asked for example script!
Posted ImagePosted ImagePosted Image

#2 Soul_Assassin

Soul_Assassin

    Chief Warrant Officer

  • Members
  • 3507 posts

Posted 15 May 2004 - 10:01

wow thnx, O2 been out for sooo long and only now there is a use for this function, thnx alot

#3 Alex.XP

Alex.XP

    Corporal

  • Members
  • 77 posts

Posted 13 July 2004 - 23:05

Thank you very much!
Posted Image Posted Image Posted Image
VME Team | VME PLA MOD | A PLA Veteran
Posted Image