Skip to content
On this page

class ReductionSettings

Settings for the ReductionProcessor class. Handles all the settings for Simplygons simplification algorithms. The user can tell the reduction processor which features are important by using the 'FeatureFlags' parameter, and also the relative importance of these features using the Set{feature}Importance methods. Also settings for things like symmetry are set here.

Properties

PropertyDescription
AllowDegenerateTexCoordsThe AllowDegenerateTexCoords flag. If true, texture coordinates are allowed to become degenerate (triangles can have 0 area in texture space). This may sometimes look better, but if tangent space normals are used, tangent spaces may become degenerate.
CreateGeomorphGeometryThe CreateGeomorphGeometry value. If set, the reducer will create a GeometryData object that is a morphed version of the original GeometryData, that can be used to morph between the original geometry and the reduced geometry. Should not be used together with TJunctionRemover, NormalRecalculation or Material LOD.
DataCreationPreferencesThe flag that specifies how big "freedom" Simplygon has when it comes to altering vertex/triangle data. Allowing more altered data means it will be easier to create good looking LODs, but without altered data it will be easier to keep the memory-usage in the LOD-chain more optimized. Note: When using OnlyUseOriginalData, the geometry being reduced can not have a node transformation matrix other than the identity matrix.
EdgeSetImportanceThe importance value of user selected edges. Can be used when a Boolean UserCornerField with the name SgEdgeSelectionSet is added to the Geometry. The importance is relative to the values of the other mesh features (or disabling an importance entirely by setting it to 0). A higher number means higher importance. Default is 1.0
GenerateGeomorphDataThe flag for if the reduction process should store geomorph data in the processed GeometryData object. This data is an array with same size as the vertexcount was before the reduction process, and will have the coordinates for each vertex on its corresponding position on the reduced GeometryData surface. Can be used to give smooth transition from a highlevel LOD to a lowlevel LOD. This array can be accessed with the GeometryData custom field "SgMappedVertexCoords".
GeometryImportanceThe importance value of the position of the vertices and triangles of the Geometry, or the silhouette of the Geometry. The importance is relative to the values of the other mesh features (or disabling an importance entirely by setting it to 0). A higher number means higher importance. Default is 1.0
GroupImportanceThe importance value of the boundary between triangles from different sub-geometries. The importance is relative to the values of the other mesh features (or disabling an importance entirely by setting it to 0). A higher number means higher importance. Default is 1.0
InwardMoveMultiplierThe inward move multiplier, how much the mesh is allowed to shrink its silhouette perimeter.
KeepSymmetryThe KeepSymmetry flag. If set, the reducer will detect symmetric features, and retain symmetry during processing. Please note that for a geometry to be considered symmetrical, also the texture coordinates must be mirrored.
KeepUnprocessedSceneMeshesIf false, the processor will remove all geometry and scene meshes which were not selected for processing from the scene. If true, only the geometry in the ProcessSelectionSet will be replaced or updated, while the rest of the scene tree is kept intact. New geometry is always added as the last child of the scene root. If generating a mappingimage to cast materials, new materialIds will also be appended to the end of the old material table instead of replacing the old ones.
LockGeometricBorderIf set, will lock the geometric border of the geometry, and not reduce at all. This setting might be useful if the geometry needs to fit a neighbor geometry, but will reduce overall reduction quality (geometric quality over reduction ratio)
MaterialImportanceThe importance value of the boundary between triangles with different materials. For example, if triangles with a metallic material are connected to triangles with a wood material, this setting will determine how important it is to keep the border between them intact. The importance is relative to the values of the other mesh features (or disabling an importance entirely by setting it to 0). A higher number means higher importance. Default is 1.0
MaxEdgeLengthThe maximum length of the triangles edges after reduction. Can be used to limit output triangle size.
MergeGeometriesThe processor will merge all the geometries in the scene into a single geometry if MergeGeometries is enabled.
NameThe name of the ReductionSettings object. (Inherited from Object)
OutwardMoveMultiplierThe outward move multiplier, how much the mesh is allowed to grow its silhouette perimeter.
PreserveQuadFlagsIf true, the QuadFlags triangle field in the input geometries (used for marking triangle pairs as quads for use in the QuadReductionProcessor) will be maintained in the processing geometries through the triangle reduction process as well as possible. This will cause most polygons involved in collapses performed by the triangle reducer to become triangles. This allows sequential triangle->quad reductions to handle mixed geometries. Setting this to false removes the QuadFlags triangle field entirely, ensuring the output geometry is 100% triangles with no implicit quads.
ProcessSelectionSetIDWhich selection set should be processed. If set to -1, all geometries in the scene will be processed. If both selection set name and ID are set, the name will be used.
ProcessSelectionSetNameWhich selection set should be processed. If the name is not found, all geometries in the scene will be processed. If both selection set name and ID are set, the name will be used.
ReductionHeuristicsThe flag that decides how precise the reducer will be during the mesh reduction. Fast -> Reducer will be faster, but onscreensize and trianglecount will not match perfectly. Consistent -> Reducer will be slower, but onscreensize and trianglecount will consistently give matching results.
ReductionPerformanceModeSet the reduction performance mode. Different performance modes dictates which features are available, and if a feature is enabled which is not compatible with the specified mode, the reducer will emit a warning, and run at a reduced performance. Please see the Concepts subsection of the documentation for which features are available in each mode.
ReductionTargetMaxDeviationThe MaxDeviation value, the maximum surface-deviation between the reduced geometry and the original.
ReductionTargetMaxDeviationEnabledEnable max deviation as a reduction target. The reducer will stop when the set max deviation has been reached.
ReductionTargetOnScreenSizeThe OnScreenSize value, used to calculate the maximum surface-deviation allowed, by assuming errors less than 1 pixel onscreen will not be noticeable.
ReductionTargetOnScreenSizeEnabledEnable on screen size as a reduction target. The reducer will stop when the set on screen size has been reached.
ReductionTargetStopConditionThe stop condition for the reducer. Any -> the reducer will stop when any single one of the set reduction targets have been reached. All -> the reducer will stop when all enabled reduction targets have been reached.
ReductionTargetTriangleCountThe wanted triangle count. The range is 0->inf.
ReductionTargetTriangleCountEnabledEnable triangle count as a reduction target. The reducer will stop when the set triangle count has been reached.
ReductionTargetTriangleRatioThe wanted reduction ratio. The range is 0->1.
ReductionTargetTriangleRatioEnabledEnable triangle ratio as a reduction target. The reducer will stop when the set triangle-ratio has been reached.
ShadingImportanceThe importance value of the vertex-normals of the Geometry, both the sharp edges, as well as how the normals interpolate over the surface of the triangles. The importance is relative to the values of the other mesh features (or disabling an importance entirely by setting it to 0). A higher number means higher importance. Default is 1.0
SkinningImportanceThe importance value of the bone-weights of the vertices. The more impact a vertex has on the skinning of the Geometry (for example, vertices close to joints), the more likely it is to be kept. The importance is relative to the values of the other mesh features (or disabling an importance entirely by setting it to 0). A higher number means higher importance. Default is 1.0
SymmetryAxisSet what axis to be used for symmetry calculations.
SymmetryDetectionToleranceThe tolerance used when detecting symmetry. Values in the ranges 1e-5 to 1e-3 will usually produce good results. This specific tolerance corresponds to the off-plane tolerance, ie. the tolerance of the coordinate components that are not the symmetry axis. The in-plane tolerance is always 10 times the off-plane tolerance. This value is relative to the size of the Geometry, so 0.01 would mean 1% of the bounding box size of the Geometry.
SymmetryOffsetSet SymmetryOffset, the position on the symmetry axis where the symmetry plane is placed.
TextureImportanceThe importance value of the UV coordinates of the Geometry, both the boundary of the UV charts, as well as the UV stretch across the triangles. The importance is relative to the values of the other mesh features (or disabling an importance entirely by setting it to 0). A higher number means higher importance. Default is 1.0
UseAutomaticSymmetryDetectionThe AutomaticSymmetryDetection flag. If set, and KeepSymmetry is on, the reducer will detect any X,Y,Z symmetry plane and will override any user set symmetry plane with the detected one. If no symmetry is found, KeepSymmetry will be turned off before reduction.
UseHighQualityNormalCalculationSet to true and the reducer will do a much more precise way of calculating the vertex normals. It will however be slower. Set to false and it will do a much more rough estimation of what the vertex normals will look like, but faster.
UseSymmetryQuadRetriangulatorThe UseSymmetryQuadRetriangulator flag. If true, and KeepSymmetry is on, any triangles that have been triangulated from symmetrical quads into unsymmetrical triangles are detected and fixed. The edges of said triangles are flipped across the old quad so that the mesh becomes symmetrical again.
VertexColorImportanceThe importance value of the vertex-colors of the Geometry, both the boundary between triangles with different colors, as well as how the colors interpolate over the surface of the triangles. The importance is relative to the values of the other mesh features (or disabling an importance entirely by setting it to 0). A higher number means higher importance. Default is 1.0

