Re: 2.1 PACKED ATTRS

New Message Reply Date view Thread view Subject view Author view

Sharon Clay (src++at++rose.asd.sgi.com)
Sun, 7 Jul 1996 17:50:40 -0700


Hi,

I'll reply first to the original question on this issue:

+>---- On Jul 4, 1:25pm, Nacho Sanz-Pastor. Computer Arts + Developments wrote:
> Subject: 2.1 PACKED ATTRS
->Hi all,
->
-> Does anybody know if it's possible ( I guess it's not ) to use vertex arrays
->in
->2.1 that only pack normals, texvertices and vertices, without the per vertex
->color field ?

Yes!

The PFGS_PACKED_ATTRS format, specified with pfGSetAttr(), such as
        pfGSetAttr(gset[i], PFGS_PACKED_ATTRS, PFGS_PA_C4UBN3ST2F, cnt, NULL);
works in conjunction with the other attribute bindings on the pfGeoSet to
define the expected data in the packed attrs array.
The packed attribute format tells Performer not what data to send to the pipe,
but where to find it if the corresponding attribute has already been given a
PER_VERTEX binding on the pfGeoSet.
This is to ensure that a pfGeoSet really only has one set of attribute binding
behavior, regardless of whether or not you are using the packed attrs.
It also keeps us from having to redefine all of the attribute binding choices
as packed attribute formats.
So, the PFGS_PACKED_ATTRS format specifies the maximum set of PER_VERTEX attributes
that are expected to be in the packed attribute array and the rest are
going to be taken from the normal data arrays.

For example, the difference between formats PFGS_PA_C4UBN3ST2F and
PFGS_PA_C4UBN3ST2FV3F is that with PFGS_PA_C4UBN3ST2FV3F, the vertex coordinates
are expected to be interleaved in the packed attribute array and with
PFGS_PA_C4UBN3ST2F the are sent as a separate data array using the array attatched
to the pfGeoSet with
        pfGSetAttr(gset[i], PFGS_COORD3, PFGS_PER_VERTEX, coords, NULL);

If you are using packed attrs and have format PFGS_PA_C4UBN3ST2F or
PFGS_PA_C4UBN3ST2FV3F but don't give a PFGS_PER_VERTEX color binding
with pfGSetAttr(gset[i], PFGS_COLOR4, PFGS_PER_VERTEX, NULL, NULL);
then we assume that there are NO colors in the packed attr array and no
"bogus" data is sent to the pipe.

If you ARE going to use per-vertex colors with packed attributes, then we
force you to put the colors as shorts packed into the interleaved array because
otherwise you would have no performance advantage from using the packed attributes
and might as well just have the pfGeoSet use the regular drawing routines
(perhaps with display lists).

You might check out the pguide/libpr/C/packedattrs.c example to play with this.

The reason for allowing some attribute arrays (vertex coordinates) to be
separated out from the packed attributes is to allow the use of the efficient
VertexArray extension on iR while not requiring that you duplicate the data.
There are Performer operations like culling and intersections that need access to
the vertex coordinates and normals in their separate arrays.
In the future, the real performance extension will be the InterleavedArrays
extension and that will only be usable with the all-interleaved mode.

src.

-- 
-----{-----{---++at++   -----{----{---++at++   -----{----{---++at++   -----{----{---++at++
Sharon Rose Clay (Fischler) - Silicon Graphics, Advanced Systems Dev.
src++at++sgi.com  (415) 933 - 1002  FAX: (415) 965 - 2658  MS 8U-590
http://www.sgi.com/Technology/Performer/
-----{-----{---++at++   -----{----{---++at++   -----{----{---++at++   -----{----{---++at++

======================================================================= List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/ <--new! Submissions: info-performer++at++sgi.com Admin. requests: info-performer-request++at++sgi.com


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:53:09 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.