OGRE COMMANDLINE UTILITIES

OgreXMLConverter
----------------
Converts between the binary and XML formats for .mesh and .skeleton. Will also
allow you to generate LOD information if you are converting to the binary
format.
This tool is necessary to convert from the XML to OGRE's native runtime
format if your exporter produces XML. You can find the XML Schema for the .mesh
and .skeleton formats in the Ogre source under Tools/XMLConverter/docs.

Usage: OgreXMLConverter [options] sourcefile [destfile]

Available options:
-i             = interactive mode - prompt for options
(The next 4 options are only applicable when converting XML to Mesh)
-l lodlevels   = number of LOD levels
-d loddist     = distance increment to reduce LOD
-p lodpercent  = Percentage triangle reduction amount per LOD
-f lodnumtris  = Fixed vertex reduction per LOD
-e             = DON'T generate edge lists (for stencil shadows)
-r             = DON'T reorganise vertex buffers to OGRE recommended format.
-t             = Generate tangents (for normal mapping)
-o             = DON'T optimise out redundant tracks & keyframes
-d3d           = Prefer D3D packed colour formats (default on Windows)
-gl            = Prefer GL packed colour formats (default on non-Windows)
-E endian      = Set endian mode 'big' 'little' or 'native' (default)
-q             = Quiet mode, less output
-log filename  = name of the log file (default: 'OgreXMLConverter.log')
sourcefile     = name of file to convert
destfile       = optional name of file to write to. If you don't
                 specify this OGRE works it out through the extension
                 and the XML contents if the source is XML. For example
                 test.mesh becomes test.xml, test.xml becomes test.mesh
                 if the XML document root is <mesh> etc.

Because the default behaviour is to convert binary to XML and vice versa, you
can simply drag files onto this converter and it will convert between the 2
formats, although you will not be able to use it to generate LOD levels this
way.

When converting XML to .mesh, you will be prompted to (re)generate level-of-detail(LOD) information for the mesh - you can choose to skip this part if you wish, but doing it will allow you to make your mesh reduce in detail automatically when it is loaded into the engine. The engine uses a complex algorithm to determine the best parts of the mesh to reduce in detail depending on many factors such as the curvature of the surface, the edges of the mesh and seams at the edges of textures and smoothing groups - taking advantage of it is advised to make your meshes more scalable in real scenes.

New XML converter param: -merge

Postby dark_sylinc » Yesterday, 2012 12:42 am

I just added to v1.9 a new param:
Usage:

ogrexmlconverter -merge 0,1 myFile.mesh.xml

This will merge two texture coordinates into one: float1 Texcoord0 and float2 Texcoord1 become float3 Texcoord0.
This is very useful to save interpolators. Some GPUs work faster (negligible gain probably, though), but more importantly, this makes a lot easier to handle shader permutations when you write complex übershaders.
The merge happens after generating the tangents (otherwise it may get screwed?)
Note that the merge doesn't happen if the following rules aren't met:
  • Both texcoords. must be in the same buffer source.
  • Both texcoords. must be adjancent in memory (i.e. nothing between them).
  • Both texcoords. must be of the same type (you can't mix short with float)
  • There has to be enough room. You can't merge float2 with float3 because there is no float5. The merge will fail.

Since all known exporters export following these rules, you shouldn't have much of a problem. The merge only runs once, but running the converter multiple times you can collapse more than two texcoords.
This is a long shot from the "vertex.layout" I want for 2.x; but it satisfies our current, more urgent needs; and probably other people too.
Enjoy!

OgreMeshUpgrade
---------------

This tool upgrades a .mesh file from any previous version of OGRE to the latest
version. You will be advised in Ogre.log if your meshes are of an old version;
OGRE can still load old versions but performance may not be as good as it would
be with the latest version.
You are advised to upgrade your meshes whenever you
update to another major version of OGRE.

Usage: OgreMeshUpgrader [options] sourcefile [destfile]
-i             = Interactive mode, prompt for options
-l lodlevels   = number of LOD levels
-d loddist     = distance increment to reduce LOD
-p lodpercent  = Percentage triangle reduction amount per LOD
-f lodnumtris  = Fixed vertex reduction per LOD
-e         = DON'T generate edge lists (for stencil shadows)
-t         = Generate tangents (for normal mapping)
-r         = DON'T reorganise buffers to recommended format
-d3d       = Convert to D3D colour formats
-gl        = Convert to GL colour formats
-srcd3d    = Interpret ambiguous colours as D3D style
-srcgl     = Interpret ambiguous colours as GL style
-E endian  = Set endian mode 'big' 'little' or 'native' (default)
sourcefile = name of file to convert
destfile   = optional name of file to write to. If you don't
             specify this OGRE overwrites the existing file.

Again you can drag files onto this tool, so long as you don't mind it
overwriting the file in place. If you'd prefer to keep a backup, make a copy or
use the command line to upgrade to a different file.

Reorganising vertex buffers: this tool now allows you to restructure the vertex
buffers in your mesh. If you are upgrading from a version prior to 0.15.0, then
you should answer 'y' when asked if you want to reorganise the buffers, since
0.15.0 and later allows more efficient structures in the binary mesh. You will
then be shown the buffer structures for each of the geometry sections; you can
either reorganise the buffers yourself, or use 'automatic' mode, which is
recommended unless you know what you're doing.

[v1.8]

OgreMeshUpgrader now accepts an optional -V parameter where you can specify the target version to write.

MeshSerializer can now write all versions of .mesh back to Ogre 1.0 rather than only being able to write in the latest version format. This should make it easier for tool & exporter developers who can use the latest code but still support users on older versions

MeshMagick

http://www.ogre3d.org/tikiwiki/MeshMagick
----------
Copyright 2007 by Daniel Wickert

Command-line tool for performing operations on meshes and skeletons.

Usage:

MeshMagick [global_options] toolname [tool_options] infile(s) -- [outfile(s)]

Available Tools:

info - print information about the mesh.
meshmerge - Merge multiple submeshes into a single mesh.
optimise - Optimise meshes and skeletons.

rename - Rename different elements of meshes and skeletons.
transform - Scale, rotate or otherwise transform a mesh.

See MeshMagick -help=toolname for more detailed information.

optimise

Allows you to optimise meshes and skeletons. This will merge equal vertices, remove unneeded animation tracks and do other sensible optimisation operations, that can result in smaller mesh file size and better performance.
Options:

-tolerance=val
Tolerance value for treating vertices as equal (all components)

-pos_tolerance=val
Tolerance value for treating positions as equal

-norm_tolerance=val
Tolerance value for treating normals as equal

-uv_tolerance=val
Tolerance value for treating uvs as equal

-keep-identity-tracks
When optimising skeletons, keep tracks which do nothing

A merging example:
meshmagick meshmerge input1.mesh input2.mesh input3.mesh — output.mesh

原文地址:https://www.cnblogs.com/pulas/p/2811324.html