Motion blur shader?

Posted By: Poison

Motion blur shader? - 06/05/07 15:28

Has someone a good motion-blur shader?
Posted By: Slin

Re: Motion blur shader? - 06/05/07 18:55

You will need A7 Comm or A6 Pro to use motion blur.
You can find a simple solution for fullscreen blur on the wiki.
If you´ve got only A6 Comm, you could use Sylex (There is a fullscreen blur included (You could combine the blurstrength with the mousemovement to archive some kind of motion blur for the camera)).
If you want to get real motion blur, you will need a postprocessing shader (it is the same with the sylex blur).
It could be possible to change the Depth of Field shader (created by BoH_Havoc), to a real, working motionblur shader.

Or just look through the internet for a shader and make it usable with 3DGS.

I don´t think that there is a real motion blur shader for 3DGS yet.


Slin
Posted By: tompo

Re: Motion blur shader? - 06/05/07 22:33

This is a good opportunity to Guitar to make a real motion blur shader
I will be veeeeeeeery grateful for this too
now it's just blur looking like bloom or dof, not "normal" motion blur like in "normals" speedy games
Posted By: xXxGuitar511

Re: Motion blur shader? - 06/06/07 03:51

lol... Thanks bro.

I've actually been thinking about this. Here's my ideas in "Guitar language". Hopefully they make sense to everyone else...

- set up x amount of render targets (2 - 4)
- switch the camera's render target to the next target every frame, and cycle through after x.
- Send the targets to the shader starting with the most recent to the last target.

This will avoid using bmap_blit because the camera renders directly, so there will be no slowdown in getting the images. I can take them directly from the camera view. There are no problems here...


The problem comes when actually blurring the images. How should it be done? I could easily mix the images at different alpha's, but this would probably be too visible between "slides". This would be the most FPS friendly

[New Idea!]However, I could also store the difference in camera angles and pass those to the shader. This way I'd know which direction to blur and how far. However, mixing all these images and blurring them would KILL FPS, and I don't have the fastest computer.

Let me know your opinions, and I'll see what I can find time for


xXxGuitar511



..And in case your wondering how I found this? I go through all the [unread] posts in the forum about 3x a day... lol. Well, at least the sections that appeal to me.
Posted By: PHeMoX

Re: Motion blur shader? - 06/06/07 04:34

Quote:

However, I could also store the difference in camera angles and pass those to the shader. This way I'd know which direction to blur and how far. However, mixing all these images and blurring them would KILL FPS, and I don't have the fastest computer.




If I recall correctly this causes unwanted 'earthquake' effects, not quite a good motion blur..

Cheers
Posted By: tompo

Re: Motion blur shader? - 06/06/07 06:50

Idea 1... make couple of cameras always front of player with alpha depends of player speed...
Result: but this will kill FPS (VGA) to screenshots

Idea 2... Or make all entitys in the level with my.move = on; my.streak = on; with vel_x/y depends of camera orientation
Result: but this will kill CPU

Idea 3... every entity creates his own couple of clones with fadeing alpha from his position to camera position when moving
Result: Kill them both

Idea 4... turn on bloom and then entitys creates only one clone with changing scale_x/y depends of camera orientation and speed and those clones have a gradient alpha schannel
Result: I have no idea

So we need some shader like blur but working with changing player orientation (pan/tilt) during c_move... but I'm totaly grren with shaders

Last time I've seen nice motion blur effect in TestDrive Unlimited... In this game U can make a photo of Your car and doing this You can change "power" of motion blur by slider! Your car is not moving but with this slider it looks like photo has been made during full speed. Strange is that it's looking like every entity on the screen creates own clones

BTW.. I HATE CONITEC!!! (joke) because now I'm not playing the games like always before but during the play I'm looking at this game like "how they made this or this" and how I can do that looking at the engine, effects, moves, cameras... not just enjoing the game
Lara is not just climbing anymore... now she is traceing and c_moving
Posted By: Poison

Re: Motion blur shader? - 06/06/07 10:09

thanks for the ideas guys!!
Posted By: Shadow969

Re: Motion blur shader? - 06/06/07 12:43

Quote:

Lara is not just climbing anymore... now she is traceing and c_moving



