Mkay, so I decided to try and add a motion blur for my lil project but (as usually) failed miserably. I'm using quite small objects (obj.*) imported from 3ds max, tried all different motion blur strenght options but it still did not work.
On the first sight it seems to be above my skill to do such thing, but from my past experience many things seem much more complicated than they are in real, I will surely give it a go and look for other implementations and try to use them.
currently 'm looking into the MotionBlurRenderPass code - seems there's some geometry streching and velocity calculation.
and in my impl i notice strange geometry distortion (similar artefacts as in your screens) - seems to be something out of bounds in calc - problem with the vert-shader? but the code looks ok. and frag-shader seems to be ok. i also controlled blurStrength and the input matrices. i use many (differently rotated/translated) shared-meshes, but have to look if this is a problem for that code - i'm new to glsl - worked with directx before…
has anybody out there some suggestions what there can be wrong?
i've found the reason why my implementation did not work correctly - seems MotionBlurRenderPass has problems with SCALING of a spatial. i did a downscaling of 0.1f to my object nodes and got distorted geometry with motion-blur.
if i use normal (1.0f) scaling, everything works fine.
looking into the MotionBlurRenderPass code seems it considers the scaling for matrix calc, but maybe in a wrong way…
Thanks for your time but unfortunately it did not solve my issues, here is how it looks after I disabled all of the localscales and scaled object up in 3d software:
hmmmm the new screeny seems to show that there happens nothing with motionblur… but i do not see any more vertex-artifacts as in your earlier screenshots!??
very difficult to say what's the problem here. have seen in one forum entry that there were problems with ATI-cards, the solution was a loop-unroll in the frag-shader.
good thing to do is to debug MotionBlurRenderPass first with the TestMotionBlur app and then with your own - and compare!!! check if all renderpass-related stuff is in it's right order and place ((simple-)update, render, …) and maybe have a look into the matrices in both cases - hope that helps!
Well tried messing up with the code, but I couldn't get any further with solving my issue.
The motion blur effect in previous post of mine "does something", when I move it (with localtranslation) it changes depending on direction of movement change. So when I move left it is a bit more blue, when I move right a bit less, when I move backwards it looks almost as if blur worked but only until I stop moving my object.
but motion-blur does only "something" when objects ARE moved. this implementation calculates a speed vector in image-space using the last transformation and the current of the model.
a nice pdf-doku of the algorithm can be found by googleing: "stupid opengl shader tricks"
maybe you can post some more screens, where the effects you describe can be seen?
Okay, so I have turned motion blur on again, made sure everything is on scale 1f, and moved cam far away to capture the ship, here's what I get depending on movement direction:
Ship model in ^ this screenie is quite big so motion blur effect on the "move down" is almost invisible, but from what I remember from the past, when I used smaller model motion blur seemed to affect ship "almost correctly" when it flew down.