Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ANNOUNCEMENT: Please use SURF_NODRAW for invisible brushes from now on!
10-09-2012, 05:14 PM, (This post was last modified: 10-23-2012, 12:31 AM by Max.)
Post: #1
ANNOUNCEMENT: Please use SURF_NODRAW for invisible brushes from now on!
Hi everyone! Just a friendly update from engineland.

For a long time, we had no standardized way to do invisible surfaces in maps. (These were for things like clipping brushes, the back side of a one-sided fence, the bottom surface of a light beam, and so on.) One of the more popular ways is to use the texture arena6/blacktrans and then mark the surface as transparent. In fact, if you look in mapsrc/, this is how most of the stock maps were made.

Another way to do it is with the surface flag SURF_NODRAW. Just select the surface or brush you want to be invisible, and check the SURF_NODRAW box in the surface inspector. You can use any texture with SURF_NODRAW.

[Image: surfaceinspectornodraw.png]

For a long time, it didn't really matter which method you used. However, recent changes to the engine have made it much more efficient to use SURF_NODRAW, so it's better to start using it from now on. (Actually, it was already slightly more efficient to begin with.) The old method will continue to work, but it is not recommended anymore.

The engine changes basically make SURF_NODRAW usable for caulking, meaning the engine can completely ignore the surfaces for the purposes of rendering (but not for collision detection.) Unusually, this caulking is implemented in the engine at load time, rather than in the map compiler, meaning old maps with NODRAW surfaces don't have to be recompiled.

If you have any maps in beta that are still using the old method, now would be a good time to switch before you finalize them. If you've already finalized your map, don't worry about it.

Caulking
This is common practice in games based on Quake III, but we haven't really supported it until now. In those games, it's done by applying a special texture. We do it with SURF_NODRAW. Here's how it works:

If there are any surfaces in your map which can't possibly be seen by players, they should be marked as SURF_NODRAW. This makes the map more efficient to render. Examples of surfaces that can't be seen are:
  • The upper sides of rafters that can't be reached from the ground.
  • The upper side of a ceiling fan.
  • If you have any room which is walled off and only visible through glass (like the martian conveyor area in dm-deathray,) then the back of the glass will never be visible.
  • The bottom of any stationary func_wall, or the side of it that's always up against a wall.
  • Parts of doors that are always inside the wall.
  • The part of a func_plat that always faces the wall.
  • If you have a pool of water, slime, or lava which is either unreachable or shallow enough that you cannot submerge your head even by crouching, and if there are NO trans flags (the liquid is opaque,) then the floor of the pool will always be invisible.
You should really think creatively and try to mark as many surfaces with SURF_NODRAW as you can get away with. However, be sure not to use the flag on surfaces which could be reached by trickjumping. For example, it is quite possible to reach the rafters in dm-eternal.

If I mark a surface with SURF_NODRAW, should the brush be marked as detail?
The answer is "sometimes." You do not need to mark the brush as detail if you use SURF_NODRAW on a surface no one will ever see. Clipping brushes (for example, the solid brushes you make around each misc_mapmodel) should definitely be marked as detail, otherwise they can leave "holes" in the floor and walls where they touch. (And it's good practice anyway, it makes the BSP more efficient.) In general, if the use of SURF_NODRAW causes you to be able to see somewhere you wouldn't otherwise see (i.e. through the brush to the other side,) it should be marked as detail.

Note that it's okay, even desirable, to use SURF_NODRAW to make a "hole" in the outer wall of your map, as long as that hole will never be visible. Do not mark any brush in the outer wall as detail, it will cause your map to leak.

Examples:

Suppose this is your map. It has two rooms, one room is sealed off with a transparent fence.
[Image: 13024904.png]

This is how the map compiler will see your map:
[Image: 61698111.png]

However, this is the walkable area that you can reach in-game:
[Image: 71039396.png]

In this case, it's okay to mark the following surfaces as SURF_NODRAW:
[Image: 73381634.png]

Even though they create "holes" to the void outside the map:
[Image: 80244058.png]

Because no one will ever see them without spectating out of bounds.
[Image: alienarena272.jpg]
[Image: alienarena270.jpg]
(Note how the back of the fence is gone too. Every surface you eliminate helps make the BSP more efficient.)

Now, suppose I wanted to add a clipping brush like this:
[Image: 16945367.png]

If I just set SURF_NODRAW without doing anything else, I'd get something nasty like this:
[Image: alienarena271.jpg]

So I also set it as detail, and that fixes the problem.


(NOTE: be sure to use the latest map compilers from SVN, they treat NODRAW detail brushes specially.)
Reply
10-09-2012, 07:15 PM,
Post: #2
RE: ANNOUNCEMENT: Please use SURF_NODRAW for invisible brushes from now on!
interesting
on freaky#5 and #6 ive used a brush with arena6/blacktrans and surf5 (trans33). i will use surf8 in the final version Smile
[Image: 1mj8I8vrcsu7.png]
________________________________________________
If you want to touch the sky - f*ck a duck and try to fly!
Reply
10-09-2012, 08:09 PM,
Post: #3
RE: ANNOUNCEMENT: Please use SURF_NODRAW for invisible brushes from now on!
Updated original post to add a note about caulking.
Quote:* maxtothemax is back
<maxtothemax> with a vengeance
<maxtothemax> and chips
<maxtothemax> and bean dip
Reply
10-14-2012, 05:26 PM,
Post: #4
RE: ANNOUNCEMENT: Please use SURF_NODRAW for invisible brushes from now on!
Update original post with a note about marking brushes as detail.
Quote:* maxtothemax is back
<maxtothemax> with a vengeance
<maxtothemax> and chips
<maxtothemax> and bean dip
Reply
10-14-2012, 05:59 PM,
Post: #5
RE: ANNOUNCEMENT: Please use SURF_NODRAW for invisible brushes from now on!
Huh??
(10-09-2012, 05:14 PM)Max Wrote: ...it's okay, even desirable, to use SURF_NODRAW to make a "hole" in the outer wall of your map, as long as that hole will never be visible...
[Image: dorig.png](Art by {OS}Drastic)
system specs in profile
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)