Pixel motion blur artifact...

5000fdaaeeeb9f038be93cf67eb3b130
0
David_Gallagher 102 Sep 07, 2012 at 05:57

Hi I’ve implemented pixel motion blur based on the dx9 sample (though I’m using dx11) using velocity buffers, and it look good, but there is a wierd artifact if I’m orbiting a mesh. if I just move the camera left/right,back/forward etc… it is fine, the problem occurs only if I’m orbiting the mesh looking in it’s direction.

does anyone know the best way to get rid of this or should i try the dx10 example. is it better? thanks for any advice on this.

below are a couple of pics showing the issue and where it’s ok.

here it looks fine…(spining ball)
[img]https://dl.dropbox.com/u/20866095/OE2/mb_000.JPG[/img]

here there is bleeding when orbiting the mesh…( it looks worse runtime with a gap between the bleed and the ball)
[img]https://dl.dropbox.com/u/20866095/OE2/mb_001.JPG[/img]

25 Replies

Please log in or register to post a reply.

A8433b04cb41dd57113740b779f61acb
0
Reedbeta 167 Sep 07, 2012 at 15:59

Do you have a term in your motion blur to throw out samples with too big a depth discrepancy? Kinda looks like the motion blur on the ground is sampling into the pixels occupied by the ball. Unfortunately, postprocess motion blur / DoF is all but impossible to do without obvious artifacts in some situations, but you might at least be able to mitigate the problem with some hacks, like throwing out samples whose depth is too far from the depth of the center pixel, where “too far” means an arbitrary value you have to tweak for your scene.

Fd80f81596aa1cf809ceb1c2077e190b
0
rouncer 104 Sep 07, 2012 at 20:01

god motion blurs look so good - for a photo finish game they must be real good for the real effect.

5000fdaaeeeb9f038be93cf67eb3b130
0
David_Gallagher 102 Sep 07, 2012 at 21:59

@Reedbeta, currently no, but that sounds like a great idea and might at least minimize the issue to something i can live with, great idea on the depth, thanks again.

@rouncer, yeah it does, i hope someone solves it one day as it really give a nice smooth feel to a game.

Fd80f81596aa1cf809ceb1c2077e190b
0
rouncer 104 Sep 08, 2012 at 14:54

i guess vector blurs are easier than torque - your actually taking on the more challenging one.
If i did it - just image space, project the vector then sample in the direction of the 2d line made. should be pretty simple, if i had a vector and 3d position per pixel on the screen i bet that would look amazing when like say a plane wooshes by the screen.

5000fdaaeeeb9f038be93cf67eb3b130
0
David_Gallagher 102 Sep 08, 2012 at 23:01

that’s definitely given me more to think about aswell rouncer, thanks. i’ve wanted to get a good motion blur going for a while now so these ideas are really usfull to me.

88dc730f0f71e55be39de0ad103bd9ff
0
Alienizer 109 Sep 09, 2012 at 00:33

Sorry to be off the subject but I do have a question about motion blur for a raytacer. The way I’ve read it’s done is to actually move the object some random offset (within a range of course) on every pass. But isn’t this require to rebuild the kd-tree or the octree? Or maybe I’m just not using the right way to do this on a raytracer (not real time)? Thanks!

A8433b04cb41dd57113740b779f61acb
0
Reedbeta 167 Sep 09, 2012 at 00:50

Hmm, good question. I can’t imagine you’d actually build a whole bunch of kd-trees for different time values; it would be too slow. Perhaps the kd-tree is built using an extended bounding box based on how far each object moves during the frame. Another approach might be to consider the scene as a 4D scene, build a 4D kd-tree and do 4D raytracing. That approach would also generalize nicely to relativistic rendering, where you take lightspeed into account… ;)

6837d514b487de395be51432d9cdd078
0
TheNut 179 Sep 09, 2012 at 03:39

For a raytracer? According to Blender, their raytracer animates the next several frames and uses the temporal information to deduce the motion blur effect. Nothing fancy, straight photoshop effect.

