Convert Virtual Texture Datasets to Tiled Textures

The 3D Network Visualizer display engine does not handle virtual textures at runtime. Therefore you must convert the virtual texture datasets into tiled textures. This is done with the mftTool. It creates the highest resolution textures possible from the virtual texture dataset and binds them to individual tiles.

The mftTool

The mftTool is a command-line tool for converting virtual texture datasets into tiled textures so that they can be loaded by “Managing Network Connections“ on page 547.

. Table 55 describes the command-line options. The syntax for mftTool is as follows:

mftTool -f filename [-c index -w index -l index -m string -r path ... -x size -s directory -t filename -A -g -e -u -p threads -- -v -h]

Table 55 describes the command-line options.

Table 55: MftTool command-line options

Option Description
(-- | --ignore_rest) Ignore all arguments after this one.
(-A | --regenerateAll) Forces the regeneration of all Tiled Textures. This can be much slower and is needed less frequently if the Virtual Texture Dataset does not change.
(-c | --col) index The column to convert, using a zero-based index.
(-e | --encryptImages) The Tiled Textures will be generated in the MEIF file format. If not specified the file format will be DDS.
(-f |--file) filename The name of the MetaFlight file which contains the GGDS
(-g | --generateFiles) Generate tiled textures from the Virtual Texture and generate tiles in MEDF format from the FLT tiles which use the new textures. Also a MFT file will be published. The output name will be equal to the MetaFlight file specified with the -f option with the string _medf appended to the end before the extension. The above example would create a new MetaFlight file named yourTerrain_medf.mft in the same directory as yourTerrain.mft.* If the generated tiled texture already exists the file will not be regenerated.
(-h | --help) Displays usage information.
(-l | --level) index The level to convert, using a zero-based index.
(-m | --missing) string The missing texture placeholder.
(-p | --threads) threads Specifies the number of threads to run. Specifying zero will result in the number of threads equaling the number of logical processors the host machine has.
(-r | --searchDir) directory Adds a directory to the search path when resolving external references. During processing any external references not found will be removed from the generated files.
(-s | --subDir) directory The path to the substitution texture specified by the VTDS. The arguments -s and -t are mutually exclusive
(-t | --vtFile) file The name of the MetaFlight file which contains the VTDS. The arguments -s and -t are mutually exclusive.
(-u | --publishMftOnly) Publish a new MetaFlight file which can be loaded by 3D Network Visualizer applications. The output name will be equal to the MetaFlight file specified with the -f option with the string _medf appended to the end before the extension. The above example would create a new MetaFlight file named yourTerrain_medf.mft in the same directory as yourTerrain.mft.* The -u and the -g arguments are mutually exclusive.
(-v | --version) Display version information and exit.
(-w | --row) index The row to convert, using a zero-based index.
(-x | --textureSize) size Specifies the maximum texture size to generate in pixels per dimension. Larger textures use more memory and are slower page in, but allow for greater Virtual Texture resolution.

If neither the generate (-g) or the publish only (-u) argument is specified, mftTool prints out information regarding the MetaFlight terrain.

Using the mftTool to Process MetaFlight Files

To process a terrain with a single MetaFlight terrain file that has one GGDS and one VTDS, run the mftTool as follows:

mftTool -f C:\yourTerrain\yourTerrain.mft -s C:\yourTerrain\ds200-vt-otw-virtual-texture -g -A -e

The following example shows how to process a terrain with two MetaFlight terrain files, one with the GGDS and one with the VTDS. In this case, the tiles also contain external references to other Flight models.

mftTool -f C:\yourTerrain\ds100-flight-terrain\ds100-flight.mft -t C:\yourTerrain\ds200-vt-otw-virtual-texture\ds200-vt.mft -r C:\yourTerrain\textures -r C:\yourTerrain\objects -m C:\yourTerrain\MissingTexture.png -x 4096 -g

This creates a new MetaFlight file that references the new geometry grid dataset with virtual textures bound to it.

Convert Geometry Grid Datasets with Tiled Textures

The mftTool only needs to publish the MFT when the GGDS uses tiled textures. Cultural feature datasets are often built this way. These can be converted using the medfTool like all other files. The command syntax for the medfTool is described in “Compressing Model Files“ on page 321.

To only publish a new MetaFlight for the cultural dataset, do the following:

mftTool C:\yourTerrain\flt\ds7_culture_db5_building_area_new-hier_cult\ds7_culture_db5_building.mft -u -p 0

To convert a MetaFlight with tiled textures into a compressed format, use the medfTool, as follows:

medfTool -s C:\yourTerrain\flt\textures -s C:\yourTerrain\flt\objects --directory C:\yourTerrain\flt\ds7_culture_db5_building_area_new-hier_cult -x flt -t -m rgb -m rgba -m jpg -m bmp -p 0 -z 1

The medfTool is described in “Compressing Model Files“ on page 321.

Note: The medfTool should never be run on a directory which contains GGDS tiles which use Virtual Textures.

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · Documentation compiled and provided by Beijing ZNetLink Technology Co., Ltd.

交流群 · QQ Group:OPNET/智网妙算网络仿真交流群(群号 486383494)

原文档 © 2017 Riverbed Technology · 本站为公益翻译,由 AI 辅助完成,请仔细甄别

Original documentation © 2017 Riverbed Technology. Community translation, AI-assisted. Contact: jiazequn@znetlink.com