Brush drawing tip to minimize triangles


(Machine for to kill) #1

I discovered this as I was looking at this tutorial about something completely different. Anyway look at the following two rooms

Pay attention to the red lines (I know they’re hard to make out). Just pay attention to the edges. Assuming we apply caulk to all the faces that will never be visible. The red faces on the first image have to be visible so no caulking there, but on the second one they will never be visible, so caulk away. The basic idea is to use trapezoidal brushes instead of the rectangular ones for making walls and ceilings and floor etc. The first picture has 24 visible faces while the second one has only 12!!! That’s 50% less triangles in your compile and rendering time (again if we caulk where we should). Granted that the number of faces that you see depends on where you’re standing, for example if you stand inside either room you see the same number of triangles. The benefits of this technique show mainly during compile time and when you’re looking at the corner of a building from the outside.

So that’s my 2 cent


(MuffinMan) #2

yep this technique saves a big load of triangles, good example to learn from are the official ET-maps!


(redfella) #3

n1 (spam)

bananna dance yay!

:banana:


(G0-Gerbil) #4

Or alternatively you could model like in your first (the left) picture, but make the two side ones overlap the top and bottom fully. Again, assuming you caulk correctly, you’ll end up with the same compiled triangles as in your right hand picture.

Not that I’d recommend it particularly, but just for completeness sake… :slight_smile:


(JIM_BOB7813) #5

Just to clarify, is this technique is called mitering?


(digibob) #6

In this case, it is actually SLIGHTLY better doing it the way you suggest. :slight_smile:


(G0-Gerbil) #7

Any chance of an explaination why? :slight_smile:
I only regurgitated info I’d read elsewhere (I think scds_reyalP pointed me in it’s direction), therefore I have no actual knowledge of why you’d want to do it this way…


(digibob) #8

less unique planes, and less bevel planes, and geneally, axial is better than non-axial.


(Loffy) #9

…it is actually SLIGHTLY better doing it the way you suggest… [/quote]

I see.
Axial planes (x, y & z planes) are better. Ok.
But how about z-fighting (or what it is called, overlapping brushes?)?
Or, perhaps overlapping brushes arent such a big problem anymore, as it was ( I think) in RtCW?
// Loffy


(G0-Gerbil) #10

Overlapping caulked faces aren’t a problem (and hence why I mentioned in my first post that it assumes correct caulking has been done - in my example you’d have to caulk the short ends of each wall).

If you are the kind of person who doesn’t caulk, then yeah you’ll end up with textures fighting, or in the case of structural brushes, possibly nothing being drawn at all.
If you don’t caulk, you are better off doing the second of Machine For To Kill’s (weird name!) method, IE mitring the corners with diagonals.

Many people these days though build their map, paint it entirely with caulk and then go around adding textures only when needed. If you be one of these, then it appears the method I mention is the winner. A fact even I wasn’t aware of :smiley:


(Loffy) #11

Cool.
Perhaps one should do two sample rooms, with brushwork in it. One of the rooms is done with technique A and the other with B. Then there must be a way to measure wich room has the better, faster play.
Perhaps r_showtris 1, to see what brushwork is done with less tris. Or that other command, the one that tells vertices. Not sure what it is called.
Im such a noob, I feel, sometimes.
// Loffy


(Irrelevant) #12

Doesn’t having overlapping brushes slow down vis or make it less accurate or something?

Just something I heard…


(Machine for to kill) #13

[quote=“G0-Gerbil”]Or alternatively you could model like in your first (the left) picture, but make the two side ones overlap the top and bottom fully. Again, assuming you caulk correctly, you’ll end up with the same compiled triangles as in your right hand picture.
quote]

I don’t like things overlapping (that’s if you mean two brushes occupying the same space, cause there’s also overlapping meaning that it just covers it somehow), I think overlapping will cause problems somewhere along the line so better to avoid it all together even for caulked textures.

When I finish my glorious map i will caulk everything and then put the textures on the surfaces where needed.

What you all seem to be missing about the two designs which I mentioned but nobody payed attention to is that it all depends on which areas of the cube/room will be visible. Since most rooms by definition are designed to be used internally (is that the right word) then both ways are the same.

My way is better theoretically and it might help at compile time.

I’ve been hearing in many places about orthogonal brushes being better but usually just from regular people and preceded by the phrase “I think” So can someone who knows the compiler (you hear me ydnar) state once and for all what are the advantages (if any) of using orthogonal brushes. Maybe I’m wrong but ingame orthogonal doesn’t really have meaning because you can view brushes from many directions.

the end


(G0-Gerbil) #14

