- Asset has no Crytek Shader assigned
- Multiple assets get exported as one big single mesh instead of separate ones
- 3DS Max crashes instantly during export
- More than two triangles share an edge
- Bloated .cgf file size
- Degenerate Faces & Invalid Tangent-Matrix error
- How to fix Degenerate Faces & Invalid Tangent-Matrix error
Asset has no Crytek Shader assigned
If you get the error "The following material is not set to the Crytek Shader: Face, it means that some faces or objects in your scene have no Crytek shader assigned. To fix that select the object or faces and in the Material Editor change the Shader Type to "Crytek Shader".
Multiple assets get exported as one big single mesh instead of separate ones
You have multiple assets in your scene, after exporting it out of 3DS Max and importing it in Cryengine3, you see all the assets with one node and only as one file.
To solve that you need to make sure that the checkbox "Export File per Node" is checked since if not it will export multiple dummy nodes as one file (example if you have different pieces of a building you exported came into the Cryengine3 as one).
3DS Max crashes instantly during export
If you export your asset and 3DS Max crashes instantly, one of the main reasons could be that the LODs have been linked under the dummy node.
To fix that, link the LODs under the main mesh node.
More than two triangles share an edge
When you get an error during export in the CRYENGINE Exporter window, stating: "Failed to compile geometry in node......- More than two triangles share an edge" it means that you might have double faces attached to each other or two faces who are attached sharing the same edge but the vertices are not welded.
To fix that go to the modifier tab click on it, scroll down and select "STL check".
Once the STL modifier is activated it will highlight those faces in red where then it can be fixed.
Bloated .cgf file size
If you export your asset out of 3DS Max and the .cgf file size is very high, the first thing you should check if in the scene vertex animation is turned on. If it is please uncheck the box and export the asset again.
Degenerate Faces & Invalid Tangent-Matrix error
When the exporter and/or editor log reports errors like these:
- [\Warning] Invalid tangent-matrix in model: objects/characters/alien/grunt/grunt_body.chr; tangent and binormal are parallel, vertex 2663 of 3545, position x=0.000000;y=-0.055068;z=1.489441
- Tangent Space Generation failed!
It is most likely related to so called "degenerate faces".
Degenerated faces are triangles where all edges lie on each other, so that the triangle has no face area:
For these triangles no tangent space matrix can be calculated, which is necessary for all shading computations in our engine - normal mapping in particular.
Also meshes with only degenerate triangles will cause problems with texture streaming because the engine cannot calculate its texel-density.
How to fix Degenerate Faces & Invalid Tangent-Matrix error
To solve that problem you need to remove such triangles from your mesh. The tricky part is that they are not always apparent, because they look like a normal edge.
In Max we have the cryMaxTools which is located on the top shelf that tool can find such triangles and mark them.
Select the meshes you would like to check and go on the top shelf click on cryMaxTools and scroll down to ToolBox
A new window will pop up, with the meshes selected, click there on "CryModeling" tab and then "Mark Dengenrated Triangles".
The tool will go through all selected objects, find degenerate triangles and place a point helper on them.
Also the point helper will be linked to the corresponding object and added to a new layer containing only such degenerate triangle markers:
Now you can go through the point helpers one by one and resolve the degenerate triangles - a few examples:
Some more helpful hints
- The boundingbox of a helper node is always as long as the broken face, so you get an idea of what you're looking for.
- There will always be as many helpers as degenerate triangles - having 3 helpers on the same spot, means that there are 3 degenerate triangles!
- Degenerate faces may be part of a polygon - in particular polygons with more than 4 vertices are problematic, because 3dsmax auto triangulates them so pay attention to triangulation:
Unfortunately the script cannot fully capture the behavior of the RC, so the is a small chance that it will not find all the degenerate triangles that the RC finds.