Re: Blended LODs

New Message Reply Date view Thread view Subject view Author view

John Rohlf (jrohlf++at++tubes)
Thu, 3 Nov 94 13:15:14 PST


>
> Hi all,
> are there any plans to support selectively blended LODs in performer
> rather than globally setting a single blending range for all transitions drawn
> to a channel? Using traversal callbacks for this seems cumbersome and would
> only allow me to switch blend ranges for a single pfLOD (assuming it works),
> not individual transitions between geometries.
> Ideally I'd like to specify blend ranges in the same manner as I specify LOD
> ranges. This would allow selective switching or blending between the models
> below the same pfLOD.

        Yes. The next release of Performer will have sophisticated
LOD management mechanisms. Here's a sneak preview but be forewarned
that we may change the API/functionality in the real release.

pfLOD(3pf) IRIS Performer libpf Reference Pages pfLOD(3pf)

NAME
     pfNewLOD, pfLODRange, pfGetLODRange, pfLODCenter, pfGetLODCenter -
     Create, modify, and query level of detail nodes.

C SPECIFICATION
     #include <Performer/pf.h>

     pfLOD * pfNewLOD(void);

     void pfLODRange(pfLOD *lod, long index, float range);

     float pfGetLODRange(pfLOD *lod, long index);

     void pfLODTransition(pfLOD *lod, long index, float distance);

     float pfGetLODTransition(pfLOD *lod, long index);

     void pfLODCenter(pfLOD *lod, pfVec3 center);

     void pfGetLODCenter(pfLOD *lod, pfVec3 center);

     void pfLODLODState(pfLOD *lod, pfLODState *ls);

     void pfLODLODStateIndex(pfLOD *lod, long index);

PARAMETERS
     lod identifies a pfLOD.

DESCRIPTION
     A pfLOD is a level-of-detail (LOD) node. Level-of-detail is a technique
     for manipulating model complexity based on image quality and rendering
     speed. Typically, a model is drawn in finer detail when close to the
     viewer (occupies large screen area) than when it is far away (occupies
     little screen area). In this way, costly detail is drawn only when
     necessary.

     Additionally, IRIS Performer can adjust LODs based on rendering load. If
     a scene is taking too long to draw, IRIS Performer can globally modify
     LODs so that they are drawn coarser and render time is reduced (see
     pfChanStress).

     IRIS Performer uses range-based LOD and adjusts for field-of-view and
     viewport pixel size. Range is computed as the distance from the
     pfChannel eyepoint which is drawing the scene to a point designated as
     the center of a pfLOD. This range is then potentially modified by
     pfChannel attributes (see pfChanLODAttr, pfChanStress). This range
     indexes the pfLOD range list to select a single child to draw.

     pfLOD is derived from pfGroup so it can have children and use pfGroup API
     to manipulate its child list. In addition to a list of children, a pfLOD
     has a list of ranges which specify the transition points between levels-
     of-detail. pfNewLOD creates and returns a handle to a new pfLOD.

                                                                        Page 1

pfLOD(3pf) IRIS Performer libpf Reference Pages pfLOD(3pf)

     pfLODCenter sets the object-space point which defines the center of lod.
     center is affected by any transforms in the hierarchy above lod (see
     pfSCS). pfGetLODCenter copies the LOD center point into center.

     pfLODRange sets the value of range list element index to range which is a
     floating point distance specified in world coordinates. A child is
     selected based on the computed range (LODRange) from the eyepoint to the
     pfLOD center and the range list (Ranges) according to the following
     decision test:

        if (LODRange < Ranges[0])
            draw nothing;
        else
        if (LODRange >= Ranges[i] && LODRange < Ranges[i+1])
            draw Child[i];
        else
        if (LODRange >= Ranges[N-1] where N is length of Ranges)
            draw nothing;

     Ranges specified by pfLODRange must be positive and increasing with index
     or results are undefined. pfGetLODRange returns the range with index
     index.

     Normally, LOD transitions are abrupt switches that can cause distracting
     visual artifacts. On hardware which supports it, IRIS Performer can
     blend (fade) between levels-of-detail for a smooth transition. Fade
     level-of-detail (FLOD) is enabled by setting a non-zero fade range with
     pfChanLODAttr. FLOD is discussed in greater depth in the pfChanLODAttr
     man page.

     pfLODTransition sets the distance over which IRIS Performer should tran-
     sition or "fade" between an lod's children. The number of transitions is
     equal to the number of LOD children + 1. Thus Transitions[0] specifies
     the distance over which LOD child 0 should fade in. Transitions[1] speci-
     fies the distance over which IRIS Performer will fade between child 0 and
     child 1. Transitions[N] specifies the distance over which the last lod
     child will fade out. Note that performer will regulate the transition
     such that the fade will be centered based on the ranges specified by
     pfLODRange. It is also important to note the pfLODTransition distances
     should be specified such that there is no overlap between transitions or
     reasonable, but undefined, behavior will result. Thus, it is important
     to consider pfLODRanges when specifying transition distances.

     Note that in practice IRIS Performer will multiply this transition dis-
     tance by a global transition scale (this scale is set by calls to pfLOD-
     ChanAttr with the PFLOD_FADE token).

     The default behavior of pfLODTransition is that each transition is set to
     a distance of 1.0 (except Transitions[0] which is set to 0.0 by default).
     This makes it easy to specify a "global fade range" by controlling a
     pfChanLODAttr attribute - PFLOD_FADE. By setting PFLOD_FADE to 10.0, all

                                                                        Page 2

