Snarkpit Articles


Texture alignment across 'curved' faces poses a number of problems, and much of it can turn into an evil guessing game of offsets, scales, and angles. Often overlooked are the Vertex Manipulation and Align to View tools within the editor. This tutorial introduces some practical uses of these tools, but an intermediate familiarity with vertex manipulation and texture alignment will be required for best use. Some notes about each:

Vertex Manipulation, while risky for inexperienced users, is one of the most powerful tools available in Hammer. One of its most powerful uses is, surprisingly, in texture alignment. Any face moved, split, or created in vertex manipulation retains the properties (alignment, offset, etc.) of the original face unless the operation draws the plane past the point where a perpendicular to axis error would occur. Clipping often (but not always) loses much of this information, causing you to spend extra time and effort re-aligning the textures. In many cases, face splitting and vertex/edge dragging will give you the results quicker and with no texture misalignment.

Align to View is a quirky but powerful texture alignment tool. While often more apt to screw things up, careful camera placement can allow some very nice alignment to be done much easier than it would be otherwise. An align to view accident caused me to stumble upon the style I used for the 'liquid' background in Wormhole and Odin's Guard.

Here's just one way to use both of these tools, but hopefully this just helps you open the door to more possibilities:



As you can see, default texture alignment across curves in Half-Life can cause problems. Even with the use of the Arch and Cylinder tools, alignment issues like this often pop up (note: I have only used this texture for demonstration purposes). In this case, I manually clipped the faces, but almost any means of creation will give a similar result. However, it is possible to do this:



...in less time and with less effort. In this example, rather than clipping, I used vertex manipulation to pull the faces back as necessary, retaining the original texture alignment and causing the texture to line up just perfectly. Done on a 256x256 solid block with 12 faces and a grid size of 8, it should look something like this:



The ability for vertex manipulation to retain original surface properties in motions such as this makes it incredibly valuable in creating and modifying more complex architecture, especially when you start getting this many faces involved (or more). However, you can see it's still not quite perfect - the outside faces, far steeper than the inside faces, have a much more stretched appearance.

Those of you who have tried align-to-world and align-to-face operations on these sorts of faces know how frustrating proper alignment can sometimes be. It'd be nice to just be able to pop the "world" alignment box and call it good, but that's just not the case. However, the Align to View operation in Texture Application can greatly help.

To properly use Align to View, you have to have your camera set up just right. You'll need to actually set a camera point first, so those of you like me who just like to get into a map and start flying around with the space bar, don't forget this step smiley In this example, we have a 6 sided surface. The middle face of each side of 3 is at a 45 degree angle. Set your camera at a 90 degree angle facing that face, targetting the midpoint (the camera does snap to grid on a very fine level, so placement is not as tricky as it may seem). In this case, where the brushes form a vertical curve, I also set the camera to the vertical midpoint height of the brushes. In the end, your view should look something like this:



Once you have aligned your view this way, be careful to not move anything! Then, go to texture application and select "Align to View" from the bottom. Click on the three faces making up this half of the curve. Then, select "Lift and Select" and mark all 3 faces. Tick the "Treat as one" box on and then click "Fit." You'll notice the texture will now fit perfectly across all 3 faces... but it always goes upside-down. Set the vertical scale to -x, where x = whatever scale it fit to (or you set it to) and make note of the x scale, though we won't do anything with it yet. Repeat the same process for the other half.



This is a comparison between fitting the texture across all faces with world alignment set (on the left) and with our align to view work done (on the right). Once you have both sides taken care of, you'll need to manually join them together. To do so, take the right half, select all 3 faces, and change the x scale to twice the number it currently is (in this case, I went from .71 to 1.42). Keeping "Treat as one" marked, align these textures to the right. Repeat the same process on the left, aligning them to the left. You now have this:



The reason for performing the Align to View operation on each side individually is that it had already occured naturally when we performed the first vertex operation, hence the stretching. Applying the proper texture axis to the faces will allow the two sides of the curve to blend much better than they would otherwise - our new version no longer has any notable stretching on the outside (steepest) faces

Of course, this same technique applies to convex faces as well, and also works on conic sections... See a similar example I whipped up while testing out ns2.wad long long ago...



Vertex manipulation and Align to View are tricky tools to use properly, but with the right knowledge can make many things much easier to handle. While this demonstration is very limited in scale and complexity, this is just the beginning of a huge range of possibilities allowed by these tools. Enjoy.


Post ReplyView Topic
Discussion
0 starsPosted by parakeet on Sat May 1st 2004 at 2:21am

Has fixed my "cut up" textures! and the pics are quite self explanatory
[author]
Posted by KungFuSquirrel on Wed Mar 24th 2004 at 2:04am

By 'conic sections' I simply mean any cylindrical brushwork that is not aligned to the vertical or horizontal grid - for example, the small lips on the tank in the final example. It works best if the section is proportionately small (i.e. trying to align textures this way on an actual cone/spike won't work so well), and so it usually comes in handy on trims and bevels,
0 starsPosted by Ves Wolf on Wed Mar 24th 2004 at 1:36am

Very nice *applauds*. So what's this you say about conic sections? We've just finished this in pre-calc class, and I'd love to actually use something I learned there...
0 starsPosted by Forceflow on Tue Mar 23rd 2004 at 4:58pm

perfect tut ... as usual ... go KFS smiley
0 starsPosted by Gollum on Tue Mar 23rd 2004 at 11:43am

I learned something new by reading this. That is all too rare, so top marks to the Squirrel!
0 starsPosted by pepper on Sun Mar 21st 2004 at 10:11am

oh i see, nevet noticed that:p
[author]
Posted by KungFuSquirrel on Sat Mar 20th 2004 at 5:42pm

Roads are flat planar surfaces, so that's the only way to do it. :P This involves aligning textures across non-planar faces. smiley
0 starsPosted by pepper on Sat Mar 20th 2004 at 4:11pm

it loosk ok but doesnt really solve the prob for alignment on roads, i always rotate on degree to aligna texture
0 starsPosted by KoRnFlakes on Sat Mar 20th 2004 at 10:38am

Bloody good work, thanks for adding the tut smiley
0 starsPosted by Crackerjack on Sat Mar 20th 2004 at 4:01am

Excellent tutorial, I think I had to read it over twice to fully understand but, I really like this method and will be practicing on upcoming levels.
Post ReplyView Topic