glodAdaptGroup - Adapts a group to a particular LOD based on the bound transform matrices and group settings.
void glodAdaptGroup(GLuint name)
PARAMETERS
- name
-
The name of the group to adapt
Adaptation of a group is governed using the
glodGroupParameter[if] interface. This takes a configuration tag
and a value. The configuration options that affect group adaptation
are explained below.
The main configuraiton option for a group is its adaption
mode. Acceptable values for GLOD_ADAPT_MODE are GLOD_ERROR_THRESHOLD
or GLOD_TRIANGLE_BUDGET.
Error threshold mode refines all fo the emmbers of your group to
within a certain constant amount of error. The metric for
determining this error, as well as the constant error amount, is
selectable through the glodGroupParameter interface.
The GLOD_ERROR_MODE setting selects how geometric error is
interpreted for this group. Possible error modes are
GLOD_OBJECT_SPACE_ERROR or GLOD_SCREEN_SPACE_ERROR. Depending on
whether you chose object or screen space error mode, you must also
specify the amount of acceptable error for refinement using
GLOD_OBJECT_SPACE_ERROR_THRESHOLD or
GLOD_SCREEN_SPACE_ERROR_THRESHOLD, depending on your choice of the
error mode.
The following code sets group 0
to adapt all of its
member objects to a screen-space error of no more than 3 pixels.
glodGroupParameter(0, GLOD_ADAPT_MODE, GLOD_ERROR_THRESHOLD);
glodGroupParameter(0, GLOD_ERROR_THRESHOLD,
GLOD_SCREEN_SPACE_ERROR);
glodGroupParameter(0, GLOD_SCREEN_SPACE_ERROR_THRESHOLD, 3.0f);
If you set the group to GLOD_TRIANGLE_BUDGET, you must also set the
number of triangles that you want the group to contain after
adaptation. This is set using GLOD_MAX_TRIANGLES. Additionally, you
must set the way in which triangles will be chosen --- with respect to
screen space or object space. This is done by setting
GLOD_ERROR_MODE to GLOD_OBJECT_SPACE_ERROR or
GLOD_SCREEN_SPACE_ERROR.
The following code sets a group to refine to int num_tris
triangles
using the screen-space appearance of the object as a guide.
glodGroupParameter(0, GLOD_ADAPT_MODE, GLOD_TRIANGLE_BUDGET);
glodGroupParameter(0, GLOD_ERROR_MODE, GLOD_SCREEN_SPACE_ERROR_MODE);
glodGroupParameter(0, GLOD_MAX_TRIANGLES, num_tris);