Re: listing textures

New Message Reply Date view Thread view Subject view Author view

Michael T. Jones (mtj++at++babar.asd.sgi.com)
Wed, 9 Oct 1996 11:01:06 -0700


On Oct 9, 10:33am, Angus Henderson wrote:
> Subject: Re: listing textures
> pfuMakeTexList constructs a list of textures by recursively traversing
> the IRIS Performer scene graph rooted by node. Since this traversal is
> exhaustive no texture will be missed.
>
> (SO the manual says - I think it used to miss out the detail textures though
)

Angus' comment brings to light a difference in the use pfuMakeTexList() was
designed for and that which Jude Anthony is seeking.

Since pfuMakeTexList() was written as a helper function for pre-loading
textures, the list it makes is exhaustive with respect to Performer, but
that won't be complete for Jude. Here's why:

1. When you call pfuDownloadTex, it applies each texture in the list. Since
   detail textures are referenced by non-detail textures, the list does not
   contain detail textures. This is not an error, since they will in fact
   be downloaded and bound in the normal process of texture loading.

2. In the "what textures can I delete" case, you want the name of each
   referenced texture, both base and detail. This is a different situation
   (since "rm" is not going to know about the base texture -> detail texture
   pairing ;-)
/*
 * processGeoSet() -- add textures referenced by geoset to list
 */

static void
processGeoSet (pfGeoSet *geoset, pfList *list)
{
    pfGeoState *geostate;
    pfTexture *mainTex;

    /* validate argument */
    if (geoset == NULL || (geostate = pfGetGSetGState(geoset)) == NULL)
        return;

    /* add main texture (if defined) to list */
    if (((mainTex = pfGetGStateAttr(geostate, PFSTATE_TEXTURE)) != NULL)&&
        ((pfGetGStateInherit(geostate)&PFSTATE_TEXTURE) == 0))
        if (pfSearch(list, mainTex) < 0)
            pfAdd(list, mainTex);
}

New code simply needs to change the last action to:

    if (a main is texture defined)
        if (it's not already in the list)
            {
            add it.

            if (a detail texture is defined for this main texture)
                if (the detail texture is not already in the list)
                    add it.
            }

Michael
The solution is easy - change libpfutil/tex.c to also add detail textures
to the list (but *don't* use the new version for normal texture prepaging).

Current code:

=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
            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:45 PDT

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