Texture aliasing problems
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.
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.
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.
"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!
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!
Quote:Original post by riruiloTexture parameters are per-texture-object state. They effect the texture object that's currently bound to the current texture unit.
"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 environments and texture functions (specified with glTexEnv*) are per-texture-unit state. They effect the current texture unit (glActiveTexture).
Quote:Original post by riruiloAt load time.
"and your video card will generate the mipmaps."
When? All times I render my scene? or just the first frame?
What is the exact difference between
gluBuild2DMipmaps
and
glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);
glTexImage2D(....);
?
Thanks a lot.
gluBuild2DMipmaps
and
glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);
glTexImage2D(....);
?
Thanks a lot.
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.
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
Popular Topics
Advertisement