Tuesday, December 09, 2008

Dealing With Repetition

I was going to post some pictures of the newly fixed "auto-vary" feature, but before I can do that in a way that makes any sense, I need to explain how X-Plane deals with texture repetition.

Texture repetition is the inevitable result of using "landuse-style" texturing (that is, a repeating single texture representing a type of land).  Typical X-Plane land use textures are 1024 x 1024 at max res and repeat about every 3-5 km.  Unfortunately, our brains are pattern-recognizing machines, and the result of this texturing scheme is that the "grid lines" of texture placement become apparent over wide views.  

We use a number of techniques to minimize this problem.

Lots of Land Uses

Our main tool to combat repetition is to not use a given land use for too large of an area.  This has the advantage of efficiently using the entire set of textures, and (because terrain textures change based on an irregular grid, based on elevation) the changes to textures are both irregular in shape and "plausible" in placement.

In this picture, you can see that the urban residential land use has been interrupted by various forest and grass textures.  This is intentional - Sergio tuned hte land use rules to make sure that we wouldn't have large regions of one land use type.  Those blobs match the irregular grid, which gets its shape from the terrain's elevation.

Variation

In the above picture, you can still see the repeating grid of the residential terrain; observe the right side - you'll see the same repeating vertical pattern of road repeating over and over.  In order to further hide repetition, we use the same texture multiple times, but in offset locations.

Here you can see that the vertical line on the right side has been broken up a bit.

More VRAM

In some cases, a terrain covers such large areas despite the rule set (e.g. for really flat areas) that we use two separate textures and can vary between them.  Here you can see both input textures for our dry square crop land use, as well as the combined results.



In summary, we have three techniques:
  1. Add more rules to prevent large spans of a single land-use.
  2. Use a texture with multiple offsets (variation)
  3. Use two textures and vary between them.

No comments: