Sign in to follow this  
rcook

gluBuild2DMipmaps problem

Recommended Posts

Hi guys, so I'm using gluBuild2DMipmaps to create mipmaps for my textures(flexible to other suggestions for generation). It has a graphic of the earth for now. It looks great except near the poles, it will generate this weird stuff I can't explain so I have screen shots. The thing is I can get rid of it by using GL_LINEAR or GL_NEAREST for my min filtering, but that looks bad because it's missing any mipmapping and when the object moves it looks really jaggedly and sharp. It looks much better for everything else when I use GL_*_MIPMAP_* except that it creates this artifact I'm talking about. Here are the screen shots: That is using any of the four GL_*_MIPMAP_* combinations of linear or nearest. To prove it doesn't have to be that way here it is with GL_LINEAR: So yeah, I'm sure more information is needed to point out what I'm doing wrong, but let me know. I'll be playing with it so I'll post if I make any progress, Thanks guys

Share this post


Link to post
Share on other sites
So I've narrowed it down.

This is definitely just because these are the final (highest, top) level of triangles for the sphere (The bottom probably does it too, just not as noticeable).

I specify everything as quads, so maybe this is created by the fact that these are quads with two points overlapping?

Share this post


Link to post
Share on other sites
Actually I'm wrong, it's definitely a linear buildup of ugliness. The next lower level of triangles also has a nasty blurring.

I tested this by when I just wrote something to determine if a quad is really a triangle (and switched to making it a triangle) and added something to make it so I can turn on or off drawing the top most level of triangles.

...hmm I'm really curious if full screen anti aliasing would solve this so that I could just not just mipmaps. It very clearly is a problem with blurring from using the mip maps, and if I could just use GL_LINEAR and do fsaa it seems like it would rid me of the uglies mipmapping is supposed to fix.

Any opinions?

Share this post


Link to post
Share on other sites
Quote:
Original post by V-man
If you have ANISOTROPY support, call
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_ANISOTROPY_EXT, Anisotropy);

reference

http://www.opengl.org/wiki/Texture_Mapping


Thank you, I'll look into it because I'm always looking to make textures look nicer.


Buuuut I solved it :) At least my specific problem for my solution.

For posterity, I simply had to make one call to play with the mipmap selection (add a bias).

glTexEnvf(GL_TEXTURE_FILTER_CONTROL, GL_TEXTURE_LOD_BIAS, "a float value");

For the third argument I put a negative number (which made it prefer high res mip maps).

Oddly this didn't work well with my modification to change the top row of quads into the triangles they really were (got rings for some reason...?). But as long as I left them quads it looks great. I'm only using a value of -1.0

You can tell if this solution will help you by whether or not when you get closer to the textures they produce much better results, which is what led me down this path until I saw a small section in the OpenGL superbible (pg 329 4th ed)

Cheers

Share this post


Link to post
Share on other sites
Yeah, I'm starting to learn a lot more about textures, maybe I should have used a low res texture and then switched to high res as I got closer.

But I still needed some level of minification and GL_LINEAR/NEAREST wasn't doing it. So this saved me from having to do switch out to a higher detail until I want to get a reeaaaally high detail.

Thanks for the response V-man

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this