Go to QuArK Web Site
Caps and Arches (Brushes)
Updated 05 Apr 2018
Upper levels:
QuArK Information Base
2. Map editing
2.4. Shape Builders

 2.4.3. Caps and Arches (Brushes)

 [ Prev - Up - Next ] 

Brush-based `Caps' and arches are made by the same shape-builder, and arches are probably its most important function, so that's what gets discussed most here.


 Index


 Making an arch

tiglari - 05 Apr 2018   [ Top ] 

The brush-arch is a collection of brushes designed to fill in a boxy hole to make it look like an archway. So a good way to start would be to make a wall with a hole in it, perhaps by first making a wall-brush, then a subtractor brush, then subtracting. The result might look like this, where the bottom of the subtractor has then been raised up a bit in preparation for the next step:

Now to make the arch-shaped filler, facing the brush that's been left in the archway, 'RMB -> Brush Curves -> Arch':

Some additional brushes forming arch-shape (tinted blue in some views, such as the one to the right) will appear inside the brush, and if the brush itself isn't selected, it will be invisible.
What's happened is that the original brush has been put inside a duplicator (you should check this by fossicking around in the tree-view), which makes it invisible unless selected. By default, four brushes are produced, and there is a gap in the middle, but this and various other aspects of what is produced can be changed by changing the specifics of the duplicator.

Now the most important aspect of this way of making an arch is that it can be changed dynamically, after it's made. To see this, click inside its area until the arch itself disappears, and its `guide brush' appears instead because it's selected:

We can now drag this brush around, and the arch will move, and more importantly, we can reproportion the arch by dragging the individual faces. Especially, we can change it's shape inside the hole by dragging the bottom up and down:
Since these are ordinary faces, which provide data to the duplicator code the makes the arch patches, we can do all the ordinary face stuff to them, such as tag/glue.

So there's the shape; the next problem is to control the textures.


 Texturing the arch

tiglari - 05 Apr 2018   [ Top ] 

Arches get the textures for their front and back faces off the front and back faces of their guide brush. So all we have to is to tag some face of the wall (assuming the other wall bits are properly aligned), then select the front face of the arch's guide brush, and then 'RMB -> Project Texture from Tagged'. and ditto for the back wall. The results should look more or less as to the right (the red line is the part of the outline of the wall-face that the texture was projected from).

If your arch's front or back textures are misaligned, you should fix them now; if they're not, mess them up and then fix them.

The inside of the arch is unfortunately not so straightforward. It would be nice if there was some way to wrap the texture on the front or back onto the inside curve, but there isn't, at least without using specially pre-prepared and proportioned textures. So we basically are stuck with a misalignment here, which can be ameliorated by using some fairly bland, unpatterned texture on the inside faces.


But what we can do is get the textures aligned around the inside of the archway. The inside faces get their texture off the top face of the guide-brush. So basically what we want to do is wrap that texture onto the two walls. But somehow everything has to get aligned. What happens is that texture is compressed and positioned in such a way that if the same texture is projected to the top face of the hole and wrapped down the wall, everything lines up. So first put a bland texture on the top face of the guide-brush. This will produce something like what's to the right, not very good because of the different texture appearing at the very top and sides:

So Next, tag the top face of guide brush, then the bottom face of the brush that's at the top of the whole, and 'RMB -> Texture -> Project from tagged'. Then the quickest way to wrap down the sides is to select the sides of the whole, and 'RMB -> Texture -> Wrapping -> Wrap from tagged mirror'. The result ought to look like this:

In the game, the joins may be unpleasantly visible, due to light effects, but if there is an arghrad-like editing tool, this can be fixed by putting the same lightvalue (or equivalent property) onto the top face of the guide brush and the other faces forming the opening. The top-brush's lightvalue (& all other specifics) will be copied onto the inner faces of the generated brushes.

If you put an appropriately patterned texture around the inside of the arch, and look closely, you'll see that the texture scale is compressed somewhat on the curved portion; that's because its being positioned and scaled on the curve so that it will join up smoothly with what's on the walls, but the distance around the flat wall face is longer than on the smooth curve-face. This is because of a bit of tricky coding in the duplicator, whereby the texture scale is compressed just enough so that the distance in texture-space around the curve equals the distance, w.r.t the top-face scale, around the three faces defining the arch.


 Specifics

tiglari - 05 Apr 2018   [ Top ] 

The RMB menu currently at least offers only two basic shapes (arch/cap, bevel) in two orientations each, but the 'duplicators' that implement these shapes have a considerable number of specifics that implement variations. You can see what these specifics do by making an arch and experimenting.

If you uncheck the 'inverse' specific for example, the arch will turn into a 'cap'. In general, inverse shapes are concave, non-inverse their convex counterparts.

Another important specific is 'subdiv'; it's value is a number, 2 upon creation, that determines the number of segments each arch-half or bevel is divided into. 2 seems to be the minimum to provide a half-decent appearance; more will of course imply more polys. Also there's 'inner'. There are two ways of approximating an arc with straight edges, the edges can lie inside or outside the curve of the arc. Outside is the default, checking 'inner' switches to the inner method.

Another useful one is 'lower'. This flips the arch upside-down, so that the curved surface is a U that you can walk over. Lower arches take their texture from their bottom ('down') rather than their top ('up') faces.

Also there's 'onside' for caps and arches, and 'standup' for bevels. Note that these change the face that the texture comes off, so for an 'onside' cap/arch, it will be the back face, for a 'standup' bevel, the top.

All of these shapes are good candidates for being 'detail' in games that support this; since the faces of the brushes are all ultimately copies of faces in the guide brush, specifics such as 'detail' (along with lightvalue, etc.) will be copied from the appropriate face of the guide-brush.



Copyright (c) 2022, GNU General Public License by The QuArK (Quake Army Knife) Community - https://quark.sourceforge.io/

 [ Prev - Top - Next ]