Snarkpit Articles


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.

You'll notice that in the above picture that the first nine vertices are already aligned, and this is because of how we chose to orientate the intial displacement brush. From here, as said before, comes the task of nudging each vertice to the corresponding vertice on the profile arches. When nudging these vertices, you'll only be using the X-axis and Y-axis options as you only need to nudge the vertices left or right, and up or down; respectively. Granted, you'll need to make the appropriate adjustments along the Z-axis if your particular arch requires such manipulation.

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.


Post ReplyView Topic
Discussion
0 starsPosted by CLs on Tue May 31st 2005 at 2:38am

A time consuming proccess, yet very useful...Great tut!
0 starsPosted by G.Ballblue on Mon May 30th 2005 at 10:22pm

As said above, this does seem to be a lot of work, but as usual, every piece of detail helps -- I would probably recomened that taking a serires of brushes, and transforming then into the correct direction would be easier, since any brush that is moved with that transform tool maintains its texture coodinates.
However, this is a good tutorial -- a bit confusing, but for anybody who really wants to get their hands messy with detail, they should read this.
0 starsPosted by SaintGreg on Sun May 22nd 2005 at 8:29pm

I like it, I think its a great idea, even if it may be somewhat time consuming, and only for the perfectionist. I guess one of the benefits of displacements comes from its shortcomings, in that they are completely unrestricted 3D, not just heightmaps, so no lod, but you can do some pretty cool stuff with them.

Never knew about that shift+left click, that really is sweet, will ocme in handy in the future! smiley
0 starsPosted by DrGlass on Thu May 19th 2005 at 6:44pm

Very intresting, never thought to use displacment for things like that.
0 starsPosted by habboi on Thu May 19th 2005 at 2:45pm

Very helpful and handy!
[author]
Posted by trepid_jesse on Wed May 18th 2005 at 9:41pm

I completely agree that this is more of a method to be used by the &quot;perfectionist at heart.&quot; I had hoped that I had achieved a rather subtle undertone that this may be a somewhat vain way to spend your time, but it provides the option nonetheless.

Then again, I suppose it also helps to illustrate another purpose behind displacement maps beside general terrain; such as Reno pointed out.
0 starsPosted by omegaslayer on Wed May 18th 2005 at 5:32pm

Thats Quite alot of work for such little road, while the tutorial is well written and designed, the actual aplication of it is minimal. Unless you create prefab after prefab (like Reno said above) then your strapped for a lot of time, when you can just rotate a regular brush 15 degrees and clip sections off, and create a road that looks almost as good.
I like the aplication of the displacement (it seems endless at what it can do with the subdivide tool) and it is probalbly more optimal than using brushes (func_detail mind you).
But all in all I'd give it and 8.5, but since there is no .5 increment ill give it an 8.
0 starsPosted by ReNo on Wed May 18th 2005 at 4:28pm

Personally I think this is a fair amount of work for somethat that is, for players, is unlikely to be noticed. That said, I feel the tutorial still has merit. It demonstrates nicely that displacement surfaces can be used for purposes other than height variety on terrain, as well as showing that texture coordinates at each vertex of the displacement surface are retained during manipulation. If you do follow this technique when making arches, I suggest you make use of hammer's ability to save prefabs. If you make prefabs for a variety of common arch sizes you can save yourself a whole lot of time in the future.
Post ReplyView Topic