kmSetAutoSortMode
Sets up the auto sort mode.
KMSTATUS KMAPI kmSetAutoSortMode(KMBOOLEAN bEnable)
Description:
This function turns on/off autosort mode of translucent polygon.
There are two translucent polygon drawing modes, auto-sort mode and pre-sort mode.
This function can select either mode for each scene separately.
Auto-sort mode
The hardware automatically sorts translucent polygons in pixel units in ascending order of Z-
coordinates (inner pixels first) rather than the order in which they were registered in KAMUI
before being drawn. In this case, [alfa] blending is performed correctly even if translucent
polygons cross one another. If there are many overlapping translucent polygons, their
processing speed is reduced, however.
The DepthMode of VERTEXCONTEXT is ignored in the auto-sort mode. The Z-
coordinates of the pixels are compared, always using KM_GREATEREQUAL. If two pixels
are at the same Z-coordinate, they are drawn in the order in which they were registered with
KAMUI.
Pre-sort mode
Polygons are drawn in the order in which they were registered with KAMUI. So, the
application program has to sort them into order of Z-coordinates. If translucent polygons
cross one another, [alfa] blending cannot be performed correctly. If it is easy for the application
program to sort polygons into the order of Z-coordinates (as with 2D sprites), the pre-sort
mode should be used, as it is faster than the auto-sort mode.
Parameters:
bEnable(input)
If it is TRUE, this parameter specifies autosort mode for translucent planes.
If it is FALSE, it emulates software-based sorting, which is the conventional sorting type.
Return values:
Value | Explanation |
---|---|
KMSTATUS_SUCCESS | Success |
kmSetAutoSortMode