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
xavier
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 9481
Joined: Fri Feb 18, 2005 2:03 am
Location: Dublin, CA, US
x 22

Post by xavier »

WinXP SP2, Quadro 3450/4000 SDI 256MB PCIx16, Core2Duo 3.2G 2GB (77.18 drivers tho -- gonna have to have a word with IT about that ;))

Not sure what difference I was supposed to be seeing between the blur and non-blur -- they both looked the same to me (I didn't get any sort of "wow that looks real" sense from the blur version).
Do you need help? What have you tried?

Image

Angels can fly because they take themselves lightly.
Vectrex
Ogre Magi
Posts: 1266
Joined: Tue Aug 12, 2003 1:53 am
Location: Melbourne, Australia
x 1
Contact:

Post by Vectrex »

xavier wrote:WinXP SP2, Quadro 3450/4000 SDI 256MB PCIx16, Core2Duo 3.2G 2GB (77.18 drivers tho -- gonna have to have a word with IT about that ;))

Not sure what difference I was supposed to be seeing between the blur and non-blur -- they both looked the same to me (I didn't get any sort of "wow that looks real" sense from the blur version).
clearly you didn't play with the mouse wheel to make then spin about. It makes loads of difference to me. Try increasing the max objects so they're move dense and once they get a bit of speed up it looks great (even though the edges are sharp which I believe is a limitation of the technique)
User avatar
xavier
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 9481
Joined: Fri Feb 18, 2005 2:03 am
Location: Dublin, CA, US
x 22

Post by xavier »

I did all that. I still see aliasing, not blur. I'll try it again at home where I know I have the latest drivers.
Do you need help? What have you tried?

Image

Angels can fly because they take themselves lightly.
User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7157
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 534

Post by Kojack »

Hmm, textures as small as 2x1 work fine, but 1x1 comes out as white. Strange.
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 »

xavier wrote:WinXP SP2, Quadro 3450/4000 SDI 256MB PCIx16, Core2Duo 3.2G 2GB (77.18 drivers tho -- gonna have to have a word with IT about that ;))

Not sure what difference I was supposed to be seeing between the blur and non-blur -- they both looked the same to me (I didn't get any sort of "wow that looks real" sense from the blur version).
Currently the effect is Framerate dependent, therefore it could really be that you don't see much difference with very high FPS (that I never achieve with my ati9600). The next version of the demo will feature some more controls to change effect settings *working on it* :wink:
User avatar
xavier
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 9481
Joined: Fri Feb 18, 2005 2:03 am
Location: Dublin, CA, US
x 22

Post by xavier »

I'll check what sort of framerate I get at work (does the demo have a framerate display option? If not I can use fraps).
Do you need help? What have you tried?

Image

Angels can fly because they take themselves lightly.
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 »

I use fraps too, therefore no display option yet. Though you should be able to view the effect when pressing ALT in windowed mode what will freeze the rendering. Compare F1 / F2 and the difference should be very visible then.

[edit]: I tried to set the windowed resolution to 640x480 to increase the framerate on my (old) machine and the effect is very visible though.
User avatar
Paulov
Greenskin
Posts: 126
Joined: Tue Apr 04, 2006 5:18 pm
Location: San Sebastian / Europe
Contact:

Post by Paulov »

Not sure what difference I was supposed to be seeing between the blur and non-blur -- they both looked the same to me (I didn't get any sort of "wow that looks real" sense from the blur version).
I had the same impression when I tried.

I might be due to the frame rate. Would be nice in order to compare to post the same scene with non blur effect.

The only moment I realized the blur effect was there, was when doing the screen capture where the face appears blurred. Would be nice if those edges could be also blurred somehow.


May be with an example similar to the "ogre" heaad posted before where apears blurred due to its rotation (rotation acording to its own edge) would make the effect more visible. O may be no :)

Good work!!!
________________________________________
pablo vidaurre sanz
www.ikernor.com
Vectrex
Ogre Magi
Posts: 1266
Joined: Tue Aug 12, 2003 1:53 am
Location: Melbourne, Australia
x 1
Contact:

Post by Vectrex »

that makes sense, as I'm using a very lowly laptop ati9600. So I get 30fps on and 100 off. At 30 it's about the right fps for some nice film framerate blurring. But I agree that a fps independant option might be good.... even though technically our eyes have a greater 'fps' than any monitor ;)
SFAOK
Kobold
Posts: 32
Joined: Thu May 20, 2004 9:22 pm

