User Tools

Site Tools


arma2:terrain:l3dt

This is an old revision of the document!


L3DT

Using L3DT to create terrain for ArmA 2. This page was written mostly on the v14.xx era.

You can export the final Texture Map directly and use as a Sat_lco…

Export as .PNG can be problematic with bigger sizes - .BMP seems to work fine up to 20480×20480…

I use the Attributes Map (AM Layer) directly exported as a base for a Mask_lco… Saving large files is even MORE problematic here, for some unknown reason - neither .PNG or .BMP will save successfully as a single file @ 20480×20480 size - 10240 is OK - larger sizes you need to export as mosaic (.PNG format) and assemble in Photoshop… not too much of a chore really - I export 3 x 3 of 8192×8192 tiles and snap em together in Photoshop and crop to 20480

One point to watch when exporting the AM layer is to switch it to color output - otherwise you'll be deeply disappointed… (options button in the save as dialog - change “ColourMapped (bool) to “true”)…

Once you have made a height-field in there you can just save that - export height-field as .png - you make your own .pbl - its just a text file - adapt the tutorial one

Then you need to generate the water table - L3Dt will use that - no need to export that

Then you get to “Attributes layer” - this is the bit that uses Climates - you can just use “DemoRockGrassSand” to start with… this will generate a layer with different colors for 3 different ground textures… Later on if you want more complex masks you'll need to read the L3DT instructions heavily - then adapt or create a “climate” of your own…

…basically what it does is analyze your height map - decide where sand, rock, grass, etc needs to go - and it draws a map with colors where each of them go… sounds awful like a Mask_lco…. you can use it as one…

