# class
ChartAggregator
Computes new texture coordinates for a geometry with overlapping UV charts.
# Properties
Property | Description |
---|---|
AutomaticTextureSizeMultiplier | A texture dimension length multiplier for the automatic texture size. |
ChartAggregatorMode | Determines which method to use when aggregating the UVs. TextureSizeProportions: Aggregated UV charts will be scaled to keep their relative pixel density relative to all other UV charts. The user can still set the size of the output texture maps. SurfaceArea: Aggregated UV charts will have their size set based on its actual geometrical size. OriginalPixelDensity: The combined atlas will be resized to fit each chart so that all charts retain the same amount of pixels as they originally had. This will override any manually set texture size. UVSizeProportions: Aggregated UV charts will have their size set based on its original UV size, disregarding the size of the texture they are used in. |
ExpandZeroAreaUVs | If ExpandZeroAreaUVs is enabled then triangles that have zero area will be slightly expanded. |
ForcePower2Texture | If UseAutomaticTextureSize is enabled, then force the texture sizes to be a power of 2. |
GutterSpace | The minimum number of pixels between charts. |
InputMaterialCount | The number of input materials used in the original geometry for mapping to multiple output materials. This needs to be set before you can set any specific in-out material mapping. 0 signifies that no in-out material mapping is used, ie. the process will produce one resulting mapping image. |
LockUVRotation | If LockUVRotation is enabled, only the original UV rotation will be used. Otherwise 4 rotations are used (90 degree rotations). |
OriginalChartProportionsChannel | Set OriginalChartProportionsChannel to an SG_MATERIAL_CHANNEL_[...]. This channel determines which texture channel to look at when determining which chart sizes to keep. |
OutputMaterialCount | The number of output mapping images that are to be generated. The triangle field OutputMaterialIds also needs to be set, or the material IDs of the original geometry needs to be set to a specific output material in this setting object. |
SurfaceAreaScale | If multiple UV charts overlap and have the same material, SurfaceAreaScale specifies which of those instances determines the the output scale. It is only valid when the ChartAggregatorMode is SurfaceArea and SeparateOverlappingCharts is false. |
TexCoordLevel | Which TexCoord level to get charts from during re-parameterization. If a TexCoordName is set, it will override the TexCoordLevel. |
TexCoordName | Which TexCoord name to get charts from during re-parameterization. |
TextureHeight | The height of the texture to use. |
TextureWidth | The width of the texture to use. |
UseAutomaticTextureSize | The automatic_texture_size flag. If true, then texture sizes will be computed for the reduced mesh depending on its pixel size on screen. |
UseVertexWeights | The UseVertexWeights flag to scale the charts according to their vertex weights. |
# Methods
Method | Description |
---|---|
GetClass | Get the name of the ChartAggregator class. |
GetGutterSpaceForMaterialIndex | The minimum number of pixels between charts. |
GetInputOutputMaterialMapping | The previously set material mapping for mat_id. |
GetKeepOriginalChartSizesTextureHeight | If KeepOriginalChartSizes is enabled: calling GetKeepOriginalChartSizesTextureWidth and GetKeepOriginalChartSizesTextureHeight after parameterization will return the final texture sizes. |
GetKeepOriginalChartSizesTextureHeightForMaterialIndex | If KeepOriginalChartSizes is enabled: calling GetKeepOriginalChartSizesTextureWidth and GetKeepOriginalChartSizesTextureHeight after parameterization will return the final texture sizes. |
GetKeepOriginalChartSizesTextureWidth | If KeepOriginalChartSizes is enabled: calling GetKeepOriginalChartSizesTextureWidth and GetKeepOriginalChartSizesTextureHeight after parameterization will return the final texture sizes. |
GetKeepOriginalChartSizesTextureWidthForMaterialIndex | If KeepOriginalChartSizes is enabled: calling GetKeepOriginalChartSizesTextureWidth and GetKeepOriginalChartSizesTextureHeight after parameterization will return the final texture sizes. |
GetTextureHeightForMaterialIndex | The height of the texture to use. |
GetTextureWidthForMaterialIndex | The width of the texture to use. |
IsA | Returns true if ChartAggregator is a or is a descendant of the class named as the type parameter. |
IsNull | Returns true if the ChartAggregator object is invalid. |
Parameterize | Executes the parameterization of the geometry. |
SetGutterSpaceForMaterialIndex | The minimum number of pixels between charts. |
SetInputOutputMaterialMapping | The material mapping for InMaterialId, meaning what material of the generated LOD InMaterialId will be baked into. Both InputMaterialCount and OutputMaterialCount need to be set for this mapping to work, and all original materials need to be mapped to an existing output id. |
SetMaterialTable | The scene material table. |
SetSeparateOverlappingCharts | The Separate Overlapping Charts flag. If charts are overlapping in the original texture coords, they will be separated. |
SetTextureHeightForMaterialIndex | The height of the texture to use. |
SetTextureTable | The scene texture table. |
SetTextureWidthForMaterialIndex | The width of the texture to use. |
# Static methods
Method | Description |
---|---|
IsClassA | Returns true if the class is a or is a descendant of the class named as the type parameter. |
SafeCast | SafeCast makes sure the input object is of a class that can be cast into spChartAggregator, and if this is the case, returns the object cast into spChartAggregator. |
# Properties details
# AutomaticTextureSizeMultiplier
A texture dimension length multiplier for the automatic texture size.
# ChartAggregatorMode
Determines which method to use when aggregating the UVs. TextureSizeProportions: Aggregated UV charts will be scaled to keep their relative pixel density relative to all other UV charts. The user can still set the size of the output texture maps. SurfaceArea: Aggregated UV charts will have their size set based on its actual geometrical size. OriginalPixelDensity: The combined atlas will be resized to fit each chart so that all charts retain the same amount of pixels as they originally had. This will override any manually set texture size. UVSizeProportions: Aggregated UV charts will have their size set based on its original UV size, disregarding the size of the texture they are used in.
# Syntax
// Setter
void SetChartAggregatorMode( Simplygon::EChartAggregatorMode value );
// Getter
Simplygon::EChartAggregatorMode GetChartAggregatorMode();
# SetChartAggregatorMode parameters
Type | Name | Min | Max | Description |
---|---|---|---|---|
EChartAggregatorMode | value | The ChartAggregatorMode value to use. |
# GetChartAggregatorMode return value
Type: EChartAggregatorMode
Default: TextureSizeProportions
Key | Value | Comment |
---|---|---|
TextureSizeProportions | 0 | Aggregated UV charts will be scaled to keep their relative pixel density relative to all other UV charts. The user can still set the size of the output texture maps. |
SurfaceArea | 1 | Aggregated UV charts will have their size set based on its actual geometrical size. |
OriginalPixelDensity | 2 | The combined atlas will be resized to fit each chart so that all charts retain the same amount of pixels as they originally had. This will override any manually set texture size. |
UVSizeProportions | 3 | Aggregated UV charts will have their size set based on its original UV size, disregarding the size of the texture they are used in. |
# ExpandZeroAreaUVs
If ExpandZeroAreaUVs is enabled then triangles that have zero area will be slightly expanded.
# ForcePower2Texture
If UseAutomaticTextureSize is enabled, then force the texture sizes to be a power of 2.
# GutterSpace
The minimum number of pixels between charts.
# InputMaterialCount
The number of input materials used in the original geometry for mapping to multiple output materials. This needs to be set before you can set any specific in-out material mapping. 0 signifies that no in-out material mapping is used, ie. the process will produce one resulting mapping image.
# LockUVRotation
If LockUVRotation is enabled, only the original UV rotation will be used. Otherwise 4 rotations are used (90 degree rotations).
# OriginalChartProportionsChannel
Set OriginalChartProportionsChannel to an SG_MATERIAL_CHANNEL_[...]. This channel determines which texture channel to look at when determining which chart sizes to keep.
# Syntax
// Setter
void SetOriginalChartProportionsChannel( const char * value );
// Getter
spString GetOriginalChartProportionsChannel();
# SetOriginalChartProportionsChannel parameters
Type | Name | Min | Max | Description |
---|---|---|---|---|
const char * | value | The new OriginalChartProportionsChannel value. |
# GetOriginalChartProportionsChannel return value
Type: spString
# OutputMaterialCount
The number of output mapping images that are to be generated. The triangle field OutputMaterialIds also needs to be set, or the material IDs of the original geometry needs to be set to a specific output material in this setting object.
# Syntax
// Setter
void SetOutputMaterialCount( unsigned int value );
// Getter
unsigned int GetOutputMaterialCount();
# SetOutputMaterialCount parameters
Type | Name | Min | Max | Description |
---|---|---|---|---|
unsigned int | value | 1 | SG_MAXIMUM_CHART_AGGREGATOR_OUTPUT_MATERIAL_COUNT | The number of outputs. |
# GetOutputMaterialCount return value
Type: unsigned int
# SurfaceAreaScale
If multiple UV charts overlap and have the same material, SurfaceAreaScale specifies which of those instances determines the the output scale. It is only valid when the ChartAggregatorMode is SurfaceArea and SeparateOverlappingCharts is false.
# Syntax
// Setter
void SetSurfaceAreaScale( Simplygon::ESurfaceAreaScale value );
// Getter
Simplygon::ESurfaceAreaScale GetSurfaceAreaScale();
# SetSurfaceAreaScale parameters
Type | Name | Min | Max | Description |
---|---|---|---|---|
ESurfaceAreaScale | value | The SurfaceAreaScale value to use. |
# GetSurfaceAreaScale return value
Type: ESurfaceAreaScale
Default: LargestInstance
Key | Value | Comment |
---|---|---|
LargestInstance | 0 | If multiple UV charts overlap and have the same material, the largest instance determines the output scale. It is only valid when the ChartAggregatorMode is SurfaceArea and SeparateOverlappingCharts is false. |
SmallestInstance | 1 | If multiple UV charts overlap and have the same material, the smallest instance determines the output scale. It is only valid when the ChartAggregatorMode is SurfaceArea and SeparateOverlappingCharts is false. |
Average | 2 | If multiple UV charts overlap and have the same material, the average of all the instances determine the output scale. It is only valid when the ChartAggregatorMode is SurfaceArea and SeparateOverlappingCharts is false. |
# TexCoordLevel
Which TexCoord level to get charts from during re-parameterization. If a TexCoordName is set, it will override the TexCoordLevel.
# TexCoordName
Which TexCoord name to get charts from during re-parameterization.
# TextureHeight
The height of the texture to use.
# TextureWidth
The width of the texture to use.
# UseAutomaticTextureSize
The automatic_texture_size flag. If true, then texture sizes will be computed for the reduced mesh depending on its pixel size on screen.
# UseVertexWeights
The UseVertexWeights flag to scale the charts according to their vertex weights.
# Methods details
# GetClass
Get the name of the ChartAggregator class.
# GetGutterSpaceForMaterialIndex
The minimum number of pixels between charts.
# GetInputOutputMaterialMapping
The previously set material mapping for mat_id.
# GetKeepOriginalChartSizesTextureHeight
If KeepOriginalChartSizes is enabled: calling GetKeepOriginalChartSizesTextureWidth and GetKeepOriginalChartSizesTextureHeight after parameterization will return the final texture sizes.
# GetKeepOriginalChartSizesTextureHeightForMaterialIndex
If KeepOriginalChartSizes is enabled: calling GetKeepOriginalChartSizesTextureWidth and GetKeepOriginalChartSizesTextureHeight after parameterization will return the final texture sizes.
# GetKeepOriginalChartSizesTextureWidth
If KeepOriginalChartSizes is enabled: calling GetKeepOriginalChartSizesTextureWidth and GetKeepOriginalChartSizesTextureHeight after parameterization will return the final texture sizes.
# GetKeepOriginalChartSizesTextureWidthForMaterialIndex
If KeepOriginalChartSizes is enabled: calling GetKeepOriginalChartSizesTextureWidth and GetKeepOriginalChartSizesTextureHeight after parameterization will return the final texture sizes.
# GetTextureHeightForMaterialIndex
The height of the texture to use.
# GetTextureWidthForMaterialIndex
The width of the texture to use.
# IsA
Returns true if ChartAggregator is a or is a descendant of the class named as the type parameter.
# IsNull
Returns true if the ChartAggregator object is invalid.
# Parameterize
Executes the parameterization of the geometry.
# Syntax
bool Parameterize( spGeometryData geom , spRealArray arr );
# Parameters
Type | Name | Min | Max | Description |
---|---|---|---|---|
GeometryData | geom | The geometry which is to be parameterized. | ||
RealArray | arr | The array where the result is stored. |
# Return value
Type: bool
# SetGutterSpaceForMaterialIndex
The minimum number of pixels between charts.
# SetInputOutputMaterialMapping
The material mapping for InMaterialId, meaning what material of the generated LOD InMaterialId will be baked into. Both InputMaterialCount and OutputMaterialCount need to be set for this mapping to work, and all original materials need to be mapped to an existing output id.
# SetMaterialTable
The scene material table.
# Syntax
void SetMaterialTable( spMaterialTable value );
# Parameters
Type | Name | Min | Max | Description |
---|---|---|---|---|
MaterialTable | value | The scene material table. |
# SetSeparateOverlappingCharts
The Separate Overlapping Charts flag. If charts are overlapping in the original texture coords, they will be separated.
# SetTextureHeightForMaterialIndex
The height of the texture to use.
# SetTextureTable
The scene texture table.
# Syntax
void SetTextureTable( spTextureTable value );
# Parameters
Type | Name | Min | Max | Description |
---|---|---|---|---|
TextureTable | value | The scene texture table. |
# SetTextureWidthForMaterialIndex
The width of the texture to use.
# Static methods details
# IsClassA
Returns true if the class is a or is a descendant of the class named as the type parameter.
# SafeCast
SafeCast makes sure the input object is of a class that can be cast into spChartAggregator, and if this is the case, returns the object cast into spChartAggregator.