---------------------------------------------------------- | CHANGING MODES IN THE LOADER | ---------------------------------------------------------- The function, pfdConverterMode_flt, is provided for affecting the behavior of the loader. void pfdConverterMode_flt ( int mode, int val ); The function pfdGetConverterMode_flt is provided to retrieve the current value set for a given mode: int pfdConverterMode_flt ( int mode ); Supported modes are: #define PFFLT_FLATTEN 1 #define PFFLT_CLEAN 2 #define PFFLT_COMBINELODS 3 #define PFFLT_SEQUENCES 4 #define PFFLT_AMBIENT_IS_DIFFUSE 5 #define PFFLT_SHOWTSTRIPS 6 #define PFFLT_COMPUTENORMALS 7 #define PFFLT_MONOCHROME 8 #define PFFLT_LAYER 9 #define PFFLT_USELONGIDS 10 #define PFFLT_USEUNITS 11 #define PFFLT_AUTO_ORIENT 12 #define PFFLT_GSTATE_TABLES 13 #define PFFLT_INHERIT_GSTATE 16 #define PFFLT_OLD_STYLE_XREFS 17 #define PFFLT_FORCE_XREF_FLAGS 18 #define PFFLT_TRANSPARENCY 19 #define PFFLT_USE_TEXMAP 20 #define PFFLT_CAT_ALGORITHM 21 #define PFFLT_CAT_SCALAR 22 #define PFFLT_SHARE_LPSTATE 23 #define PFFLT_COLLAPSE_GEOM 25 #define PFFLT_BEHAVIORS 26 For most modes, the appropriate val's are TRUE or FALSE to enable or disable the mode. PFFLT_FLATTEN - When enabled, causes a call to pfFlatten to be made after a data base has been read. See the Performer documentation for a description of pfFlatten. This mode is enabled by default. PFFLT_CLEAN - When enabled, this mode causes a call to be made to cleanTree after a data base has been read and, if enabled, pfFlatten has been called. cleanTree removes empty nodes and reparents single children of a group node to the group's parents. If a single child's parent is a pfSCS, the parent is not removed unless its matrix is the identity matrix. This mode is enabled by default. NOTE: pfFlatten will try to set pfSCS matrices to the identity, so enabling both PFFLT_FLATTEN and PFFLT_CLEAN can cause a significant simplification of a Performer scene graph. PFFLT_COMBINELODS - This combines multiple LOD beads into one pfLOD which is more efficient. It takes LOD centers and switch in/out distance into account when combining (from left to right). This mode is enabled by default. PFFLT_SEQUENCES - Animation sequences are enabled generically. Since the loader cannot call pfGetFrameRate(), it uses the value of PFFLT_FRAMERATE to compute the period for pfSeqTime() and starts the animation cycling continuously. To actively control the sequence's behavior, you can use the CB_GROUP callback or perhaps pfLookupNode() to get the pfSequence node(s). This mode is enabled by default. PFFLT_AMBIENT_IS_DIFFUSE - The loader can create pfMaterial's with material mode PFMTL_CMODE_AD (default) or PFMTL_CMODE_COLOR. PFMTL_CMODE_AD mode makes the assumption that the ambient component of a material is tied to its diffuse component, i.e. they have the same hue. This is the most efficient material mode for Gouraud, lit geometry. PFMTL_CMODE_COLOR modes matches how MultiGen renders geometry in "Dynamic" lighting mode. Material modes can be mixed in successive calls to pfdLoadFile_flt(). This mode is enabled by default. PFFLT_SHOW_TSTRIPS - Performer will allow you to view the results of the pfdTMesher by rendering each mesh in its own color. This mode simply calls pfdMesherMode(), which you can also call directly. This mode is disabled by default. PFFLT_COMPUTENORMALS - Changes the mode of PFDGBLDR_AUTO_NORMAL while building geometry. It is on (PFDGBLDR_NORMALS_MISSING) by default so as to compute face normals that are missing. This mode should be disabled (PFDGBLDR_NORMALS_PRESERVE) when loading databases that are already shaded and/or lit as desired, otherwise unlit models will become lit. Possible values are the same as for pfdGeoBldrMode() and are defined in /usr/include/Performer/pfdu.h . NOTE: Enabling PFDGBLDR_AUTO_NORMALS adversely limits the lengths of meshes produced by pfdTMesher. PFFLT_MONOCHROME - A data base can be loaded as monochrome by enabling PFFLT_MONOCHROME. This causes the loader to convert colors and the material table to YIQ monochrome. Also, each RGB[A] texture image is converted (again YIQ) into an I[A] image in memory. The associated pfTexture will retain the original texture filename. This can be useful in certain immersive applications where, for example, the left eye is drawn into the BLUE channel and the right eye is drawn into the RED. This mode is disabled by default. PFFLT_LAYER - Selects the layering mode used by the loader when creating pfLayer nodes for co-planer geometry. Possible values are enumerated in /usr/include/Performer/pr.h. This mode is set to PFDECAL_BASE_FAST by default. PFFLT_USELONGIDS - Selects the naming convention used by the loader when creating Performer nodes. Turning this mode on causes the loader to use variable length bead IDs for Performer node names. The PFFLT_REGISTER_NODE attribute is not compatible with this mode because passing the long ID would require a change in the API of fltRegisterNodeT. This mode is disabled by default. PFFLT_USEUNITS - Selects the target database units when creating Performer nodes. Possible values are enumerated in the public header file pfflt.h. They are as follows: #define FLT_METERS 0 #define FLT_KILOMETERS 1 #define FLT_FEET 2 #define FLT_INCHES 3 #define FLT_NAUT_MILES 4 This mode is set to FLT_METERS by default. For example calling pfdConverterMode_flt( PFFLT_USEUNITS, FLT_FEET ) will cause subsequent OpenFlight databases to be loaded into Performer with feet as the unit of measure. PFFLT_AUTO_ORIENT - Changes the mode of PFDGBLDR_AUTO_ORIENT while building geometry. It is off (PFDGBLDR_ORIENT_PRESERVE) by default so as not to flip faces that have strange normals. Neat lighting effects like stained glass windows, skylights, and surrealistic effects generally have such normals. Possible values are the same as for pfdGeoBldrMode() and are defined in /usr/include/Performer/pfdu.h . PFFLT_GSTATE_TABLES - Selects the number of "indexed pfGeoState" tables to handle/create while loading databases. Values greater than zero cause the loader to call pfGSetGStateIndex(3) instead of pfGSetGState(3). A value of zero or one is otherwise the same in terms a storage behavior. The default value is zero, meaning the loader will call pfGSetGState(3) to bind pfGeoState's to pfGetSet's. If pfGSetGStateIndex(3) is called, the application must call mgGetSharedPalette() and use its fltRenderMap::renditions (each rendition is a pfGeoState table) as the argument to a call to either pfApplyGStateTable(3) or pfChanGStateTable(3) before the database is viewable. NOTE: fltSharedPalette::rendMap (render-map) is a fltRenderMap* such that you can call: fltSharedPalette* palette = fltGetCurSharedPalette(); fltRenderMap* rendMap = palette->rendMap; pfChanGStateTable( chan, pfGet( rendMap->renditions, WHICH ) ); where WHICH is the "geostate table" of interest. The default value for render map 0 is FLTA_DEFAULTS which is backward compatible with previous loaders. If two renditions are requested, via PFFLT_GSTATE_TABLES, then render map one defaults to FLTA_IRDEFAULTS. PFFLT_INHERIT_GSTATE - Enables/disables the use of pfGeoState[Attr|Mode|Val]() inheritance when constructing geostates. pfGeoState attributes that are always set are: PFSTATE_FRONTMTL is set for all faces. A default material equivalent to MultiGen's is used for faces without a material. PFSTATE_TEXENV is set for texture environments other than PFTE_MODULATE. PFSTATE_TEXGEN is set for projected texture. PFSTATE_TEXTURE is set or NULL'd wrt face textures. pfGeoState modes that are always set are: PFSTATE_ALPHAFUNC is PFAF_GREATER for faces with transparency or material or texture alpha components. PFSTATE_CULLFACE is PFCF_OFF for 2-sided faces. PFSTATE_ENLPOINTSTATE is PF_ON and PFSTATE_ENFOG is PFFOG_OFF for attached pfLPointState's. PFSTATE_ENTEXGEN is PF_ON when using projected textures. See mode PFFLT_USE_TEXMAP. PFSTATE_ENTEXTURE is PF_OFF for untextured faces. PFSTATE_TRANSPARENCY is PFTR_FAST for faces with transparency or material or texture alpha components. pfGeoState values that are always set are: PFSTATE_ALPHAREF is 4.0 for faces with transparency or material or texture alpha components. All other geostate bindings may be inherited. This mode is disabled by default for backward compatibility. PFFLT_OLD_STYLE_XREFS - This mode controls the way the loader handles pre-V14.2 external references. When enabled, files referenced from pre-V14.2 files are loaded using their own palettes, as if external reference override flags were true. This is backward compatible with previous revisions of the loader. Disabling this mode causes old external references to inherit it's parent file's palettes. In either case, V14.2 and later references honor their override flags. This mode is enabled by default. PFFLT_FORCE_XREF_FLAGS - This is a compatibility mode that allows the user to force external reference override flags to TRUE. When enabled, all V14.2 and later external references whose overrides are all FALSE will be changed to TRUE. This mode is disabled by default. PFFLT_TRANSPARENCY - Changes the mode of PFSTATE_TRANSPARENCY while building geometry. It is PFTR_FAST for transparent geometry by default and PFTR_OFF otherwise. Possible values are the same as for pfGStateMode( PFSTATE_TRANSPARENCY ) and are defined in /usr/include/Performer/pr.h . PFFLT_USE_TEXMAP - Enables the use of projected texture for mappings that do not require it. This is currently particular to 3 point "put" mappings. This mode is disabled by default. PFFLT_CAT_ALGORITHM - Changes the run-time algorithm that is configured by the loader. Possible values are enumerated in the public header file pfflt.h. They are as follows: #define FLT_CAT_APP_CULL 1 #define FLT_CAT_APP_SLICE 2 FLT_CAT_APP_CULL uses pfCycleBuffer's to distribute the evaluation across the APP and CULL processes. This method completes each frame. FLT_CAT_APP_SLICE time slices the evaluation across four APP frames. This is the default mode. NOTE: This mode is obsolete for Performer 2.2 PFFLT_CAT_SCALAR - Changes the run-time feedback mechanism that adjusts the level of detail of the CAT evaluation each frame. Possible values are enumerated in the public header file pfflt.h. They are as follows: #define FLT_CAT_LOD_SCALE 1 #define FLT_CAT_CHAN_STRESS 2 FLT_CAT_LOD_SCALE causes a call to pfGetChanAttr( , PFLOD_SCALE ) each frame, effectively hooking into channel LOD scale. This is the default mode. FLT_CAT_APP_SLICE causes a call to pfGetChanStress() each frame, effectively hooking into channel stress. Either mechanism is part of the TRAV_APP callbacks setup by PFFLT_CAT_ALGORITHM. PFFLT_SHARE_LPSTATE - Enables/Disables the sharing of pfLPointState between light point geosets. When disabled, each light point bead or pre-V15.3 light point face bead will have a unique pfLPointState that can be manipulated. This mode is enabled by default. PFFLT_COLLAPSE_GEOM - Enable/Disables the pfdGeoBuilder mode PFDGBLDR_COLLAPSE_ATTRS. Disabling this mode can help pfdTMesher create longer meshes by reducing the degree of "mixed bindings". "Mixed binding" occurs when only one of either the PFGS_COLOR4 or PFGS_NORMAL3 attributes collapses to PFGS_PER_PRIM. This can happen when adjacent faces have different colors or lighting characteristics. For example, a face with vertex (smooth) normals adjacent to a face with one (flat) normal, or no normal at all, will produce this case. Beware though, all geosets will have PER_VERTEX attributes, which may actually cause a drop in performance. This mode is enabled by default. PFFLT_BEHAVIORS - Enables/Disables support for OpenFlight behaviors. When enabled, an evaluation graph is created and attached as pfUserData to the root node of the local scene graph. In addition, a list of driver control objects is created and attached as PFTRAV_APP data. Finally, a PFTRAV_APP function that evaluates each driver in the list is defined. See the section "Controlling Behaviors" below for more details. This mode is disabled by default.