PixelMotionBlur Demo
- xavier
- OGRE Retired Moderator
- Posts: 9481
- Joined: Fri Feb 18, 2005 2:03 am
- Location: Dublin, CA, US
- x 22
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).
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).
-
- Ogre Magi
- Posts: 1266
- Joined: Tue Aug 12, 2003 1:53 am
- Location: Melbourne, Australia
- x 1
- Contact:
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)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).
- xavier
- OGRE Retired Moderator
- Posts: 9481
- Joined: Fri Feb 18, 2005 2:03 am
- Location: Dublin, CA, US
- x 22
- stoneCold
- OGRE Expert User
- Posts: 867
- Joined: Fri Oct 01, 2004 9:13 pm
- Location: Carinthia, Austria
- x 1
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*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).
- xavier
- OGRE Retired Moderator
- Posts: 9481
- Joined: Fri Feb 18, 2005 2:03 am
- Location: Dublin, CA, US
- x 22
- stoneCold
- OGRE Expert User
- Posts: 867
- Joined: Fri Oct 01, 2004 9:13 pm
- Location: Carinthia, Austria
- x 1
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.
[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.
- Paulov
- Greenskin
- Posts: 126
- Joined: Tue Apr 04, 2006 5:18 pm
- Location: San Sebastian / Europe
- Contact:
I had the same impression when I tried.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 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!!!
-
- Ogre Magi
- Posts: 1266
- Joined: Tue Aug 12, 2003 1:53 am
- Location: Melbourne, Australia
- x 1
- Contact:
-
- Kobold
- Posts: 32
- Joined: Thu May 20, 2004 9:22 pm
- stoneCold
- OGRE Expert User
- Posts: 867
- Joined: Fri Oct 01, 2004 9:13 pm
- Location: Carinthia, Austria
- x 1
I have not overseen this line, vectrex It actually confirmed absolutely my thoughts.Vectrex wrote:... (even though the edges are sharp which I believe is a limitation of the technique)
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
the new "FULL" PMB
without PMB (though the heads move at the same speed)
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
- Zeal
- Ogre Magi
- Posts: 1260
- Joined: Mon Aug 07, 2006 6:16 am
- Location: Colorado Springs, CO USA
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.
*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.
- sinbad
- OGRE Retired Team Member
- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 66
- Contact:
@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.
[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.
- xavier
- OGRE Retired Moderator
- Posts: 9481
- Joined: Fri Feb 18, 2005 2:03 am
- Location: Dublin, CA, US
- x 22
- stoneCold
- OGRE Expert User
- Posts: 867
- Joined: Fri Oct 01, 2004 9:13 pm
- Location: Carinthia, Austria
- x 1
I've added the following to my frameEnded method...
it normalises the framerate to a fixed value as you see
[edit]:
@sinbad: I just added "includes_skeletal_animation true" to my material file...
...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:
in the Vertex Program I added the following (I didn't care about the normals yet):
There's nothing visible in both rendertextures.
Code: Select all
Real fps = 50.0;
Real sleepTime = 1000.0 / fps - evt.timeSinceLastFrame;
Sleep(sleepTime);
[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
}
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
}
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 );
- sinbad
- OGRE Retired Team Member
- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 66
- Contact:
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?..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?
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.
- stoneCold
- OGRE Expert User
- Posts: 867
- Joined: Fri Oct 01, 2004 9:13 pm
- Location: Carinthia, Austria
- x 1
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
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
- sinbad
- OGRE Retired Team Member
- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 66
- Contact:
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).
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).
-
- Ogre Magi
- Posts: 1266
- Joined: Tue Aug 12, 2003 1:53 am
- Location: Melbourne, Australia
- x 1
- Contact:
- sinbad
- OGRE Retired Team Member
- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 66
- Contact:
- _tommo_
- Gnoll
- Posts: 677
- Joined: Tue Sep 19, 2006 6:09 pm
- x 5
- Contact:
-
- Ogre Magi
- Posts: 1266
- Joined: Tue Aug 12, 2003 1:53 am
- Location: Melbourne, Australia
- x 1
- Contact:
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._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?
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
- tuan kuranes
- OGRE Retired Moderator
- Posts: 2653
- Joined: Wed Sep 24, 2003 8:07 am
- Location: Haute Garonne, France
- x 4
- Contact:
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 ?
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 ?
- _tommo_
- Gnoll
- Posts: 677
- Joined: Tue Sep 19, 2006 6:09 pm
- x 5
- Contact:
-
- Ogre Magi
- Posts: 1266
- Joined: Tue Aug 12, 2003 1:53 am
- Location: Melbourne, Australia
- x 1
- Contact:
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 blockytuan 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
Interestingly when I press pause (which looks cool) my FPS goes up considerably. Any optimisations possible?