For licensing the physics technology contact licensing@rigsofrods.com

Terrain finishing

From Rigs of Rods Wiki

Jump to:navigation, search

So you have your terrain, You've placed all of the airports/buildings/marinas, but it's missing something. You can't quite put your finger on it, but this page should help you get your terrain as good looking as possible!

Some notes

Miniature picture

The miniature picture shows at the terrain selection when you highlight the terrain, and is a preview picture of your terrain. It is usually a scaled-down version of the original texture file, but you can use any picture you like as long as it matches the rules below.

You should note some things:

  • Make the picture look good, nothing attracts more people than good looking pictures.
  • Take a good picture, one picture tells one thousand words!

The preferred size is 256x256 pixels. Using too big picture is waste of file size and video memory. The file is named mapname-mini.DDS (where mapname is the name of your terrain)

Adding grass

Grass is one of the things that can add eye-candy to your terrain, but it's very FPS hungry (But don't worry - you can turn it off in the Configurator!). In this section I will explain how to add a grass density map, and how to create your own grass textures.

You have two options when adding grass, you can use the default textures and/or create you own. These two sections bellow will show you how to do either.

Using the default grass textures

RoR comes with plenty of grass textures you can use for your terrain, so setting up your map shouldn't be a problem.

  • First off you'll need to chose which grass textures you want to use. Here is a list of the default grass textures included with RoR
    • grass1
    • grass2
    • grass3
    • grass4
    • grass5
    • grass6
    • grass7
    • tumbleweed
    • seaweed
  • Next you'll have to setup the grass density map, see the Making detailed grass density map section on how to create one.

Making own grass textures

1. First you have to make the texture. The preferred size is 256x256. Use black for background as it makes adding to RoR easier.
2. When you are finished, save the file as PNG.
Terrain finishing 3.png
3. Then you have to make transparent parts. In this example I'll use Paint.NET.
4. Select all the black colour with the "Magick Wand" tool.
Terrain finishing 4.png
5. Then press "Delete" on your keyboard and you should have transparent parts. You can add some blur if you want.
6. Now save and close Paint.NET. Copy the grass texture you just made to RoRfolder/data/paged
7. Now open Notepad. Add this:

material *grass*
{
	receive_shadows off
	technique
	{
		pass
		{
		    alpha_rejection greater 128
			ambient 1.0 0.7 0 1
			specular 0.0 0.0 0.0 1 10
			emissive 0.0 1.0 0.0 0.5
			//lighting off
			cull_hardware none
			cull_software none
			scene_blend alpha_blend
			alpha_rejection greater_equal 128
			//depth_write off
			
			texture_unit
			{
				texture *grass*.png
			}
		}
	}
}

See the *grass* -parts? Replace them with the name of your grass texture file.
8. Save the file as .material to your RoRfolder/data/paged. You can name the file whatever you want.
9. Now you have your own grass texture!

Making detailed grass density map

You must create a grass density map to tell RoR where to place the grass on the map. This technique below was used for Mr. Ruvido, but in this example I'll be using Aspen Grove and Paint.Net

  • Open the terrain Texture in Paint.net and select the magic wand tool.

Terrain finishing 5.jpeg Terrain finishing 6.jpeg

  • Set the Flood mode to "Global" and click anywhere on the green parts of the texture. Now all of the grass should be highlighted, you may need to play with the "Tolerance" slider to find the best results.
These are the options you will need to change
The green grass of the terrain should now be selected.

  • Once you have the area you want selected, click the bucket fill tool and change the colour to white

Terrain finishing 9.jpeg Terrain finishing 10.jpeg

  • set the flood mode to global, the tolerance to 100% and click inside the selected area. Once you've done that, select Edit-> Invert Selection (Or press Ctrl+I) and change the colour to black and click anywhere outside the white area.
Terrain finishing 11.jpeg

Terrain finishing 12.jpeg

And there you have it, a detailed grass density map Save the picture as mapname-grass, where mapname is the name of your terrain and put it in the same folder as your .terrn

Info on how to add grass to your terrn -file is found here:
Terrn file description

Trees

