sharpening a texture when rendering

Hi all,
since I start from a low resolution video when played at fullscreen the image is quite blurred, is there a way when rendering to sharpen the image?

thanks in advance

Hi Melmoth,

If you start from a low resolution video, there’s not much you can do to improve the resolution. You can set the magnification filter for your texture to GL_LINEAR to get rid of the pixel-blocks but this will result in blurry images when your magnification factor is high.

Other than that, you can take a look at the unsharp filter or deblurring algorithms such as deconvolution using some FFT or wavelet based approaches. Just google for deblurring.

Don’t be fooled by the CSI series on TV where they’re able to extract megapixel resolution images from surveillance cameras with 4x4 pixels :wink:

N.

Thanks for answering,

well I know that it’s not so possible to improve quality, the only thing I was thinking is that maybe when rendering there was some OpenGl built-in Sharpener filter. That can maybe give the impression to the viewer that the quality is better…

The Nvidia cards have a sharpening filter that can be used to sharpen textures when anti aliasing is enabled. It should be somewhere in the nvidia control panel. Maybe there’s also something similar for ATI cards.

N.

I am pretty sure the “sharpen texture” is based on using other mipmap levels. It will not help when you are already magnifying level 0.

Otherwise, you may do a shader that does an unblur, there is an example in the Orange Book.

If you arn’t at the point of magnification, you can sharpen via subtracting out part of the next lowest mipmap level (use the texture lod bias to do this).

tex2D(,0) - sharpenAmount * tex2D(,1)

This also assumes that you manually correctly generated your mipmaps via a gaussian blur and downsampling instead of glGenerateMipmapEXT() which I believe just does a non-overlapping box filter (depends on driver, I’m not sure?). Basically what you are doing in Photoshop terms is an un-sharp mask (subtract out a blurred version of an image results in a “sharpened” image).

If you are trying to sharpen under magnification, I believe you might want to read Chris Green’s (Valve) “Improved Alpha-Tested Magnification for Vector Textures and Special Effects”,

http://www.valvesoftware.com/publications/2007/SIGGRAPH2007_AlphaTestedMagnification.pdf

This is from their publications page,

http://www.valvesoftware.com/publications.html

Hope that helps!

Timothy, that is a nice paper, but not useful for video.

This only increases the max anisotropic filter level (or does nothing when you already use 16x AF). It’s a completely redundant setting.