Texture aliasing problems

Started by
8 comments, last by MARS_999 16 years, 11 months ago
Hi friends! Can you help me? My question is where should I write these lines: glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); I am using multitexturing. Thanks a lot.
I've seen things you people wouldn't believe. Attack ships on fire off the shoulder of Orion. I watched C-beams glitter in the dark near the Tannhauser gate. All those moments will be lost in time, like tears in rain. Time to die.
Advertisement
glTexParamteri();
glTexParamteri();
gluBuild2DMipmaps();

Better yet, use new features of GL

glBindTexture(...);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);
glTexImage2D(....);

and your video card will generate the mipmaps.
Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);
"and your video card will generate the mipmaps."

When? All times I render my scene? or just the first frame?

By the way, I using multitexturing:

glClientActiveTexture( GL_TEXTURE0_ARB );
glActiveTextureARB( GL_TEXTURE0_ARB );


glClientActiveTexture( GL_TEXTURE1_ARB );
glActiveTextureARB( GL_TEXTURE1_ARB );

Should I use it two times?

Thanks a lot!
I've seen things you people wouldn't believe. Attack ships on fire off the shoulder of Orion. I watched C-beams glitter in the dark near the Tannhauser gate. All those moments will be lost in time, like tears in rain. Time to die.
Quote:Original post by riruilo
"and your video card will generate the mipmaps."

When? All times I render my scene? or just the first frame?

By the way, I using multitexturing:

glClientActiveTexture( GL_TEXTURE0_ARB );
glActiveTextureARB( GL_TEXTURE0_ARB );


glClientActiveTexture( GL_TEXTURE1_ARB );
glActiveTextureARB( GL_TEXTURE1_ARB );

Should I use it two times?

Thanks a lot!
Texture parameters are per-texture-object state. They effect the texture object that's currently bound to the current texture unit.

Texture environments and texture functions (specified with glTexEnv*) are per-texture-unit state. They effect the current texture unit (glActiveTexture).
Quote:Original post by riruilo
"and your video card will generate the mipmaps."

When? All times I render my scene? or just the first frame?
At load time.

What is the exact difference between
gluBuild2DMipmaps

and

glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);
glTexImage2D(....);


?


Thanks a lot.
I've seen things you people wouldn't believe. Attack ships on fire off the shoulder of Orion. I watched C-beams glitter in the dark near the Tannhauser gate. All those moments will be lost in time, like tears in rain. Time to die.
Quote:Original post by riruilo
What is the exact difference between
gluBuild2DMipmaps

and

glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);
glTexImage2D(....);


?


Thanks a lot.


IIRC gluBuild2DMipmaps() is done on the CPU and the latter is done with your GPU... Either one will get the job done.
Interesting.

So, for an old card is better gluBuild2dmipmaps, idnt it?
I've seen things you people wouldn't believe. Attack ships on fire off the shoulder of Orion. I watched C-beams glitter in the dark near the Tannhauser gate. All those moments will be lost in time, like tears in rain. Time to die.
Quote:Original post by riruilo
Interesting.

So, for an old card is better gluBuild2dmipmaps, idnt it?


no, just check to see if GL_SGIS_generate_mipmap extension is supported

This topic is closed to new replies.

Advertisement