I was reading an old ATI paper on shadow mapping last night and one of the ideas in it got me thinking about another problem.
You can sometimes see it in my HDRPipeline Sample - the process of down-sampling, blurring and then up-sample blending can really show some nasty aliasing. Basically you can end up seeing big "soft" pixels. They're blurred/filtered, but because of the down-sampling they still appear very blocky.
Anyway, the ATI paper suggested that a uniform filter wasn't a good idea as it introduced artificial patterns into the result. The human eye is very good at spotting these artifical patterns. It's a fairly common theme across computer graphics to use different sampling patterns (e.g. Monte-Carlo Integration in ray-tracing) and methods to get around this problem.
So I was thinking about (when I get time) experimenting with this. I thought that instead of uploading a grid of constants to the pixel shader I could upload a number of sampling points within the grid.
Then I thought about the fact that this is applied to every pixel (in true Pixel Shader fashion) the same way. So I wondered about doing some sort of dynamic selection/rotation of the samples.
Using some of the HLSL intrinsics you should be able to work out if the current pixel is either an ODD or EVEN row/column. Thus you end up with 4 possibilities for a given pixel:
For an odd value of X you could invert the X coordinates of each sampling point, and for an odd Y you could invery the Y coordinates of each sampling point. Thus for every pixel you get one of 4 rotations of sampling points.
+-+-+-+-+-+ +-+-+-+-+-+ +-+-+-+-+-+ +-+-+-+-+-+|o| | | | | | | | | |o| | | | |o| | | |o| | | |+-+-+-+-+-+ +-+-+-+-+-+ +-+-+-+-+-+ +-+-+-+-+-+| | |o| |o| |o| |o| | | | |o| | | | | | | |o| |+-+-+-+-+-+ +-+-+-+-+-+ +-+-+-+-+-+ +-+-+-+-+-+| | |X| | | | | |X| | | | | |X| | | | | |X| | |+-+-+-+-+-+ +-+-+-+-+-+ +-+-+-+-+-+ +-+-+-+-+-+| |o| | | | | | | |o| | | | |o| |o| |o| |o| | |+-+-+-+-+-+ +-+-+-+-+-+ +-+-+-+-+-+ +-+-+-+-+-+| | | |o| | | |o| | | | |o| | | | | | | | | |o|+-+-+-+-+-+ +-+-+-+-+-+ +-+-+-+-+-+ +-+-+-+-+-+ Original Mirror X Mirror Y Mirror XY
I need to try it out (maybe tomorrow), but I think it could eliminate much of the obvious artificial artifacts involved with the original (trivial) algorithm...