That's exactly how i see games now
As for motion blur i simply use transparent camera view, blocks with flat flag on, and models with alpha test material. looks cool, only problem is with objects like panels or flares with alpha channel - they become transparent and ugly
Posted By: xXxGuitar511

Re: Motion blur shader? - 06/06/07 15:54

Quote:

BTW.. I HATE CONITEC!!! (joke) because now I'm not playing the games like always before but during the play I'm looking at this game like "how they made this or this" and how I can do that looking at the engine, effects, moves, cameras... not just enjoing the game
Lara is not just climbing anymore... now she is traceing and c_moving




Me too, lol. I take the time to figure out how to recreate these things. Unfortunatly, this is how I see the world now (sort of) as well. I look around, and wonder how I might be able to duplicate these things in the game.


Back to the topic of the shader, Ill try my first idea, by mixing the different "slides" first. I'll post some results, and if it's too crappy, then I'll work from there...
Posted By: tompo

Re: Motion blur shader? - 06/06/07 16:12

Quote:

Unfortunatly, this is how I see the world now (sort of) as well. I look around, and wonder how I might be able to duplicate these things in the game.



Ask Matrix developers

And what you think about my 4th idea? Possible to work?
Posted By: xXxGuitar511

Re: Motion blur shader? - 06/06/07 16:42

na, I don't think it would work that great. Only entities would have the blur (not the world), and making copies of entities will slow down alot as well...

...As for the matrix dev's, That wold be wierd. I'd be constantly paranoid... lol...
Posted By: Ichiro

Re: Motion blur shader? - 06/07/07 00:33



This isn't a shader, but you can fake a decent motion blur effect here:

http://www.coniserver.net/ubbthreads/sho...true#Post703206
Posted By: xXxGuitar511

Re: Motion blur shader? - 06/07/07 06:25

Interesting... How does it work? I see that there's a panel that has a copy of the screen, and alpha is set depending on the time passed between frames. But is that it?
Posted By: Poison

Re: Motion blur shader? - 06/07/07 12:27

Wow really cool
Posted By: Ichiro

Re: Motion blur shader? - 06/07/07 22:16

I see that there's a panel that has a copy of the screen, and alpha is set depending on the time passed between frames. But is that it?

Yep! It's cheap and easy, like a good date.

By which I mean this.
Posted By: Grafton

Re: Motion blur shader? - 06/08/07 16:56

I have been using Ichiros' blur method for a while as a nitro boost effect.
It works very, very well.
Posted By: xXxGuitar511

Re: Motion blur shader? - 06/08/07 17:17

I'm deciding if I should use 3DGS or Sylex for this.

I'd much prefer to use 3DGS, but I don't know how to set up PP efects.


A have the image.
Then do I apply it to a model?

How do I get the image through the shader and back to the screen?
Posted By: PHeMoX

Re: Motion blur shader? - 06/08/07 17:24

Quote:

I'm deciding if I should use 3DGS or Sylex for this.

I'd much prefer to use 3DGS, but I don't know how to set up PP efects.




You can use both. If you've got 3dgs pro, then take a look at my 10 post-processing effects thread or take a look at the AUM in which it's featured (third last or so?). It should give you all the information you need to set it up. BoH_Havoc has contributed a lot too, that code should also explain everything,

Here are the links:

http://www.coniserver.net/ubbthreads/showflat.php/Cat/0/Number/716792/an/0/page/15#Post716792

http://www.coniserver.net/ubbthreads/showflat.php/Cat/0/Number/724586/an/0/page/8#Post724586

Cheers
Posted By: xXxGuitar511

Re: Motion blur shader? - 06/08/07 17:44

Thanks PHeMoX, I got the answer from your 10 PP shaders...
Posted By: xXxGuitar511

Re: Motion blur shader? - 06/08/07 18:58

he, Thanks for PM Tompo

I've gotten a basic shader done. I've got to run to work now so I don't have time to set up a demo. And by demo I mean release the code in a usable way

I'm workin till midnight, so I'll set it up when I get home (~9 hours).

It simply blends 4 different shots of the screen at different alpha levels. It's simple and dirty. There aren't any time calculations for alpha values yet, but will be added soon!

It uses another view, so it will be a lil slower. However, it uses four bmaps as render targets and avoids bmap_blit, so its not that slow...;)
Posted By: William

Re: Motion blur shader? - 06/09/07 03:57