Well normally I’d agree, and I originally only posted ‘my’ method because I remember seeing proof that it did not cause the problems people automatically assumed it did.

So at that point, I knew it was as effective as your other method, and would produce the same results (assuming properly caulked etc. etc.).

That, of course, then left it down to personal preference, and indeed I don’t use the method I detailed myself.

It was djbob (who to be fair could be described as ‘knowing a bit about it all’ :wink: ) who said my method was actually the best.

It’s all relative anyway, for a few hundred examples in a map of either method, I can’t imagine it REALLY making that much difference, it’s just on a purely technical level it appears ‘my’ way is best - the real world difference might be hundredths of a second though - I have no way of knowing myself :slight_smile:


(chavo_one) #15

Your way? LOL! Sorry, that struck me funny.

What you all seem to be missing about the two designs which I mentioned but nobody payed attention to is that it all depends on which areas of the cube/room will be visible. Since most rooms by definition are designed to be used internally (is that the right word) then both ways are the same.

Actually, the two examples are not equal in efficiency when viewed from the inside. The first (left) example has overdraw, which is not as efficient as the mitred edges.

So can someone who knows the compiler (you hear me ydnar) state once and for all what are the advantages (if any) of using orthogonal brushes. Maybe I’m wrong but ingame orthogonal doesn’t really have meaning because you can view brushes from many directions.

Non-orthogonal brushes are only considered “bad” if you make them structural. I’m not ydnar and don’t know nearly as much as he does, but I do know he has addressed this issue many times before.

Here’s a bit from ydnar that touches on the proper use of non-axial brushes.

The advantages of using structural orthogonal brushes (that I’m aware of):
-being able to compile your map without errors.
-quicker compile
-smaller, neater bsp file


(hhhmmmmm) #16

Hi all
If you not sure how to miter (i didnt know for like 6months) theres a couple of videos over @ www.modsonline.com .
There for SoF2 but they are the same as in E.T radient.


(SCDS_reyalP) #17

Mitered is nice for simple boxes like that. However, if you start making complex shapes, it becomes a pain to get all your various edges to line up. Even more so if you try to miter the roof and floor as well. This becomes even more of a pain if you try to adjust it later. Also, in actual practice you rarely want walls that are just a single texture on the inside and outside. You want trim, and support structures and paintings on the walls. If you try to use single brushes for both the interior and exterior walls, adding some little decoration to one means you have to rebuild the other, often resulting in unneeded triangles, or accept a lot of overdraw and z-fighting. If you try to also use the same brushes for structure, you get an overly complex .bsp and long vis times too.

For this sort of thing, I find it easier to use indivudual brushes for exterior detail, interior detail, and structure. You don’t have to wory about mitering, and if you want to add some trim or something to the inside, you don’t have to worry about adjusting the outside, or hurting your triangle count. You can build the building entirely out of detail, and then use huge sheets of caulk to seal it up.

First screenshot has nothing filtered:

You can see the details on the outside of the building, as well as the big sheet of caulk that makes up the structural wall.

Here is the stucture:

Dead simple. That gives super quick compile times and reduces vis data, despite the amount of detail.

Here is the detail:

Notice that there is still some caulk showing. That is the back of the detail from the inside of the building, and the key to why this actually makes contrstruction simpler, even though it uses more brushes.

Here is the inside:

I’ve selected some of the outside detail brushes so you can see why having the inside and outside be made of different brushes is a good thing.

Now think about if I had tried to make that same wall with conventional textured structure, and both sides of the brushes textured where possible. Either my brushwork would be hugely complex, or there would be z-fighting and overdraw. In any case, there would be pointless BSP splits. Also, If I wanted to adjust the details on the outside, I’d have to pay attention to how it affected the details on the inside.

The thing to keep in mind is that brushes are cheap especially if they share planes.

While this looks messy and complicated, in practice, it makes adjusting the interior or exterior of a building very simple. It also makes you memorize the filter keys :D.

One final word of caution. If you don’t understand why this is good, don’t try to do it. You can make a huge mess of your map, and not get any benefit. You can also make excellent maps with conventional construction.

The canonical description of this method is found here:
http://www.csis.gvsu.edu/~bickelj/quakin/Welcome.html


(digibob) #18

Just to clarify this a little, since afaik, most people aren’t aware of this. ALL brushes, regardless of construction, will be made to have 6 axial planes ( in addition to whatever planes they already had ). So a regular 6 sided axial brush will just have 6 planes, but one of those brushes above which has been mitred at both sides, would end up with 8. This will increase your BSP size ( albiet very little, but it all adds up with huge maps ), and slows down collision detection ( albiet very little again, yada yada ).