PixelMotionBlur Demo

A place to show off your latest screenshots and for people to comment on them. Only start a new thread here if you have some nice images to show off!
User avatar
stoneCold
OGRE Expert User
OGRE Expert User
Posts: 867
Joined: Fri Oct 01, 2004 9:13 pm
Location: Carinthia, Austria
x 1

PixelMotionBlur Demo

Post by stoneCold »

Hi folks,
Some (!!) time ago I already stated how interested I am in the upcoming MotionBlur10 or it's dx9 counterpart, "Pixel" / "Object Space" Motion Blur.
I think all of you know the (good) old frame feedback motion blur, which is fine for effects where the screen should look like the player is dizzy or somewhat. This not really fits the name MOTION Blur, but for instance Crysis has already shown MotionBlur10 in action...
Image

With this technique it's possible to really blur just (fast) moving objects, as it happens in reality to the human eye. It's really amazing how real moving objects can look with this technique applied.

Therefore I did some research and in cooperation with Zeal I can finally present to you...

PixelMotionBlur in Ogre
Scene without PMB:
Image

Scene with PMB:
Image

...and finally...
the source code: LINK
[edit]: the binary: LINK

MOUSE WHEEL: increase, decrease rotation speed of the ogreheads
F1, F2: enable, disable the PMB effect
F3, F4: enable, disable the debug overlay for the two velocity textures
WASDEQ: camera movement

the performance can be further improved by using a renderable listener, but I had no time up to now to integrate it. I'll submit an update :wink:

greetings
Last edited by stoneCold on Sat Apr 16, 2011 8:24 pm, edited 9 times in total.
User avatar
yuriythebest
Orc
Posts: 468
Joined: Sun Jul 10, 2005 11:44 am
Location: Kiev, Ukraine

Post by yuriythebest »

awsome! can you also make a binary release?
asteroidWars - an OGRE game
NOOB MAKE MMORPG- the flash movie
User avatar
CaseyB
OGRE Contributor
OGRE Contributor
Posts: 1335
Joined: Sun Nov 20, 2005 2:42 pm
Location: Columbus, Ohio
x 3

Post by CaseyB »

Looks very cool! I can't wait to play with it when I get home!
Image
Image
User avatar
Paulov
Greenskin
Posts: 126
Joined: Tue Apr 04, 2006 5:18 pm
Location: San Sebastian / Europe

Post by Paulov »

The image looks promising...

but for artists is hard to compile things, an executable would be apreciated.


Thanks.
________________________________________
pablo vidaurre sanz
www.ikernor.com
User avatar
tau
Silver Sponsor
Silver Sponsor
Posts: 413
Joined: Wed Feb 11, 2004 11:44 am
Location: Austin (that's kept wierd :))

Post by tau »

WOW

(that's all I can say...)
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66

Post by sinbad »

That's really nice. Wiki article? :)
User avatar
Kencho
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4011
Joined: Fri Sep 19, 2003 6:28 pm
Location: Burgos, Spain
x 2

Post by Kencho »

Kudos to you! Haven't enjoyed this here yet, but sure looks great and promising :)
Image
User avatar
Wolfmanfx
OGRE Team Member
OGRE Team Member
Posts: 1525
Joined: Fri Feb 03, 2006 10:37 pm
Location: Austria - Leoben
x 100

Post by Wolfmanfx »

Well done :)...und hast dich schon für eine uni entschieden?
User avatar
stoneCold
OGRE Expert User
OGRE Expert User
Posts: 867
Joined: Fri Oct 01, 2004 9:13 pm
Location: Carinthia, Austria
x 1

Post by stoneCold »

Thanks for the great replies, and sorry for not instantly replying to the "binary" request, but I just HAD to try out my today bought GF8800GTS together with some friends. We watched 3DMark06, FEAR, NFS:Carbon and everything worked stunningly great on maximum settings :wink:

I'll compile / release the binary asap.
Wolfmanfx wrote:...und hast dich schon für eine uni entschieden?
Ja, TU-Wien / Cg :wink: ist eben das interessanteste Studium in Österreich für mich. Kannst du mir vielleicht sagen ob ich auch ins Sommer-Semester einsteigen kann? Denn auf der TU page steht unter "Einschreiben" nur der Termin Juli - Oktober fürs Wintersemester.

greetings
User avatar
Wolfmanfx
OGRE Team Member
OGRE Team Member
Posts: 1525
Joined: Fri Feb 03, 2006 10:37 pm
Location: Austria - Leoben
x 100

Post by Wolfmanfx »

Ja sicher kannt im SS einsteigen bin ich damals nachn Zivildienst auch :) dann sehen wir uns ja in wien....ausserdem gibts im SS eine Game Competion http://www.cg.tuwien.ac.at/courses/CG23 ... index.html da hab ich letztes jahr mit gemacht und den 3ten platz mitn Ogre gemacht :) vll mach ich dieses sem mit dir LU ;) dann geht sich bestimmt der erste platz aus ^^
User avatar
Kencho
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4011
Joined: Fri Sep 19, 2003 6:28 pm
Location: Burgos, Spain
x 2

