opengl texture mipmaping produces artifact?

I used a single quad and repeated a single texture to make the ground. When I use mipmapping, there is some (blue)artifact that shows. It doesnt appear when I use GL_NEAREST or GL_LINEAR.

Has anyone encountered this problem before?

I’m not sure if it helps, but is your quad ok? It needs to be 64x64 or 128x128 etc.

the texture file is 512x512. I used the soil library to read the texture and make the mipmap

I think that your library is adding a fading color to some of the lower level of the mipmap. Can you save the texture (and all mipmap level) in a file and check?
You can also use program like glIntercept ( or the commercial gDebugger to check the textures.

My bet is on a problem with Soil doing the mipmaps.
Try just loading the file through Soil, and not generating the mipmap yet if it is possible.
Then see :
To make OpenGL generate the mipmaps / alternate version is to call glTexParameteri( GL_TEXTURE_2D, GL_GENERATE_MIPMAP_SGIS, GL_TRUE ); before glTexImage2D.

If the same artifact appear, then it would be the hardware itself … what is your video card ?

There is a simple way to see the exact mipmap in your case:
glTextureParameteri(GL_BASE_LEVEL, level_id)
glTextureParameteri(GL_MAX_LEVEL, level_id)

This will force GL to use only LOD level_id. Iterating through those you’ll see how correct is Soil with mipmap generation.

Thanks to everyone for all the help! soil is the culprit. I used glGenerateMipmap to make the mipmaps and it produced perfect results.