Methods

MethodDescription
AddObserverAdds a user-defined observer object to the interface, that will receive events from the interface. (Inherited from Object)
GetBoolParameterGet a named parameter boolean value. (Inherited from SettingsObject)
GetClassGet the name of the ReductionSettings class. (Inherited from Object)
GetDoubleParameterGet a named parameter floating point value. (Inherited from SettingsObject)
GetErrorStringReturns a string describing the error that was found the last time ValidateSettings was performed. (Inherited from SettingsObject)
GetIntParameterGet a named parameter integer value. (Inherited from SettingsObject)
GetStringParameterGet a named parameter string value. (Inherited from SettingsObject)
GetUIntParameterGet a named parameter unsigned integer value. (Inherited from SettingsObject)
IsAReturns true if ReductionSettings is a or is a descendant of the class named as the type parameter. (Inherited from Object)
IsNullReturns true if the ReductionSettings object is invalid. (Inherited from Object)
IsSameObjectAsReturns true if the ReductionSettings object is valid. (Inherited from Object)
NonNullReturns true if the ReductionSettings object is valid. (Inherited from Object)
PrintInfoPrints the content/info of the ReductionSettings object to the log. (Inherited from Object)
RemoveObserverRemoves a previously added observer object. (Inherited from Object)
SetBoolParameterSet a named parameter boolean value. (Inherited from SettingsObject)
SetDoubleParameterSet a named parameter floating point value. (Inherited from SettingsObject)
SetIntParameterSet a named parameter integer value. (Inherited from SettingsObject)
SetReductionTargetsSet reduction targets and stop condition used in the reduction.
SetStringParameterSet a named parameter string value. (Inherited from SettingsObject)
SetUIntParameterSet a named parameter unsigned integer value. (Inherited from SettingsObject)
SetValidateParameterNamesSet if parameter names should be validated or not. Parameters that previously do not exist will generate and error if validation is enabled and be allowed if validation is disabled. (Inherited from SettingsObject)
ToJSONGet settings as JSON for debugging purposes. (Inherited from SettingsObject)
ValidateSettingsValidates the current settings values. (Inherited from SettingsObject)

