Re: [info-performer] glBindTexture overrides pfTexture

New Message Reply Date view Thread view Subject view Author view

From: rick.van.haasen++at++philips.com
Date: 04/07/2003 06:34:52


Hi

it could be that texture->apply() uses 'lazy evaluation' to see if it
should do
someting. Because the texture isn't changed (through its interface), it
will
not bind again (the initial binding was done before your call-back was
called)
You could try to use a "dummy operation" on the texture object to enforce
a new texture-binding.

Rick

------------------------------------------------------------------------------------------------
Rick van Haasen Philips Research
Laboratories Eindhoven
Building: WY8-48 Prof. Holstlaan 4
Phone: +31 40 2744357 5656 AA Eindhoven
Fax: +31 40 2744660 The Netherlands
E-mail: rick.van.haasen++at++philips.com
-------------------------------------------------------------------------------------------------

Stephen Jeffrey <Stephen.Jeffrey++at++maths.uq.edu.au>
Sent by:
owner-info-performer++at++holodeck.engr.sgi.com
07-04-2003 08:37
Please respond to Stephen.Jeffrey

 
        To:
        cc: "'info-performer++at++sgi.com'" <info-performer++at++sgi.com>
(bcc: Rick van Haasen/EHV/RESEARCH/PHILIPS)
        Subject: [info-performer] glBindTexture overrides pfTexture
        Classification:

Hi,

I have a draw callback specified on a geode. The
callback binds to an OpenGL texture object and
then draws some geometry. The callback returns
and the geode is then drawn. The problem is the
geode is drawn with the OpenGL texture, not
the pfTexture specified on its geostate ie. the
OpenGL texture seems to override the pfTexture.

int pre_draw_callback(pfTraverser *trav, void *data)
{
   glBindTexture(GL_TEXTURE_2D, ogl_tex);
 
   ... draw some geometry, textured with "ogl_tex" ...

   // Try to switch back to the pfTexture
   pfGeode *node = (pfGeode *)trav->getNode();
   pfGeoSet *geoset = node->getGSet(0);
   pfGeoState *gstate = geoset->getGState();
   pfTexture *texture = (pfTexture *)gstate->getAttr(PFSTATE_TEXTURE);
   texture->apply();
}

   ... then draw the geode ...

int post_draw_callback(pfTraverser *trav, void *data)
{
   ... clean up ...
}

I have tried using pfTexture::apply() in the callback
to switch back to the pfTexture after I'm finished
with the OpenGL texture object, but it has no effect.

Any ideas?

cheers
steve

-----------------------------------------------------------------------
   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
-----------------------------------------------------------------------


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Mon Apr 07 2003 - 06:39:12 PDT

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