[info-performer] pfGeoArray generic attributes and shaders

Date view Thread view Subject view Author view

From: Duvan Cope (dcope++at++ist.ucf.edu)
Date: 06/22/2004 11:30:20


Hello again,

I am trying to use the pfGeoArray's generic attributes to pass in vertex
data for skinning (bone ids and weights). I simply cannot get anything to
pass through though. My code...

    weightAttr = pfGeoArray::addGenericAttrType("weights", 6);

    /*...Allocate and set weightList values...*/

    performerGeoarray->addAttr(weightAttr, 4, GL_FLOAT, 0, weightList);

    boneAttr = pfGeoArray::addGenericAttrType("bones", 7);

    /*...Allocate and set boneList values...*/

    performerGeoarray->addAttr(boneAttr, 4, GL_FLOAT, 0, boneList);

In the OpenGL ARB shader program I try to access the values using
vertex.attrib[7] and [6] but none of these values seem to be reaching
(they are all apparently zero). Could I get some sample code on how to
use the generic attributes or any other form of information to help me get
this to work? I have tried setting the list data using the setAttrPtr()
with no better results. The man pages or any other documentation I have
found do not seem to mention what the last parameter to setAttrPtr() is
for however.

I have also found what appears to be an error in the pfGProgramParms man
page...

       A pfGProgramParms is a set of indexed quadruples of floating point val-
       ues, that are used as parameters for vertex and fragment programs. The
       values are specified using function pfGProgramParms::setParameters, The
       index specifies the first index of the specified parameters (the index
       by which the parameters are accessed in the GPU program) and the count
       specifies how many indices will be set. The type is one of
 
              PFGP_FRAGMENT_LOCAL
                     local parameters of a single fragment program.
 
              PFGP_FRAGMENT_ENV
                     environment parameters. Shared between all fragment pro-
                     grams.
 
              PFGP_VERTEX_LOCAL
                     environment parameters of a single vertex program.
 
              PFGP_VERTEX_ENV
                     environment parameters. Shared between all vertex pro-
                     grams.
       The pointer ptr points to the parameter data.

The whole description for types seems to be wrong. The type specified in
the setParameters() method should be a PF_GPP_FLOAT_4 (describing the data
structure itself). This is how it is in the sample gprogram.c file and it
also seems to be the only thing that works.

Thanks in advance,
Duvan


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Tue Jun 22 2004 - 11:33:28 PDT