Static methods

MethodDescription
IsClassAReturns true if the class is a or is a descendant of the class named as the type parameter. (Inherited from Object)
SafeCastSafeCast makes sure the input object is of a class that can be cast into spReductionSettings, and if this is the case, returns the object cast into spReductionSettings. (Inherited from Object)

Properties details

AllowDegenerateTexCoords

The AllowDegenerateTexCoords flag. If true, texture coordinates are allowed to become degenerate (triangles can have 0 area in texture space). This may sometimes look better, but if tangent space normals are used, tangent spaces may become degenerate.

CreateGeomorphGeometry

The CreateGeomorphGeometry value. If set, the reducer will create a GeometryData object that is a morphed version of the original GeometryData, that can be used to morph between the original geometry and the reduced geometry. Should not be used together with TJunctionRemover, NormalRecalculation or Material LOD.

DataCreationPreferences

The flag that specifies how big "freedom" Simplygon has when it comes to altering vertex/triangle data. Allowing more altered data means it will be easier to create good looking LODs, but without altered data it will be easier to keep the memory-usage in the LOD-chain more optimized. Note: When using OnlyUseOriginalData, the geometry being reduced can not have a node transformation matrix other than the identity matrix.

EdgeSetImportance

The importance value of user selected edges. Can be used when a Boolean UserCornerField with the name SgEdgeSelectionSet is added to the Geometry. The importance is relative to the values of the other mesh features (or disabling an importance entirely by setting it to 0). A higher number means higher importance. Default is 1.0

GenerateGeomorphData

The flag for if the reduction process should store geomorph data in the processed GeometryData object. This data is an array with same size as the vertexcount was before the reduction process, and will have the coordinates for each vertex on its corresponding position on the reduced GeometryData surface. Can be used to give smooth transition from a highlevel LOD to a lowlevel LOD. This array can be accessed with the GeometryData custom field "SgMappedVertexCoords".

GeometryImportance

The importance value of the position of the vertices and triangles of the Geometry, or the silhouette of the Geometry. The importance is relative to the values of the other mesh features (or disabling an importance entirely by setting it to 0). A higher number means higher importance. Default is 1.0

