|
Utilities for the Mapper
By: Desmond Fletcher
Mappers like tools; tools to speed up the process and make the project look better. Well, Torque has a number of functions that fit this bill. So we took the Torque Wrench, tuned up a few areas of code, and created a utilities menu (recently posted to Resources) with the mapper in mind. The utilities menu features console functions organized into lists with the different functions activated by radio buttons or sliders. The features to date are organized into four areas: metrics, interiorRenderModes, logfile, and sun vector calculator. This article focuses on the interiorRenderModes.
When the mapper is using the DEBUG version of Torque, there are seventeen interiorRenderMode options available. The menu system makes it easy to select the different options (at least I know I can't remember them all at the console command-line; and I got tired of sticking post-its on my walls). In case you haven't got the utilities menu installed, I'll show the console functions in the section titles in the discussions below.
Normal --> setInteriorRenderMode(0);
The image below shows the utilities menu (activated by the F5 function key) with the "Render Options" window selected and the "Normal" radio button selected. All the modes for interior rendering can also be activated from the console (press the tilde "~" key to drop down the console and type the function command). For example, for normal view mode which shows all the interior textures and lightmaps, type in the expression setInteriorRenderMode(0); (including the semi-colon) and press enter.
Render as Lines --> setInteriorRenderMode(1);
This setting displays the outlines of interior polyhedrons (brushes). This might be useful for evaluating placement on the terrain, matching placement of different interiors, etc.
Show Detail Polys --> setInteriorRenderMode(2);
All brushes that were categorized as members of the Detail class in your map editor will show up as Red; otherwise, the brushes will be displayed white. For a lengthier discussion on Detail brushes, please see this link on optimizing framerate.
Show Ambiguous Polys --> setInteriorRenderMode(3);
Ambiguous planes appear to occur when two brushes share plane descriptions that have different texture parameters. If the texture parameters were the same, the compiler (map2dif) will attempt to "disambiguate" and remove one redundant plane description; if not, the brush is marked as ambiguous. Ambiguous planes are displayed Green; otherwise white.
Show Orphaned Polys --> setInteriorRenderMode(4);
Orphaned polys occur when a plane description has no winding (essentially it doesn't exist). These can occur in certain editors that don't control for broken polys during the editing process. Orphaned polys are displayed Blue; otherwise white.
Show Lightmaps --> setInteriorRenderMode(5);
This mode is useful for checking where shadows are falling on surfaces. The surfaces are not displayed with the texture.
Show Only Textures --> setInteriorRenderMode(6);
Mode 6 displays only the textures (without the lightmaps). This mode is useful for capturing new textures of entire walls.
Show Portal Zones --> setInteriorRenderMode(7);
The images above have no interior (even though they are classified as interiors)--so there are no portals. However, when structures have interior spaces (you can go inside), then portal brushes provide some display optimization. Since portals are invisible in-world, mode 7 provides the tool to see where they are located. Portal zones are displayed with various colors.
Show Ambient lit Surfaces --> setInteriorRenderMode(8);
All surfaces that are affected by ambient lighting are displayed in Red.
Show Collision Fans --> setInteriorRenderMode(9);
The collision surfaces of interiors are denoted by red tick marks at the vertices.
Show Triangle Strips --> setInteriorRenderMode(10);
Each brush surface is broken into triangles during the compile process. Mode 10 displays the triangles with various alternating colors so the triangles are easily visible.
Show Null Surfaces --> setInteriorRenderMode(11);
Null surfaces are brush planes that were textured with the NULL texture (see the link above). This mode helps find surfaces that were perhaps accidentally textured as NULL; these will be displayed as Red as shown in the image below; otherwise the textures are normal.
Show Large Textures --> setInteriorRenderMode(12);
This is one of the more useful modes when trying to optimize the final world for release. Sometimes mappers are tempted to use very high-resolution images; this is only a problem when there are a lot of them. Mode 12 helps locate where high-resolution textures are being used and perhaps make decisions about how critical they are. The list below shows the colors the textures are tinted based on size:
- Blue if 256x256
- Green if 256x512 or 512x256
- Red if 512x512
- Otherwise gray
The images below shows different texture sizes that were used on different Levels-of-Detail for the same interior:
Show Hull Surfaces --> setInteriorRenderMode(13);
Similar to triangle strip display, this mode displays the each brush surface in various colors.
Show Vehicle Hull Surfaces --> setInteriorRenderMode(14);
Similar to Hull surfaces; various colors are used.
Show vertex colors --> setInteriorRenderMode(15);
Not functioning correctly at this time
Show detail level --> setInteriorRenderMode(16);
Ok, we saved the best for last: mode 16 is perhaps the most useful of the interiorRenderMode settings. When activated, the current detail level state is displayed in colors based on the list below. This makes is a lot easier to determine the best min_pixels settings in the map editor.
- Level_0: white
- Level_1: blue
- Level_2: green
- Level_3: red
- Level_4: yellow
- Level_5: violet
- Level_6: cyan
- Level_7: gray
- Level_8: blue-gray
- Level_9: green-gray
The images below show the changing detail levels for a group of interiors in sequence as we move our position farther away.
That's it for the interiorRenderMode settings. As I said at the beginning, the mapper can use set these modes from the console or can take advantage of a Utility Menu Gui recently posted by myself and Richard O'Brien: http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=2565. However you choose, these are essential tools for producing efficient, optimized maps for Torque interiors. Enjoy.
|