# 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.

# Syntax

// Setter
void SetAutomaticTextureSizeMultiplier( real value );

// Getter
real GetAutomaticTextureSizeMultiplier();

# SetAutomaticTextureSizeMultiplier parameters

Type Name Min Max Description
real value The desired multiplier.

# GetAutomaticTextureSizeMultiplier return value

Type: real

# 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.

# Syntax

// Setter
void SetExpandZeroAreaUVs( bool value );

// Getter
bool GetExpandZeroAreaUVs();

# SetExpandZeroAreaUVs parameters

Type Name Min Max Description
bool value The new ExpandZeroAreaUVs.

# GetExpandZeroAreaUVs return value

Type: bool

# ForcePower2Texture

If UseAutomaticTextureSize is enabled, then force the texture sizes to be a power of 2.

# Syntax

// Setter
void SetForcePower2Texture( bool value );

// Getter
bool GetForcePower2Texture();

# SetForcePower2Texture parameters

Type Name Min Max Description
bool value The desired flag.

# GetForcePower2Texture return value

Type: bool

# GutterSpace

The minimum number of pixels between charts.

# Syntax

// Setter
void SetGutterSpace( unsigned int value );

// Getter
unsigned int GetGutterSpace();

# SetGutterSpace parameters

Type Name Min Max Description
unsigned int value The value to which GutterSpace will be set.

# GetGutterSpace return value

Type: unsigned int

# 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.

# Syntax

// Setter
void SetInputMaterialCount( unsigned int value );

// Getter
unsigned int GetInputMaterialCount();

# SetInputMaterialCount parameters

Type Name Min Max Description
unsigned int value The number of outputs.

# GetInputMaterialCount return value

Type: unsigned int

# LockUVRotation

If LockUVRotation is enabled, only the original UV rotation will be used. Otherwise 4 rotations are used (90 degree rotations).

# Syntax

// Setter
void SetLockUVRotation( bool value );

// Getter
bool GetLockUVRotation();

# SetLockUVRotation parameters

Type Name Min Max Description
bool value The new LockUVRotation.

# GetLockUVRotation return value

Type: bool

# 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.

# Syntax

// Setter
void SetTexCoordLevel( unsigned int value );

// Getter
unsigned int GetTexCoordLevel();

# SetTexCoordLevel parameters

Type Name Min Max Description
unsigned int value The level/id of the TexCoord to use (i.e. 0-255).

# GetTexCoordLevel return value

Type: unsigned int

# TexCoordName

Which TexCoord name to get charts from during re-parameterization.

# Syntax

// Setter
void SetTexCoordName( const char * value );

// Getter
spString GetTexCoordName();

# SetTexCoordName parameters

Type Name Min Max Description
const char * value The name of the TexCoord to use (i.e. 'TexCoord0'-'TexCoord255').

# GetTexCoordName return value

Type: spString

# TextureHeight

The height of the texture to use.

# Syntax

// Setter
void SetTextureHeight( unsigned int value );

// Getter
unsigned int GetTextureHeight();

# SetTextureHeight parameters

Type Name Min Max Description
unsigned int value The texture height.

# GetTextureHeight return value

Type: unsigned int

# TextureWidth

The width of the texture to use.

# Syntax

// Setter
void SetTextureWidth( unsigned int value );

// Getter
unsigned int GetTextureWidth();

# SetTextureWidth parameters

Type Name Min Max Description
unsigned int value The texture width.

# GetTextureWidth return value

Type: unsigned int

# 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.

# Syntax

// Setter
void SetUseAutomaticTextureSize( bool value );

// Getter
bool GetUseAutomaticTextureSize();

# SetUseAutomaticTextureSize parameters

Type Name Min Max Description
bool value The desired flag.

# GetUseAutomaticTextureSize return value

Type: bool

# UseVertexWeights

The UseVertexWeights flag to scale the charts according to their vertex weights.

# Syntax

// Setter
void SetUseVertexWeights( bool value );

// Getter
bool GetUseVertexWeights();

# SetUseVertexWeights parameters

Type Name Min Max Description
bool value The desired flag value.

# GetUseVertexWeights return value

Type: bool

# Methods details

# GetClass

Get the name of the ChartAggregator class.

# Syntax

spString GetClass();

# Parameters

GetClass takes no parameters.

# Return value

Type: spString

# GetGutterSpaceForMaterialIndex

The minimum number of pixels between charts.

# Syntax

unsigned int GetGutterSpaceForMaterialIndex( unsigned int id );

# Parameters

Type Name Min Max Description
unsigned int id The output material ID.

# Return value

Type: unsigned int

# GetInputOutputMaterialMapping

The previously set material mapping for mat_id.

# Syntax

