UvpOperationInputT
An object of this type is used to carry all parameters required by the packer to execute an operation.
Fields
UVP_OPCODE m_Opcode |
An enum value determining the operation type to execute. Go to the Packer operations section for more details. |
Default value: UVP_OPCODE::INVALID |
Required feature code: none |
int m_ThreadCount |
Maximum thread count which will be used by the packer. If set to 0, then the packer will use the total number of cores available in the system. |
Default value: 0 |
Required feature code: none |
UVP_TOPO_ANALYSIS_LEVEL m_TopoAnalysisLevel |
Enum value describing how exact the packer will be when analysing UV topology. Using the default value for this parameter (FORCE_EXTENDED) is always recommended, so the application should not change this value. |
Default value: UVP_TOPO_ANALYSIS_LEVEL::FORCE_EXTENDED |
Required feature code: none |
const char* m_pDeviceId |
A string specifying the packing device which should pack the UV map. This member is only used in the PACK operation. In order to list all packing devices available in the system one needs to run a REPORT_VERSION operation. |
Default value: NULL |
Required feature code: none |
int m_Precision |
A number describing how exact the algorithm will be when performing operations on UV islands. If set to a too low value, overlapping islands may be present after packing is done. |
Default value: 500 |
Required feature code: none |
float m_Margin |
Determines the distance between islands after packing. The margin distance is scaled by a certain factor after packing is done, that is why the margin specified by this parameter is not exactly preserved. |
Default value: 0.003 |
Required feature code: none |
float m_PixelMargin |
Determines the distance between UV islands in pixels of the texture. A margin defined using this parameter is exact (in contrast to the
m_Margin member). This parameter is only used if its value is greater than 0 (in such a case the
m_Margin option is ignored and this parameter is used to determine distance between UV islands). |
Default value: 0.0 |
Required feature code: none |
float m_PixelPadding |
Determines the distance in pixels between UV islands and the packing box border. This option is only used if
m_PixelMargin is enabled. Setting
m_PixelPadding to 0 means the feature will be ignored and pixel padding will be equal to the half of
m_PixelMargin. |
Default value: 0.0 |
Required feature code: none |
int m_PixelMarginTextureSize |
Specifies the size of the texture the packed UV map will be used with. It allows proper application of the
m_PixelMargin/
m_PixelPadding values during the packing process. |
Default value: 1024 |
Required feature code: none |
UVP_PIXEL_MARGIN_METHOD m_PixelMarginMethod |
A method the packer will use to determine the exact pixel margin. |
Default value: UVP_PIXEL_MARGIN_METHOD::ADJUSTMENT_TIME |
Required feature code: none |
int m_PixelMarginAdjustTime |
Time in seconds the packer will spend on determining the exact pixel margin. Time set to 1 second is enough in most cases, increase this parameter only if you don’t get an exact result for the specific UV map. This parameter is only used if
m_PixelMarginMethod is set to ADJUSTMENT_TIME. |
Default value: 1 |
Required feature code: none |
bool m_FixedScale |
When set to true, the packer will not scale islands during packing. If UV islands can’t fit into the packing box, the NO_SPACE code will be returned by the operation. |
Default value: false |
Required feature code: none |
UVP_FIXED_SCALE_STRATEGY m_FixedScaleStrategy |
Determines how islands are packed when
m_FixedScale is set to true. |
Default value: UVP_FIXED_SCALE_STRATEGY::BOTTOM_TOP |
Required feature code: none |
int m_RotationStep |
A rotation step (in degrees) to use when generating island orientations to be considered during the operation. For example when setting
m_RotationStep to 90, the packer will consider 4 orientations of every UV island. If
m_RotationStep is set to 0, then only one orientation will be considered (no rotations will be applied to islands). |
Default value: 90 |
Required feature code: ISLAND_ROTATION |
bool m_IslandRotationStepEnable |
Enables per-island rotation step functionality. |
Default value: false |
Required feature code: ISLAND_ROTATION_STEP |
bool m_PrerotDisable |
Disables the initial rotation of islands before generating other orientations. The pre-rotation operation usually optimizes packing, so this option should only be used if really needed. |
Default value: false |
Required feature code: none |
int m_HeuristicSearchTime |
Specifies a time in seconds for a heuristic search. After timeout is reached the search will finish and the best result will be returned to the application. If the time is set to 0, the packer will perform the search continuously, until the result is applied, either by closing the render window by the user or by calling the
cancel method by the application. If
m_HeuristicSearchTime is set to a value lower than 0, then the functionality will be disabled. |
Default value: -1 |
Required feature code: HEURISTIC_SEARCH |
int m_HeuristicMaxWaitTime |
Maximal time the packer will wait for a better result during a heuristic search. If the heuristic algorithm is not able to find a tighter packing during that time, the operation will be automatically finished and the best result found so far will be returned by the packer. If
m_HeuristicMaxWaitTime is set to 0, then the functionality will be disabled. |
Default value: 0 |
Required feature code: HEURISTIC_SEARCH |
bool m_AdvancedHeuristic |
If set to true, the packer will examine a broader set of solutions during a heuristic search. This method is most useful when packing a limited number of UV islands - in such a case it allows to find a packing of better coverage. Enabling this option is not recommended when packing a UV map consisting of a greater number of islands. |
Default value: false |
Required feature code: ADVANCED_HEURISTIC |
bool m_PackToOthers |
If set to true, the packer will pack selected islands so they do not overlap with unselected islands. This option is used to add new islands (selected) to islands which were already packed earlier (unselected). |
Default value: false |
Required feature code: PACK_TO_OTHERS |
bool m_ProcessUnselected |
If set to true, indicates that the packer should determine which UV islands are selected and which aren’t. |
Default value: false |
Required feature code: none |
UVP_PACKING_MODE m_PackingMode |
Determines how the UV map is packed. The following values are available: - SINGLE_TILE - standard packing to a single tile
- TILES - the UV map is packed into a specific number of tiles. Required feature code: PACK_TO_TILES
- GROUPS_TOGETHER - islands will be divided into groups using the
m_GroupingMethod parameter. All groups will be packed into a single tile, islands belonging to the same group will be neighbors after packing. Required feature code: GROUPING
- GROUPS_TO_TILES - islands will be divided into groups using the
m_GroupingMethod parameter. Every group will be independently packed into a separate tile. Required feature code: GROUPING
|
Default value: UVP_PACKING_MODE::SINGLE_TILE |
Required feature code: Depends on value |
UVP_GROUPING_METHOD m_GroupingMethod |
Determines how islands will be divided into groups. |
Default value: UVP_GROUPING_METHOD::DISABLED |
Required feature code: GROUPING |
float m_GroupingCompactness |
A value from 0 to 1 specifying how much the packer should prefer solutions providing more compact grouping, when packing groups together. A lower value means the packer will strive less to achieve compact grouping, at the same time it will prioritize achieving better coverage of the overall packing. With a greater value of the parameter, groups will be packed more compactly, but the coverage of the entire solution might be worse. This parameter is only used if
m_PackingMode is set to GROUPS_TOGETHER. |
Default value: 0.0 |
Required feature code: GROUPING |
float m_SimilarityThreshold |
This value is always used by the packer when it determines whether two islands have similar shape. A greater value of this parameter means islands will be more likely recognized as similar. A lower value means more accurate distinction. |
Default value: 0.0 |
Required feature code: none |
int m_TileCount |
Specifies the number of tiles which will be used during packing. If set to 0, then the number of tiles is unlimited. Used only if
m_PackingMode is set to TILES. |
Default value: 0 |
Required feature code: PACK_TO_TILES |
int m_TilesInRow |
Determines the number of tiles in a single tile row. Used only if
m_PackingMode is set to TILES or GROUPS_TO_TILES. |
Default value: 1 |
Required feature code: none |
UVP_LOCK_OVERLAPPING_MODE m_LockOverlappingMode |
Determines how the packer will process overlapping islands during packing. Available values: - DISABLED - overlapping islands won’t be locked (default behaviour)
- ANY_PART - two islands will be locked together (processed as a single island), if only they overlap by any part
- EXACT - two islands will be locked together, only if they have the same bounding boxes in the UV space and have identical area.
|
Default value: UVP_LOCK_OVERLAPPING_MODE::DISABLED |
Required feature code: LOCK_OVERLAPPING |
float m_LockDistance |
Specifies the maximal distance in the UV space below which two islands will be locked together, if
m_LockOverlappingMode is set to ANY_PART . If ‘Lock Distance’ is set to 0, then two islands will be locked if and only if they have any part overlapping. |
Default value: 0.0 |
Required feature code: LOCK_OVERLAPPING |
bool m_LockGroupsEnable |
Enables the lock groups functionality. |
Default value: false |
Required feature code: LOCK_OVERLAPPING |
bool m_PreValidate |
Automatically validate the UV map before packing. If any invalid UV face is found during validation, the operation will be aborted and the given UV faces will be reported. |
Default value: false |
Required feature code: VALIDATION |
bool m_MultiDevicePack |
If set to true, the packer will use all packing devices simultaneously whenever possible. |
Default value: false |
Required feature code: MULTI_DEVICE_PACK |
bool m_NormalizeIslands |
If set to true, the packer will automatically scale UV islands before packing so that the average texel density is the same for every island. |
Default value: false |
Required feature code: none |
Vector2T m_TargetBoxP1 |
Determines the bottom-left corner of the square, where UV islands will be packed. Used only if
m_TargetBoxEnable is set to true. |
Default value: uninitialized |
Required feature code: TARGET_BOX |
Vector2T m_TargetBoxP2 |
Determines the top-right corner of the square, where UV islands will be packed. Used only if
m_TargetBoxEnable is set to true. |
Default value: uninitialized |
Required feature code: TARGET_BOX |
bool m_Benchmark |
If enabled, the packer will send benchmark data to the application after packing is done. |
Default value: false |
Required feature code: none |
bool m_RenderResult |
If set to true, the packer will render the resulting UV map in a separate window. |
Default value: false |
Required feature code: none |
bool m_RenderInvalidIslands |
If set to true, the packer will render the input UV map with invalid islands marked in red, every time invalid islands are found before executing operation. |
Default value: false |
Required feature code: none |
bool m_RealtimeSolution |
If set to true, the packer will immediately send a
UvpPackSolutionMessageT message every time it finds a packing of a better coverage during a heuristic search. Otherwise, it will only send a single
UvpPackSolutionMessageT message after the search is finished, at the very end of the operation. |
Default value: false |
Required feature code: none |
Methods
const char* validate() |
Check whether the parameters set by the application in the given
UvpOperationInputT object are valid and consistent. WARNING: this operation might be time consuming (in particular it iterates over the UV data), so it should only be used during application debugging - it should not be used in production. |
Parameters: none |
Return value: - const char* - the return value is set to NULL, if the validation was successful. Otherwise the return value is set to a pointer to a human readable message describing the problem.
|
Last updated on 10 Dec 2020
Published on 10 Dec 2020