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 tovlakas on Mon Nov 28th 2005 at 10:07am

Great tutorial. I was just asking about this in the FF IRC room, I guess I should have looked first, eh? Great tutorial Jesse.
[author]
Posted by trepid_jesse on Tue Aug 9th 2005 at 6:14pm

I mentioned the DispEd program in the comments of this tutorial, and I did so after I noticed the program myself.

I only assumed you went wrong somewhere in the process of making the displacement because of what you said in your first reply.
0 starsPosted by Varsity on Mon Aug 8th 2005 at 4:50pm

Nevertheless, you should at least mention it. And no, I didn't go wrong - the problem was with texture alignment on the edges, something that DispEd's solution didn't manage either!
[author]
Posted by trepid_jesse on Mon Aug 8th 2005 at 8:41am

Well, Varsity, if the displacement didn't work that isn't the fault of this tutorial. You just went wrong somewhere in the midst of creating the displacement.

I've tried using that DispEd program a number of times since this tutorial, but ultimately, I still find it &quot;easier&quot; to do it this way. It's actually becoming a fairly quick process now, and the burden it puts on time isn't really all that bad. I just don't like DispEd, as it currently stands, as it's not terribly intuitive and I find it difficult to get what I want out of it. I'm sure the author of the program is very adept at creating lots of cool displacements with the program, but I think it still needs quite a bit of work.

Whatever works best for you, though.
0 starsPosted by Varsity on Sun Aug 7th 2005 at 6:14pm

Oh my god, I just spent an hour making a displacement that didn't even work before I read the comments and found the program that did it for me in seconds. PLEASE update the tut!
0 starsPosted by Cyax on Sun Jul 24th 2005 at 12:40am

Brilliant, I'll spend the extra five mins to make my map betetr anyday. Thanks for this tutorial, I use this in every textured arch I make now.
0 starsPosted by Forceflow on Fri Jul 8th 2005 at 8:58pm

Good tutorial
[author]
Posted by trepid_jesse on Fri Jun 17th 2005 at 1:50am

Well, given that it was recently on the front page of this site, you can make your own.

<a href="http://www.violator.eclipse.co.uk/disped" target="_blank">http://www.violator.eclipse.co.uk/disped</a>

That handy programs makes the methodology outlined in this tutorial a moot one.
0 starsPosted by LickitySpliff on Fri Jun 17th 2005 at 1:47am

Can you submit a prefab maybe? im lazy..
0 starsPosted by trepid_jon on Sun Jun 5th 2005 at 8:32am

One thing to keep in mind is that I don't think light bounces off of displacement maps like it does on normal brush faces. I'd show a screenshot from ff_hunted where it was obvious, but I don't think we can just go around showing FF screenshots that haven't been released to the public yet.

But what I mean is that the lighting won't look as good on the curved displacement map arch as it would on just a normal brush-based arch. In ff_hunted, we used this technique in a few areas, one of which being the ceiling in this screenshot...

<a href="http://www.fortress-forever.com/?a=media&amp;id=ff_hunted_6" target="_blank">http://www.fortress-forever.com/?a=media&amp;id=ff_hunted_6</a>

That screenshot has the old brush-based arch in it and you can see the texture breaking on each turn of the arch. Since then, we've updated the ceiling of that tunnel to use a curved displacement map arch. When we did that, the lighting/shadows were really dark in some spots of the displacement map ceiling. To sorta fix it, we added some dim lights similar to the light_spots up in the corners of that tunnel to help make the dark spots not as noticeable.

OK, enough typing. I just figured I'd mention that the lighting acts a little different on displacement maps, so keep that in mind when using this technique...especially for indoor areas where the lighting might not be as constant everywhere.
Post ReplyView Topic