Re: Texture mapping

New Message Reply Date view Thread view Subject view Author view

Fischler (src++at++rose)
Thu, 16 Mar 1995 01:00:27 -0800


+>---- On Mar 16, 5:48pm, horne++at++vislab.su.edu.au wrote:
> Subject: Texture mapping
->
->can anyone give more details about turning off and on textures.
->The problem, as far as i can fathom is that perfromer seems to only
->handle 2 states:
-> nothing is textured
-> everything MUST be textured.

Nope - you really do get to control this.

->The problem is that I want to create a database where only some of the
->objects are textured, but what happens is that those obects that don't have a
->texture pick up whatever was the last texture definition.
->
->[ i have tested this with the default perfly by viewing 2 identical
->wavefront models; one with a texture and one without, and they both pick
->up the texture ]
->

You can set the texture enable on the pfGeoState of any model:
        pfGStateMode(gstate, PFSTATE_ENTEXTURE, PF_ON or PF_OFF);
By default, all pfGeoState settings inherit from the global state.
Perfly (and libpf) assumes that on machines with fast texture, you will
choose to have the majority of your database textured and so
texture is enabled by default. Objects with pfGeoState that
do not set the texture or the enable will inherit both from
the global state. This way, objects will be textured on fast machines,
but not on slow machines. Objects that have no texture should set
        pfGStateMode(gstate, PFSTATE_ENTEXTURE, PF_OFF);

Perfly didn't set up a default global texture. So, the texture of one object
is being set, then when we restore the global state we leave texturing on and
don't change the current texture, and then when we draw your
next object it is getting both the texture and the enable.
Are you using our obj loader? We are probably neglecting somewhere
to set the texture enable to OFF on untextured objects.
You might check for this on your resulting object to see that
is the case:
        pfGetGStateMode(gstate, PFSTATE_ENTEXTURE);

We are trying to deal with this situation a bit better in 2.0...

src.

-- 
-----{-----{---++at++   -----{----{---++at++   -----{----{---++at++   -----{----{---++at++
Sharon Rose Clay (Fischler) - Silicon Graphics, Advanced Graphics Dev.
src++at++sgi.com  (415) 390 - 1002  FAX: (415) 965 - 2658  MS 8U-590
-----{-----{---++at++   -----{----{---++at++   -----{----{---++at++   -----{----{---++at++

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:51:05 PDT

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