January 7th, 2009

Shader Madness

I’ve been doing a lot of messing around with HLSL recently and one thing that has really started to bother me is that I can’t find a definitive reference for the language. I’m not talking about tutorials, I mean answers to questions like “what are the possible enumeration values of MinFilter” or “what is the actual syntax of the operator <X>”. It’s getting on my nerves. I know this document must exist somewhere, but MSDN constantly comes up bare and google is inundated by so many code snippets it’s hard to find something that is authoratative.

In any case, I’ve managed to piece together the beginnings of my attempt at adding specular bloom and motion blur to a test project. This is what I have so far:

The picture on the left is the true color output, the center is visualization of the offset image, and the right is a visualization of the light intensity map. I say visualizations because the actual maps are floating point textures (the offset image is R16G16F and the intensity map is R32F). All three are generated in a single pass using multiple render targets. Right now, you can use the X,Y,and B buttons to switch between views. I haven’t yet finished the process of combining them all together.

I have been reading around and I can’t find or think of a good way to do motion blur on the GPU. Because each pixel in the input contributes to an unbounded number of pixels in the output, the only way to do it via GPU (that I can think of) would involve doing a grid search and finding the correct pixel to blur from. This seems like it would get expensive. I will probably try this as well as a CPU approach. I’ll post more later as to whether or not this was a success.

One Response to 'Shader Madness'

  1. 1pete
    February 19th, 2006 at 23:59

    do i see santa clause off in the distance!!

    welll i should


Leave a Response

RSS | Comments RSS | title image copyright Robert Gendler |