Static Mesh Landscape

Overview

This page describes the process of converting a landscape that uses the MM_VertexBlending parent material into static mesh geometry and transferring all of the weight blending.

Creating Texture Mask

The first step that needs to be done is exporting the landscape layers using the landscape tool. Simply right-click each layer and click on “Export to file”.

../_images/2015-08-19_11-08-28.jpg

Open the five layers inside of Photoshop and create a new image that has the same dimensions as the exported layers. This new image will be the texture mask that the new material will use. In the new image you want to paste the layers into the following channels.

../_images/TextureMask.jpg

After transferring the landscape layers you will need to flip the new texture mask vertically and save it. Inside of Unreal import the new texture mask. Make sure to disable sRGB and choose TC Vector Displacementmap for compression settings.

Export/Import Landscape

Select the landscape and click on “Export Selected…” from the Unreal file menu. Save the file in FBX format so that it saves out all of the UV channels. Import the FBX file into any 3d program. Make sure not to change the pivot! Move the landscape so that its pivot is at the origin and delete any geometry that will not be needed. Copy the UVs from the 2nd UV Channel to the 1st and then delete the 2nd UV channel.

Now you must transfer the colors from the texture mask created above to the vertices. In Maya select the landscape geometry and click Mesh Display -> Paint Vertex Color Tool. In the tool options click on Attribute Maps and then Import. Choose RGBA for import value and then click on the Import… button and choose the texture mask you created above (Make sure you saved it out with the alpha!). After that you should see the landscape mesh with vertex colors applied in the maya viewport.

Now export the landscape geometry as an FBX file.

../_images/2015-08-19_11-46-54.jpg

Edited landscape geo that is centered at the origin inside of 3ds max.

Import the new landscape geometry as a static mesh asset inside of Unreal. Open the static mesh properties and create an additional LOD. Reduce the second LOD as much as possible for simple and accurate collision. If the collision mesh is greater than 2k triangles the landscape mesh will need to be cut up into separate pieces. After the second LOD is created enable use triangle mesh collisions and use last LOD for collision mesh under Static Mesh Settings.

../_images/2015-08-19_11-54-33.jpg

Landscape Collision

Place the landscape(s) static mesh into the level and copy the location values from the Landscape actor to the new static mesh. This will make sure that both the old landscape and the static mesh are overlapping exactly.

../_images/2015-08-19_12-01-29.jpg

Under the landscape static mesh actor’s details make sure you set “Forced LOD Model” to 1. This is so that the landscape static mesh will not use the collision LOD visually.

Normals

Before exporting the FBX it is good to reset the normals and to apply one smoothing group to all of the faces of the landscape. This can be done in 3ds Max or Maya but the example below shows the process in 3ds Max. You can usually tell there is an issue with the normals if the vert count is much higher than the triangle count in Unreal. Usually the vert count is less than the triangle count if everything is imported correctly.

../_images/EditNormals.jpg

Select the mesh geometry and apply an Edit Normals modifier. Press shift + a to select all of the normals and then click on the reset button. This will unlock the normals in case the mesh was imported with custom normals.

../_images/OneSmoothingGroup.jpg

After that you can add an Edit Poly modifier, or collapse the stack, to select all of the faces. Just go to face selection mode and press shift + a to select all of the faces. Then make sure that there is only one smoothing group applied to all of the faces, like in the screenshot. You might have to click on “Clear All” down in Polygon: Smoothing Groups if there are already multiple smoothing groups applied.

Material Setup

Now you need to make a new material for the landscape static mesh. Select the material that is being used on the old landscape and create a material instance of it. The new material should use the old landscape material as its parent. Apply the new material to the landscape static mesh. Open the new material and enable isConvertedLandscape. This will make sure that the UV scaling is the same as before.