Page 1 of 1

Enhanced Mosiac Features

PostPosted: Fri Mar 25, 2016 12:17 am
by LauraEss1957
I make this set of suggestions motivated entirely from my use of OpenSimulator (OS), and starting to use LT3D to make terrain for my own Open Simulator grid, so I shall explain what that is and how terrain is imported/exported from it.

Background
OpenSimulator is the open source version of SecondLife (SL), a virtual world in which avatars can explore, interact with other avatars, build objects, buildings and vehicles, and own and alter land. The basic unit of land in both is the Region, also known as a Sim, and the complete collection of sims for each independent world is called a Grid. In SL, sims are always 256x256m in size. In OS the default size is also 256x256m, by they can also be squares in sizes that are multiples of 256 (e.g. 512x512, 768x768, etc). Below shows a segment of the 3rd Rock Grid map, centred around the welcome centre. Each sim in 3RG is 256x256m in size.

Image

Each sim has a name and a rating. The circle and highlighted area in the above image shows the location of my avatar and what I can see from my avatar's view point when not looking at the map. Now while it's possible to edit the terrain within the virtual world via your avatar, this is a hit and miss operation compared to importing a heightfield created by a dedicated program. In both OS and SL if you're the owner of a sim you can import and expert a heightfield directly into a sim your avatar is in. The Region Estate Dialog Box looks like this (taken sing Singularity viewer in a test grid in a 256x256m sim):

Image

