| Caps and Arches (Patches) Updated 22 Apr 2001 | Upper levels: - QuArK Information Base - 2. Map editing - 2.4. Shape Builders

2.4.2. Caps and Arches (Patches) | [ Prev - Up - Next ]

Patch-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 below.

Index

- - Making an arch (25 Feb 2001)
- - Caulking (22 Apr 2001)
- - Specifics (03 Mar 2001)
- - Troubleshooting (03 Mar 2001)
- - Techniques (03 Mar 2001)

Making an arch | tiglari - 25 Feb 2001 | [ Top ]

To make an arch, first click on the cube icon in the user panel, or use whatever technique you normally use to make a more or less cubical brush. Then, in a side-on map-view, select the brush and 'RMB -> Curves -> Arch'. An arch-shape will appear inside the brush, and if the brush isn't selected, it will be invisible. If you open up a 3d view and look around, you'll see that there are patches with textures on the front and back, and inside curve. What's happened is that the original brush has been put inside a duplicator, which makes it invisible unless selected. You can see this by looking at the tree view, as illustrated: The duplicator then controls the production of the actual patches comprising the arch, by means that we will shortly start manipulating. Of course, due to the one-sided visibility of patches, the arch isn't a very satisfactory piece of archicture until we put it into a suitable architectural environment. But first, a bit more about the arch itself. You might think that once made, it's made, and what you see is all you get, but not at all. First, click on the arch until its `guide brush' (the one inside its duplicator) is selected. We can now drag this brush around, and the arch will move, and we can reproportion the arch by dragging the individual faces. 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 the next step is to make a wall with a hole in it, using whatever your favorite technique for doing this is (if you want to live dangerously, you can subtract with the arch brush before or after turning the original brush into an arch). Now move the arch's `guide brush' into the hole, and line everything up so that the sides and the top are flush with the sides of the hole, and the bottom is where you want it. In a 3d view, things should look as more or less as shown: |
Now, when we select the duplicator itself (which can be done without opening the tree view by selecting the brush and 'RMB -> Navigate Tree -> Arch -> Select'), we'll see something like this: When the duplicator is selected, the tracery of bezier mesh lines becomes visible. Also, in an OGL view, the brush itself takes on a reddish color (this doesn't happen in the other views). It is also possible that the textures might be misaligned, so controlling that is our next topic. |
Arches get the textures of 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 face (there's a further amelioration we'll get to later, after dealing with the arch/cap duplicator specifics).
But what we can do is get the textures aligned around the inside of the archway. The inside curve gets its texture off the top face of the guide-brush. So basically what we want to do is wrap that texture onto the two walls. However for geometrical reasons we don't want to quite do that. To set the scene, raise the bottom of the guide-brush to explose some bare wall-side, then select the top face of the guide-brush and put a suitable ceiling-texture on it. The results might look like this as to the right. |
Next, tag the top face of guide brush, then select a wall, as indicated to the right: Finally, on the selected face, do 'RMB -> Texture -> Wrapping -> From tagged mirror'. The texture on the curve ought to now extend down the wall, smoothly aligned. Repeat on the other side, and it's done. |
But if you look closely with an patterned texture, 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. A final point: for some textures, especially small and/or non-square ones, this positioning trick doesn't work and the textures come out strangely warped. This is a bug I haven't tracked down yet; to use these texture on inside arches, you have to check the `stretchtex' box, & you'll have to manage alignments manually.

Caulking | tiglari - 22 Apr 2001 | [ Top ]

The arch now looks OK, but we've left out an important step, caulking. The problem with it now is that the engine will actually draw the brush-faces that are concealed by the curves, which is a waste, because they can't be seen. The solution is to attach a the 'special/caulk' shader to the hidden faces. For the top slab that sits over the arch, we can easily just do this, but for the sides it's a bit more of a chore, because part of the inside faces of the walls are exposed, and others aren't (this is also a 't-junct', which is Evil. So there's a little trick to speed up caulking. Tag say the left face of the guide-brush of the arch, then select the right-face of the left wall-block. Now RMB|More Tagging|Caulk from tagged. The wall will be split into two, and the caulk pasted onto the part of the wall that's hidden. In QuArK, you can see a bit of the caulk-texture where the curve and the wall join, but in Quake3a you can't (I'm not sure if QuArK's behavior is a bug or a feature). Of course, if you reproportion the arch, you'll need to adjust the walls as well; a good application for Tag Face/Glue to Tagged.

Specifics | tiglari - 03 Mar 2001 | [ Top ]

The RMB menu currently offers three basic shapes (arch/cap, bevel, column) 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 have their textures on a concave curve-side, non-inverse on a convex one. 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. Then there's 'onside', which lays the arch down its side, to make a curved wall. Another is 'stretchtex'. If this is checked, then whatever texture on the back face will be stretched to cover the curve, without any of the alignment manipulations. This is useful if you have a specially prepared texture that you specifically want to put on a curve, but not elsewhere. Some of the remaining ones will be discussed in the section 'Techniques' below.

Troubleshooting | tigalri - 03 Mar 2001 | [ Top ]

The arch/cap duplicator code is fairly complicated, and various things can go wrong. The typical symptom is that the arch disappears, because something goes wrong with the code that generates its `images'; (the patches that it's supposed to produce, in this case). When this happens, inspect the duplicator in the tree view and check that the following things are true: There is exactly one brush under it (other stuff can easily find its way in, everything but the first brush will be ignored and effectively disappeared from the map). That brush has six faces labelled front, back, up, down left, right. These faces are in the expected relationship to each other (if you're staring at front, `right' is to the right, etc.). This is all important because the face-names are used by the code that generates the brushes. If all this seems OK and it still doesn't work, something deeper is wrong, post on the quark or quark-python forum. Two other things that might go wrong are: texture distortion on the curve, for some (small, non-rectangular) textures. `cracks&180; between the seams of complex architecture, when Q3A is run with hi r_subdivisions values. The first is a bug with no real cure, the remedies are to either use another corner, or check `stretchtex'; and do texture alignments by hand. For the second, the problem is that Q3A is tesselating the two patches to different extends. Currently, the fix is to dissociate the images of the duplicators, then use the mesh|double rows/column RMB commands to increase the number of control points along the edge, and also Tag Point|Knit edge to tagged to check that everything is lined up right. I soon hope to add some more specifics to the duplicators that will have them generate thicker meshes, so that dissociation won't be necessary. Also more options, so that invisible patches can be excluded from complex architecture without dissociation. At present, finding a bad arch could be difficult; there should eventually be diagnostic functions for these duplicators and some sort of map-check for them to pick up the bad ones.

