Re: [info-performer] Add attribute using GLSL

Date view Thread view Subject view Author view

From: Stace Peterson (stacep++at++sgi.com)
Date: 05/12/2005 13:42:25


A quick bit of clarification, as this is easy to confuse - generic
attributes are per-vertex values that can be used by vertex shaders,
while shader uniforms are per-shader program values sent to both vertex
and fragment shaders.

You will need to use pfGeoArrays if you would like to add generic
attributes. For Performer 3.2, using pfGeoArrays in place of pfGeoSets
has been simplified somewhat, so the pfGeoArray interface is very
similar to pfGeoSet. Adding a generic attribute only requires calling
pfGeoArray::setAttr() with the appropriate values. See the pfGeoArray
man pages for details. One note - generic attributes had a bug in
Performer 3.2. This bug has been fixed in our current builds, and will
be available with 3.2.1. As a workaround, you can use unused texture
coordinate locations in place of generic attributes, with no loss in
functionality, for now.

As far as glBindAttribLocationARB(), that is for binding uniforms for
GLSL use. Call the pfShaderProgram::addUniform() function with the
appropriate values, and it will manage the uniform locations
automatically, making sure they are available for GLSL use.

Hope this helps,
Stace

Jimi Hong wrote:
>
> Dear Performers
>
> I'm trying to program in GLSL.
> Performer has a method for binding uniform value.
> (ShaderProgram->addUniform)
> But I can't find a method for binding an attribute.
> setAttr method of geoset has only COORD, NORMAL, COLOR and TEXCCOORD.
> And I need a GENERIC type of attribute.
>
> I've red that in Performer Newsletter "Add attribute using a method at
> GeoArray".
> But If I use geoarray, I should convert geode model to geoarray model,
> shouldn't I?
> I haven't try this way, because I think geode must have some other way.
>
> Please let me know.
> How to use the method - glBindAttribLocationARB(myProgram, 1, "AAA") -
> in Performer?
>
> Thank you.
>
> -----------------------------------------------------------------------
> 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
> -----------------------------------------------------------------------

-- 
------------------------------------------------------------------
Stace Peterson                                      stacep++at++sgi.com
Silicon Graphics, Inc.                              (650) 933-2323


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Thu May 12 2005 - 13:42:26 PDT