This is all going to be about numbers, and to make sure everything is perfect you'll need to choose the amount of times the texture is going to be horizontally tiled over the pillar (as in, how many times the texture repeats around the pillar).
We have to make sure the result of the following equation has no fractions.
Code: Select all
OFFSET = NUMBER_OF_H_TILES * TEXTURE_SIZE / NUMBER_OF_PILLAR_FACES
Let's try a simple example: - Texture: 128 pixels.
- Pillar: 8 sides, radius=64, AlignToSide=True.
- Number of tiles: 2
Code: Select all
OFFSET = 2 * 128 / 8 = 32
Once you figured out the 'OFFSET', we need to figure out the horizontal scaling.
In order to do so, we need to measure one of the pillar's sides, or calculate it if we can't directly measure.
The best way to measure is using clip markers snapped to the pillar's vertices.
You're better off disabling 'Drag Grid' and creating the clip markers somewhere other than the pillar you're working on, then moving each marker on the 3d viewport into two of the pillar's points you want to measure. The editor will then snap the markers to said points, make sure you have the pillar already built into the map or there won't be any snapping. Once you've created two clip markers as shown above, calculate the distance between said points (it's a lot easier if done over one dimension).
Considering the pillar of the previous example, the measurement of one of the faces results in:
- 53.019165 Then we apply the following formulat to obtain the horizontal scale:
Code: Select all
H_SCALE = PILLAR_FACE_LENGTH * NUMBER_OF_PILLAR_FACES / (NUMBER_OF_H_TILES * TEXTURE_SIZE)
Code: Select all
H_SCALE = 53.019165 * 8 / (2 * 128) = 1.656848
Select all of the pillar's side surfaces:
- Hit 'Unalign'
- Apply the 'H_SCALE' you just calculated.
- Apply to (U or V pan) OFFSET (32 on our example).
- Deselect one surface, apply offset again.
- Deselect another surface, apply offset again.
- Keep doing that until you're done with the surfaces.
Due to rounding of some numbers the results may not be 100% perfect but the texture alignment's precision will be down to the pixel.