Techniques | tiglari - 03 Mar 2001 | [ Top ]

I'll discuss two techniques here, the use of a 'thick'; arch to avoid texture misalignments between the front face and the inside edges, and how to do a round porthole with no texture seam around the curved opening.
Start with something like the uninspiring archway to the right. Basically what we're going to do is create a whole nother arch inside it, with the same dimensions, but with a 'thickness'; projecting inward, with a different texture and a curved 'seam' on the front and back. Note that the bottom of the arch has been pulled off the floor. |
A way to do this is as follows. First select the arch's guide-brush, and then Edit | Duplicate from the top menu. If you look inside the arch duplicator you'll see that there are two brushes. Drag one of them out out from inside the duplicator so that it is sister the duplicator rather than inside it, select it, and finally RMB | Curves | Arch in a map view, looking at it from the front. You'll now have two identical arches occupying the same space. Now select one of the arches and look at its specifics, and input a value such as say 8 into its 'thick' specific. You should now see an extra thickness protruding inward around the curved surface, onto which you can put some different texture. Next you'll want to make two side brushes to put under the overhang, before doing the textures. To the right is a wirefrom view of what things might look like now. |

Now the idea is to put onto the front faces of the arch and the side-blocks the same texture as will go on the inside surface, so that there won't be a sharp texture-discrepancy around the edge of the opening. Also, the fronts of the side-brushes and the arch can be pulled out a bit to make a protruding `lip'. As a final elabortion, you should push the `details' button on entity specifics page, and suppress the creation of faces that can't be seen.
There is also the problem of getting the textures aligned around the inside of the opening. This is a bit tricky, but here's a procedure. Put the texture you want on to top face of the thick arch's guide brush, tag that face, and then wrap it down onto the hidden (facing the wall) faces of the two side brushes. Then tag this hidden face of one brush, and project the texture onto its opposite exposed face (facing into the archway), and repeat for the second brush. |
This can be tricky and confusing because of all the mirror-image type reversals from wrapping and projecting textures onto faces pointing in opposite directions, but it can be made to work out. One point to keep in mind is that the texture you put on the top face of the arch's guide brush is reflected (mirror-imaged once) when you see it on the inside surface of the arch; when you wrap it onto the hidden faces of the side-brushes it doesn't get reflected, only rotated, but finally gets reflected when you project it from the hidden face to the exposed one. (So it's confusing; figuring it out was worse).
And finally, Alex Haarer's archlib plugins provides an assortment of complex prefab arch structures.
Another technique I'll describe verbally without pikkies is a round porthole. First make a square opening, fit a brush into it exactly, wrap a texture seamlessly around the brush (the faces that contact the opening), and project the top and bottom textures of the brush onto the top and bottom faces of the opening. Then cut the brush in half so that you have two brushes, one on top of the other, exactly touching, filling the bottom and top half of the opening. Now make each brush into an arch, set the lower one to lower, and project the top and bottom textures of the opening to the top and bottom faces of the corresponding brush. That should do it.

GNU General Public License by The QuArK (Quake Army Knife) Community - http://www.planetquake.com/quark | [ Prev - Top - Next ]