Surround Meshes (Advanced Tutorial)

From WiCWiki

Jump to: navigation, search

Contents

What are Surround Meshes?

A World in Conflict map consists of a playfield area surrounded by 8 tiles which are individual map segments that are of a lower level of detail than the playfield itself and which fade towards the horizon, thus giving the impression that the area expands far beyond the scope of the actual existing map. WicED refers to these 8 map tiles as Surround Meshes. All surround meshes used in World in Conflict have to be square shapes with each side measuring 1.536 kilometres. The advantage to working with surround meshes is that much detail and life can be added to your map without significantly impacting the game’s performance.

WicED recognizes two different types of surround meshes - Procedural Surround Meshes and Imported Surround Meshes:

Procedural Surround Meshes

Procedural surround meshes are created by reading a Photoshop Height Map file (*.raw) into WicED or by using WicED’s Terrain Generator. Procedural Surround Meshes are created mathematically and because of this they can be edited and textured within WicED. The value of Procedural Surround Meshes is that they can be generated automatically and are created with minimal effort.

More information on Procedural Surround Meshes is available in section 2 of this guide.

Imported Surround Meshes

Imported surround meshes are separate 3D-models that have stored vertex data, this means that they can not be edited in WicED, only in third party software. The strength of using Imported Surround Meshes is that map-makers may model their map freely outside of WicED as well as add any number of additional details to the surround.

Imported Surround Meshes are *.mrb files - WicEDs own file format for storing the vertex data that a 3D-model consists of. These *.mrb files are created from Procedural Surround Meshes (see above) using WicEDS function for exporting surround mesh height maps to *.lwo files that can edited in third party software packages such as Newtek Lightwave, Luxology Modo and Autodesk Maya.

Working with Imported Surround Meshes is explained further in section 3 of this guide.

How to create Surround Meshes from a Photoshop Height Map file *.raw

A height map is a grayscale bitmap image that describes terrain information by using contrast to define various levels of elevation. White pixels in the height map image represent the highest possible level of elevation a segment of the terrain may possess while a black pixel likewise describes the lowest possible level of elevation.

WicED only recognises height maps that use Adobe Photoshop Height Map format called *.raw. However, this guide does not cover how to work with height maps, only how to use them in relation ship with WicED.

When creating Surround Meshes from a height map you must import all 8 surround meshes as a single height map image. This image must be 1539x1539 pixels so that each of the surround mesh segments is 512x512 pixels in size. The centre of the height map image is the play field height map. (See the tutorial on creating playfield terrain). Once your surround height map *.raw file is created you are ready to import it into WicED.


Do this by selecting Setting>Surround Mesh settings from the menu.

The Settings Dropdown Menu


The following window will appear:

Surround Mesh Settings

Click the Import Height Map button and you will be prompted to locate your *.raw file. Select the *.raw file and click ok. WiCED will now read your height map and display it as a terrain wireframe in the 3D-view of your World in Conflict map.

You now have Procedural Surround Meshes that can be textured with WiCEDs Texture Generation tool or that can be exported to *.lwo files so that they can be edited in a third party 3D-software package to be brought back into your map as Imported Surround Meshes.

Texturing Procedural Surround Meshes with the Texture Generation Tool

  • For the full tutorial on creating textures in WiCED see the section on the Texture Generation tool.

When creating splatted textures for your Procedural Surround Meshes you must first open the Texture Generation Tool from the tool palette by clicking The Texture Generation Icon.

In the main window of the Texture Generation Tool, make sure that the Surround box is checked.

The Texture Generation Tool

When you now click the “Render” button to produce the textures you have previously created for your playfield they will now also be applied to your surround meshes.

In order to make the transition from playfield to surround mesh as seamless as possible use to the Fade to surround mesh command found in the menu under Edit>Fade to Surround Mesh. This will cause the textures to blend, thus reducing any lines that may appear along the surround mesh border.

How to import Surround Meshes from a third party 3D-software package

Exporting the meshes

This section will explain the process of exporting your WiCED Surround Meshes to a third party 3D-modeling software. Advanced users may wish to do this in order to add an increased level of mesh- and texture-detail to the surround and create far more interesting World in Conflict maps.

For the purpose of this guide it will be assumed that the user possesses the basic knowledge of how to generate terrain and ground textures within WiCED as well as some working knowledge of an external 3D-software package.

Start WiCED and select File>New to create a new map or File>Open to open an existing map. If you are selecting a new map, use the Terrain Generation Tool or import a height map file (*.raw) to create your playfield and Surround Meshes. (See the section on terrain generation for more information on this.)

The next step is to export each surround height map to a mesh file that can be read by any 3D-modeling tool. WiCED has been designed from the ground up to function seamlessly with Luxology Modo and Newtek Lightwave software and any exported files will automatically become *.lwo files (Lightwave Object). However, most industry standard 3D-software packages are able to handle and/or convert this format.

To export the meshes select File>Export>LWO>Surround meshes -> LWO from the menu.

You will then be prompted to select where on your hard drive that you wish to create the exported mesh files.

For the sake of organizing your work it may be simplest to export the files to <installfolder>\maps\<yourmapname>\surround meshes; this is the default folder for any Surround Mesh files related to your World in Conflict map.

Once you have selected/created a folder 8 files will be created on your hard drive, each named surroundmeshx.lwo, numbered from 0 to 7.

