Table of Contents
Importing maps into TGEAWritten by: Trollfiddler. Exporting from L3DTExporting the heightfieldThe TGEA import interface loads terrain from 16-bit unsigned RAW files. To get such a file from L3DT, do the following:
Exporting the texture
Importing into TGEAThere is documentation on the Torque Developers Network at Garage Games which explains the Atlas terrain and texture import commands (generateChunkFileFromRaw16 and generateTQT respectively). These are also discussed on the GG web site in many forum threads. As an alternative to these commands you can use the slightly less confusing Atlas import GUI (which is available from the resources section at GG). There are some details required for either or both methods of import. These can be gathered from L3DT and are explained below. HeightRangeThis is required for the terrain mesh import if you use the GUI. You can check the height range in L3DT by selecting the Operations->Heightfield->change vert scale option. The “altitude range” is shown in the middle of the pop-up box, and that's the value you should enter for the “height range” in the GUI. Just cancel out from change_vert_scale when you've noted the altitude range. Square sizeThis is required for the terrain mesh import in both the GUI and console command. When you create a new map in L3DT you specify the “heightfield resolution”. This is the value that you should enter as the “square size” in the import GUI or in the console command. You can find it by going to the menu option settings/current_project. When the pop-up box appears, expand “HF” in the tree. The value you require is shown as the “HorizScale” in the expanded tree. Vertical scaleThis is required for the terrain mesh import in the console command only. This can be found by starting the L3DT viewer (L3DTVi2) and opening your terrain. Select the menu option view/Map_group_tree_view. When the pop-up box appears, select the heightfield in the tree at the top. The vertical scale will be displayed in the list of details in the lower pane. A quicker rough rule of thumb that has been recommended on the GG web site, is to divide the HORIZONTAL scale by 65536 to get the vertical scale. Leaf SizeThis is required for the texture import using the console command or GUI. You only need to worry about leaf-size calculation if you are using the built-in console command in TGEA (generateTQT). If you are using the GUI then you do not need to know how to calculate the leafsize. The GUI has a button that will calculate it for you. However, if you are using the console command and not the GUI then the formula for calculating LeafSize is: LeafSize = ImageSize / 2^(TreeDepth - 1) Where ImageSize is the size of your texture, and TreeDepth is the treedepth that you specified for your terrain mesh when you imported it into TGEA. So, for example, if we have an image size of 2048 and a treedepth of 6: LeafSize = 2048 / 2^(6-1) = 2048 / (2^5) = 2048 / 32 = 64 Please note: Tree depth and error metrics are beyond the scope of this tutorial as they are related to the rendering engine and not L3DT. Besides which, they are largely a matter of guesswork and experimentation to see which values work best for your particular scenario. See the Garage Games web site for more information on these subjects. Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Share Alike 3.0 Unported
|