One point here - export Attributes layer as .PNG - but switch to color… (options button in the save as dialog - change “ColourMapped (bool) to “true”…

You can then carry on and generate a bump map layer (normals) - L3DT will use that - you don't need to export it - then a light map - ditto for that…

Finally you get to Texture map

At this stage L3DT will look at the basic 3 color attributes map it made earlier, and actually make a proper texture map (Like a Sat map) using a different texture for each color … You can export this and use it as a Sat_lco

So - height field map = height field + make a .pbl

Attributes map = Mask_lco (remember to change option to save in color)

Texture Map = Sat_lco

So to start with you can use say a 1024 height map - but for speed just do a 1024 Attributes and other layers… later when you're happier with stuff - crank that up to 10x - you can make a 10240×10240 mask and sat and get more detail…

L3DT is a genuine bitch to get the hang of… it'll take time to understand all the stuff - a lot of which u don't need… your principal layers are the ones mentioned above - but the generation process in L3DT demands you make all the rest if you want bump mapping at the Tex stage - you need to have previously generated a Normals layer - if you want light and shade effects you need to have made a light map - these make the Tex map look good - but the only ones you'll export are the 3 above…. (actually - since Arma2 does its own lighting, I've found skipping the light map layer is best - you also need to untick “use light map” at the Texture layer stage… Otherwise you're “baking in” directional lighting to your Sat layer, which may look extra-great when the sun in-game is conveniently in the right place, but extra-shit when all the in-game shadows are going in the opposite direction

Export as .PNG - it'll be a 16bit gray scale for the height field, and 8bit color for the other two - you can use them as they stand…

Again - not immediately informative, but the L3DT User Guide will basically explain all the options…

I use a “Combine Channels” function in PSP to combine 4 flat masks into a multicolor mask.

L3DT can also generate alpha maps. It can be called only by the menu and not in the default work flow (height map etc etc).

The result is a mask that can directly be used in visitor. I don't change anything. As when making the alpha map you can define what attributes from the attribute map are mapped to a color.

Only thing to keep in mind is that l3dt creates the alpha maps namely and correctly in the alpha channels. In Photoshop this results in seeing a pictures that looks absolutely blank.

If this scares you off you can just open it with paint (or any other simple tool that does not support alpha channels) and save it. As poor paint does not get the alpha channels it saves it as a normal color as you know it and for that voila you can see it.

L3DT With Visitor 3

Use a .png greyscale export from L3DT as your “first” import of the terrain into Visitor - along with a .pbl file - exactly like in the tutorial. At this stage things will import fast - you can use the .pbl file to microtune the sea level and generally get things the way you want them.

Later on, once you've been laying roads, etc - you might decide to use L3DT to tweak some areas - maybe for settlements, or flatten an area for an airstrip… However - at this stage, you may already have manually fine-tweaked heights in Visitor, or smoothed roads, etc - this makes the version of your heightmap currently in use in Visitor the most up-to-date one - so in order to preserve that work, you'll need to Export your heightmap from Visitor - tweak in L3DT, then Import back into Visitor - hopefully without disturbing anything! - this is especially important once you start placing objects at “absolute heights” - like bridge sections, etc… this is where XYZ format comes in handy.

Once your terrain is advanced a little - you'll find that that 2minute “terrain import via greyscale” can take 2 hours!! - it still works - just takes forever to reimport! However - for some reason XYZ format will still import ultra-fast.

Initial .png export from L3DT - note your minimum and maximum heights exactly. Import into Visitor with same max and min in associated .pbl file.

For any subsequent terrain editing once work has progressed a bit.

  • Export terrain as image from Visitor (you'll get a popup with two sets of max/min figures - write down the TOP ones) - this will result in a .pbl and a .png… throw the .pbl away and…
  • Import .png into L3DT (use the exact max/min you wrote down).
  • Edit terrain to little hearts content…
  • Export as XYZ…
  • Re-Import into Visitor…..

Subsequent imports of XYZ seem to work OK - but I've found the initial import should be a .png and .pbl setup - at least until you're happy with the overall heights, sea level, etc.

Climate Colors

Redo your climate so the different surfaces in the AM map have the bright primary colors you want to use in your Layers.cfg/mask_lco. when exporting this as a .png, *look at “options” - change it to “color”.

When creating/exporting the TX map (Sat tex layer). *maybe skip “use lightmap” - it makes odd shadows on the texture that can look weird in-game, and maybe skip “antialias” as well.

Tips

Satellite Mask & Texture

Save attributes map. Paint/paste your roads and airfields etc there. Import back to L3DT and choose proper color and attributes for the ne areas. Now you can export this into texture map too.

Resizing Heightfield

Open your XYZ terrain in L3DT and select Operations → Heightfield → Resize heightfield. Then choose new size. If you wish to change the cell size, select Operations → Heightfield → Change horizontal scale.

Calculating 4096 heightfield with 10m cell size attributes / texture layer will be very very slow. More than 1 hour of processing.

ImageMagick Mosaic Stitching

How to create one satellite image out of L3DT saved mosaic tiles using ImageMagick.

Save the attributes and texture layers in L3DT using 5 x 5 mosaic's. This mosaic size is nice because lets say you make common 20480 x 20480 resolution satellite, it will mosaic into 4096 x 4096 tiles (5 x 5).

BTW Creating 20480 resolution attributes and texture with L3DT takes about 2 - 4hours depending on your computer speed.

Use (in this example) for mask: Satellite_mask_mosaic and for texture: Satellite_texture_mosaic file names.

Write the MASK file names into “mosaic_mask.txt” file, which in our example looks like this:

Satellite_mask_mosaic_x0y4.png
Satellite_mask_mosaic_x1y4.png
Satellite_mask_mosaic_x2y4.png
Satellite_mask_mosaic_x3y4.png
Satellite_mask_mosaic_x4y4.png
Satellite_mask_mosaic_x0y3.png
Satellite_mask_mosaic_x1y3.png
Satellite_mask_mosaic_x2y3.png
Satellite_mask_mosaic_x3y3.png
Satellite_mask_mosaic_x4y3.png
Satellite_mask_mosaic_x0y2.png
Satellite_mask_mosaic_x1y2.png
Satellite_mask_mosaic_x2y2.png
Satellite_mask_mosaic_x3y2.png
Satellite_mask_mosaic_x4y2.png
Satellite_mask_mosaic_x0y1.png
Satellite_mask_mosaic_x1y1.png
Satellite_mask_mosaic_x2y1.png
Satellite_mask_mosaic_x3y1.png
Satellite_mask_mosaic_x4y1.png
Satellite_mask_mosaic_x0y0.png
Satellite_mask_mosaic_x1y0.png
Satellite_mask_mosaic_x2y0.png
Satellite_mask_mosaic_x3y0.png
Satellite_mask_mosaic_x4y0.png

Write the TEXTURE mosaic file names into “mosaic_texture.txt” file, which in our example looks like this:

Satellite_texture_mosaic_x0y4.png
Satellite_texture_mosaic_x1y4.png
Satellite_texture_mosaic_x2y4.png
Satellite_texture_mosaic_x3y4.png
Satellite_texture_mosaic_x4y4.png
Satellite_texture_mosaic_x0y3.png
Satellite_texture_mosaic_x1y3.png
Satellite_texture_mosaic_x2y3.png
Satellite_texture_mosaic_x3y3.png
Satellite_texture_mosaic_x4y3.png
Satellite_texture_mosaic_x0y2.png
Satellite_texture_mosaic_x1y2.png
Satellite_texture_mosaic_x2y2.png
Satellite_texture_mosaic_x3y2.png
Satellite_texture_mosaic_x4y2.png
Satellite_texture_mosaic_x0y1.png
Satellite_texture_mosaic_x1y1.png
Satellite_texture_mosaic_x2y1.png
Satellite_texture_mosaic_x3y1.png
Satellite_texture_mosaic_x4y1.png
Satellite_texture_mosaic_x0y0.png
Satellite_texture_mosaic_x1y0.png
Satellite_texture_mosaic_x2y0.png
Satellite_texture_mosaic_x3y0.png
Satellite_texture_mosaic_x4y0.png

Notice how the coordinates go from x0, y4 - top left to x4, y0 - bottom right. If you would use different number of mosaics, this file list would have to be changed accordingly.

Then create DOS .bat file like this:

montage -mode concatenate -size 20480x20480 @mosaic_mask.txt Satellite_mask_lco.png
montage -mode concatenate -size 20480x20480 @mosaic_texture.txt Satellite_texture_lco.png
pause

Now just execute the .bat file and you have the mask and texture PNG's saved nicely.

Please note that the Satellite_mask_lco.png is saved in Indexed color mode, if you attempt to import it to Visitor 3, it will crash. You must open it in Photoshop, change to RGB color and save. You should also open and save the Satellite_texture_lco.png image too although it comes out from ImageMagic as RGB color image.

Tip; if your montage run fails or gets stuck just running endlessly, reboot your computer to do fresh start, then try again and most likely it will run OK.

L3DT Mosaic Coordinates

L3DT Mosaic Coordinates for the image stitching are following.

*_x0y0.png is lower left corner
*_x0y1.png is one up left side

*_x0y4.png is top left corner

Satellite Resolution

When you are trying to save large attributes (mask) or texture (texture, doh) it only allows you to increase and decrease the values by multiply… to counter this, type your own number in the spinbox.

When generating large mask/texture it will take a long time in L3DT, you should test all settings first in the smallest (or smaller) resolution to save time. 20480 resolution texture generation takes hours.

Large PNG Save

You cannot save for example 20480 resolution image out of L3DT, you have to save it in tiled mosaic first.

You can choose to save tiled output - with each tile as a png, in any size of grid you want.

See above how to stitch together the mosaic files.

CPU Usage

On default settings L3DT uses all the CPU power it can get. This makes your windows sluggish and almost impossible to use. You can tweak L3DT by going Utilities → Throttle CPU and put that to about %50 and Settings → Multi-Thread settings, tick Core count manual override and put it at least one lower than the amount of cores you have. Like 4 core system put in 3.

Now your L3DT attributes and textures processing does not cause your windows to get sluggish and other programs work fine. L3DT is much slower on processing this way, so lets say in our computer 20480 res textures computed in 2hrs with default/full settings while on the suggested settings here its 4hrs. If you look at the times and say no thanks, consider that with full settings your windows is pretty much unusable for that 2hrs amount…

Attribute / Mask RGB Colors

How to change the Attribute map / Mask image colors that are used for the land types.

Resources → Climates → Climate Manager

Select Climate Type (I recommend copying one first and changing that) then Edit, then choose land type, edit and there you'll find the RGB's under “Display col.” box.

arma2/terrain/l3dt.1484297715.txt.gz · Last modified: 2017-01-13 08:55 by snakeman