Texture distortions

Hi all,
This is probably something real easy, but my problem is this: the textures seem to be getting “distorted” and I get this “glistening” effect the larger the viewing distance is or the smaller the view angle to the polygons that have the texture on. When I’m getting closer, the effect is no longer noticeable. I noticed that in games, e.g. the floor is “blurred” in the distance as if to avoid the very problem I’m experiencing.

Now how is it done? What are the common techniques to eliminate that?

Thanks,

I should clarify: the effect is visible only during movement (i.e. first person perspective rotations), and doesn’t exist for still scene.

Sorry I dont have time for a detailed response, but just a few pointers.

To solve the problem at a distance, look into mip-mapping your textures.

To solve the problem viewing at an angle, look into anisotropic filtering.

I have mipmapping turned on, however I use
gluBuildMipmaps routine… Is generating mipmaps manually better?

I’ll look into anisotropic filtering…
Thanks

Actually GL_LINEAR for the texture minimize and maximize filters should already get rid of most of the “glistening” effect. Do you have texture filtering enabled at all or is it GL_NEAREST?

The reason for texture distortion you mentioned I can only imagine perspective correction being turned off. Try switching it to GL_NICEST.

The problem you describe, which is known as texture aliasing, is solved by using mipmaps.

Make sure to set your GL_TEXTURE_MIN_FILTER to either GL_LINEAR_MIPMAP_NEAREST (bilinear mipmapping) or GL_LINEAR_MIPMAP_LINEAR (trilinear mipmapping).

If you really have mipmapping turned on, you should not be seeing any texture aliasing. If you are, there must be some other problem.

Almost all modern GL implementations do perspective-correct texturing whether you tell them to or not, so it’s unlikely that perspective correction is the problem.

  • Matt

As I said earlier, I have mipmaps on, GL_LINEAR for min and GL_LINEAR_MIPMAP_LINEAR for max…

What can be the other reason for this?
-bart

With what depth color is your window initialized? If it is 16bits, try it with 32bits, and see what happens. It may be a problem with the zBuffer.
If it is, you have to use glFrustum to fix it.

Bruno

GL_LINEAR_MIPMAP_LINEAR for GL_TEXTURE_MIN_FILTER! Now it looks cool!
Sorry mcraighead, didn’t notice you were talking about MIN_FILTER, I had LINEAR_MIPMAP_LINEAR turned on only for MAG_FILTER…

The docs in MSDN on this topic are somewhat confusing…
Thanks!

im a stopid ass but having mipmaps for max doesn’t make sense does it. now i wanna know is there a program out there that a person can run code through and it’ll catch all these stopid errors eg a ‘invalid syntax’ error ain’t that much help is it, well it is but not for us lazy ****s