Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I am drawing lots of textures and panning and zooming in and out on them. When the camera zooms out they look really ugly.

What can I do?

share|improve this question
4  
Did you try generating mipmaps? –  bummzack Apr 14 '11 at 12:04
1  
Might also help to provide some screenshots of what exactly you're talking about. Could be a couple things, but as bummzack said, probably mipmaps. –  Leniency Apr 14 '11 at 14:33
    
imgur.com/a/pdzdS theres zoomed in and zoomed out –  tm1rbrt Apr 14 '11 at 15:03
    
That texture is a bad example, no matter what, its tiled, it will always look strange zoomed out (esp since it has a distinct pattern) –  Daniel Apr 16 '11 at 8:22
add comment

1 Answer

up vote 5 down vote accepted

Yup, looks like mipmaps. This looks like it might be a good resource on how to add them in. Once in though, you can manipulate the filtering - try enabling trilinear filtering or anisotropic filtering.

share|improve this answer
    
gluBuild2DMipmaps is a bad function to suggest. If you are targeting OpenGL 2, you should use GL_GENERATE_MIPMAP. If you are targeting OpenGL 3, you should use glGenerateMipmaps. –  user744 Apr 14 '11 at 18:51
1  
Also, for preference, don't even bother with online generation. You can generate mips offline pretty easily, which only adds around 30% to your texture sizes, but saves a ton of loading time. You can also experiment with alternate shrinking filters to achieve the look you want (sharper, softer, etc). As for filtering: if you're only doing 2D screens, don't bother with anything but linear: anisotropic filtering is for coping with changing mip levels across a single polygon, which can't happen if you're orthogonal to the camera. –  Chris Subagio Apr 14 '11 at 19:03
    
Online generation is still useful if you're doing dynamic textures. Some 2D APIs I have worked with will automatically atlas as you load (under the premise a 2D game is more likely to load lots of small textures, and the artist burden of manually atlasing would be large), which requires online mipmap generation. –  user744 Apr 14 '11 at 20:01
    
Made my answer a community wiki - haven't done openGl in years so others can suggest better resources in the answer if they want. –  Leniency Apr 14 '11 at 20:36
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.