I’m not sure what the DX samples are doing, but as Reed stated it looks like you’re blurring parts of the background. Motion blur, like a lot of other effects, ideally require you to operate on the object independently. That each object should be rendered to a separate FBO, blurred, and then blended back into the scene. Not very practical, so a workaround is to impose a limit on the pixels you do modify, but then you get some artifacts. Though I’ve never seen motion blur implemented at the object level. An LCD screen gives you this effect for free. I’ve only seen motion blur implemented at the camera level, which is dirt easy to implement because you’re just blurring the whole frame equally. Still, if your goal is to only blur the ball, I would suggest you render it separately, blur it, then blend it back into the scene. You’ll get the quality you’re looking for. If your game is a bit more complicated, then you’ll have to work around the artifacts.

5000fdaaeeeb9f038be93cf67eb3b130
0
David_Gallagher 102 Sep 09, 2012 at 06:36

thanks TheNut. what I decided, like you hinted at, was rather than do both camera and object velocity on the per object level, i seperate them to only do object velocities(translat,rotate,animation etc…) on the object level and then in the post process side do the camera velocities based on the reconstruction of position from depth using inverse view projection and previous viewprojection. by doing this i did get rid of the gap artifact at least and looks much better, so that cleared up 95% of what i couldn’t live with. The main reason i needed to clean this up was for things like a third person perspective view where the orbiting of the player character just looks ugly, so as a final step i will create an MRT mask aswell that will allow me to prevent camera blur effecting the mesh when the camera is orbiting such as 3rd person example but still allowing object velocity motion blur, and i should have exactly what i’m after (fingers crossed) as this was the only artifact that was a deal breaker for me. thanks guys really helped a bunch.

below are som pics after the current changes…

camera stationary…

mb\_000\_test\_2.jpg

camera orbiting (will be much nicer once i mask off the camera blur on the focus mesh being orbited)

mb\_001\_test\_2.jpg

Fd80f81596aa1cf809ceb1c2077e190b
0
rouncer 104 Sep 09, 2012 at 10:59

really nice… skeletal animation blurring - nice.
good work on the synthetic environment too - looks like a nice toy land. B)

5000fdaaeeeb9f038be93cf67eb3b130
0
David_Gallagher 102 Sep 09, 2012 at 21:38

Thanks rouncer, appreciate it.

5000fdaaeeeb9f038be93cf67eb3b130
0
David_Gallagher 102 Sep 11, 2012 at 00:31

well it worked! it was a bit tricky getting the masking to work but once I figured it out it was all down hill from there.

anyway here are some last pics of it…Thanks again everyone for your input!

[img]https://dl.dropbox.com/u/20866095/OE2/mb_000_final.JPG[/img]

[img]https://dl.dropbox.com/u/20866095/OE2/mb_001_final.JPG[/img]

5000fdaaeeeb9f038be93cf67eb3b130
0
David_Gallagher 102 Sep 11, 2012 at 07:53

~~I did have one more question…~~

~~I’ve just tried converting it to a compute shader (mind you i have only recently started using them) and i don’t understand something…~~

nevermind figured it out, but will stick with just a pixel shader for this one as there wasn’t much performance gain (in my attempt at a compute shader version atleast).

B20d81438814b6ba7da7ff8eb502d039
0
Vilem_Otte 117 Sep 11, 2012 at 21:02

To the topic of “How to actually do correct motion blur”:

Motion blur in ray tracers and path tracers are done commonly in 2 ways:
1.) “Hack” way - Using the special “animated transform” that describes the object movement over the frame. E.g. this solution is basically the same we’re talking about in this topic, except that we blur at time we’re creating image (e.g. no post-processing and neither bugs that are tied to it, like blurring background, etc.). Although this is a hack and only works for simple transformations (no deformations, etc.) - unlike the post processing solution. E.g. neither of these can actually compute correct motion blur. So is there any way to do it? … -> 2.)

2.) Real way - Okay this will sound silly, but you actually do the stuff, you did on GPUs in the ages of accumulation buffers. Basically current frame is average of several frames. Now you will say that this will produce all artifacts for fast objects or quick camera rotation. The solution is - use sub-frames. You actually sample N sub-frames with defined sub-step before and after current frame (to get correct motion blur at current frame), where finding the N value is tricky. You need to select value high enough to have nice smooth motion blur on fast objects and low enough to actually compute N frames in some realistic time scale (e.g. doing this in few minutes or hours, depending on machines and time-scale available -> basically the almighty budget). Of course the N value can be computed or approximated.

