Optimization Commands: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
 
(Changed page completely, reserving it for a list of console commands.)
Line 1: Line 1:
==[[showbudget]]==
Before you start doing any optimizing on an existing map, you should know what to optimize -- it'll be a waste of time and effort to optimize, say, your world brushes if your dynamic lights are what are actually killing performance. So your first tool is [[showbudget]]. Get to know it well!


To effectively use '''showbudget''', you should turn it on and run around your level. Look for areas that cause trouble (fps goes too low and/or some bars jump significantly to the right). These trouble spots should be the initial focus of any optimization. As to how low of an fps reading is too low, or how far a jump is significant... that's for you to decide. You might try comparing your readings to those of the sample maps.
Commands and variables used for optimization.
==[[mat_wireframe]]==
The other major tool you can start using from the beginning is [[mat_wireframe]]. This is a console variable that shows everything that the graphics engine is trying to draw. You will very quickly find that it tries to draw a lot more than a human would think it should.


Notice that many brushes, especially large ones, are broken up several times. Some of this is unavoidable, but much of it can (and should!) be corrected. It is unavoidable that rectangular faces are converted into two (or more) triangles--Source only draws triangles, so this is fine. But sometimes a face is broken into dozens of oddly-shaped triangles, and this is a problem, since more triangles means that the map is slower. One aspect of optimizing a map is to reduce the number of triangles your world is broken into.
;+showbudget:Displays an informational panel displaying engine performance. See [[showbudget]].


Usually, the engine will draw many props that are not actually visible. Another major aspect of map optimization deals with that problem: how to encourage the engine to draw only as much as it should. Hint brushes and occluders can help here; both are discussed later.
====mat_leafvis====


Try using mat_wireframe to compare the maps of beginners to those of professionals. If using you own maps, running the VIS stage of compilation will help.
;mat_leafvis 0:...
 
;mat_leafvis 1:...
 
 
====mat_wireframe====
Displays the BSP visleaf wireframe for the map. Useful when optimizing for seeing how visleafs are arranged.
 
;mat_wireframe 0:This setting is default. It doesn't display any wireframes.
 
;mat_wireframe 1:This setting displays all the leaves that is visible in the PVS, using red polygons. It is useful for determining how many leaves are calculated in total, but has the most potential for clutter.
 
;mat_wireframe 2:This setting displays all the brush leaves in the players line-of-sight, using green polygons, hiding the ones he cannot see.
 
;mat_wireframe 3:This setting displays the leaves using pink squares.

Revision as of 09:42, 8 March 2006

Commands and variables used for optimization.

+showbudget
Displays an informational panel displaying engine performance. See showbudget.

mat_leafvis

mat_leafvis 0
...
mat_leafvis 1
...


mat_wireframe

Displays the BSP visleaf wireframe for the map. Useful when optimizing for seeing how visleafs are arranged.

mat_wireframe 0
This setting is default. It doesn't display any wireframes.
mat_wireframe 1
This setting displays all the leaves that is visible in the PVS, using red polygons. It is useful for determining how many leaves are calculated in total, but has the most potential for clutter.
mat_wireframe 2
This setting displays all the brush leaves in the players line-of-sight, using green polygons, hiding the ones he cannot see.
mat_wireframe 3
This setting displays the leaves using pink squares.