Game Development Community

Performance and Number of Terrain Textures

by Keith Johnston · in Torque 3D Professional · 03/01/2010 (8:40 pm) · 4 replies

We have a 1024x1024 terrain block, square size 1. We have about 30 different terrain textures, each with a 512x512 diffuse, detail, and normal texture.

We have noticed about a 10fps difference when we remove all but one terrain texture. Does this seem reasonable?

Any guidance on the number of terrain textures with respect to performance?

#1
03/02/2010 (10:54 am)
There will be jumps in performance when the number of textures in one cell within the TerrainBlock exceeds the amount it can draw in one pass. For sure no detail passes will be the fastest... this is why at distance we fade out the detail passes.

The total amount of terrain detail layers is not the issue. What is more importaint is how many layers you use in any one cell of the terrain. If you keep to using only 4 layers at any one time in the same area of the terrain it should be a single draw call and render fairly efficiently.

Also side projection is very expensive... 2x the cost of a normal layer... use it sparingly and only where it really makes a difference.

Parallax and normal mapping should only be used if they make a difference for the material. Very small details do not take advantage of parallax and normal mapping and would be a waste of GPU fillrate.
#2
03/02/2010 (2:25 pm)
Quote:
What is more importaint is how many layers you use in any one cell of the terrain. If you keep to using only 4 layers at any one time in the same area of the terrain it should be a single draw call and render fairly efficiently.

Ahhh ... now that's useful info.
#3
03/03/2010 (7:15 pm)
Steve- I totally agree.

I would love some guidance on best practices on terrain texturing from a technical standpoint.

Along these lines...

Is it any more efficient to create several terrain materials, reusing the same detail/normal/parallax textures, just at different scales and different colors provided by the diffuse? Versus a different texture for each material?

A lot of variation can be made with just scaling and coloring a texture differently... would be good to know how much of a benefit is had there.

A little speculation: I am also finding that with really nice looking detail textures, my diffuse is not contributing much beyond some color variation as it needs to be scaled quite large and blurred to keep from interfering with the detail. Would it make sense to simply use an rgb value for the diffuse contribution, rather than a texture? If it were possible to have many differently colored rock materials, all based on a single rock detail/normal map set but with different diffuse values, it seems like I could get a lot more variation out of a lot less and hopefully not impact frames rates, but I have no idea on this.
#4
03/08/2010 (1:20 pm)
Quote:The total amount of terrain detail layers is not the issue. What is more important is how many layers you use in any one cell of the terrain. If you keep to using only 4 layers at any one time in the same area of the terrain it should be a single draw call and render fairly efficiently.

What exactly do you mean by a cell of terrain, does this correspond to one pixel of the heightmap texture ie how many layers are on one terrain material? Or do you mean how many materials are shown in a particular locality, say within view of the camera? What is an 'area'?