L3DT users' wiki
Large 3D terrain generator

Exporting TER for T3D

Author Aaron
Date 1 Oct. 2009

Before we start

Disclaimer

  • To use this tutorial, you must be using L3DT Professional or Pro for Torque version 2.8 or later.
  • This plugin is still relatively new. Please report any bugs to aaron@bundysoft.com.

Heightfield size and scale

In T3D, the size of TER files must be square and a power of two (e.g. 256×256, 512×512, 1024×1024, etc.) This means that when you generate your heightfield in L3DT, you must set the heightfield width and height to the above sizes.

I have it on good authority that the largest practical, performant size for T3D 1.0 is a 2048×2048 pixel TER file. Larger map sizes may degrade engine performance.

You may use any horizontal scale you like with T3D. However, for quality FPS terrain, a horizontal scale of 2m or less is recommended.

Generating alpha maps

In T3D, the TER files contain a mask used to apply detail maps. The L3DTio_TorqueTER exporter generates this mask from the alpha maps generated by L3DT (see alpha maps in userguide).

The following points are relevant here:

  • The number of alpha layers must be less than or equal to 254. If the layer count is greater than this, use the 'Combine alpha layers' wizard to combine alpha layers.
  • The alpha map resolution must be set to 1. This is the default setting.

Generating the texture

Unlike terrain in TGE or TGEA, the T3D terrain renderer may also use a pre-blended unique texture as the base colour map. This may be generated in L3DT as per the usual method. However, you should note the following points:

  • The 'use light map' option should be disabled in the texture wizard (T3D calculates its own lighting).
  • For best results, the texture resolution should be 2 or greater. Larger values produce more detailed terrain textures, but consume more texture memory in T3D.

Exporting the file(s)

To export the terrain as a single Torque TER file for T3D, select the 'File→Export→Torque T3D→Export Torque TER (v7)' menu option. This will open the 'Export Torque TER' window, shown below:

:plugins:fileio:l3dtio_torqueter:userguide:exporttorqueterdlg.png

The options are as follows:

TER file name

To select the TER filename, press the browse ('…') button. The file should be exported into your game folder, or a subdirectory thereof. For example, for the 'FPS Example' demo in T3D 1.0, the proper directory for saving TER files is:

C:\Torque\Torque 3D 2009 SDK 1.0\Examples\FPS Example\game\art\terrains\

Texture path

The 'Tex path' field is the relative path from the terrain file to the folder in which the textures/materials for the terrain will be stored. By default, this setting is automatically generated (using the 'auto' checkbox) such that if you save the TER file in the 'game\art\terrains\' folder, your textures will be stored in the 'game\art\terrains\[project name] textures\' folder.

After you set the TER file name, the 'tex. path' field will be updated automatically.

Example

For example, if I save a TER file here:

C:\Torque\Torque 3D 2009 SDK 1.0\Examples\FPS Example\game\art\terrains\L3DT_test.ter

…the automatically-generated texture path will be:

L3DT_test textures

…which means the textures will be saved in this folder:

C:\Torque\Torque 3D 2009 SDK 1.0\Examples\FPS Example\game\art\terrains\L3DT_test\L3DT_test textures\

Game folder

Before L3DTio_TorqueTER can export your TER file, it must know the path to your game's root folder. Please enter this path into the 'Game folder' edit box or select the folder using the '…' browse button.

For example, for the 'FPS Example' demo in T3D 1.0, the correct game folder is:

C:\Torque\Torque 3D 2009 SDK 1.0\Examples\FPS Example\game

Export mission file

If you enable the 'Export mission file' checkbox, the L3DTio_TorqueTER plugin will also create a stub T3D mission file (.mis) that includes the correct settings for the terrain.

Material settings

After you click OK in the Export to Torque TER window, the T3D Material Manager window will appear, as shown below. In this window, you may set the various texture settings for the materials in your map.

:plugins:fileio:l3dtio_torqueter:userguide:t3d:T3DMtlManager.png

You can also open the T3D Material Manager directly using the 'File→Export→Torque T3D→Material Manager' menu option.

Output

After you click OK, the L3DTio_TorqueTER plugin will export the TER file, material textures, materials.cs file, and mission file.

Results

www.bundysoft.com_l3dt_gallery_r28_2009nov11_t3d_8x_res.jpg
TER from L3DT, with 8x resolution texture, rendering in T3D FPS demo.

 
plugins/fileio/l3dtio_torqueter/userguide/t3d.txt · Last modified: 2017/08/31 06:56 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki