Texture alignment through arches using displacement maps
by trepid_jesse (view all articles)

unrated
Using displacement maps to preserve texture alignment around arches.
by trepid_jesse (view all articles)

unrated

Update
This tutorial bothers me now. It bothers me because the method that is explained is fairly laborious, and can become very tedious given that Hammer doesn't deal with small brushes well. You can very easily end up with guide brushes that don't line up well, or "incomplete" guide brushes due to you trying to create geometry that is too small.
There's a number of things that this tutorial doesn't cover. At the time, we had just started tinkering around with displacements and discovered such things were possible. We later learned quite a bit more, and have been using a different and improved method. Nicer displacements are possible with less effort and less time, and I'm not talking about using the subdivide tool either.
Instead of updating this tutorial, I think I'll just make a new tutorial in the future. At present, this focus of this tutorial should be more that of informing you that there's a great deal more to displacements than terrain. This method is dated, stupid and can be greatly improved upon.
Precursor
This tutorial may become somewhat convoluted as you progress, but I suppose it's just the nature of the problem. I'll try to remain as comprehensive as possible.
At any rate, the idea behind this particular tutorial is to use a displacement map to create an arched piece of geometry, but with preserved texture alignment. Wait, what does that even mean?
Well, what I believe to be a very common technique for texturing an arched surface is to align the interior face of the arch to "Top," and then texturing the actual face you're working with via alt+right clicking the interior face onto the face you're wanting to texture. Trying to explain such a simple process turned into a confusing sentence, so here's a picture:
Of course, the whole purpose of the above was to point out the lower half of the aforementioned picture. The above method creates lots of very minor indescrepancies between each face of the arch. Sometimes, however, these differences can be exaggerated in textures with lots of parallel lines.
Let's try and remedy that.
Step 1
First, we need to make some profile arches. We need to define where and how are future displacement map is going to be orientated. Since our above road section is 256 unit wide road, curved through a 512x512 section, let's go with that. We need to create a set of equally sized concentric arches that "fill up" the arch that defines the overall size. That's easy enough to do, and once you have, you can delete the original profiling arch.
Right now, you might be wondering why we used eight eight-sided arches. To answer the latter half of the question: we used eight-sided arches because our initial arch was an 8 sided arch and we wanted the outer and inner vertices to align with the first and last sets of vertices of the inner concentric arches. The answer to the first half of the question will be answered in the next step.
Step 2
It's only Step 2 and it's already time to make the displacement map. You can make this displacement map whichever way you want to, but please first refer to the "Caveats and Other Information" found at the bottom of this tutorial before continuing. Personally, I make the displacement share the bottom two vertices of my profle arches, and make the height the same as that of the arch.
What power do we use though? Well, remember that question from Step 1? We want to make our displacement with a power of 3. We make it with a power of 3 because this creates displacements with 23</sup> = 8 triangles on each edge of the displacement. This works out because we made 8 arches, and each vertex from the displacement map will coincide with a vertex on the profile arches. I guess you could say the vertices of the displacement map and that of the arches have a 1-to-1 relationship. That's really want you want, too, as this will provide the most accurate means to manipulate the displacement map. It will also help to avoid obfuscation when trying to single out vertices.
Step 3
It's time to now use the "Paint Geometry" feature of displacement maps to align all of the vertices. Incase you're wondering, yes, this can become an incredibly tedious task.
One thing that can be very helpful during this step is to work in "3D Wireframe" when aligning all the vertices, and it's also helpful to align your displacement in such a way as the face of the displacement is contiguous with the profile arches. Unchecking the "Spatial" option and setting an initial distance to 1 is also a good way to get started for this step.
Finished
After you have all of the vertices of the displacement map aligned to the vertices of the profile arches you should be left with something quite similiar to this:
The top half of the above picture shows the completed displacement along side the profiling arch, and the bottom half shows the difference between the original texturing method against the completed displacement.
So, with a little work, we were able to eliminate those texture discrepancies and preserve the continuity of the texture.
Caveats and other information
- The note from Step 2 is to inform you that the initial orientation of the brush to be turned into the displacement should be placed in such a way that you're most comfortable working with it. Since you're going to be spending a lot of time nudging the vertices around, you'll want to try and save as much time as possible by putting the displacement map in the "most appropriate" place for you.
- When nudging the vertices, for the displacement map, you can hold shift and use left-click to freely manipulate a selected vertex along the axis you define in the options.
- This process can work with arches that don't have 4, 8, or 16 sides. When working with these, however, you'll need to calculate how many concentric arcs to make based on which power you'll define in the future displacement. After doing that, you'll need to figure out how to correspond the vertices of the displacement to that of the arch. This is a rather general explanation, but just a little intuition and some basic math is all you need to determine such things.
- During Step 3 you may need to nudge the vertices at a distance less than one, which an be entered manually in the options.
- Going from the Step 3 to being finished is where all of the work in this tutorial presents itself. Don't expect to rush through that particular step.