int GetInputOutputMaterialMapping( unsigned int InMaterialId );

# Parameters

Type Name Min Max Description
unsigned int InMaterialId The input material ID.

# Return value

Type: int

# GetKeepOriginalChartSizesTextureHeight

If KeepOriginalChartSizes is enabled: calling GetKeepOriginalChartSizesTextureWidth and GetKeepOriginalChartSizesTextureHeight after parameterization will return the final texture sizes.

# Syntax

unsigned int GetKeepOriginalChartSizesTextureHeight();

# Parameters

GetKeepOriginalChartSizesTextureHeight takes no parameters.

# Return value

Type: unsigned int

# GetKeepOriginalChartSizesTextureHeightForMaterialIndex

If KeepOriginalChartSizes is enabled: calling GetKeepOriginalChartSizesTextureWidth and GetKeepOriginalChartSizesTextureHeight after parameterization will return the final texture sizes.

# Syntax

unsigned int GetKeepOriginalChartSizesTextureHeightForMaterialIndex( unsigned int OutputID );

# Parameters

Type Name Min Max Description
unsigned int OutputID The output id.

# Return value

Type: unsigned int

# GetKeepOriginalChartSizesTextureWidth

If KeepOriginalChartSizes is enabled: calling GetKeepOriginalChartSizesTextureWidth and GetKeepOriginalChartSizesTextureHeight after parameterization will return the final texture sizes.

# Syntax

unsigned int GetKeepOriginalChartSizesTextureWidth();

# Parameters

GetKeepOriginalChartSizesTextureWidth takes no parameters.

# Return value

Type: unsigned int

# GetKeepOriginalChartSizesTextureWidthForMaterialIndex

If KeepOriginalChartSizes is enabled: calling GetKeepOriginalChartSizesTextureWidth and GetKeepOriginalChartSizesTextureHeight after parameterization will return the final texture sizes.

# Syntax

unsigned int GetKeepOriginalChartSizesTextureWidthForMaterialIndex( unsigned int OutputID );

# Parameters

Type Name Min Max Description
unsigned int OutputID The output id.

# Return value

Type: unsigned int

# GetTextureHeightForMaterialIndex

The height of the texture to use.

# Syntax

unsigned int GetTextureHeightForMaterialIndex( unsigned int id );

# Parameters

Type Name Min Max Description
unsigned int id The output material ID.

# Return value

Type: unsigned int

# GetTextureWidthForMaterialIndex

The width of the texture to use.

# Syntax

unsigned int GetTextureWidthForMaterialIndex( unsigned int id );

# Parameters

Type Name Min Max Description
unsigned int id The output material ID.

# Return value

Type: unsigned int

# IsA

Returns true if ChartAggregator is a or is a descendant of the class named as the type parameter.

# Syntax

bool IsA( const char * type );

# Parameters

Type Name Min Max Description
const char * type Name of the class to check if ChartAggregator is, or is a descendant of.

# Return value

Type: bool

# IsNull

Returns true if the ChartAggregator object is invalid.

# Syntax

bool IsNull();

# Parameters

IsNull takes no parameters.

# Return value

Type: bool

# 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.

# Syntax

void SetGutterSpaceForMaterialIndex( unsigned int id , unsigned int value );

# Parameters

Type Name Min Max Description
unsigned int id The output material ID.
unsigned int value The value to which GutterSpace will be set.

# 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.

# Syntax

void SetInputOutputMaterialMapping( unsigned int InMaterialId , int OutMaterialId );

# Parameters

Type Name Min Max Description
unsigned int InMaterialId The input material ID.
int OutMaterialId The output material 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.

# Syntax

void SetSeparateOverlappingCharts( bool value );

# Parameters

Type Name Min Max Description
bool value The desired flag value.

# SetTextureHeightForMaterialIndex

The height of the texture to use.

# Syntax

void SetTextureHeightForMaterialIndex( unsigned int id , unsigned int value );

# Parameters

Type Name Min Max Description
unsigned int id The output material ID.
unsigned int value The texture height.

# 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.

# Syntax

void SetTextureWidthForMaterialIndex( unsigned int id , unsigned int value );

# Parameters

Type Name Min Max Description
unsigned int id The output material ID.
unsigned int value The texture width.

# Static methods details

# IsClassA

Returns true if the class is a or is a descendant of the class named as the type parameter.

# Syntax

static bool IsClassA( const char * type );

# Parameters

Type Name Min Max Description
const char * type Name of the class to check if the class is, or is a descendant of.

# Return value

Type: bool

# 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.

# Syntax

static spChartAggregator SafeCast( spObject object );

# Parameters

Type Name Min Max Description
Object object Object to cast.

# Return value

Type: ChartAggregator