Saturday, November 7, 2009

Fun with Texture Filtering

One key item I'm working on is considerably more robust hardware support and fallback modes. It's quite often erroneously believed that D3D is capable of software emulation in cases where a feature isn't supported, but this is actually not so. In fact it's OpenGL that does the software emulation thing (but without providing a means of testing capabilities to see if it's going to do so) whereas D3D will normally fail silently and do nothing.

Texture filtering is on the list, and has now been extended to fallback gracefully from anisotropic to trilinear to bilinear to nearest neighbour to no filtering for all 3 of magnification, minification and filtering between miplevels. I haven't yet re-implemented the old "gl_texturemode" command, but I hope to do so (and in a way that makes it work identically to in GLQuake).

A consequence of texture filtering is that the hardware accelerated Quakes have always appeared blurred, smeared and somewhat washed out when compared to software Quake. I'm not yet certain of a good approach for mitigating this (fixing it definitifely would be impossible) but I'd like to try do something about it. The real problem is that filtering down miplevels causes a lot of it, and that software Quake's colormap was set up to provide a certain look which isn't reproducable in a hardware engine. It's a case of "nice to have" rather than "must have" though.

0 comments: