Table of Contents
Mesh exporterHi Everyone, Good news! There have been some big improvements in the latest build of L3DT (v2.9 build 25) that affect how users can export terrains as optimised mesh files. Please read on for more details… Seamless tiled exporterA long-standing request has been the ability to export the terrain as an optimised mesh that is split across multiple files. This was not possible in the past because the mesh decimator plugin did not have a way to force the edge triangles of adjoining tiles to match up exactly. This problem has now been fixed by rendering 'brute force' unoptimised triangles at tile edges. You can see the effect in this wireframe rendering, where the seam between each of the four tiles includes the unoptimised triangles:
And, for the sake of eye-candy, below is a short video from earlier showing the output of the new mesh exporter. This terrain was a set of 16 seamlessly tiled OBJ mesh files with textures, which was loaded tile-by-tile in into Sapphire:
How to export tilesTo make use of the new mesh exporter, select the new 'File→Export→Export optimised mesh' menu option, which will open the new Export mesh window shown below:
The complete user guide for the new exporter is on-line here. The controls should be familiar to you if you've used the 'File→Export→Export OBJ and MTL' or the 'File→Export→Export 3DS and texture' menu options, except that this new window also includes controls for the tile size, and a few other handy options. Mesh previewThe mesh exporter includes a preview button that allows you to check the output before exporting the mesh, so that you can make sure that all the settings are just right. This button will generate the mesh for your map (or for a single tile, if using tiled export), tell you the vertex/triangle count, and then show you the output mesh like so:
Please note that the mesh preview shows you the geometry and the vertex normals, but does not include texture rendering, bump maps, or the like. It's just a simple preview, so go easy on it ;) Selected area exportAnother useful feature of this new exporter is that it can be used to export only selected areas of the map as mesh files, which was not previously supported by the OBJ/MTL exporter. To make use of this feature, simply use the select area tool on the heightfield to hand-select the area to export (shown below), and then run the exporter using the 'File→Export→Export optimised mesh' menu option.
If you want to use precise coordinates instead of hand selection, you can also select the area using the 'Edit→Select map area' menu option (see user guide). Note that the coordinate origin (0, 0) is the south-west corner of the map. Textures, bump maps, etc.As with the old 'File→Export→Export OBJ and MTL' option, this new exporter also saves the texture and material definition for each tile, which makes it nice and easy for you to load the tiles into your game engine or renderer. The exporter also goes beyond the old exporter and includes the ability to export other 'auxiliary' maps such as alpha maps, normal maps, etc. Please note that this feature only exports the auxiliary maps in the appropriate files. It does not add any references to these auxiliary maps within the mesh/material files. Hence, this option won't magically make mesh files render with bump maps or alpha maps. That is still your job for the moment. For simplicity, all the texture/image data is exported as 24-bit bitmap images, partly because this prevents compression artefacts, and partly because the BMP plugin can export HUGE bitmaps without hitting any memory issues (c.f. JPG/PNG). However, if there is much wailing and gnashing of teeth, I will add support for some popular compressed formats (JPG/PNG/DDS). Is that gnashing I hear…? Updated 2011/07/05: I have included in the next build of the plugin the option to select different file formats for the texture and auxiliary map images (JPG/PNG/DDS/etc.) This option will be available in the release version of L3DT 11.07, due later this month. Mesh file formatsOn the subject of file formats; this tiled exporter supports the DAE (COLLADA), 3DS, OBJ/MTL, and X file formats 1). Tiled exporter support for the other mesh files like B3D and TIN will be added as time permits. If you have particular need of a specific file format not yet supported by this mesh exporter, please let me know in this forum thread.
Highly observant users may also notice that the exporter also supports a 'ZMESH' file format. This is L3DT's very own mesh file format, which is a compact, compressed binary file that is very fast to load and save. However, this format is only supported by L3DT, and is not intended to be used as an exchange format with other applications. It's just there because it allows Sapphire to load certain resources more quickly (trees, helicopters, etc).
Bug fixesA regrettably long-running problem with L3DT's mesh exports was that, when using the mesh decimator, the output files often contained, in addition to the correct geometry, some spurious triangles that had invalid coordinates. These were very uncool, and required manual editing to fix. I have now fixed the decimator so that it no-longer produces these dodgy triangles. Yay! Another problem with the old decimator was that it didn't always wind triangles in the same direction; some were clockwise and some were counter-clockwise. This caused problems because backface culling would show triangles wound one way and skip triangles wound the other way. The new exporter winds all triangles in the same direction, which you can set in the exporter window using the face winding control, discussed below. Other items of noteVertex normalsThe mesh decimator now generates vertex normals. However, vertex normals are only exported by the OBJ and X plugins at the moment. Vertex normal support will be added for the other mesh files (3DS, B3D, etc.) as time and specifications permit. Coordinate systems & face windingIn the new mesh exporter, you can select from two coordinate systems:
You also have the choice of two face winding options:
More detailsFor more details about the tiled mesh exporter, please consult the on-line user guide. Still to doThis update is by no means the end point of mesh development in L3DT. There are many improvements still planned:
If you'd like to suggest other changes, please use this forum thread. How to downloadIf you want to give the new mesh exporter a try, please follow the instructions below to download the update:
FeedbackI would dearly love to hear your feedback on these changes, particularly so if you've tried loading the exported mesh files into your game engine/renderer. Please make use of this forum thread. End transmissionCheers, Aaron. 1)
Updated 24th of June 2011 to add DAE, as per this announcement.
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Share Alike 3.0 Unported
|