Visleaf: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
(Described how to examine visleaves better.)
Line 7: Line 7:
Visleafs are generated automatically from the [[BSP|BSP tree]] by the [[vvis|VVIS]] compile tool. Each (internal) surface of a visleaf is either a [[World brush]] surface or a ''Portal'' to an adjacent visleaf.  
Visleafs are generated automatically from the [[BSP|BSP tree]] by the [[vvis|VVIS]] compile tool. Each (internal) surface of a visleaf is either a [[World brush]] surface or a ''Portal'' to an adjacent visleaf.  


The [[ConVar|console variable]] "'''<code>[[mat_leafvis]] 1</code>'''" draws a red wireframe box around the Player's current visleaf, which is redrawn each time a new visleaf is entered. Visleafs can also be examined from the desktop with the [[glview]] tool.
 
==Examination==
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.
* 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.)


==See also==
==See also==

Revision as of 14:35, 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:

See also

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