PDA

View Full Version : Loss of detail in texture



owcs
06-03-2002, 04:09 PM
Hi all,

I am doing some sort of a GUI uisng the 2D overlay method. But I seem to be losing the details in the textures that I am loading. FYI I am loading them from a tga file and using glAlphaFunc to 'blank out' what I don't want. The tga file when viewed through some other external programs ie Photoshop etc looks ok but when I load it into the program it looks all messed up (blurry).

Omaha
06-03-2002, 04:55 PM
If you're distorting the image by mapping it in such a manner that it will have a different aspect ratio than the original image or if the resultant texels are larger or smaller than pixels (very likely) then OpenGL could very likely cause "blurriness" due to texture filtering.

If this is the case, look into glTexParameter* and the GL_TEXTURE_MAG_FILTER and GL_TEXTURE_MIN_FILTER parameters. You can keep it from blurring them.

Also, if your image is appearing to be diluted or missing colors, perhaps you're rendering at a lower bit depth than the original image was stored.

owcs
06-03-2002, 05:16 PM
the image is 1024 x 1024 being mapped onto a quad of the same size. GL_TEXTURE_MAG_FILTER is set to GL_LINEAR while GL_TEXTURE_MIN_FILTER is set to GL_LINEAR_MIPMAP_NEAREST. are these settings wrong?

rpxmaster
06-03-2002, 08:18 PM
I'd guess you'd want it to be like



glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);


I don't know if this'll do it though...for some reason, I'm having a crap problem drawing in 2D in my program too.

Also, make sure you're using uncompressed targas.

owcs
06-03-2002, 10:07 PM
nope, it's still rather blur, still couldnt get it to be as 'sharp' as the image. any other ideas on where i could have gone wrong?

MrShoe
06-03-2002, 10:47 PM
Your probably using the mipmap texture filter? use the linear or nearest filter.

owcs
06-03-2002, 10:59 PM
i am using gl_linear for both. could that be the problem?

owcs
06-04-2002, 12:16 AM
thanks ppl for your help. figured out the problem alrady. the textures are in 32bits but my voodoo3 can only do 16.

Omaha
06-04-2002, 03:48 PM
Also, if your image is appearing to be diluted or missing colors, perhaps you're rendering at a lower bit depth than the original image was stored.[/B]

Booyah! http://www.opengl.org/discussion_boards/ubb/wink.gif