Results 1 to 3 of 3

Thread: Merge textures function in o2

  1. #1
    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=&#34;mergedemo&#92;side1.paa&#34;;
    angle=0.000000;
    };
    class item00001 {
    x=256.000000;
    y=0.000000;
    w=256.000000;
    h=256.000000;
    scale=0.000000;
    name=&#34;mergedemo&#92;side2.paa&#34;;
    angle=0.000000;
    };
    class item00002 {
    x=0.000000;
    y=256.000000;
    w=256.000000;
    h=256.000000;
    scale=0.000000;
    name=&#34;mergedemo&#92;side3.paa&#34;;
    angle=0.000000;
    };
    class item00003 {
    x=256.000000;
    y=256.000000;
    w=256.000000;
    h=256.000000;
    scale=0.000000;
    name=&#34;mergedemo&#92;side4.paa&#34;;
    angle=0.000000;
    };
    };
    w=512.000000;
    h=512.000000;
    alpha=0.000000;
    file=&#34;mergedemo&#92;merged_sides.paa&#34;;

    models&#91;&#93;=
    {
    &#34;object01.p3d&#34;
    };
    mergedpath=&#34;v&#58;&#92;mergedemo&#34;;
    };
    };
    [/QUOTE]

    Special thanks for Suma for quick response when asked for example script&#33;

  2. #2
    wow thnx, O2 been out for sooo long and only now there is a use for this function, thnx alot
    REDHAMMERSTUDIOS | M109A6 | 3DSMAX ARMA2 TOOLBOX

    ~RHS: AFRF on the or BIF and on Facebook.

  3. #3

    Thumbs up

    Thank you very much&#33;
    VME Team | VME PLA MOD | A PLA Veteran

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •