|
In order to get our terrain ready for our map in the Delta3D Editor we need to bake the terrain texture. Baking is a process that takes a static mesh with multiple assigned textures and generates a combined image. We will be creating one image that will cover our entire terrain. Please note that we will not be going into the process or topic of UVW Unwrapping since it is beyond the scope of this tutorial.
Baking Textures
With your terrain selected, click on ‘Render>Render to Texture’ from the main menu. The Render to Texture dialog window will open.
Scroll down in this menu and take a look at all our options. Wow! Look at all those settings! Luckily we are only interested in a few options. Under general settings go ahead and select a path for the baked material output. You will need the output file in later steps. If your Plane01 is NOT in the ‘Objects to Bake’ menu then you need to select it in the viewport now. Click the ‘Add…’ button located in the Output section and select DiffuseMap from the list. We are going to be creating a diffuse map for our output and then read it back into our mesh in later steps.
Select Diffuse Color in the Target Map Slot: drop down menu. Go ahead and select a decent image size, I chose 2048. A larger image will result in a clearer textured terrain. You can now go ahead and hit the Render button located at the bottom of the dialog, which will generate the output of a baked material AND apply an UVW unwrap “Automatic Flatten UVs”. Notice that the rendered preview image has a lot of holes. You can try and tighten up your image a little by increasing the Automatic Mapping Threshold Angle. The default setting is 45, bump it up to 75 and press the ‘Render’ button again.
Your new preview should look something like the following:
Outstanding! We have a few more steps before we are ready to export our final static mesh terrain. Notice that in the modifier menu you now have a new Automatic Flatten UVs applied to our mesh. If you are experienced with 3D Studio max you can go ahead and edit the UVW mapping at this point, otherwise press the ‘Save…’ button and save our UVW mapping coordinates. Again an explanation of UVW mapping is beyond the scope of our simple terrain tutorial. I named my mapping file terrain_tutorial.uvw. We will be using the uvw file shortly so don’t lose it.
Click the Automatic Flatten UVs modifier in the list and click the little trashcan icon. This will remove the modifier from our static mesh. Press ‘M’ and open up the Material Editor window. Select an empty material slot and name it baked_material. Under the map menu check the Diffuse Color checkbox and then press the None button to assign our diffuse map. After the Material/Map browser window opens, select ‘Bitmap’ from the list. Select our Plane01DiffuseMap.jpg file we generated earlier when we baked the textures of our terrain. Click the parent button to return to the top of our material stack.
Now we need to apply a UVW Unwrap modifier to our terrain mesh. Select the terrain mesh and then under the modifier drop down menu select Unwrap UVW.
You’ve now applied an Unwrap UVW modifier and need to load our terrain_tutorial.uvw file saved from earlier. Click the ‘Load’ button and select the saved UVW file. The coordinates we saved earlier are now applied to our static mesh!
Ok we only have a few steps left and our terrain is ready to export. Open up the material editor again by pressing ‘M’. Drag the baked_material directly on our static mesh. Click the icon in the material editor that looks like a blue and white cube. This will turn on the preview of our texture so we can see what our terrain will look like.
Now all we have left to do is export our terrain as a .3ds file. Click the File>Export from the main menu. The Select File to Export dialog window will open allowing us to choose a name for our file. Make sure that the file type you are saving is *.3ds. When you hit save a dialog window will open up asking if we would like to preserve MAX’s texture coordinates, click the OK button. NOTE ** max will rename your output filename if it is too long (longer than 8 characters). In our case it is too long, so take note of the new filename displayed in the output warning. Close the output warning window and then in your file system rename your output texture file from Plane01DiffuseMap.tga to the new output name, in my case it was Plane01D.tga. The reason we need to accommodate 3D Studio is due to the fact that the .3ds file internally references the external baked texture file. Keep this in mind because from now on your .3ds file requires that texture file to be in the same directory to display correctly. You should now have a .3ds file that is ready to be used in the Delta3D World Builder.
Importing a Static Mesh Terrain into the Delta3D Editor
This section describes the method of importing our new static mesh terrain into the Delta3D Editor. If you are unfamiliar with the level editor now would be a good time to go back through the tutorials and get reacquainted.
In the Delta3D Editor set the project context if you have not done so already. This can be accomplished by clicking the menu item File>Change Project.
Select a directory where you want the project to reside on your computer. Once you have done this click the ‘Apply’ button. You will be returned to the editor when this process is complete.
Setup a new map by clicking the menu item File>New Map. This will open up a New Map dialog where you can set the name and description for your map.
Click the OK button to create your new map. You’re just about ready to add your static mesh terrain.
In the resource window area select the Static Mesh tab. With the Static Mesh root folder selected, press the button at the bottom of the window that has a folder with an arrow icon.
An import window will open up. Select the button labeled ‘…’ and choose the .3ds file for your terrain AND the baked material we applied previously (Plane01D.tga).
Click the ‘Import’ button once after you have selected your files to import. The static mesh terrain is now added to the project. Right click the static mesh *.3ds terrain file you just imported and click the ‘Create’ menu item. Your static mesh will now be visible in the map viewport.
This short tutorial on the generation of a static mesh terrain should help build a foundation for more advanced terrain building. If you would like a challenge try adding a few more blend materials to the terrain and add a few more textures. The use of layers in photoshop to create heightmaps and 3D Studio Max to generate terrain are both very flexible and powerful tools for creating interesting terrain.
This concludes our tutorial on one method of creating a static mesh terrain.
|