Actually this 2. could be understood as discretization of what Reedbeta described (e.g. using “4D ray tracing”). Note that relativistic ray tracing is quite possible, just don’t forgot variable time at your rays (though I’m not saying it’s being actually used).

But unless you actually do some physics simulation (or high quality render, where motion blur is the main effect of it), you will probably stick to either “Hack” ray tracing solution or post processing solution.

#David Gallagher - It looks like something is wrong with your lerp value’s third argument. Just from first look you’re dividing in pixel shader and multiplying in compute shader. Note that it might be also somewhere else (but I think that this produces somewhat weird texture coordianates), I probably would have to see whole code of compute shader and think a bit more about it. :)

B5262118b588a5a420230bfbef4a2cdf
0
Stainless 151 Sep 12, 2012 at 09:14

Motion blur for me is one of those “I really like the idea of it, but ….” subjects.

I always end up looking at it and thinking “What does it really add to the game?”

To me motion blur is only really valid in cut scene type views, for in the playable parts of the game I think it is a distraction that actually counter-productive.

You don’t get motion blur with the mark one eyeball, so why would I want it in a game?

Motion blur is an artifact of camera based systems, so if you have motion blur, you are implying that a camera is in use and hence the “player” is not really there.

Given that view point, I only ever use it in cut scenes and always either use an accumulation buffer approach, or just do it with 3ds max and record it to disk.

What do you guys think about the use of motion blur?

5000fdaaeeeb9f038be93cf67eb3b130
0
David_Gallagher 102 Sep 12, 2012 at 10:47

What do you guys think about the use of motion blur?

I myself really like it, at least the version I was able to get working (i think it’s similar to project offsets motion blur). I don’t like it too overdone, unless it’s waranted, like a cartoony kind of feel. but the thing i like is it takes away that chopyness as the camera is turning and think it adds to the emersion, at least for me, as my eyes are watching a screen not eyes inside other eyes, so going the movie approach does make sense from that point of view, but everyone has thier own tastes and it something that can always be turned off in the settings. I also really like it when in a vehicle moving really fast, I think it really adds a nice touch as i remember an old james bond game i played once and had a great motion blur for the car driving stages and really gave the feeling of speed. anyway that’s my 2 cents.

B5262118b588a5a420230bfbef4a2cdf
0
Stainless 151 Sep 12, 2012 at 11:08

Often old games set your perspective for the rest of your life. :D

When I wrote FOFT I was often accused of doing an Elite rip off, that was total bollocks.

I was trying to do a Starflight rip off. ;)

6837d514b487de395be51432d9cdd078
0
TheNut 179 Sep 12, 2012 at 11:56

Motion blur, like depth of field is a neat effect to simulate slow shutter speeds, but you’re making assumptions. You assume the gamer is focused on a subject when his eyes may in fact be trying to focus somewhere else. For cinematics these types of effects are acceptable, but for real-time gaming it’s more annoying than beneficial. I personally think the natural side effects of ghosting in an LCD monitor reflect realistic motion blur far better than a programmed solution. When I turn my head, the world around me doesn’t wash out :)

5000fdaaeeeb9f038be93cf67eb3b130
0
David_Gallagher 102 Sep 12, 2012 at 13:21

Often old games set your perspective for the rest of your life.

so true, I have a handful of greats i measure everything by. :)

I wrote FOFT I was often accused of doing an Elite rip off, that was total bollocks.
I was trying to do a Starflight rip off.

lol

You assume the gamer is focused on a subject when his eyes may in fact be trying to focus somewhere else

I definently agree with you for depth of field, but motion blur when tuned it really only really smooths the rendering. it doesn’t really impose on the players focus as (depending on the game of coarse I usually find myself focusing the same way the mouse is toward the center of the screen).
here is a Video from my engine, showing some various filters all containing this motion blur and even with it’s slightly exaggerated settings (just to make it more noticable in the video) the motion blur (except when paused) just looks like the original without camera shadering when turning.

