Originally Posted by HEK Tutorial
he creation and placement of portals: The hallways for the 2 base structures (blue base and red base) will be made Exact portal volumes.
Later, when the level is running in the game, use rasterizer_wireframe 1 to view the level and exit and enter the hallways to see how the level geometry and objects are not drawn from the player view as this portal volume is entered and exited.
1) Select the blue base. In Face mode, create 2 polygons that exactly fit the doorways of the hallways.
2) Make sure the normals for the faces point outwards, this will help define the volume between the faces. the normals can be viewed by clicking on the Show Normals check box under Selection. If the normals are not easily visible, the lengths of the visual representations of the normals can be increased using the Scale value.
3) Detach the faces for the Exact portals by clicking on Detach under Edit Geometry. The Detach dialog window will appear.
4) In the Detach as: field enter the name "base portals".
5) Click on OK.
Repeat the above procedures 1-5 for the red base and combine the 8 faces that compose the portals into 1 object called "base portals".
The first image further explains the above procedures.
6) Now select the "base portals" object and apply the "portal materials" Multi/Sub-Object.
Once this is complete, assign the +exactportal material to the faces by selecting all the faces and setting the Material ID to 2 for the faces.
Once this is complete, the "base portals" object should be linked to the "frame".
Note that the portal materials are at 80% opacity, this is just a setting in the Sub-Material and has no effect in game, it is just used as a visual aid in 3ds Max.
The two hallways have now been defined as Exact Portal volumes.
The second image further explains the above procedures and shows the final results of the listed operations.
The level will now be divided using standard Portals.
7) Deselect all objects. Under Create click on Plane.
8) Enter the following values in the listed fields, Length Segs: 1 and Width Segs: 5
9) In the Right view, create the plane such that the edges extreme edges extend past the extents of the level.
Take this plane and create 3 more planes for a total of 4 planes that run lengthwise "North" to "South".
The third image further explains the above procedures and shows the final results of the listed operations.
10) Convert all the planes into an Editable Mesh (Edit Mesh) and Attach all the planes into 1 object called "terrain portals".
11) The planes and faces were all aligned to try and divide the level evenly. Vertices and the associated edges and faces were aligned along major edge boundaries in the level.
The fourth image further explains the above procedures and shows the final results the above procedures.
12) To further subdivide the level into more portals, faces running "West" to "East" were created using the existing vertices and edges for the planes. Only the middle 4 edges and associated vertices were used. In addition, the edges were extended past the level boundaries.
Make sure that the normals are consistent for all the faces, this will determine how the portal volumes are created.
In the example, the faces running "East" to "West" have their normals pointing North, while the faces running "North" to "South" have their normals facing "East".
13) Select all the faces and Clear All the Smoothing Groups and apply Material ID 1 to all the faces to assign the +portal material.
Once the above procedures are completed, link the "terrain portals" object to the reference frame "frame" object.
The level has now been portalled.
The fifth image or last image further explains the above procedures and shows the final results the above procedures.