GroupImportance

The importance value of the boundary between triangles from different sub-geometries. The importance is relative to the values of the other mesh features (or disabling an importance entirely by setting it to 0). A higher number means higher importance. Default is 1.0

InwardMoveMultiplier

The inward move multiplier, how much the mesh is allowed to shrink its silhouette perimeter.

KeepSymmetry

The KeepSymmetry flag. If set, the reducer will detect symmetric features, and retain symmetry during processing. Please note that for a geometry to be considered symmetrical, also the texture coordinates must be mirrored.

KeepUnprocessedSceneMeshes

If false, the processor will remove all geometry and scene meshes which were not selected for processing from the scene. If true, only the geometry in the ProcessSelectionSet will be replaced or updated, while the rest of the scene tree is kept intact. New geometry is always added as the last child of the scene root. If generating a mappingimage to cast materials, new materialIds will also be appended to the end of the old material table instead of replacing the old ones.

LockGeometricBorder

If set, will lock the geometric border of the geometry, and not reduce at all. This setting might be useful if the geometry needs to fit a neighbor geometry, but will reduce overall reduction quality (geometric quality over reduction ratio)

MaterialImportance

The importance value of the boundary between triangles with different materials. For example, if triangles with a metallic material are connected to triangles with a wood material, this setting will determine how important it is to keep the border between them intact. The importance is relative to the values of the other mesh features (or disabling an importance entirely by setting it to 0). A higher number means higher importance. Default is 1.0

MaxEdgeLength

The maximum length of the triangles edges after reduction. Can be used to limit output triangle size.

MergeGeometries

The processor will merge all the geometries in the scene into a single geometry if MergeGeometries is enabled.

Name

The name of the ReductionSettings object. (Inherited from Object)

OutwardMoveMultiplier

The outward move multiplier, how much the mesh is allowed to grow its silhouette perimeter.

PreserveQuadFlags

If true, the QuadFlags triangle field in the input geometries (used for marking triangle pairs as quads for use in the QuadReductionProcessor) will be maintained in the processing geometries through the triangle reduction process as well as possible. This will cause most polygons involved in collapses performed by the triangle reducer to become triangles. This allows sequential triangle->quad reductions to handle mixed geometries. Setting this to false removes the QuadFlags triangle field entirely, ensuring the output geometry is 100% triangles with no implicit quads.

ProcessSelectionSetID

Which selection set should be processed. If set to -1, all geometries in the scene will be processed. If both selection set name and ID are set, the name will be used.

ProcessSelectionSetName

Which selection set should be processed. If the name is not found, all geometries in the scene will be processed. If both selection set name and ID are set, the name will be used.

ReductionHeuristics

The flag that decides how precise the reducer will be during the mesh reduction. Fast -> Reducer will be faster, but onscreensize and trianglecount will not match perfectly. Consistent -> Reducer will be slower, but onscreensize and trianglecount will consistently give matching results.

ReductionPerformanceMode

Set the reduction performance mode. Different performance modes dictates which features are available, and if a feature is enabled which is not compatible with the specified mode, the reducer will emit a warning, and run at a reduced performance. Please see the Concepts subsection of the documentation for which features are available in each mode.

ReductionTargetMaxDeviation

The MaxDeviation value, the maximum surface-deviation between the reduced geometry and the original.

ReductionTargetMaxDeviationEnabled

Enable max deviation as a reduction target. The reducer will stop when the set max deviation has been reached.

ReductionTargetOnScreenSize

The OnScreenSize value, used to calculate the maximum surface-deviation allowed, by assuming errors less than 1 pixel onscreen will not be noticeable.

ReductionTargetOnScreenSizeEnabled

Enable on screen size as a reduction target. The reducer will stop when the set on screen size has been reached.

ReductionTargetStopCondition

The stop condition for the reducer. Any -> the reducer will stop when any single one of the set reduction targets have been reached. All -> the reducer will stop when all enabled reduction targets have been reached.

ReductionTargetTriangleCount

The wanted triangle count. The range is 0->inf.

ReductionTargetTriangleCountEnabled

Enable triangle count as a reduction target. The reducer will stop when the set triangle count has been reached.

ReductionTargetTriangleRatio

The wanted reduction ratio. The range is 0->1.

ReductionTargetTriangleRatioEnabled

Enable triangle ratio as a reduction target. The reducer will stop when the set triangle-ratio has been reached.

ShadingImportance

