Terrain. cfg Parameters

Source: Internet
Author: User
Tags scale image

The terrain. cfg file contains many ground generation options. As in the past, I will only talk about basic things. For more details, see/* here. It should be noted that the ground scenario manager design contains the paging function, but it has not yet been implemented. However, there is a plug-in ogre that can currently implement this function: Paging Scene Manager.

The ground scenario Manager uses a heightmap to generate a ground. You can change the height chart by changing the heightmap. Image parameter. You can change the post graph on the ground by changing worldtexture. You can also change detailtexture to make the ground more realistic. You can find the default images of terrain. cfg in/Media/materials/textures.

The shape and color of the terrain in the scene are calculated from a height chart, a terrain texture, and a detail texture. A height image is a gray scale image. Each pixel represents a height value. 0 indicates the ground plane, and 255 indicates the highest point of the terrain.

The texture of the layer covered by the terrain is stretched. These terrain textures are representative of mottled brown, green, white, or gray suitable for the surface, grass, snow, or rock terrain. The terrain texture is usually much smaller than the terrain to be covered, so it is often blurred in the near future. In order to solve this problem, a detailed texture is used to mix the terrain texture in the near view. The detailed texture is not stretched, eliminating the near-view fuzzy problem.

A terrain is divided into small terrain blocks. Small terrain blocks may be displayed by the scenario manager at different levels of detail, depending on the layout of small blocks and the distance from the observer. The whole terrain is projected into a coordinate space in the world.

The terrain scenario Manager usesTerrain. cfgThe script is set.

 

1.Worldtexture: Specifies the name of the terrain texture.

2.Detailtexture: Specifies the detailed texture name.

3.Detailtile: This specifies the number of times that the detailed texture repeats in each terrain block. That is, if the value isNThe detailed texture is displayed in N * n cells of each terrain block. If this value is set too low, the terrain will be blurred in the near view, and vice versa, it will look like there is a repeated pattern (show up, ^ _ ^) during the observation ).

4.Pagesource: Specifies the source of the height chart data. The default value isHeightmap.

5.Heightmap. Image: Specifies the height chart name. The size must be square and 2 ^N+ 1. The larger the height chart, the higher the terrain details, but the more resources the program consumes (including the program startup time ).

6.Pagesize: The terrain will havePagesize*PagesizeThat's big. As mentioned above, it must be 2 ^N+ 1 (for example, 65,129,257,513,102 5 ).

7.Tilesize: Small terrain BlocksTilesize*TilesizeSize. The value must be smallerPagesize.This number must be 2 ^N+ 1 must comply with 2 ^ n + 1. Too small will seriously affect the performance. If it is too large, it will cause unnecessary high details in some parts of the scenario.

8.Maxpixelerror: Specifies the maximum allowable error when determining which level of detail is used. If it is set too high, the terrain will be torn apart. If it is set too low, the performance will be affected.

9.Pageworldx,Pageworldz: Set the range of the terrain in the world coordinate system. The larger the terrain, the lower the details. The number of vertices used by the terrain is based on the height map, not the world size. You can scale the terrain to any size you want.

10.Maxheight: The maximum Terrain Height in the world coordinate system. 0 .. 255 in the height chart scales to 0 .. maxheight in the world coordinate system.

11.Maxmipmaplevel: Specifies the number of detail layers used to render the terrain. The distant and flat aspects of the terrain are rendered with low details.

Advanced configuration parameters

Some height charts are saved in raw format. The following parameters describe the raw format.

12.Heightmap. Raw. Size: Specifies the size of the height chart, which must be the same as above.

13.Heightmap. Raw. BPP: Number of bytes per pixel, 1 = 8 bits, 2 = 16 bits.

14.Heightmap. Flip: If it is set to true, the height chart is flipped.

 

Height chart processing description

The height image must be a grayscale image. If not, you can use Photoshop to process the image. Choose image> mode> grayscale, and save it as PNG.

 

Coordinate System Problems

Terrain Scene Manager uses the upper left corner of the texture image as the world origin point (, 0). It ranges from left to right to the X direction and from top to bottom to the z direction, from the screen to the outside of the screen is Y in the positive direction, in line with the right hand coordinate system.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.