How are tile based environments UV mapped?

Started by
3 comments, last by LorenzoGatti 3 years, 9 months ago

In styles such as this, how are environments UV mapped? That is, when there is a specific tileset that is applied to things in a consistent, repetitive way. (as opposed to tiles that loop, or are layered)

My initial method was to model the environment, select all "wall" face UVs and Move them all over the correct tile at once. However, this seems overly time consuming. What are current methods like for repetitive tasks such as this?

Advertisement

If by “tiling” you mean aligning the textures on the left and right side of vertical cliff edges to make them look continuous, it can be done automatically, as usual (for example) in level editors for Doom.

Given the horizontal texture coordinate at one vertical edge and the desired scale factor between texture coordinates and lengths (e.g. 1 texel = 5 cm) a simple script can compute the texture coordinate at the other vertical edge of the next cliff trapezoid, repeatedly until the chain of cliff faces ends or changes texture.

Note that to match texture coordinates around a circular face chain you'll have to alter the scale factor (the total length must be a whole multiple of the extent of the texture).

Omae Wa Mou Shindeiru

@LorenzoGatti Not totally sure what you mean.

In the case of the above image, it basically comes down to 1 tile = 1 face (horizontally), with the exception of vertical edges.

Kiiryu said:

In the case of the above image, it basically comes down to 1 tile = 1 face (horizontally), with the exception of vertical edges.

But faces have different widths, so this incorrect mapping causes distortions. For example, look at the top middle of the picture: the face where the low platform ends is particularly large, the one to its left is about half as wide, and since they have the same texture one looks stretched and the other looks compressed.

Instead of mapping texture coordinates 0 to 1 both to the narrow face and the wide face, you could map, say, 0 to 0.8 to the narrow face (supposing it's the first one and starts at 0) and double that extent, 0.8 to 2.4, to the wide face. Continuing to the right, the next face is narrower, let's say 1.3 texture units, so it should have texture coordinates 2.4 to 3.7 (reduced to 0.4 to 1.7). And so on.

Omae Wa Mou Shindeiru

This topic is closed to new replies.

Advertisement