Mesh tools

<< Click to Display Table of Contents >>

Navigation:  Simplygon API 7.1 User guide >

Mesh tools

The Simplygon API offers a set of mesh tools and utilities useful for other tasks than reduction and remeshing.

 

IChartAggregator

The chart aggregator creates a new UV layout for a mesh, where UV charts from the original mesh are reused. The tool is executed by a call to the Parameterize method, for an example see the chart aggregator example.

 

IMaterialReplacer

Tool for replacing similar materials. The tool will replace materials with other materials that gives the least visual error, cutting down draw calls. An example is given in the material replacer example.

 

IGeometryTangentCalculator

The tangent calculator tool can be used to calculate and populate a valid tangent and bitangent field for a given input geometry using one of several computation methods. Given a texture coordinate set, it populates the corresponding Tangent and Bitangent fields with data, i.e. if texture coordinate set 2 is used, the fields Tangents2 and Bitangents2 are calculated.

 

IGeometryValidator

The IGeometryValidator checks if a geometry is valid, e.g. consistent indices, number of triangles etc. It is executed by a call to the ValidateGeometry method. After a validation has been run, the results are stored in the variables ErrorValue and ErrorString, which can both be fetched from the geometry validator object.

 

INormalRepairer

The INormalRepairer repairs normals on a mesh, typically after processing, and is executed using the RunProcessing method. This tool can also be used to calculate new normals on a mesh that lacks them.

 

IParameterizer

The parametrizer creates a new UV space mapping for a mesh, where texture coordinates are unique per vertex. This is useful e.g. when preparing for light map baking, where no parts of the geometry should share UV space. The tool is executed by a call to the Parameterize method, for an example see the parameterizer example.

 

IPartRemover

The IPartRemover tool can identify unconnected sub-meshes, and remove meshes that fall below a given size threshold. This size threshold can be set globally for the entire geometry, or per-material to be able to remove things like decals effectively. An example is given in the material part remover example.

 

ISceneValidator

The ISceneValidator checks if the data stored in a scene is correctly formatted for use by Simplygon. It is executed by a call to the ValidateScene method. After a validation has been run, the results are stored in the ErrorValue and ErrorString variables, which can be fetched from the scene validator object.

 

ISurfaceMapper

ISurfaceMapper creates a mapping image between two user-defined geometries. This mapping image can be used to cast materials from the source material to the destination material.

So for instance if you would have a mesh of a planet with lots of geometric details on the surface, you can set a similiar sized simple spherical mesh as your destination geometry. You can then cast the original materials to the sphere, and the geometric details will be baked to a normal map on the sphere, using the different IMaterialCaster classes.

The mapper basically looks for the source geometry in the inverse normal direction from the outwardly offset destination geometry, and maps pixels accordingly. This means that you can modify the normals of the destination geometry to adjust the search direction to your liking.

For more info, please look at the surface mapping example.

 

Mapping image settings

This is the same settings as in the reducer, please see the appropriate section for more information.

 

IVertexColorBaker

IVertexColorBaker bakes a specific channel of a material into a color field, stored per triangle corner. This can be useful e.g. for coarse LODs where resolution permits color by vertex instead of texture without visible loss of quality. An example is given in the vertex color baking example.

 

IWelder

Tool for welding geometry vertices that are closer to each other than a given threshold.