The RAW terrain files are actually Raw BGR (Interleaved) format (and I'd ignore the advice about the "red channel" shown here). According to the SL wiki, each RAW file is: 256 x 256 pixels, 13 channels, Interleaved, 8 bit depth, No header. These are image files (and probably have the same limitations as png images) and you can edit them in Photoshop, but it seems you can't import them directly into LT3D. But this means that even if you don't own/run the grid, you can still save/load terrain directly into your sims, a good thing for SL users because Linden Labs runs that world! Currently, trying to load RAW files saved by LT3D into OS will either give you an error message or incredible spikey terrain as OS fails to interpret it.

The other way of getting terrain into and out of sim is via the console. The console isn't available directly to users of SL, but if you run an OS grid you have access to it. The commands used are:

Code: Select all
change region <region name>

terrain save "<filename>"
terrain load "<filename>"

terrain save-tile "<filename>" tilewidth tileheight xMin yMin
terrain load-tile "<filename>" tilewidth tileheight xMin yMin


In general you need to change to a region before you do terrain save or terrain load to it. The console starts at the root location and any command made there affect ALL regions (and you can always go back to that using change region root). The console interprets a <space> as a divider unless it's withing quotes, which is why I have them around <file name>. The tilewidth and tileheight are measured in sims, and the xMin and yMin are the grid's coordinates of the bottom left corner of the rectangle of sims defined by tilewidth and tileheight. For example, the command for importing terrain for a 2 wide by 3 high grid of sims might look like this...

terrain load-tile "\\MEDIA-WIN7\OS-SL\Seconds\Urbania\LT3D\r32Files\South Island Test.r32" 2 3 1020 945

...where 1020,945 is the location of the bottom left corner of the 2x3 rectangle of sims. Doing a simple save or load of the terrain can only be in png and .r32 formats. At the moment OS can only save-tile to png format, but it can load-tile from .r32 (RAW32), .f32 (RAW32), .ter (Terragen), .raw (LL/SL RAW), .jpg (JPEG), .jpeg (JPEG), .bmp (BMP), .png (PNG), .gif (GIF), .tif (TIFF), .tiff (TIFF), .gsd (SYS.DRAWING) formats.

Having a mosaic-tiled project in LT3D seems like a good idea for someone using LT3D to make their terrains for OS. The tiles can easily be used to correspond to ones in their OS Grid in layout and size. Selections that match tiles or larger groups can be imported and exported either way in r32 format. Selecting the Split Map into Tiles (Mosiac Map) option in the Export Map wizard will (if you set it up correctly) export heightfield files in r32 format so that there's an r32 file for each region in your OS Grid.

I'll make my suggestions about enhancing this in the next reply to this post (just taking a break for lunch).

Re: Enhanced Mosiac Features

PostPosted: Fri Mar 25, 2016 4:34 am
by LauraEss1957
Suggestions

While the following suggestions would greatly benefit someone working with both Open Simulator and LT3D, you should also be helpful for others who need to would with terrains divided into square grids of squares.

Apart from creating a Mosaic when creating a new project, you can alter that by using the LAYER > MOSAIC menu as shown below:

Image

TILE LABELS
Each mosaic tile gets a label with which to identify it with. Initially when a mosaic is created the label for a particular tile is "xvalueyvalue" starting with x0y0. This mirrors how heightfields exported using the Split Map into Tiles option are currently named (e.g. 2x2 Export_x1y0). In addition to the Draw Mosaic Tiles option on the VIEW > DISPLAY EFFECTS menu, there would also be a Show Tile Labels entry which could be toggled independently. When toggled on, the tile's label would be displayed at a location in that tile on 2D maps, and in the HUD while 3D editing. Even if this setting were off, the label would be listed the dialog box that appears when the user double clicks a point on a 2D map.

Each Tile label could be edited to whatever the user wanted. The Mosaic menu above would have an Edit Tile Labels entry. This would bring up a dialog box similar to the Teleport one, but with a list of Tile Labels used in the project. The user could scroll through these, to edit, or reset to the default value, or reset all to the default value. When viewing a 2D map with the mouse, there be an extra Edit Tile Label entry in the context menu (greyed out when it's not a mosaic project) which would bring up an edit dialog box just for that label (maybe also with a reset button). If a user combines the mosaic all labels are deleted. If a user changes the mosaic tile size, then the label list is discarded and a new list created with default names.

TILE SELECTION
I've already made a Mosaic Selection Snap suggestion, however this would work slightly different. If the mouse is in selection mode, pressing CTRL (or perhaps selecting the "Tile Selection Mouse Mode" on the command bar) while dragging the mouse would select whole tiles. This will produce a rectangular selection area of one or more tiles, or have no additional effect if there are no tiles.

EXPORTING INTO TILES
Exporting a map using the Split Map into Tiles option would name the exported files slightly differently. Instead of creating filenames using the pattern of ExportName_xValueyValue it would now be ExportName_Label. If the user hasn't changed any of the default labels, then the file naming will be exactly the same as it is now. However if some or all of the labels have been changed, then the new labels will apply instead. For example changing x2y3 to The Arena would change the name of the file exported using the name of TestExport from TestExport_x2y3 to TestExport_The Arena. Likewise the label might be changed to x2y3-The Arena, keeping the location in the name but still identifying it in the export.

An issue here would be duplicate labels but this could be avoided in two ways. Firstly an edited label would be checked against other existing labels and rejected if it duplicates another. Secondly, when exporting at prefix could be added to the end of the filename (e.g. TestExport_The Arena_1) to avoid conflict.

EXPORT SELECTED TILES
This would be an additional entry under the FILE > EXPORT menu and greyed out if there were no tiles in the project. This would be similar to using the Split Map into Tiles option, but only those tiles either fully or partially selected using the mouse would be exported as tile. This is also different from Export Selected Area after using the TILE SELECTION to select whole tiles - that would export the whole selection as one file, whereas this exports a block of tiles as separate files.

IMPORT TO TILE
This would be drop-down menu on the Merge Heightfield dialog box (and greyed out if no tiles). The drop-down menu would have an initial value of [UNSELECTED] and a list of all the tile labels in the project. If the user user would selects a tile from that list, it then autofill values into the height, width, X Offset, and Y Offset, based on the size and location of the chosen tile. The user can still edit those values, but doing so resets the drop-down menu to [UNSELECTED].

And that's it. The whole idea is make fill use of the tiles as defined within LT3D. If you're working with an equivalent grid outside of the program. I know this looks ambitious but to me it seems a logical extension of using a mosaic.