Re: trouble loading texture

New Message Reply Date view Thread view Subject view Author view

From: Brian Furtaw (brian++at++sgi.com)
Date: 02/24/2000 07:02:12


Tim,

I don't have a copy of Vega to run but I modified
/usr/share/Performer/src/pguide/libpf/C++/bump.C to use your callback
green.marble.2.rgb and I get a view through green marble of whatever
model I put up.
I of course had to make up my own pfTexEnv and pfTexture calls. You also
had a bad call to pfGetTransparency(PTR_FAST), I assumed you meant
pfTransparency(PTR_FAST) so I used that.

So what kind of Vega node do you have your callback attached to I added
mine to a pfGeode? Is it possible the node you have it attached to is
getting culled?

Brian

Tim Gion wrote:
>
> On Wed, 23 Feb 2000, Brian Furtaw wrote:
>
> > I don't have the contents of your callback so I can't say what you are
> > doing right or wrong. If you call pfGetEnable(PFEN_TEXTURE) does it
> > return true? Have you setup a TextureEnv? The man for pfTexture tells me
> > apply takes care of calling load and format methods for you. This seems
> > to be so in all the examples I can find. Does the texture have power of
> > two dimensions? I am just grabbing at straws here can you provide some
> > test code that demonstrates the problem? Does the texture load fine
> > through Performer, try this iv file,
>
> I'm posting the callback below. Textures are enabled and the
> pfGetEnable() call confirmed that. The texture does have two dimensions
> and it displayed fine in perfly with your Inventor file. I explicitly set
> up a pfTexEnv and applied it, but didn't have any luck with that either.
> Here's the callback:
>
> static void
> drawWater(vgChannel* chan, void* udata)
> {
> GLint matmode, mm;
> GLfloat projmat[16];
> GLboolean cullface, texon;
> int trans;
> static float alpha = 0.5f;
>
> trans = pfGetTransparency();
> glGetBooleanv(GL_CULL_FACE, &cullface);
> glGetBooleanv(GL_TEXTURE_2D, &texon);
>
> pfPushState();
>
> pfGetTransparency(PFTR_FAST);
> glDisable(GL_CULL_FACE);
>
> pfDisable(PFEN_LIGHTING);
>
> pfPushIdentMatrix();
> glDisable(GL_DEPTH_TEST);
> glGetIntegerv(GL_MATRIX_MODE, &matmode);
> glMatrixMode(GL_PROJECTION);
> glGetFloatv(GL_PROJECTION_MATRIX, projmat);
> glMatrixMode(matmode);
> glGetIntegerv(GL_MATRIX_MODE, &mm);
> glMatrixMode(GL_PROJECTION);
> glLoadIdentity();
> gluOrtho2D(0.0f, 1.0f, 0.0f, 1.0f);
> glMatrixMode(mm);
>
> if(!texon)
> glEnable(GL_TEXTURE_2D);
>
> glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
> pfEnable(PFEN_TEXTURE);
> pftexenv->apply();
> pftex->apply();
>
> glBegin(GL_QUADS);
> glColor4f(1.0f, 1.0f, 1.0f, alpha);
> glVertex2f(0.0f, 0.0f);
> glTexCoord2f(0.0f, 0.0f);
> glVertex2f(1.0f, 0.0f);
> glTexCoord2f(1.0f, 0.0f);
> glVertex2f(1.0f, 1.0f);
> glTexCoord2f(1.0f, 1.0f);
> glVertex2f(0.0f, 1.0f);
> glTexCoord2f(0.0f, 1.0f);
> glEnd();
>
> if(!texon)
> glDisable(GL_TEXTURE_2D);
>
> pfPopMatrix();
> glMatrixMode(GL_PROJECTION);
> glLoadMatrixf(projmat);
> glMatrixMode(matmode);
> glEnable(GL_DEPTH_TEST);
>
> pfEnable(PFEN_LIGHTING);
> pfTransparency(trans);
> glEnable(cullface);
> pfPopState();
>
> glFlush();
> }
>
> Tim Gion
> tcg3j++at++cs.virginia.edu (fastest) or gion++at++cs.virginia.edu
> http://www.cs.virginia.edu/~tcg3j
>
> -----------------------------------------------------------------------
> List Archives, FAQ, FTP: http://www.sgi.com/software/performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com

-- 
    ----oOOo----    ----oOOo----    ----oOOo----    ----oOOo----

Brian Furtaw (brian++at++sgi.com) Graphics Guru Office:(301)572-3293 Fax: (301)572-3280 12200-G Plum Orchard Drive OpenGL/Performer/OpenInventor/ImageVision Silver Spring, Maryland 20904 Optimizer/React/PCI Device Drivers


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Thu Feb 24 2000 - 07:09:30 PST

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