Re: Changing textures on the fly.

New Message Reply Date view Thread view Subject view Author view

Marcus Barnes (marcus++at++multigen.com)
Wed, 20 Dec 1995 11:32:14 -0800


On Dec 20, 3:37pm, Mark Baranowski wrote:
> Subject: Changing textures on the fly.
> Hi All,
>
> As a 'newbie' to Performer (1.2) still waiting to go on the training
> course, I am hoping someone will be able to give me an overview of the
> issues involved in changing the texture maps used on pfGeoSets at
> runtime.
>
> We use .flt databases in Performer and Vega applications. I am
> assuming that the pfGeoSets created by the loader will have a
> pfGeoState attached.

Yes.

> Is a call to:
>
> pfGStateAttr(geostate, PFSTATE_TEXTURE, newTex)
>
> all I need to do, and will there be a problem identifying those
> GeoStates which reference the particular texture?

Yes, this can work. You can traverse the scene graph using a pfTraverser.
 Visit all the geosets and remember all their geostates. You should make a set
(use pfList) of the unique geostates. Examine the pfTexture's bound to the
geostates for their names using pfGetTexName().

Be carefull of changing textures that have already been downloaded into the
hardware as this may cause texture memory swapping. The loader does not
download any textures itself.

> As I want this to apply to all geometry which was modelled with the
> original texture, is redefining the texture associated with that
> particular texture index a viable alternative? (I guess I would have
> to dip into GL (texdef2d and the like) to do that?)

The loader manages texture sharing by pathname. I don't recommend messing with
the texture indices. In OpenFlight V14.2 you can use external references to
substitute texture palettes in the manner you describe. This may be usefull to
your application.

[munch]

>-- End of excerpt from Mark Baranowski

Regards.

--
    __  ___      ____  _ ______          Marcus Barnes, Member Tech. Staff
   /  |/  /_  __/ / /_( ) ____/__  ____  MultiGen Inc, 550 S. Winchester
  / /|_/ / / / / / __/ / / __/ _ \/ __ \ Blvd. STE 500, San Jose CA 95128
 / /  / / /_/ / / / / / /_/ /  __/ / / / PH:1-408-556-2654 FX:1-408-261-4102
/_/  /_/\__,_/_/\_\/_/\____/\___/_/ /_/  EMAIL: marcus++at++engr.multigen.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:52:10 PDT

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