• Announcements

Archived

This topic is now archived and is closed to further replies.

What kind of texture filtering do you use ?

Recommended Posts

cippyboy    223
Actually Im aiming towards the best texturing filtering that provides the most acurate/realistic effect upon rendering. curently I use
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_LINEAR);
Also meaning that I have mipmaps. Upon all that it seems that the anisotropic filtering is the best way around all this although it might consume some perormance(never tested it against fps rate, but it was kind of fast). So at 8x anisotropic filtering everything looks mighty good but not all cards have that so a general alternative way must exist. What do you use/What is the best ?

Share this post

Share on other sites
I personally use GL_LINEAR for both parameter.

Now i''ve got a question too, is there a filter that uses contrast in the way it filter the texture at a distance ?
For example, if i''d have a white texture with black dots, all 1 pixel in size. Is there a filter that makes these dots visible just a little longer than for example GL_NEAREST and then maybe combining pixel colors?
I am not sure but this could be the way mipmapping works, i never really tried.
I hope i am clear.

Thanks in advance, TP

Share this post

Share on other sites
ga    126
cippyboy: if you want it to work with all cards you''ve to use some of the standard openGL filters like GL_LINEAR_MIPMAP_LINEAR.
Why not just use anisotropic filtering if it''s available and else use GL_LINEAR_MIPMAP_LINEAR?

Living Monstrosity: I don''t think such a filter exists in any opengl extension...
GL_NEAREST should always produce white and black pixels and no gray pixels in your example.

Share this post

Share on other sites
cippyboy    223
[ga] I already use that "standard" stuff, and know what nearest and linear imply all together but... I wanted an example of a professional combination... I playes Serious Sam 2 the other day and it had some interesting options in advanced rendering menu, like how textures are filtered(blured/sharped it wrote) and when theres a lot of blur the game looks like crap... also a lot of sharpness gives some spikes to the edges and most of the textures
[Living Monstrosity] I guess you should try mipmapping use my setting and then come back with youre problem

Share this post

Share on other sites
Enigma    1410
To get maximum anisotropic filtering on any card, just do:
if (GL_EXT_texture_filter_anisotropic){
float mta;
glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &mta);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, mta);
}

Living Monstrosity: best way to do what you want would probably be to set your min filter to GL_LINEAR_MIPMAP_LINEAR, and upload a set of custom mipmaps. The base level would be your original image with black dots on white, the next level would be a reduced version of this, but still with sharp black dots in the same place, and so on down the levels. Hope this makes sense.

Enigma