pfuCalcSizeFinestMipLOD(3pf) OpenGL Performer 3.2.2 libpfutil Reference Pages
NAMEpfuCalcSizeFinestMipLOD - estimate min texture LOD that will used for
rendering a scene
FUNCTION SPECIFICATION
#include <Performer/pfutil.h>
float pfuCalcSizeFinestMipLOD(pfFrustum *cullFrust, int viewportWidth,
int viewportHeight, float heightAboveTerrain,
float min_dst_dxyz, int maxtexsize)
DESCRIPTIONpfuCalcSizeFinestMipLOD attempts to calculate a tight lower bound on the
min (finest) texture mipmap LOD (level of detail) that mipmapping
hardware will use to render a scene, given the view frustum, viewport
size in pixels, distance from the eye to the closest point (or to
bounding volume) in object space, a lower bound on the min change in
texture coords (s,t) per change in object coords (x,y,z), and the texture
size (which is used only for clamping the result, which can otherwise be
unbounded).
For more explicit details and a description of the algorithm and its
assumptions, see the comment at the top of the source file
/usr/share/Performer/src/lib/libpfutil/mipmin.c.
The resulting LOD calculated by this function is useful for virtual clip
texturing, in which typically only a small fixed number of contiguous
texture LODs can be accessed at a time, and the application has control
over which LOD that window of contiguous levels should start (the
"virtual LOD offset"). In such a situation it is wise to choose an LOD
Offset that is less than the LOD returned by pfuCalcSizeFinestMipLOD but
as close to it as possible, so as to maximize the number of levels the
hardware has to work with and thereby increase the effectiveness of
mipmapping.
Typically the LOD calculated by this function is used to determine the
minLODTexPix argument to be passed to the pfuCalcVirtualClipTexParams
function along with other information about the texture, scene, and
eyepoint.
For examples of various uses of this function, see the sample source code
for the .spherepatch and .ct scene loaders, and the virtcliptex sample
program:
/usr/share/Performer/src/lib/libpfdb/libpfspherepatch/pfspherepatch.C
/usr/share/Performer/src/lib/libpfdb/libpfct/pfct.C
/usr/share/Performer/src/sample/pguide/libpf/C/virtcliptex.c
The libpfutil source code, object code and documentation are provided as
unsupported software. Routines are subject to change in future releases.
Page 1
pfuCalcSizeFinestMipLOD(3pf) OpenGL Performer 3.2.2 libpfutil Reference Pages
SEE ALSO
pfClipTexture, pfMPClipTexture, pfuCalcTexDerivs,
pfuCalcVirtualClipTexParams, clipfly
Page 2