The problem with Ichiro's shader, while great, was that it didn't work with bloom. Hopefully the one your testing works with bloom Guitar, that'd be nice!
Posted By: xXxGuitar511

Re: Motion blur shader? - 06/09/07 05:36

It depends... My shader simply renders another view over the camera, using only GS.

It's a mess of "depends" to know if bloom would work with it, but you could always add another pass to the shader which does bloom. I'm writing a bloom shader now for Broozar, perhaps I could implement it into this one. I'd of course keep two seperate version of it though
Posted By: Ichiro

Re: Motion blur shader? - 06/09/07 15:14

The problem with Ichiro's shader, while great, was that it didn't work with bloom.

Can you point to that shader (if it's publicly available)? I'd like to give the two a whirl together.
Posted By: xXxGuitar511

Re: Motion blur shader? - 06/09/07 17:27

[AFAIK] What William said is true. Bloom is done after the rendering. Since the view is rendered onto a bmap, the bloom has not been done yet...
Posted By: Ichiro

Re: Motion blur shader? - 06/10/07 01:02

Yeah. I just figured I might be able to come up with something.
Posted By: xXxGuitar511

Re: Motion blur shader? - 06/10/07 05:43

I've got the "cheap" version of it finshed, zipped, and ready to be published. However, my host has left me a month ago, so who wants to host it?!

Simply copy the files into your project folder (Blur.wdl, Blur.fx, Blur.tga). And include <Blur.wdl>; into your main script. You can adjust the amount of blur through the blurStrength variable at the top of Blur.wdl.


Uses 1 additional view, 4 render targets, and a PS2.0 shader. Requires A6 Pro. ALL COMMENTS WELCOME! Still a WIP. Needs to add ACTUAL BLURRING...
Posted By: Shadow969

Re: Motion blur shader? - 06/10/07 09:45

Altough i don't have PRO and PS2.0 i can host it. PM or email me
Posted By: William

Re: Motion blur shader? - 06/11/07 00:55

Quote:



Can you point to that shader (if it's publicly available)? I'd like to give the two a whirl together.





It's the one in Sphere. I tried messing around with the view layers and the such, but couldn't get it to work. I think it turned the screen bright colors than white in a few seconds when used with bloom(this is based of memory).
Posted By: Ichiro

Re: Motion blur shader? - 06/11/07 14:31

Ah. Thanks.
Posted By: xXxGuitar511

Re: Motion blur shader? - 06/11/07 17:01

Thanks to the very generous PHeMoX, here it is: Blur Shader

It's just a little demo thing, but it's something
Posted By: William

Re: Motion blur shader? - 06/12/07 06:33

I tried it out. Although, it doesn't seem to have the bloom, and I couldn't figure out how to properly scale the entity that the view is being put on, to the screen's size. Screen becomes a bit darker too, but mabye this was the lack of bloom. Fog also doesn't work yet.. Overall though, pretty good job so far. I wonder though, is motion blur possible with bloom? Thanks for showing it.
Posted By: xXxGuitar511

Re: Motion blur shader? - 06/12/07 06:44

- Bloom: Havn't added any bloom yet

- darker: It shouldn't be, but it may be due to mixing the four copies of the view

- fog: Sorry, I forgot to have the blur's view copy the fog parameters from the camera view.



I know this isn't anything special, I just wanted to release something to show progress... sorry
Posted By: tompo

Re: Motion blur shader? - 06/12/07 08:19

Nothing to sorry bro you are doing great job and free
Posted By: PHeMoX

Re: Motion blur shader? - 06/13/07 00:07

Quote:

I know this isn't anything special, I just wanted to release something to show progress... sorry




It's working good here, although a bit darkerish indeed. Don't worry man, keep it up.

Btw. why didn't Ichiro's blur shader mix well with bloom? Which bloom shader? The one from Rhuarc? I thought I had them mixed without problems a long time ago actually,

Cheers
Posted By: xXxGuitar511

Re: Motion blur shader? - 06/13/07 04:50

I havn't actually tested it myself, but my guess is that it has something to do with rendering to textures. {i'm guessing] that rendering to a texture comes dircetly from the view, not after any effects...

I [believe] that I used vec_lerp() for blending the images on the blur shader, but perhaps I changed that after I sent the code to PHeMoX
Posted By: Puppeteer

Re: Motion blur shader? - 06/14/07 12:45

@ xXxGuitar:
Your shader doesn't look like real blur..
Is there an other way doing it?
Like that:
http://www.bizarreonline.net/news/images/studioupdate/photomode/02_motionblur.jpg
Posted By: tompo

Re: Motion blur shader? - 06/14/07 14:39

interesting.. at this screen olny trees has a motion blur... rest of buildings have only bloom. The same is in f.e. Test Drive Unlimited.
So maybe my idea to create clone (maybe less detialed) for entitys (trees) and scale it x/y depends of camera position and add a gradient alpha channel to better looking... it's not so bad idea?
Posted By: Puppeteer

Re: Motion blur shader? - 06/14/07 14:54

well... with shaders... 4000 polys per model .... this gonna be hard..
Posted By: xXxGuitar511

Re: Motion blur shader? - 06/14/07 17:38

There are many problems with doing motion blur. For example, if you had an object fly past the user (standing still), you would want it to blur that object, yes? However, the PP shader doesn't know which pixel to move, or which dirrection to smear them, so I take several shots and mix them newest first, oldest last.

However, that method does not actually "blur" objects, it just creates several mixed copies of it, which "sort-of" blurs it

I havn't added anything to the shader (besides lerp() for better mixing), because I don't really know what to do next. If anyone wants to, please feel free to take my release and continue it.... I'm out of ideas and time
Posted By: JibbSmart

Re: Motion blur shader? - 06/14/07 21:32

http://ati.amd.com/developer/ShaderX2_MotionBlurUsingGeometryAndShadingDistortion.pdf

^^ if someone is feeling a bit clever it actually has a lot of the shader there. i didn't look at it enough to determine how much is directly usable with GS, but it looks good! i think their implementation would work better with balls than complex objects, but i've got some ideas that could be used with animated objects if i have time this weekend.

julz
Posted By: Poison

Re: Motion blur shader? - 06/15/07 05:49

if you have the new rendern monkey 1.62 then you can get the motionblur from it
you must export it almost to a fx file.
Posted By: xXxGuitar511

Re: Motion blur shader? - 06/15/07 06:44

eh, not sure about this. It will, like anything else, only work for models. Being said, rotating the view quickly would not blut the object if it were still. This soley depends on the objects velocity.

As said, it might not work well for complex models, but reading through the shader, since it stretches by the surface normal, it might actually be fine with complex models...
Posted By: JibbSmart

Re: Motion blur shader? - 06/15/07 07:02

i think it would be best for object-based motion blur though. you couldn't use that example for motion-blur of animated models because polygons are definitely going to intersect with each other a lot, particularly with complex hands, fingers, etc.

on second thought, the blurring would make the intersections a non-issue. i was thinking about it at school, and thinking that a closed fist has normals in lots of different directions, pointing towards and away from each other. very fast-moving fists would have a lot of intersecting polygons, but it shouldn't look too bad if everything is blurred and smoothed.

it would work with rotating models of the relative velocity was vertex-based, not object-based (which would be required anyway for blurring animations). each entity could remember their own camera-relative vertex positions in an array (may be easier with lite-c if you have global structs that point to an entity and contain an int[array] with relative camera positions for each frame).

i haven't learned how to pass extra info (such as an array) to a shader yet (i'm very fresh at this), but i will in a sec after i do some experiments for a school project.

julz
Posted By: xXxGuitar511

Re: Motion blur shader? - 06/15/07 07:22

NVidia uses a very similar method as what I did, but they used 16 frames instead of 4. 3DGS materials are limited to 4 textures though, so without a DLL, no luck

They also used a different mixing method (which I will look into) that adds a sort-of "bloom" effect to it, which in turn, blurs the image for better mixing. I'll have to give this a try...
Posted By: Matt_Aufderheide

Re: Motion blur shader? - 06/20/07 19:14

Quote:

NVidia uses a very similar method as what I did, but they used 16 frames instead of 4. 3DGS materials are limited to 4 textures though, so without a DLL, no luck




Currently you can use 8 textures in A6, assign all 4 material skins, and also the entSkins 1-4 all show up.

I agree that you should be able to assign more than 8 textures to a material, most cards support at least 16 per pass...
© 2024 lite-C Forums