Post by Kencho »

At least post in dual mode ;) or open an "Only for german people" thread :P
Image
User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7157
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 535

Post by Kojack »

This is what I get when I run it:

Image

In PMB, I get ghosts of the ogre heads going diagonal down/left (no matter how fast I spin them) and a very blury sky. With PMB off, the ghosts disappear and the skybox returns to normal.


My system: geforce 7800gtx, xp, athlonx2, latest dx sdk, eihort cvs.


(Oh, and the debug version won't build because pixelmotionblur.cpp isn't disabled like it is in the release build).
User avatar
joshcryer
Gnome
Posts: 351
Joined: Wed Oct 13, 2004 8:22 am

Post by joshcryer »

Oh my God! I was thinking about how I'd do this for several days recently, after having watched the Project Offset videos again. It was driving me insane, so I just gave up on it entirely. OMG. OMG!!!!

What happens when you freeze the simulation? Will the blur stay as in "Project Offset"?

You are my hero stoneCold! Thank you so so much for this. (Sorry if I sound overexicited by this.)
bharling
Gremlin
Posts: 166
Joined: Fri Jun 30, 2006 1:04 pm

Post by bharling »

Funny, I was trying out a techdemo of another engine only yesterday, which features motion blur as one of its major selling points, at which point I thought to myself 'Wow, I wish you could do that in Ogre'. And lo! you can :)

Ace!
Was here
JeDi
Gnome
Posts: 351
Joined: Thu Oct 21, 2004 1:34 pm
Location: Diepenbeek, Belgium
x 3

Post by JeDi »

Great!

Is this about the same technique as used in "Project Offset"? Cause then we should really apply it to a simple particle system as they did, cause I remember my jaw dropping to the floor when I saw the difference. And indeed, being able to "freeze" the effect was one of the most impressive parts of the demo.

Greetz,
JeDi
User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7157
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 535

Post by Kojack »

What happens when you freeze the simulation? Will the blur stay as in "Project Offset"?
Yep, it should handle that. It's up to you to tell the shaders how much every object has moved, so if you keep passing the same data to the shader without actually moving, then it will blur while standing still.
Cause then we should really apply it to a simple particle system as they did
It won't work on a particle system without some extra work. The technique requires manually passing a current and previous matrix for every moving object. So you'd need to pass this data for each particle.
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

Post by Assaf Raman »

Nice work! :D
Watch out for my OGRE related tweets here.
User avatar
stoneCold
OGRE Expert User
OGRE Expert User
Posts: 867
Joined: Fri Oct 01, 2004 9:13 pm
Location: Carinthia, Austria
x 1

Post by stoneCold »

JeDi wrote:Is this about the same technique as used in "Project Offset"? Cause then we should really apply it to a simple particle system as they did, cause I remember my jaw dropping to the floor when I saw the difference. And indeed, being able to "freeze" the effect was one of the most impressive parts of the demo.
Thanks to point me to "Project Offset"(.com) again. I haven't been there for a long time, and now I watched the movie you are talking about. I had to download the HD 720p version to actually see how / what they do to blur their particle systems.
Project Offset - SneakPeek 2 (topmost video, a real MUST-HAVE-SEEN thing)

My current PMB implementation actually does consider full WorldViewProjection matrix changes (movement, rotation, scaling -> from SceneNodes). The same applies for "Project Offset" PMB.

BUT they have also managed to include skeletal animation (you see it at the very beginning of the movie, where the ogre (:)) shakes it's head).
Image

