Setting up the terrain texture

In this recipe, we will teach you how to set up a new grass-like terrain texture for you to paint on the terrain.

Getting ready

  1. Have My_Level open inside of Sandbox.
  2. Review the Generating a procedural terrain recipe to learn about the Terrain Editor.
  3. Review the Navigating a level with the Sandbox Camera recipe to get familiar with the Perspective View.
  4. Review the Terrain sculpting recipe.
  5. Have the Rollup Bar open and ready.

How to do it...

  1. First open the Terrain Texture Layers window, found in the main Sandbox Toolbar | Terrain | Texture.
  2. In this window, create a new layer—Add Layer.
  3. Rename your NewLayer to Grass (double-click NewLayer to rename it).
  4. Then change the layer texture of this layer: Change Layer Texture | Terrain Folder | ground_mud_grey.dds.
  5. Now change the detail texture; click on the material path for this layer, Materials/material_terrain_default | Terrain Folder | grass_7. Go back to Terrain Texture Layers window | Assign Material.
  6. Set up your layer to have a greenish color to it—RollupBar | Terrain tab | Layer Painter | select Grass. Set the color in the color box to Red: 191, Green: 215, Blue: 138.
  7. Save the color to your layer and click the Layer button above the color box.
  8. Paint on your terrain.
    How to do it...

How it works...

The Layer Texture and Detail Texture work together in an overlapping fashion to breathe life into the terrain texture that is applied onto the terrain. While the Layer Texture works best as an overall brightness randomizer (seen with the ground_mud_grey texture) to break up the distant tiling, the Detail Texture is the main texture that is seen when closest to the player's view.

It is important to note that the Detail Texture should provide the detail only and not so much of the color (the color is handled in the Layer Texture). Grayish textures within the detail material do not interfere with the colors from the Layer Texture. Each of these diffuse textures should be high pass filtered.

There's more...

Here are some additional settings that can be utilized.

Radius and Hardness: Much like Sculpting Terrain, you can change the brush size and hardness in the Layer Painter to either a blanket wide area with your Terrain Texture, or just to get those fine details where you need them.

Altitude and Slope: These parameters can be set per layer allowing you to only paint that layer within the Altitude (meters) or Slope (degrees) threshold. This is especially useful for cliff-like layers (for example, 55 to 90).

Filter (Brightness): The Filter slider is an extra brightness pass on the color you have already set. Without needing to change the color over and over, you may change the brightness quickly with this slider.

Tile Resolution: Tile Resolution affects how many terrain tiles are in each terrain sector. The higher the resolution, the higher the amount of tiles used (better layer blending as well as softer transitions in the Layer Texture).

Ranging from 64x64 to 2048x2048, this tiling resolution is an important factor when it comes to optimization as well as high quality terrain. It is recommended that you use a higher value for play areas of your map and low values for terrain sectors that will not have the player in it.

Generating Surface Textures: It is important after doing work with the Terrain Textures on your map to a Generate Surface Texture to bake your textures into your terrain. This creates a compressed version of your painted terrain texture job into a .pak file called terraintexture.pak. The information stored in this .pak file reduces the total terrain texture size of the map to 1/6 of its original size as well as reducing the amount of drawcalls on the level.

To generate surface textures, go to File | Generate Surface Texture | Pick resolution (higher = better quality, lower performance) | (Optional) High Quality (does an additional pass over the textures to bake in further detail while keeping the same memory footprint) | OK.

See also

  • The Terrain sculpting recipe
  • The Saving your level recipe
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.58.50.156