I have enabled mipmapping, but up close the texture looks wrong
It should be
I am using
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
Thanks in advance for any help…
I have enabled mipmapping, but up close the texture looks wrong
It should be
I am using
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
Thanks in advance for any help…
this is not really “advanced” opengl, this is more beginner questions.
You are wrong, mipmapping is enabled with :
(with trilinear filtering, come on, we are in 2007)
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
then the mag filter should be bilinear :
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
And about your rgb stripes
on your texture it looks like you did not upload it correctly.
Sorry - I did not post enough info -
When I render the texture without mipmapping, it appears fine up close (no rgb colors). But when viewing from a far it looks poor - lots of aliasing of the lines.
When I render with mipmapping, the aliasing goes away, but I get strange rgb stripes up close.
I am generating mipmaps with:
gluBuild2DMipmaps( GL_TEXTURE_2D, 3, w, h, GL_RGB, GL_UNSIGNED_BYTE, image->pixels );
and rendering with (thanks for the trilinear tip):
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR );
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
Why do I get strange RGB lines when rendering with mipmapping enabled?
Thanks again for any help…
I solved it.
It was my own error.
Format should have been GL_RGBA
gluBuild2DMipmaps( GL_TEXTURE_2D, 4, w, h, GL_RGBA, GL_UNSIGNED_BYTE, image->pixels );
Thanks for your help…