...back to particles :wink:, as I read your post / watched the movie I already thought, it couldn't be that they really store the WVP for each of the particles (surely more than 500) and it's done in realtime.
Therefore I downloaded (as said) the HD version of the video to see more clearly how the blurring of the particles is achieved, and it confirmed my thoughts.
It looks like they don't consider the full WVP for blurring, but only the World component (movement in world space). Also the actual blurring of the particles isn't done as a post processing effect (like the rest of the scene), but with a PixelShader that just applies an fading out alpha at each particle. This alpha effect seems to be adjusted by particle speed. The higher the speed of the particle, the more the alpha fading takes place.

Image
You see that the original shape of the particles (rectangular) isn't changed and therefore I think it's done with the technique described above + the fact that the motion blur for the particles can be paused is another indicator. (The rest of the scene doesn't stay blurred in the video)
sinbad wrote:Wiki article?
Basically a good idea, though I will wait until the whole demo is finished and I'm satisfied with the result :wink:
BTW, I could need some clearifying words from you, because I'm not very sure if my plan to get skeletal animation working is very right.
I recognised that my current PMB implementation doesn't handle an Entity's animation (skeletal in this case as said). I simply tried out the ninja.mesh. First I thought that it would work nontheless, because I thought that my vertex shader would get the already transformed vertex positions. It seems that this is not the case, because the animation causes no blur at all.

When I recognised this, the line "includes_skeletal_animation true" of the ogre manual (material script section) poped to my mind. :wink:

@ sinbad: my idea is to implement the skeletal animation as stated in the manual in hardware. Then I would have the animation transformed vertex position in my shader and the blurring should work as expected.
Is this theory right and is it the only / best way to go, or is there another solution?

@ Kojack: the problem you get is really weird, I just compiled the binary release of the demo + included an option to show the two velocity rendertextures I'm using. (F3 shows the debug overlay, F4 hides it)
PixelMotionBlur Demo binary (win32)
It would be great if you could tell me if both rendertextures display alright on your system. Both should show a black/blue shot of the scene with the ogreheads.

thanks for the replies, I hope to showcase skeletal animation / particle motion blur soon :wink:
Last edited by stoneCold on Wed Jan 10, 2007 10:31 pm, edited 2 times in total.
User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7157
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 535

Post by Kojack »

Here's the scene when the heads aren't moving:
Image

And here it is when they are spinning pretty fast:
Image
User avatar
stoneCold
OGRE Expert User
OGRE Expert User
Posts: 867
Joined: Fri Oct 01, 2004 9:13 pm
Location: Carinthia, Austria
x 1

Post by stoneCold »

As said the rendertextures should be black/blue. Black background, Blue ogreheads. I've added a second technique to the skybox material where I use just black images to get a completely black skybox for the rendertextures.
Therefore it seems the loading of the black textures failed. Does ogre.log say something in that manner?
Panter
Halfling
Posts: 97
Joined: Mon Mar 20, 2006 2:42 pm

Post by Panter »

stoneCold wrote:As said the rendertextures should be black/blue. Black background, Blue ogreheads. I've added a second technique to the skybox material where I use just black images to get a completely black skybox for the rendertextures.
Therefore it seems the loading of the black textures failed. Does ogre.log say something in that manner?
I'm having the same problem as Kojack (I do also have a 7800 series card but the GO version).

Some snippets of the Ogre logs although I see nothing severly wrong:
....
21:27:51: Finished parsing scripts for resource group Internal
21:27:51: Texture: evening_fr.jpg: Loading 1 faces(PF_B8G8R8,512x512x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,512x512x1.
21:27:51: Texture: evening_bk.jpg: Loading 1 faces(PF_B8G8R8,512x512x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,512x512x1.
21:27:52: Texture: evening_lf.jpg: Loading 1 faces(PF_B8G8R8,512x512x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,512x512x1.
21:27:52: Texture: evening_rt.jpg: Loading 1 faces(PF_B8G8R8,512x512x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,512x512x1.
21:27:52: Texture: evening_up.jpg: Loading 1 faces(PF_B8G8R8,512x512x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,512x512x1.
21:27:52: Texture: evening_dn.jpg: Loading 1 faces(PF_B8G8R8,512x512x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,512x512x1.
21:27:52: Texture: velocity_fr.jpg: Loading 1 faces(PF_B8G8R8,1x1x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,1x1x1.
21:27:52: Texture: velocity_bk.jpg: Loading 1 faces(PF_B8G8R8,1x1x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,1x1x1.
21:27:52: Texture: velocity_lf.jpg: Loading 1 faces(PF_B8G8R8,1x1x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,1x1x1.
21:27:52: Texture: velocity_rt.jpg: Loading 1 faces(PF_B8G8R8,1x1x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,1x1x1.
21:27:52: Texture: velocity_up.jpg: Loading 1 faces(PF_B8G8R8,1x1x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,1x1x1.
21:27:52: Texture: velocity_dn.jpg: Loading 1 faces(PF_B8G8R8,1x1x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,1x1x1.
21:27:52: Creating viewport on target 'Simple Ogre App', rendering from camera 'SimpleCamera', relative dimensions L: 0.00 T: 0.00 W: 1.00 H: 1.00 ZOrder: 0
21:27:52: Viewport for camera 'SimpleCamera', actual dimensions L: 0 T: 0 W: 800 H: 600
....
21:27:52: Mesh: Loading ogrehead.mesh.
21:27:52: Can't assign material Ogre/Eyes to SubEntity of Object_0 because this Material does not exist. Have you forgotten to define it in a .material script?
21:27:52: Can't assign material Ogre/Skin to SubEntity of Object_0 because this Material does not exist. Have you forgotten to define it in a .material script?
21:27:52: Can't assign material Ogre/Earring to SubEntity of Object_0 because this Material does not exist. Have you forgotten to define it in a .material script?
21:27:52: Can't assign material Ogre/Tusks to SubEntity of Object_0 because this Material does not exist. Have you forgotten to define it in a .material script?
21:27:52: Texture: RustySteel.jpg: Loading 1 faces(PF_B8G8R8,256x256x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,256x256x1.
21:27:52: Can't assign material Ogre/Eyes to SubEntity of Object_1 because this Material does not exist. Have you forgotten to define it in a .material script?
21:27:52: Can't assign material Ogre/Skin to SubEntity of Object_1 because this Material does not exist. Have you forgotten to define it in a .material script?
21:27:52: Can't assign material Ogre/Earring to SubEntity of Object_1 because this Material does not exist. Have you forgotten to define it in a .material script?
21:27:52: Can't assign material Ogre/Tusks to SubEntity of Object_1 because this Material does not exist. Have you forgotten to define it in a .material script?
21:27:52: Can't assign material Ogre/Eyes to SubEntity of Object_2 because this Material does not exist. Have you forgotten to define it in a .material script?
21:27:52: Can't assign material Ogre/Skin to SubEntity of Object_2 because this Material does not exist. Have you forgotten to define it in a .material script?
21:27:52: Can't assign material Ogre/Earring to SubEntity of Object_2 because this Material does not exist. Have you forgotten to define it in a .material script?
21:27:52: Can't assign material Ogre/Tusks to SubEntity of Object_2 because this Material does not exist. Have you forgotten to define it in a .material script?
21:27:52: Can't assign material Ogre/Eyes to SubEntity of Object_3 because this Material does not exist. Have you forgotten to define it in a .material script?
21:27:52: Can't assign material Ogre/Skin to SubEntity of Object_3 because this Material does not exist. Have you forgotten to define it in a .material script?
21:27:52: Can't assign material Ogre/Earring to SubEntity of Object_3 because this Material does not exist. Have you forgotten to define it in a .material script?
21:27:52: Can't assign material Ogre/Tusks to SubEntity of Object_3 because this Material does not exist. Have you forgotten to define it in a .material script?
21:27:52: Can't assign material Ogre/Eyes to SubEntity of Object_4 because this Material does not exist. Have you forgotten to define it in a .material script?
21:27:52: Can't assign material Ogre/Skin to SubEntity of Object_4 because this Material does not exist. Have you forgotten to define it in a .material script?
21:27:52: Can't assign material Ogre/Earring to SubEntity of Object_4 because this Material does not exist. Have you forgotten to define it in a .material script?
21:27:52: Can't assign material Ogre/Tusks to SubEntity of Object_4 because this Material does not exist. Have you forgotten to define it in a .material script?
21:27:52: Can't assign material Ogre/Eyes to SubEntity of Object_5 because this Material does not exist. Have you forgotten to define it in a .material script?
21:27:52: Can't assign material Ogre/Skin to SubEntity of Object_5 because this Material does not exist. Have you forgotten to define it in a .material script?
21:27:52: Can't assign material Ogre/Earring to SubEntity of Object_5 because this Material does not exist. Have you forgotten to define it in a .material script?
21:27:52: Can't assign material Ogre/Tusks to SubEntity of Object_5 because this Material does not exist. Have you forgotten to define it in a .material script?
21:27:52: Can't assign material Ogre/Eyes to SubEntity of Object_6 because this Material does not exist. Have you forgotten to define it in a .material script?
21:27:52: Can't assign material Ogre/Skin to SubEntity of Object_6 because this Material does not exist. Have you forgotten to define it in a .material script?
21:27:52: Can't assign material Ogre/Earring to SubEntity of Object_6 because this Material does not exist. Have you forgotten to define it in a .material script?
21:27:52: Can't assign material Ogre/Tusks to SubEntity of Object_6 because this Material does not exist. Have you forgotten to define it in a .material script?
21:27:52: Can't assign material Ogre/Eyes to SubEntity of Object_7 because this Material does not exist. Have you forgotten to define it in a .material script?
21:27:52: Can't assign material Ogre/Skin to SubEntity of Object_7 because this Material does not exist. Have you forgotten to define it in a .material script?
21:27:52: Can't assign material Ogre/Earring to SubEntity of Object_7 because this Material does not exist. Have you forgotten to define it in a .material script?
21:27:52: Can't assign material Ogre/Tusks to SubEntity of Object_7 because this Material does not exist. Have you forgotten to define it in a .material script?
21:27:52: Creating viewport on target 'rtt/2312544', rendering from camera 'SimpleCamera', relative dimensions L: 0.00 T: 0.00 W: 1.00 H: 1.00 ZOrder: 0
21:27:52: Viewport for camera 'SimpleCamera', actual dimensions L: 0 T: 0 W: 800 H: 600
21:27:52: WARNING: Texture instance 'VelocityTexture' was defined as manually loaded, but no manual loader was provided. This Resource will be lost if it has to be reloaded.
21:27:52: WARNING: Texture instance 'VelocityTextureLast' was defined as manually loaded, but no manual loader was provided. This Resource will be lost if it has to be reloaded.
21:27:52: Creating viewport on target 'rtt/2313856', rendering from camera 'SimpleCamera', relative dimensions L: 0.00 T: 0.00 W: 1.00 H: 1.00 ZOrder: 0
21:27:52: Viewport for camera 'SimpleCamera', actual dimensions L: 0 T: 0 W: 800 H: 600
21:27:52: WARNING: Texture instance 'CompositorInstanceTexture0' was defined as manually loaded, but no manual loader was provided. This Resource will be lost if it has to be reloaded.
21:27:53: Render Target 'rtt/2313856' Average FPS: 205.179 Best FPS: 205.179 Worst FPS: 205.179
21:27:53: Render Target 'rtt/2312544' Average FPS: 205.179 Best FPS: 205.179 Worst FPS: 205.179
21:27:53: Render Target 'rtt/2312896' Average FPS: 205.179 Best FPS: 205.179 Worst FPS: 205.179

....
User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7157
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 535

Post by Kojack »

The log didn't show any problem with the velocity texture. So I tried resizing the texture up to 8x8 instead of 1x1 and it works better now.

Image
User avatar
stoneCold
OGRE Expert User
OGRE Expert User
Posts: 867
Joined: Fri Oct 01, 2004 9:13 pm
Location: Carinthia, Austria
x 1

Post by stoneCold »

alright, seems like a graphics chip problem, I'm working with an ATI one (no problems)

thanks for the info kojack

[edit]: patched binary download
User avatar
yuriythebest
Orc
Posts: 468
Joined: Sun Jul 10, 2005 11:44 am
Location: Kiev, Ukraine

Post by yuriythebest »

I tried the demo using my nvidia n6600. The first time the camera was outa control and skewed and there was blurring, huring all firther runs there were neither problems with the camera nor blurring.
asteroidWars - an OGRE game
NOOB MAKE MMORPG- the flash movie
User avatar
Paulov
Greenskin
Posts: 126
Joined: Tue Apr 04, 2006 5:18 pm
Location: San Sebastian / Europe

Post by Paulov »

Thanks for the binary version.

I´ve run the demo in a Point of View 7600GT 256 DDR3 with no problem.
Os..>Win xp SP 2.

Only when exiting with alt+tab for pasting in photoshop the camera was like inverted, but the blur effect still worked OK.

Image

Image
________________________________________
pablo vidaurre sanz
www.ikernor.com