pfIBRtexture(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
NAME
pfNewIBRtexture, pfGetIBRtextureClassType, pfIBRtextureLoadIBRTexture,
pfIBRtextureIBRTexture, pfGetIBRtextureIBRTextures,
pfGetIBRtextureNumIBRTextures, pfGetIBRtextureDefaultTexture,
pfIBRtextureFlags, pfGetIBRtextureFlags, pfIBRtextureIBRdirections,
pfGetIBRtextureIBRdirections, pfIBRtextureDirection,
pfGetIBRtextureDirection - A class used to store a set of images, views
of a object.
FUNCTION SPECIFICATION
#include <Performer/pf.h>
pfIBRtexture* pfNewIBRtexture(void *arena);
pfType* pfGetIBRtextureClassType(void);
void pfIBRtextureLoadIBRTexture(pfIBRtexture* ibrtexture,
char *format, int num, int step);
void pfIBRtextureIBRTexture(pfIBRtexture* ibrtexture,
pfTexture **textures, int numTex);
void pfGetIBRtextureIBRTextures(pfIBRtexture* ibrtexture,
pfTexture ***textures, int *numTex);
int pfGetIBRtextureNumIBRTextures(pfIBRtexture* _ibrtexture);
pfTexture* pfGetIBRtextureDefaultTexture(pfIBRtexture* ibrtexture);
void pfIBRtextureFlags(pfIBRtexture* ibrtexture, int which,
int value);
int pfGetIBRtextureFlags(const pfIBRtexture* ibrtexture,
int which);
void pfIBRtextureIBRdirections(pfIBRtexture* ibrtexture,
pfVec3 *directions, int numDirs);
void pfGetIBRtextureIBRdirections(pfIBRtexture* ibrtexture,
pfVec3 **directions, int *numDirs);
void pfIBRtextureDirection(pfIBRtexture* ibrtexture,
float dir);
float pfGetIBRtextureDirection(const pfIBRtexture* ibrtexture);
PARENT CLASS FUNCTIONS
The OpenGL Performer class pfIBRtexture is derived from the parent class
pfObject, so each of these member functions of class pfObject are also
directly usable with objects of class pfIBRtexture. Casting an object of
class pfIBRtexture to an object of class pfObject is taken care of
automatically. This is also true for casts to objects of ancestor
Page 1
pfIBRtexture(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
classes of class pfObject.
void pfUserDataSlot(pfObject *obj, int slot, void *data);
void pfUserData(pfObject *obj, void *data);
void* pfGetUserDataSlot(pfObject *obj, int slot);
void* pfGetUserData(pfObject *obj);
int pfGetNumUserData(pfObject *obj);
int pfGetNamedUserDataSlot(const char *name);
const char* pfGetUserDataSlotName(int slot);
int pfGetNumNamedUserDataSlots(void);
int pfDeleteGLHandle(pfObject *obj);
Since the class pfObject is itself derived from the parent class
pfMemory, objects of class pfIBRtexture can also be used with these
functions designed for objects of class pfMemory.
pfType * pfGetType(const void *ptr);
int pfIsOfType(const void *ptr, pfType *type);
int pfIsExactType(const void *ptr, pfType *type);
const char * pfGetTypeName(const void *ptr);
int pfRef(void *ptr);
int pfUnref(void *ptr);
int pfUnrefDelete(void *ptr);
int pfUnrefGetRef(void *ptr);
int pfGetRef(const void *ptr);
int pfCopy(void *dst, void *src);
int pfDelete(void *ptr);
int pfIsFluxed(void *ptr);
int pfCompare(const void *ptr1, const void *ptr2);
void pfPrint(const void *ptr, uint which, uint verbose,
FILE *file);
void * pfGetArena(void *ptr);
DESCRIPTION
A pfIBRtexture stores a set of images of a complex object as viewed from
different directions. The directions are specified using
pfIBRtextureIBRdirections. Internally, pfIBRtexture uses pfDirData to
store the views. pfDirData determines the type of view distribution. It
could be a set of views around the object, all perpendicular to the
vertical axis. Or the views can be a set of rings and each ring contains
an array of evenly spaced views that have the same angle from the
horizontal plane. Otherwise, the views are assumed to be uniformly or
randomly distributed around the sphere of directions. The directions
have to be specified before the images are set.
Once the directions are specified the images are set using
pfIBRtextureIBRtextures. The parameters are an array of pointer to the
textures containing the views and the number of the textures in this
array.
If views are organized in rings the images can be loaded directly from a
Page 2
pfIBRtexture(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
set of files using pfIBRtextureLoadIBRtexture without the need to specify
the directions first. The parameter format specifies the path in which
the images are stored as well as how they are indexed, for example,
"images/view%03d.rgb". The other two parameters specify the number of
images and the increment between two loaded images (this is useful when
the texture memory is limited, by specifying step=2 every second image is
skipped).
If the flag PFIBR_3D_VIEWS is not set function pfIBRtextureLoadIBRtexture
sets one ring with specified number of textures and a horizontal angle of
0. If the flag PFIBR_3D_VIEWS is set the class checks whether a file
'info' is present in the image directory. If it is the information about
rings is loaded from that file. It contain two values at each line - the
horizontal angle and the number of texture at each ring. If the file is
not present in the image directory the directions have to be specified
before the images are loaded by calling pfIBRtextureIBRdirections. Rings
are indexed from 0 and should be ordered by the horizontal angle, with
the lowest angle at index 0. Each ring can have different number of
textures associated with it.
When rings of views are used the image files read by function
pfIBRtextureLoadIBRtexture should be indexed by the ring index and the
index of the image in a given ring. The format string should be set
appropriately, e.g. "images/view%02d_%03d.rgb". In case the textures are
specified by the user using pfIBRtextureIBRtextures the texture pointers
are all stored in a single array, starting with textures of the first
ring, followed by textures of the second ring, and so on.
It is assumed that the views in each ring are uniformly spaced and they
are ordered clockwise with respect to the vertical axis. If the views are
ordered in the opposite direction, set the direction to -1 by
pfIBRtextureDirection.
At present, pfIBRtexture is used only by pfIBRnode. It provides a draw
function for pfGeoSets that belong to the pfIBRnode, but the draw process
is transparent to the user. The user can control it by setting flags
using the function pfIBRtextureFlags. If the flag PFIBR_NEAREST is set
the closest view is selected and applied as a texture of the pfGeoSet.
This approach is fast on all platforms, but it results in visible jumps
when the texture is changed.
Thus by default the flag PFIBR_NEAREST is not set and two to four close
views are blended together, based on the distribution of the view. In
case of one ring of views, two views are blended, in case of several
rings of views four views are blended and in case of uniform or random
distribution of views 3 views are blended together.
If the graphics hardware supports register combiners flags
PFIBR_USE_REG_COMBINERS and PFIBR_USE_2D_TEXTURES are automatically set
by the class constructor and the blending of textures can be done in one
pass.
Page 3
pfIBRtexture(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
On IRIX, by default the flag PFIBR_USE_2D_TEXTURES is not set and a 3D
texture is used for fast blending between two closest views. To avoid
flickering when the object is viewed from a distance additional 3D
textures are used to store additional mipmap levels This feature is
available on machines with multisampling only (IR). To disable the
mipmapping, set flag PFIBR_MIPMAP_3DTEXTURES to zero. In case of several
rings, the nearest ring is selected and the views inside this ring are
blended using the 3D texture. 3D texture is not compatible with other
distributions of the views so make sure that in that case you set flag
PFIBR_USE_2D_TEXTURES.
Flag PFIBR_USE_PROXY is used when the views are mapped on an
approximation of the complex object (a proxy) and different version of
the draw functions have to be applied. You can read more about proxies in
the man page for pfIBRnode.
See pfIBRnode man page and program sample/pguide/C++/IBRnode for more
details of how to associate a pfIBRtexture with a pfIBRnode. See also
man page for makeIBRimages, a tool for generating views of a specified
object.
LIMITATIONS
When the flag PFIBR_3D_VIEWS is set 3D textures should not be used. This
mode is not implemented.
NOTES
When using pfIBRnodes and pfIBRtextures in perfly, you need an alpha
buffer. If the pfIBRnode is rendered as an opaque rectangle try command
line parameter -9 in which case perfly requests a visual with alpha
buffer.
SEE ALSO
pfObject, pfDirData, pfIBRnode, makeIBRimages
Page 4