Submitted by
Andy on Fri, 2004-11-12 06:01.
The following tutorial has been republished with consent:
- By Adam "Phatsniper" Owen
One of the great features of Half-Life 2 is the ability to import highly detailed models from software such as XSI and 3D Studio Max to use in your levels.
Using these models is much more efficient than creating the detail with normal brushes, and because models don't split BSP geometry, you can intersect walls / floors etc. with them.
Unfortunately, the brush faces behind the model are still being drawn by the engine despite the player not seeing them.
This is where the nodraw texture comes into play.
If a face is textured with the "tools/toolsnodraw" texture the Source engine will not render them, thus lowering the face count and speeding up gameplay. You apply this texture just like any normal material, using the texture application tool and applying the nodraw texture to the faces you don't want the engine to draw.
The nodraw texture :
So, when will you want to use the nodraw texture?
There are many possible situations for this tool and I'll show you a couple of examples here.
The first use is on faces the player should never see, especially the roofs of buildings.
As you can see in the above image, there are a few faces that the player can't see during normal gameplay so we'll apply the nodraw texture to them.
We've saved the engine from drawing 14 faces here, and while that might not seem such a major difference, complex maps will highly benefit from not drawing roofs and other high objects.
One thing I must mention is balancing the nodraw texture. This example would be great for a single player level if there are no high windows to look out of. The main problem comes from multiplayer games, especially team based mods which make heavy use of the freelook spectator camera. Of course, when you are spectating graphics aren't a major issue, but it can look strange if lower faces such as the top of the bottom walls aren't there (you'll see straight through those faces). I leave this to your own discretion, but it's something to keep in mind.
The other example I mentioned earlier is applying the nodraw texture to faces hidden by models. Here is a doorway with the model prop, and without :
The brush geometry roughs out the basic shape of the door, while the model contains the detail. After carefully placing the model and checking it from all angles to make sure there are no gaps you can apply the nodraw texture to the obstructed faces.
That's 4 faces saved for one doorway which otherwise would have just been sitting there eating up resources.
It doesn't stop at doorways, any face that is hidden by a model should have the nodraw texture applied to it.
Finally, type +showbudget into the console while testing your map.
This is the new r_speeds command.
Use the on screen information to narrow down problem areas and find out what is draining resources.
As you can see, the nodraw texture is an invaluable tool to combat the everlasting battle against low frame rates.
Thanks for reading and good luck! Don't hesitate to contact me with any questions or comments!
The Tangled Web We Weave: Ropes in HL2
Reducing Vis Times