Post by SFAOK »

This is a very impressive effect.
stoneCold wrote: 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
What are the chances of this being implemented in the future? :twisted:
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 »

Vectrex wrote:... (even though the edges are sharp which I believe is a limitation of the technique)
I have not overseen this line, vectrex :wink: It actually confirmed absolutely my thoughts.
Therefore I wanted to do some work to get a better result. After some experiments, I tried to add a final (bloom) blur pass (dependent on velocity too) to the compositor and here are the results...

the previous "CHEAP" PMB
Image

the new "FULL" PMB
Image

without PMB (though the heads move at the same speed)
Image
SFAOK wrote:This is a very impressive effect.
stoneCold wrote: 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
What are the chances of this being implemented in the future? :twisted:
As I already said in this post, I really want to implement (skeletal) animation too, but I'd really like to hear some clearifying words from sinbad (or another master :) ) before I jump into it :wink:
User avatar
Zeal
Ogre Magi
Posts: 1260
Joined: Mon Aug 07, 2006 6:16 am
Location: Colorado Springs, CO USA

Post by Zeal »

Hey nice work! Happy to see you got it working. I always meant to make a demo but I never had time... glad you took the liberty!

*one of these days I want to test your binaries. Maybe I can replace my implementation entirely. I never got around to supporting skeletal animations either, so id be VERY excited to hear if you get that working.
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
Contact:

Post by sinbad »

@stoneCold: yes, you could do this by supporting skeletal animation in your shader, but you'd have to manually tell it what the previous bone matrices were. That isn't that hard in fact, you can just pull them out of entity->getSkeleton()->_getBoneMatrices and save them off somewhere so you have the previous versions and set them on your other 3x4 matrix array every frame. It does of course take double the number of shader constants :)

[edit]In actual fact I guess you could just derive the difference between the bones from the last frame and the bones from the current frame and pass that instead, that would take less constant space and your shader would be much cheaper. The diff doesn't have to be calculated every vertex after all.
User avatar
xavier
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 9481
Joined: Fri Feb 18, 2005 2:03 am
Location: Dublin, CA, US
x 22

Post by xavier »

Image

That is with the blur on (without it gets about 500fps). So I am guessing that since it's running at about 10x film speed that there won't be much blur to see?
Do you need help? What have you tried?

Image

Angels can fly because they take themselves lightly.
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 »

I've added the following to my frameEnded method...

Code: Select all

		Real fps = 50.0;
		Real sleepTime = 1000.0 / fps - evt.timeSinceLastFrame;
		Sleep(sleepTime);
it normalises the framerate to a fixed value as you see

[edit]:
@sinbad: I just added "includes_skeletal_animation true" to my material file...

Code: Select all

vertex_program Velocity_VS hlsl
{
	source Velocity_VS.hlsl
	includes_skeletal_animation true
	target vs_2_0
	entry_point vs_main
}
...and got the same problem that I saw in some other forum threads. The skeletal animation is still performed in software, where the entity should stand still in it's default pose and be processed just by the vertex program. What could cause this?

Furthermore the shader seems to not get the transform matrix array.
Vertex Program Definition:

Code: Select all

