I came across a problem while implementing the algorithm presented in a paper that keeps on coming back after every attempt I make, so I decided I'd create an account and ask for some help as I don't seem to be able to resolve it and I'm slowly, but surely running out of hair.
I've got pretty much everything up and working. I can calculate both camera and object velocities in window space/pixels, this used to be working with older techniques too. I can store the length and depth along with the velocity in an ARGB8 texture for easy lookup. I can calculate the TileMax and NeighborMax vectors properly. I think even my blur algorithm is right.
So what is my problem, you might ask? Well, there are in fact 2 things that keep on bugging me:
1) I went with their velocity mapping algorithm (7th page, section 5). I can store the velocities just fine mapped to [0,1], but how exactly do I read them back? As I understand it, it's firstly mapped to [-0.5, 0.5] and then to [0,1] thanks to that trailing +0.5. So how do I read it back? Do I just go with (V[x]*2.0-1.0)*MaxBlur? Or do I go with (V[x]-0-5)*MaxBlur? Or do I do the full inverse of the function? I'm kinda lost, and the paper doesn't really talk about unpacking.
2) How exactly do you deal with zero, or close to zero velocity? The algorithm uses dot products and vector lengths using the original vector, which can quite easily be zero.
Some help would be really appreciated, as certain things are not exactly clear and also, feel free to ask for more info/my implementation if I didn't give enough info!