Editing Surround Meshes outside of WiCED

To edit the newly created mesh files, simply open them using your 3D-software package of choice then begin to add mesh details as you wish. There are however many things that need to be considered while editing these meshes;

When you wish to texture the ground of the exported Surround Mesh with your own image file its important to remember one thing; WiCED handles texture coordinates differently than external software packages which means that any texture you apply to the ground in your surround mesh using the existing UV-coordinates exported from the editor will be inverted along the U-axis. To apply your own ground textures and to have them displayed accurately in WiCED or in game you will need to mirror/flip the existing UV-map along the U-axis.

Surround Meshes used in World in Conflict have 2 material-channels to which texture files can be applied; a diffuse texture channel and a detail texture channel. (Note that adding image files to additional channels such as specularity or reflection will cause the mesh to become invalid when attempting to import it into WiCED since surround meshes are simple and do not support these advanced features.)

The diffuse texture will be whatever image file you have applied to the material’s diffuse channel and the detail texture is a black and white image mapped to the luminosity channel.

Note that is possible to have more than 1 material applied to polygons within the Surround Mesh, as long as each material is limited to a diffuse and a luminosity channel.

Tips:

  • Due to game performance restrictions it’s advised that you do not exceed 3000-4000 triangle polygons for each individual mesh and that you do not use more than a 1024x1024 texture for the ground colour, a 1024x1024 texture for any additional mesh features and a 512x512 detail texture.
  • Try to keep your mesh clean of features such as 2-sided polygons and infinite edges as these will likely cause graphical flaws when viewing your World in Conflict map in game or in WiCED.

Converting your Surround Meshes to *.mrb files with ShowBoxN

ShowBoxN is a separate software application that is used to export 3D-models created in a third party format into *.mrb files, the format that is used by WiCED. ShowBoxN is designed from the ground up to function with Lightwave Object files so for maximum compatibility it is recommended that your files be of this format.

Start the ShowBoxN.exe located in your World in Conflict folder. Then click File>Open and locate the file that contains your edited Surround Mesh. When prompted to choose a state for your mesh, simply choose the default option. No other options may be applied to Surround Meshes.

Once your Surround Mesh is loaded select the Meshes tab in the Object window

The Meshes Tab

Each node displayed under the Meshes tab represents a material that has been applied to at least 1 polygon in your surround mesh.


Select one of these nodes and then go to the Surfaces tab under the main toolbar at the bottom of the ShowBoxN interface.

The Surface Tab


Here you will connect your images maps to each of the materials you have applied to your Surround Mesh.

In the display box you will see the available material channels that are connected to your mesh. As explained previously a Surround Mesh can only have one Diffuse and one Luminosity channel so there should never be more than two file references displayed here. You will have selected these connections when you created the textures for your mesh so they should be easily recognizable.

Click the first file name and you will be prompted to browse for your image file. Locate it and click ok. The texture should now appear on your mesh in the 3D-view.¨

Repeat this for both material channels if you are using Diffuse and Luminosity channels.

Once you have connected the image files to the mesh you must select the type of shader that your textures will be rendered with. For the purpose of working with Surround Meshes this is very important as rendering capabilities are very limited for this type of mesh.

If your texture does not contain an alpha channel you must select Surround Mesh Only from the scroll down menu. If your texture does contain an alpha channel it is recommended that you use either Standard Diffuse or Normal Map Diffuse shaders.

Typically a surround mesh will contain one surface that is the ground and does not contain an alpha channel and one surface that is any additional objects that you have added to the mesh such as houses or trees. These may well use the alpha channel, so choose your shader accordingly.

IMPORTANT: All surround mesh ground textures must be named surrmeshtextureX.dds where X is the number of the particular surround mesh (0-7). Else WiCED will not locate the ground texture. Any secondary texture files, for example those used on any houses or objects you have modeled into the Surround Mesh may have any name.

Once you applied all your image files it is time to convert the mesh file into an *.mrb file, the specific file format that can be imported into WiCED.

Do this by selecting File>MRB Export. You will then be prompted to select where you wish to place your *.mrb files. This will also create a *.mre file, this file saves all the connections you have made with image files and shaders. If you wish to alter your surround mesh further and need to re-export you *.mrb files you can open the *.mre file instead of your actual mesh file which will save you the work of re-applying your image files.


See the section on using ShowBoxN for more information on importing meshes into WiCED and applying various shaders to each mesh.

Importing surround meshes into WicED

Now it is time to import your edited Surround Meshes into WicED so that they once more become apart of the height field used in your World in Conflict map.

To do so, select from the menu Settings/Surround Mesh Settings and the following window will appear.

The Surround Mesh Settings

Now simply click one the available Surround Mesh slots numbered 0-7. Once the button is clicked you will be prompted to locate and select the *.mrb file that corresponds to that particular surround mesh tile and then click ok.

The process of importing the mesh data as a height map will take at least a few minutes. Repeat the process for each of the surround mesh tiles.

Once a surround mesh has been imported it becomes visible in WicED’s display of your map.

Tip: If ever you want to start over with the original surround meshes that were generated by WicED when you created your map, simply click the Remove All button and all Imported Surround Meshes will be removed and the original Procedural Surround Meshes will be returned.

Personal tools
User Created Content