vertex_program_ref Velocity_VS
{
	param_named_auto worldMatrix3x4Array[0] world_matrix_array_3x4
}
in the Vertex Program I added the following (I didn't care about the normals yet):

Code: Select all

	float4 blendPos = float4(0,0,0,0);
	int i;
	for (i = 0; i < 4; ++i)
	{
		blendPos += float4(mul(worldMatrix3x4Array[Input.blendIndex[i]], Input.vPos).xyz, 1.0) * Input.blendWeight[i];
	}

    vPosProjSpaceCurrent = mul(mWorldViewProjection, blendPos );
    vPosProjSpaceLast = mul(mWorldViewProjectionLast, blendPos );
There's nothing visible in both rendertextures.
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
Contact:

Post by sinbad »

..and got the same problem that I saw in some other forum threads. The skeletal animation is still performed in software, where the entity should stand still in it's default pose and be processed just by the vertex program. What could cause this?
Odd, because I use skeletal animation in vertex shaders all the time. Which other threads are you referring to, and how are you determining that this is the case?

Your shader is wrong anyway, you're transforming the post-blended position by the worldViewProj instead of just the viewProj - the bones have already transformed it into worldspace.
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 help,
this post discusses the same problem about "includes_skeletal_animation"
http://www.ogre3d.org/phpBB2/viewtopic. ... 5326a6310a
I confirm the problem by setting "includes_skeletal_animation" to true in the vertex program definition and leaving the vertex program as it was before (without any code to perform animations). Though the Entity plays the animation, but usually it should stay in default pose, whatever animation I play?!

@WVP: I actually not renamed the shader parameters, though I pass just the viewproj to it from the program :oops: :wink:
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
Contact:

Post by sinbad »

Ok, well my response is exactly the same, please debug Entity::reevaluateVertexProcessing in your case. As I said, I've never had a problem with using hardware skinning.

Your materials have to support skeletal animation in all passes and the mesh has to not include vertex animation (unless your vertex program also indicates it supports that).
Vectrex
Ogre Magi
Posts: 1266
Joined: Tue Aug 12, 2003 1:53 am
Location: Melbourne, Australia
x 1
Contact:

Post by Vectrex »

can the download link be updated? I'm getting those bugs that were fixed. Got the source too quick when it first appeared :)

ps Things like this should be stored somewhere more permanent than those temp file sharing sites.
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
Contact:

Post by sinbad »

The wiki is really the place to store them - you can upload attachments up to a certain size which can usually accommodate most things.
User avatar
_tommo_
Gnoll
Posts: 677
Joined: Tue Sep 19, 2006 6:09 pm
x 5
Contact:

Post by _tommo_ »

Anyway the source is 10 months old and written for Ogre 1.2... and doesn't work with Ogre 1.4 as it is...
There is an updated and fixed version?
Vectrex
Ogre Magi
Posts: 1266
Joined: Tue Aug 12, 2003 1:53 am
Location: Melbourne, Australia
x 1
Contact:

Post by Vectrex »

_tommo_ wrote:Anyway the source is 10 months old and written for Ogre 1.2... and doesn't work with Ogre 1.4 as it is...
There is an updated and fixed version?
Actually it does work. All I had to do was remove the old input stuff. I'm just getting that same error of the ghost offset images which looks like it was fixed.
It's too good of an effect to ignore, infact it should be an official demo along with depth of field.

Sinbad: cool I didn't know you could store zip files etc
User avatar
tuan kuranes
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 2653
Joined: Wed Sep 24, 2003 8:07 am
Location: Haute Garonne, France
x 4
Contact:

Post by tuan kuranes »

I do have an updated source version with bonus branching (PS3.0) support, but still directx only :

http://tuan.kuranes.free.fr/PixelMotionBlur.zip

Fast readme:
-mousewheel to roll heads,
-tab to pause and admire blur,
-F2 to disable,
-F1 to enable,
-F3 to try decrypting velocity textures.

Intended to add MRT and reprojection cache motion blur but miss times nowadays.

I Wonder if the pixel motion blur GPU GEMS III is using the reprojection cache idea ?
User avatar
_tommo_
Gnoll
Posts: 677
Joined: Tue Sep 19, 2006 6:09 pm
x 5
Contact:

Post by _tommo_ »

Yes i also removed all the input code and then worked... i meant that you can't just compile it as it is.
I have a doubt now: he passes the 2 matrices that are calculated per-object in the material... and i think that this way i can't have more than 1 object sharing the same material, or not?
Vectrex
Ogre Magi
Posts: 1266
Joined: Tue Aug 12, 2003 1:53 am
Location: Melbourne, Australia
x 1
Contact:

Post by Vectrex »

tuan kuranes wrote:I do have an updated source version with bonus branching (PS3.0) support, but still directx only :

http://tuan.kuranes.free.fr/PixelMotionBlur.zip
great! It works. A nice class now I notice. I had to set the textureDivider from 16 back to 1 though because it looked super blocky :)
Interestingly when I press pause (which looks cool) my FPS goes up considerably. Any optimisations possible?
Post Reply