The importance value of the vertex-normals of the Geometry, both the sharp edges, as well as how the normals interpolate over the surface of the triangles. The importance is relative to the values of the other mesh features (or disabling an importance entirely by setting it to 0). A higher number means higher importance. Default is 1.0

SkinningImportance

The importance value of the bone-weights of the vertices. The more impact a vertex has on the skinning of the Geometry (for example, vertices close to joints), the more likely it is to be kept. The importance is relative to the values of the other mesh features (or disabling an importance entirely by setting it to 0). A higher number means higher importance. Default is 1.0

SymmetryAxis

Set what axis to be used for symmetry calculations.

SymmetryDetectionTolerance

The tolerance used when detecting symmetry. Values in the ranges 1e-5 to 1e-3 will usually produce good results. This specific tolerance corresponds to the off-plane tolerance, ie. the tolerance of the coordinate components that are not the symmetry axis. The in-plane tolerance is always 10 times the off-plane tolerance. This value is relative to the size of the Geometry, so 0.01 would mean 1% of the bounding box size of the Geometry.

SymmetryOffset

Set SymmetryOffset, the position on the symmetry axis where the symmetry plane is placed.

TextureImportance

The importance value of the UV coordinates of the Geometry, both the boundary of the UV charts, as well as the UV stretch across the triangles. The importance is relative to the values of the other mesh features (or disabling an importance entirely by setting it to 0). A higher number means higher importance. Default is 1.0

UseAutomaticSymmetryDetection

The AutomaticSymmetryDetection flag. If set, and KeepSymmetry is on, the reducer will detect any X,Y,Z symmetry plane and will override any user set symmetry plane with the detected one. If no symmetry is found, KeepSymmetry will be turned off before reduction.

UseHighQualityNormalCalculation

Set to true and the reducer will do a much more precise way of calculating the vertex normals. It will however be slower. Set to false and it will do a much more rough estimation of what the vertex normals will look like, but faster.

UseSymmetryQuadRetriangulator

The UseSymmetryQuadRetriangulator flag. If true, and KeepSymmetry is on, any triangles that have been triangulated from symmetrical quads into unsymmetrical triangles are detected and fixed. The edges of said triangles are flipped across the old quad so that the mesh becomes symmetrical again.

VertexColorImportance

The importance value of the vertex-colors of the Geometry, both the boundary between triangles with different colors, as well as how the colors interpolate over the surface of the triangles. The importance is relative to the values of the other mesh features (or disabling an importance entirely by setting it to 0). A higher number means higher importance. Default is 1.0

Methods details

AddObserver

Adds a user-defined observer object to the interface, that will receive events from the interface. (Inherited from Object)

GetBoolParameter

Get a named parameter boolean value.

GetClass

Get the name of the ReductionSettings class. (Inherited from Object)

GetDoubleParameter

Get a named parameter floating point value.

GetErrorString

Returns a string describing the error that was found the last time ValidateSettings was performed.

GetIntParameter

Get a named parameter integer value.

GetStringParameter

Get a named parameter string value.

GetUIntParameter

Get a named parameter unsigned integer value.

IsA

Returns true if ReductionSettings is a or is a descendant of the class named as the type parameter. (Inherited from Object)

IsNull

Returns true if the ReductionSettings object is invalid. (Inherited from Object)

IsSameObjectAs

Returns true if the ReductionSettings object is valid. (Inherited from Object)

NonNull

Returns true if the ReductionSettings object is valid. (Inherited from Object)

PrintInfo

Prints the content/info of the ReductionSettings object to the log. (Inherited from Object)

RemoveObserver

Removes a previously added observer object. (Inherited from Object)

SetBoolParameter

Set a named parameter boolean value.

SetDoubleParameter

Set a named parameter floating point value.

SetIntParameter

Set a named parameter integer value.

SetReductionTargets

Set reduction targets and stop condition used in the reduction.

SetStringParameter

Set a named parameter string value.

SetUIntParameter

Set a named parameter unsigned integer value.

SetValidateParameterNames

Set if parameter names should be validated or not. Parameters that previously do not exist will generate and error if validation is enabled and be allowed if validation is disabled.

ToJSON

Get settings as JSON for debugging purposes.

ValidateSettings

Validates the current settings values.

Static methods details

IsClassA

Returns true if the class is a or is a descendant of the class named as the type parameter. (Inherited from Object)

SafeCast

SafeCast makes sure the input object is of a class that can be cast into spReductionSettings, and if this is the case, returns the object cast into spReductionSettings. (Inherited from Object)