From Valve Developer Community
Jump to: navigation, search

glview is a program that displays visleaves. It has been obsoleted in the Orange Box by Hammer's Map > Load Portal File feature.

However, for those who are mapping with an older version of Source:

Setting up

glview setup
You will need to use Expert compile mode for this, but it is not actually tricky.
  1. In Hammer, go to the Run Map menu (where you normally compile the map) and click the Expert... button at the bottom. The Run Map [Advanced] dialog will appear. Click Edit, New, type "GL View" (or whatever), hit Enter then click Close. "GL View" should now be in the drop-down list. Select it. Now press New.
  2. In the Command box type $bsp_exe, and in the Parameters box type -glview $path\$file.$ext.
  3. Enable Use Long filenames, Ensure file post-exists, and Use Process window. In the Ensure file post-exists box type $path\$
  4. Click New again. Press the Cmds button and select Executable. Locate glview.exe (look in C:\Valve\Steam\SteamApps\username\sourcesdk\bin\ep1\bin\glview.exe) and Open it. In the Parameters box type -portals $path\$ Enable Use Long filenames and Use Process window.
  5. In the Compile/run commands box, make sure both items are checked. Also check Run with visible objects only.
glview showing a good hallway.

When "GL View" is set up, it can be accessed through the Advanced run menu by selecting it from the drop-down list and clicking Go!. To get back to your regular compiling, click the Normal button. (Or you can set it up to do it from the Advanced dialog, but doing so is beyond the scope of this article.)

If successful, a strange window called "Camera View" should appear, with black/gray/white contents. This is glview showing you what your level looks like when the BSP program is done with it. You can use the WASD keys and the mouse to move around. By the way, use the Esc key to close glview; otherwise it might crash. Spend some time zooming around your level. Ignore the different shades of gray--they are not important. The white lines are the important part. You can control visibility of these lines by using L and B keys.