Trees are the second thing that adds most eye-candy to terrains -and eats even more FPS. But if you're playing on a fast computer, you shouldn't even notice the FPS drop. So you should always test your terrains on slower computers if possible.

Making own tree models

In this section you need one of the 3D-modeling programs, like Blender, AC3D, SketchUp... Any of these, and some basic knowledge of them.

First you have to download Ogre exporters for them:
Blender and AC3D: Modeling Plugins
Google SketchUp: SketchUp to RoR Tutorial

1. When you have downloaded and installed them, you can export the model you have made. Note that you can export other objects also, so this isn't limited to tree models. (remember to check out section 4!!) Terrain finishing 13.png
2. Copy the Mesh, Material and texture files to RoRfolder/data/paged.
3. Now the trees are ready! Check the instructions here Terrn file description

Adding trees to terrain

This is a lot harder -Trees are not added the same way as objects. Of course you can add them via terrain editor by making ODEF -files for trees. But it's still takes a lot of time to do by hand.

I hope in future there will be an option to add trees with Toolkit (no pressures, thomas). That's why I made a simple program to add trees (it can be found here: int2.zip -- (BETA 2 coming soon)). You can add trees to terrain using 2D-program, as trees don't need the y -axis. Here's a simple guide to how to add trees.

Setting up settings

1. Open up the program and press "settings"
2. This window should pop up:
Terrain finishing 14.png
3. Now you can adjust the size of trees, the name of mesh file to use and amount of random trees. Use 0 to ignore random.
4. You can also add new tree models to the list by typing the name of it to the combo box near the Tree type -box and clicking the Add -button:
Terrain finishing 15.png
5. When you're happy with your settings, press Save on the menu on left.

Adding trees

1. Load up the "I Need Trees 2 (INT2)" -program
2. Click the New -button
3. Now you must choose the size of the terrain and the texture file (supported formats: bmp, dib, rle, pcx, gif, lbm, iif). Note that the 0,0,0 point of the terrain MUST BE in the top-left corner.
Terrain finishing 16.png
4. Click the Ok button and this should pop up (depends on what terrain you selected):
Terrain finishing 17.png
5. Now hold down the mouse button to add trees. When you are finished, press "S". You should hear a small beep if your speakers are on.
6. Exit the program by pressing Alt+F4
7. Find a file named "trees.txt" from the program's folder and open it.
8. Now copy all the text to your terrn -file, save and you're done.

Removing SketchupDefault

If you have ever made an object using SketchUp you are probably aware of the very irritating SketchupDefault material. While it's not a problem anymore since duplicated materials no longer crash RoR, it's probably best to remove the material anyway.

First you have to adjust the settings of Ogre exporter (Exporter, XML converter, instructions how to install here)
1. Find the folder where you installed SketchUp (typically C:/Program Files/Google/Google SketchUp 6) then go to Plugins -folder and open ogre_config.RB with notepad.
2. Then find this line:

$g_ogre_convert_xml = true

and change it to:

$g_ogre_convert_xml = false

3. Save and exit notepad.
4. Now open up SketchUp and export the mesh as usually (go to Tools -> Export to Ogre)
5. Make a good texture to appear as a kind of "base" texture. Use this template and add it then to the object's material file:

material yourbasetexture
{
   technique
   {
      pass
      {
         diffuse 1.0 0.188235294117647 0.784313725490196 1.0
      }
   }
}

(replace the "yourbasetexture" with a name you want for the base texture. No Spaces Allowed!)
6. Now open the exported XML file with notepad.
7. Go to Edit -> Replace. Type "sketchupdefault" to the first textbox and the name of your base texture to the another textbox. Click replace all.
8. Save and exit notepad. Now find the "OgreXmlConverter.exe" and drag the XML file to the converter. Then you should get .mesh file.
9. The mesh file and material files are free from the SketchupDefault Material!

You must repeat steps 4-8 for every mesh you wish to export.


Tutorial written by Ladee. Topic and discussion can be found here: http://forumold.rigsofrods.com/index.php?topic=8585

some terrible formatting added by sweetman --Sweetman 13:40, 17 May 2009 (UTC)