Visleaf: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Described how to examine visleaves better.)
m (I don't own the Orange Box, so hopefully this isn't redundant information.)
Line 11: Line 11:
You can examine visleaves in the following ways:
You can examine visleaves in the following ways:


* If you own the [[Orange Box]], you can access Hammer's {{key|Map > Load Portal File}} feature.
* If you own the [[Orange Box]], you can access Hammer's {{key|Map > Load Portal File}} feature. (Leaf edges that touch other edges will be displayed as thick blue lines.)
* You can use the [[glview]] tool.
* You can use the [[glview]] tool.
* You can change [[console variable]]s through the [[Developer Console]]. (Entering "'''<code>[[mat_wireframe]] 3</code>'''" will display all rendered leaves, and "'''<code>[[mat_leafvis]] 1</code>'''" will outline the player's current visleaf.)
* You can change [[console variable]]s through the [[Developer Console]]. (Entering "'''<code>[[mat_wireframe]] 3</code>'''" will display all rendered leaves, and "'''<code>[[mat_leafvis]] 1</code>'''" will outline the player's current visleaf.)

Revision as of 15:05, 31 January 2011

A sample scene with two rooms.
The default visleaf structure for the above scene. Note how leaf 2 cannot see leaf 3.

Each visleaf (sometimes referred to simply as a leaf) is a hollow volume in a map which defines a 'cluster' of visible surfaces. Every visible surface of a map is part of one visleaf or another. Visleafs are used primarily by the Rendering Engine to determine (before rendering each frame) which areas of the map might need to be rendered on screen. When any part of a visleaf is potentially visible from any part of the current visleaf, the entire contents of that visleaf are considered for rendering.

Visleafs are generated automatically from the BSP tree by the VVIS compile tool. Each (internal) surface of a visleaf is either a World brush surface or a Portal to an adjacent visleaf.


Examination

You can examine visleaves in the following ways:

  • If you own the Orange Box, you can access Hammer's Load Portal File">Map > Load Portal File feature. (Leaf edges that touch other edges will be displayed as thick blue lines.)
  • You can use the glview tool.
  • You can change console variables through the Developer Console. (Entering "mat_wireframe 3" will display all rendered leaves, and "mat_leafvis 1" will outline the player's current visleaf.)

See also

Template:Otherlang:en Template:Otherlang:en:ru