pfLOD(3pf) IRIS Performer libpf Reference Pages pfLOD(3pf)

     transitions that have not be explicitly set will use 10.0 * 1.0 = 10.0 as
     their fade distance (except Transitions[0] which will not fade at all).

     Note that if one does not desire control over individual lod transitions,
     it is not necessary to call pfLODTransition.

     pfLODLODState associates the given pfLOD and pfLODState. This enables
     the control of how a particular pfLOD responds to stress and range.
     pfGetLODLODState returns the pfLODState assosciated with lod if there is
     one or NULL if one does not exist.

     pfLODLODStateIndex allows pfLODStates to be indexed on a per channel
     basis. .in 0.125iindex.in 0.125i is an index into an pfList of pfLOD-
     States specified via pfChanLODStateList. pfGetLODLODStateIndex returns
     the index currently specified for 'lod' or -1 if no index has been speci-
     fied.

     Note that if an out of range index is specified for a given pfLOD then
     the pfLODState specified as the global pfLODState for that channel will
     be used.

     (See pfChannel and pfLODState)

NOTES
     Intersection traversals currently always intersect with an LODRange of 0.
     To intersect with other ranges, a pfSwitch with the same parent and chil-
     dren as the pfLOD can be created with the pfLOD used for drawing and the
     pfSwitch used for intersecting (see pfChanTravMask).

SEE ALSO
     pfChannel, pfChanLODAttr, pfChanStress, pfLODState, pfFindLOD, pfGroup,
     pfNode

pfLOD(3pf) IRIS Performer libpf Reference Pages pfLOD(3pf)

NAME
     pfNewLODState, pfLODStateAttr, pfGetLODStateAttr, pfLODStateName,
     pfGetLODStateName, pfFindLODState - Create, modify, and query level of
     detail state.

C SPECIFICATION
     #include <Performer/pf.h>

     pfLODState * pfNewLODState(void);

     void pfLODStateAttr(pfLODState *ls, long attr, float val);

     float pfGetLODStateAttr(pfLODState *ls, long attr);

     void pfLODStateName(pfLODState *ls, const char *name);

     const char * pfGetLODStateName(pfLODState *ls);

     pfLODState * pfFindLODState(const char *name);

PARAMETERS
     ls identifies a pfLODState.

DESCRIPTION
     pfNewLODState returns a pointer to a pfLODState, which a definition of
     how an LOD or group of LODs should respond to range and stress.
     Currently, there are 8 attributes that can be used to define LOD child
     selection and child transition distance based on a LOD's distance from
     the channel's viewpoint and the channel's stress (see pfNewChan and
     pfChanStress).

     pfLODStateAttr and pfGetLODStateAttr are used to set and get the
     following attributes:

     PFLODSTATE_RANGE_RANGESCALE and PFLODSTATE_RANGE_RANGEOFFSET directly
     modify the range used to determine the current LOD child.
     PFLODSTATE_RANGE_STRESSSCALE and PFLODSTATE_RANGE_STRESSOFFSET modify how
     the current channel stress affects the range computation.

     PFLODSTATE_TRANSITION_RANGESCALE and PFLODSTATE_TRANSITION_RANGEOFFSET
     directly modify the transition widths set by pfLODTransition.
     PFLODSTATE_TRANSITION_STRESSSCALE and PFLODSTATE_TRANSITION_STRESSOFFSET
     modify how those are affect by the channel stress.

     computedRange = OverallLODScale * (range * rangeScale + rangeOffset) *
     (stress * stressScale + stressOffset);

     computedTransitionWidth[i] = OverallFadeScale * (trans[i] * tRangeScale +
     tRangeOffset) / (Stress * tStressScale + tStressOffset);

     The direct way of specifying an pfLODState for a particular pfLOD is with
     a call to pfLODLODState. However, also note that one can set a default

                                                                        Page 1

pfLOD(3pf) IRIS Performer libpf Reference Pages pfLOD(3pf)

     pfLODState on a per channel basis via use of pfChanLODState. One can
     also index pfLODStates on a per channel basis by using pfChanLODStateList
     with pfLODLODStateIndex. (See pfChannel and pfLOD).

     pfLODStateName and pfGetLODStateName set and get the name of a particular
     pfLODState while pfFindLODState will return the first pfLODState defined
     with the given name.

NOTES
SEE ALSO
     pfLOD, pfChannel, pfChanLODAttr, pfChanStress


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:50:38 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.