Texture Skewing With TexAlign
Author: R. Wey
Date: 02/19/2001
This tutorial assumes you know the basics of using TexAlign. That is, keying in proper values, making sure to hit the appropriate Cmd button to assemble the relative UnrealEd command, then applying said command either via TexAlign’s Apply button or through its remote.
"Skewing" is little known feature of texture manipulation but when applied in a map can make the difference between great texturing and perfect texturing. Of the people that are unaware it can be done but happen to notice it in a map, it tends to make them cock their head sideways like a puzzled dog and ask, "how’d he do that?"
One of the biggest reasons you don’t see it too often is probably because it can only be done in UnrealEd via log window commands and even then, the numeric values required are rather unintuitive. This unfortunate situation, however, is about to change thanks to the fourth tab in TexAlign V2.00 (see Figure 1) which eases some of the pain of this otherwise guess-work process.
Figure 1
As Figure 1 illustrates, there are two types of skewing that can be done: horizontal and vertical. When you switch to the Texture Skew tab in TexAlign for the first time (after starting the program), it defaults the skewing to "vertical only" … which is probably the most common type applied. Take note that nowhere on this page is there any reference to texture size. This is because skewing involves only ratios of rise to run (V and U, respectively) and relative V and U scaling.
Vertical Skewing
As the small picture in the vertical skewing section of Figure 1 suggests, the vertical component of a vertically skewed texture remain straight up and down but the texture rises (or falls, depending on polarity) as it progresses along the horizontal plane. This is important to understand because in order to conjure up the proper skewing command, you’ll have to know the relative "rise to run" ratio of the surface you intend to skew. The default values of 256 for a rise to 512 for a run happen to be a very common ratio used for "comfortable" ramps in a map. A rise of 1 to a run of 2, however, would produce the exact same results, as it is the VU ratio that determines the skewing rather than the actual values.
In the case of these vertical skew defaults, we are essentially stating "the texture will rise 256 texels for ever 512 it runs". That the term texels was used in this statement (and not "units") is important to note because we will rise 256 texels per 512 run only if the vertical scale is 1 (one). Now the "Vertical Scale" box should make a bit more sense and it stands to reason you’ll also need to tell TexAlign the vertical scale of the surface you intend to skew.
By this time, you’ve probably guessed what the "Negate" checkbox is for. Correct…it tells the skew to fall rather than to rise. Don’t be too concerned which is the proper direction until you actually apply it. If, after applying the skew, it’s backwards, simply hit UnrealEd’s undo button and change it in TexAlign.
Enough of this boring talk; lets see an example! Figure 2 is a pic of the hallway wall leading to the shield belt in the Unreal 1 map Elsinore.
Figure 2
Cliffy did a fantastic job on this map, however, had TexAlign been at his disposal a simple click of a button would have produced Figure 3.
Figure 3
Please look carefully and notice that the texture on the sloped wall is NOT rotated …as the joint where the sloped texture meets its level counterpart (to the right) maintained its alignment perfectly! (No, perhaps this is a bad example since bricks are seldom skewed…but you get the idea).
Horizontal Skewing
Horizontal skewing behaves exactly like vertical skewing except the logic is applied to the horizontal axis. To drum on about its particulars would be somewhat redundant. Just know that it, like vertical skewing, must also account for any U (horizontal) scaling of the surface to be skewed.
Surface Preparation
Skewing either horizontal or vertical can get messed up if the surface is not pre-conditioned. Skewing assumes the surface is first unaligned (using UnrealEd’s texture properties controls) and/or it is aligned "Wall Direction" and/or "Wall Pan", (which of these is necessary depends on several confusing factors…remember, there’s always the Undo button).
Next, you should apply any texture scaling.
Finally, call up TexAlign skewing, key in the proper values and apply them to the selected texture(s). After the skewing is applied, you can then pan and even rotate the texture until your hearts content and the skewing will stick! The only thing you can’t change after skewing is the scale (relative to the type of skew, horizontal or vertical), as this value is an integral part of the calculated skew values.
Caveats
The first problem you’re likely to discover is, (while doing a vertical skew for example), is that if the surface in question has a U (horizontal) scale applied, simply skewing the vertical will set the horizontal back to a scale of 1. In order overcome this inconvenience, you’ll need to enable horizontal skewing and specify the appropriate horizontal scale. Under most circumstances, however, you won’t want any horizontal skew …so, simply set the horizontal "Run" to zero and none will be applied. The same holds true for vertical scaling when you’re doing a horizontal skew except in that case, you must set the vertical "Rise" to zero to prevent vertical skew.
Another annoyance is that once a surface is skewed, it must first be unaligned etc. before a different skew can be applied. For some reason, skewing does not overwrite the last values…rather is seems be a cumulative texture property. Why this is, I haven’t a clue. All I know is it good to get into the habit of first prep’ing the surface(s) (described above) before you skew it.
It is entirely acceptable to simultaneously apply both horizontal and vertical skewing to a surface, assuming you have such a surface that demands the effect. The scaling in such cases, however, will get a bit confusing. Not necessarily because of bad values coming from TexAlign, rather the scales must now accommodate the hypotenuse(s) introduced by the dual skewing. Draw it out on a piece of graph paper or build a test surface in UnrealEd and look at it from an orthogonal view. It will make more sense when you see it this way.
Conclusion
Hopefully, this feature provided by TexAlign will come in handy for those areas of your map where "this just doesn’t look right…if only this texture…". My strong suggestion is to build a dummy/practice map and play around with it first. Build some slanting faces and purposely change the surface properties (i.e. flip the U and V, rotate the texture, scale it, forget to unalign it, etc.) and then apply the skewing to see the different effects these settings will have. When you get really brave, make a double skew brush and fit a 3 x 2 scaled texture rotated 90 degrees (for example) onto it. If your map ever has the need and a double skewed texture fits the bill, you can count on several viewers doing the dog thing … "how in hell’d he do that?"
Have fun, and thanks for using TexAlign.