From: Stace Peterson (stacep++at++sgi.com)
Date: 02/01/2005 11:09:07
Devrim,
First off, yes, the pfGProgramParms class is for per-object variables
used by fragment and vertex programs. For per-vertex data, you need to
use pfGeoArrays (actually, pfGeoSets can still be used with vertex and
fragment programs, only they don't provide as nice of an interface for
specifying general purpose per-vertex data).
As for the documentation, you're right - we forgot to include the
pfGeoArray::setAttr() functions in the man page. We'll fix this for the
next release. The functions look like:
pfVertexAttr* pfGeoArray::setAttr(int attrType, int size,
GLenum type, GLenum stride, void *ptr);
pfVertexAttr* setMultiAttr(int attrType, int stage, int size,
GLenum type, GLenum stride, void *ptr);
where attrType is one of:
PFGA_COORD_ARRAY
PFGA_NORMAL_ARRAY
PFGA_COLOR_ARRAY
PFGA_TEX_ARRAY
PFGA_GENERIC_ARRAY
stage can only be non-zero for texture coords and generic arrays. With
the new redesign of pfGeoArray, you no longer need to call
addAttrType(), and we will automatically create the attribute types you
need when setAttr is called. Additionally, pfVertexAttr objects are per
pfGeoArray now, so can not be used for querying global data.
Finally, as for specifying and using generic attribute arrays with
pfGeoArray, there is currently a bug with them which will be fixed for
the next release. For now, you can place this data in an unused texture
coordinate without much loss of generality.
Thanks,
Stace
Devrim Erdem wrote:
>
> On Mon, 31 Jan 2005 13:31:42 -0000, Andrew Preece <apreece++at++sgi.com> wrote:
> > Hi Devrim,
> >
> > Try the following:
> >
> > pfGeoArray *garr = new pfGeoArray() ;
> >
> > float *gvtx = (float *)pfMalloc( sizeof( float ) * 3 * MAX_COORDS,
> > pfGetSharedArean() ) ;
> >
> > garr -> setAttr( PFGA_GENERIC_ARRAY, 3, GL_FLOAT, 0, gvtx ) ;
>
> Thanks Andy, I have tried this with the pguide/libpr/C++/genArray.C
> without luck. I modified the example to add a generic array of float4.
> The app crashes in pfFrame after this modification. Please find the
> slightly modified geoArray.C attached.
>
> Thanks in advance,
>
> >
> > Regards,
> > Andy.
> >
> > -----Original Message-----
> > From: owner-info-performer++at++performer.engr.sgi.com
> > [mailto:owner-info-performer++at++performer.engr.sgi.com] On Behalf Of Devrim
> > Erdem
> > Sent: 31 January 2005 12:48
> > To: info-performer++at++sgi.com
> > Subject: [info-performer] pfGeoArray::addAttrType incorrect documention -
> > Doc. Needed
> >
> > Hello,
> >
> > I am trying to get pfGeoArrays working with generic per vertex
> > attributes. The man pages say :
> >
> > static pfVertexAttr* pfGeoArray::addAttrType(char * name, pfFunc
> > func, GLenum ecs, unsigned short mask);
> >
> > The header pfGeoArray.h says :
> >
> > pfVertexAttr* addAttrType(int type,char* name,int stage);
> >
> > The method is not static anymore and the parameter sets looks quite
> > different. I need to use the set generic per pixel float data. It is
> > not clear what type and stage is supposed to be. I assume name is the
> > name to be used for calling queryAttr().
> >
> > Would it be possible to shed some light on this method, since the man
> > pages seem to be completely out of sync ?
> >
> > Thanks in advance,
> >
> > P.S. : I also don't see the need for queryAttrType if the addAttrType
> > is per pfGeoArray rather than being global. Any thoughts on this ? I
> > assume it would be used like :
> >
> > geoArray->addAttr( geoArray->addAttrType( ... ), .... );
> >
> > if the pfVertexAttr is per geo array. I must be misunderstanding this I
> > guess.
> >
> > Devrim Erdem
> >
> > -----------------------------------------------------------------------
> > List Archives, Info, FAQ: http://www.sgi.com/software/performer/
> > Open Development Project: http://oss.sgi.com/projects/performer/
> > Submissions: info-performer++at++sgi.com
> > Admin. requests: info-performer-request++at++sgi.com
> > -----------------------------------------------------------------------
> >
>
> ------------------------------------------------------------------------
> Name: geoArray.C
> geoArray.C Type: Plain Text (text/plain)
> Encoding: quoted-printable
-- ------------------------------------------------------------------ Stace Peterson stacep++at++sgi.com Silicon Graphics, Inc. (650) 933-2323
This archive was generated by hypermail 2b29 : Tue Feb 01 2005 - 11:09:16 PST