Jump to content
Sign in to follow this  
feersum.endjinn

Merge textures function in o2

Recommended Posts

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";

};

};

Special thanks for Suma for quick response when asked for example script!

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×