Please note that Thread is a WIPIntroduction
This is a simple tutorial that goes over the problem that sometimes arises when making a model for a game such as FS2. To start off, we'll go over a few definitions so that you'll know some terminology:
What is a Manifold Mesh?
A manifold mesh
is essentially just a normal 3D model that is mesh or poly based. To my knowledge, patchs and NURBS based objects are not considered as a manifold mesh.
There are three types of manifold meshes that should be known: closed-
, and non-
manifold meshes.What is a Closed-Manifold Mesh?
A closed-manifold mesh
has all of its edges sided by exactly
2 faces.What is an Open-Manifold Mesh?
An open-manifold mesh has at least 1 edge that has only 1 face attached.What is a Non-Manifold Mesh?
A non-manifold mesh
has at least 1 edge that has more than 2 faces attached.Open-
manifold meshes can have a significantly less Tri and Vertix count than closed meshes, but cannot be used in games such as FS2. This is because FS2 uses the mesh for collision detection of craft and weapon ordinance, as well as calculating the objects "mass." This latter calculation absolutely requires closed-meshes... and may be imagined as filling the inside of the mesh with "mass" just like you would fill up a bucket with water.
Luckily, there is a procedure available for 3DS Max users that allows the modeler to stitch up and close the open mesh.
Finding the Open- and Non-Manifold Errors
- Select your object and convert it into an Editable Poly.
Right-click in one of the veiwports to open up the Quad-Menu, and then select "Convert to Editable Poly"
Convert to Editable Poly
- Apply the STL Modifier.
Left-click the "Modifier List" drop-down box located on the right-hand tool pane to open up the modifier list. Scroll down and search for "STL_Check" in the listing.
Note: If it does not appear, or you cannot find it, you may have to update your version of 3DS Max or look for a plugin online.
Apply the STL Check Modifier
- Setup the Modifier Parameters.
On the right-hand tool pane, the "Parameters" rollout for the STL Check modifier should be seen.
Punch the "Select Edges"
Un-check the "Change Mat-ID" checkbox.
Check the "Check" checkbox.
Edges that have some sort of open- or non-manifold mesh quality to them will be highlighted.
Types of Errors and How to Fix Them
There are four types of errors that the STL Check can find:
- Open Edge
These are edges that have only 1 face attached to them. Most common error.
Open Edges are typically solved by selecting "Border" on the Editable Poly and then "capping" them.
Cap the Gap
There are sometimes, however, edges that are flagged as errors when polygons skip one or more verticies on one edge. These are nearly impossible to spot visually, and can only be found by using the STL Check modifier.
To solve these errors, you must delete the polygon that common to the entire highlighted edge or edges, delete it, and then cap the gap.
Red Highlighted edges are "open," as determined by the STL Check
The front polygon has been deleted, exposing a new border
Cap the Gap
Sucess! The top edge is no longer an error
- Double Faces
These are faces that "overlap" one or more other faces.
During the conversion to Editable Poly, 3DS Max tries to get rid of the double faces (or Tri's) when it re-triangulates the Polygons as set by the Editable Mesh edge visibility. If the double-faces have at least one invisible edge, then they will be merged into a polygon.
If faces still overlap, then the modeler must delete one or more of the overlapping polygons and cap the resulting border created by the deleted polygons.
These are faces that only share 1 edge with the main object.
By default, Editable Poly's automatically separate spike's into a separate "element." therefore, you will most likely pick up on Spike errors as "Open Edge" errors instead.
If the modeler wants to keep the spikes, then they will have to experiment to find a good solution, such as replacing the spike with a pyramid.
- Multiple Edges
These are edges that "overlap" one or more other edges.
They more than often occur in Editable Mesh objects, but are virtually eliminated by Editable Poly objects.
The Editable Poly type object is an insanely useful tool for gaming, especially when dealing with objects that have already been UVW mapped. They are also very useful in optimization, and, as this tutorial showed, invaluable in repairing non- and open-manifold meshes.
Remember to check your UVW mapping once you have done your modifications. There are some times when the UVW is changed during your operations.
Addendum: Reducing the Rendering Load Caused by the Addition of Unseen Faces
In many instances, there will be faces that will never be seen by the players on closed-manifold meshes. This poses an interesting problem efficiency wise, because the faces will still have a texture applied to them.
Luckily, for FS2 there is a special default texture known as "invisible.tga"
This texture is a unique stock texture that is 10x10 and has an alpha value of 255, but most importantly it has a significantly lower memory usage.
The solution then should become readily apparent: simply select all faces that will not be seen by the player, and apply the invisible.tga texture to them.
As a modeling aide in 3DS, you can "hide" the diffuse map (invisible.tga) in the maps rollout of the material editor, and use the "Self Illumination" and "Opacity" settings to make the invisible areas visible. Don't worry, when you export your model, the map will still be applied to the faces.
Additionally, there are some faces drawn between very close together points, such as a scaled down cap on a cylinder to represent a point. The STL Check modifier will not
detect these. You can, however, easily weld together any vertix that's within a specified distance to another vertix by first selecting all verticies and then performing a "Weld within threshold" command.
Example of a 0m2
surface. The cone on the right is really a cylinder with the top face scaled way down.
Select all verticies of the object in question, and then press the "Settings" button near the "Weld" command either in the quad-menu (right click) or on the sidebar.
Finally, press the up arrow (highlighted) until the "After" vertix count is lower than the "Before."
You can rotate and pan around in your veiwport while this dialog is open, which is useful to check for any possible distortion that might have occurred. If there is distortion, then you must either reduce your threshold or reduce your vertix selection to only the corners.
References:STL Check ModifierFixing Non-Manifold Meshes (Video)Wikipedia: Manifold (technical definitions)