6837d514b487de395be51432d9cdd078
0
TheNut 179 Sep 12, 2012 at 14:51

I was thinking about games like Crysis and TF2 where motion blur is so grossly exaggerated that it actually makes the game more difficult to play. I watched your video, but it lacks contrast to make a reliable judgement. A scene with detailed textures, decent lighting (with highlights and shadows), and textual sign posts would be a much better indicator. Personally, I wouldn’t accept anything more than a 4 to 5 pixel shift in blur. That would be acceptable and as you say, enough to smooth out the edges. More than this and you have yourself a washing machine. Cinematics are a different matter though and I think, artistically, the sky is the limit here.

5000fdaaeeeb9f038be93cf67eb3b130
0
David_Gallagher 102 Sep 12, 2012 at 22:15

oh yes i see what you mean, washing machine effect is so not cool :) . I’m glad you said how much you think would be acceptabe for you, as I think rather than just add it as an on/off setting i will give the user control of the 3 parameters aswell (camera blur intensity, object blur intensity and sample count) that way the user can decide for them selves whether to use it or not and how much they would like or even only use object bluring and no camera bluring.

87e614b8b888bb2c4485c1ac16d8c779
0
moe 101 Sep 13, 2012 at 15:14

Personally I don’t like motion blur in games. It makes it just harder to recognize what’s going on. It’s ok in cinematics though as it can create a specific atmosphere and set the tone of a game. The same goes for depth of field. I think you tend to look at something out of focus and just keep wondering what it might be instead of playing the game. It makes you miss details that you as a player might find interesting.

I like that you want to let the user decide if he want’s motion blur or not. Though, it might be a bit of a pitty if you do all the work and the user just turnes it of :)
None the less these are the things that leave the user with an impression that you care for him (since you give him the choice) which can go a long way.

5000fdaaeeeb9f038be93cf67eb3b130
0
David_Gallagher 102 Sep 13, 2012 at 18:56

I like that you want to let the user decide if he want’s motion blur or not. Though, it might be a bit of a pitty if you do all the work and the user just turnes it of :)
None the less these are the things that leave the user with an impression that you care for him (since you give him the choice) which can go a long way.

yeah at the end of the day it’s the players game, and if something is annoying to them they should be able to turn it off (offtopic rant: there are so many games I wish had quick saves rather than check points and allowed skipping of the cutscene,especially before taking on a boss, as after watching a cutscene once or twice i really don’t need to see it again unless i want to for nostalgia’s sake, and i hate games when i have to traverse a very large distance in a game only to get axed and have to go right back to the checkpoint and do all the mind numbing stuff all over again, these are features i’d like also to be decided by the player//end rant lol).
But being I’m making my game for me too :) and i myself like motion blur, even if every potential player turned it off I’d be happy because i can still use it, I also want to do ingame only cinematics rather than rely on video so it’s good to have in the arsenal, at least from my needs, but yeah everyone has different needs.

B5262118b588a5a420230bfbef4a2cdf
0
Stainless 151 Sep 14, 2012 at 08:39

In my code base I have about a dozen effects that I don’t use.

I have things like GPU based 3D spherical harmonics, iterated fractal functions, speed based mesh distortion, etc. etc. etc.

They are all things that I have either seen somewhere and wanted to have a go at, or I wanted for a project that never got finished.

They are great to have in the back pocket… JUST IN CASE :D

I agree with your rant, I have actually stopped buying Square Enix’s games because of this issue. I am one of those anal bar stewards :P

B20d81438814b6ba7da7ff8eb502d039
0
Vilem_Otte 117 Sep 14, 2012 at 09:51

I think that counts for everyone stainless. F.e. in my code you can switch to pure ray-tracing or even path-tracing :D (through console). It’s only through CPU now (because it’s quite impossible to re-use meshes, textures, etc. that are used in scene for both - rasterizer and ray tracer … though I’m working on GPU solution). The thing is that almost everything I implement can be turned on (and lots of things with undefined behavior :D - “It’s not a bug, it’s a feature”).