DirectX - Custom Interpolation Filters?

Started by
1 comment, last by Adam_42 13 years, 8 months ago
Hi-

I'm fairly new here, so I apologize if this is posted in the wrong place. I am currently using DirectX in a MFC app in order to display both 2D and 3D image data. The DirectX portion of the program is mostly used for coordinate transformation of the data from memory to the screen (all in the pixel shader). Currently, I am interpolating the data across scan lines by setting the texture sampler state to D3DTEXF_LINEAR (for both MIN and MAGFILTER). For certain images acquired, this filter is sufficient, but under certain circumstances, I need something a bit better.

So, my question is the following: is it possible to change the kernel size of the interpolating filter? The default filter appears to use a 2x2 kernel for the filter, but due to the nature of the data being displayed, I need a 2x4 (or some other asymmetric size) filter to help smooth the data across more scan lines than just 2. Can this be done easily, or will I have to write the interpolation into my pixel shader?

I hope I've given enough information, and thanks for any input you can give.
Advertisement
There's nothing like that in the fixed function pipeline, you'd need to do it yourself in the pixel shader.
You could try enabling anisotropic filtering - it'll look at more than 2x2 pixels so it'll work in 2D for textures that are stretched unevenly, but you can't control the exact number of samples it uses.

This topic is closed to new replies.

Advertisement