Search Unity

Imagespace Motion Blur now available!(Updated Demo 22.09)

Discussion in 'Made With Unity' started by multivac, Sep 3, 2010.

  1. multivac

    multivac

    Joined:
    Oct 27, 2009
    Posts:
    133
    I think I can now finally release this system to the public. :D

    You can now have cinematic and high quality blurring for cheap,and the effect is a lot better than the backbuffer version that Unity included.

    Those are some notable features of this package:

    *The effect is seamlessly working between Windows and Mac and doesn't require separate builds anymore.
    *The system supports all the included Unity materials,even glass and refraction,as seen in screenshot.
    *Object based blur needs one material per object,so in essence one drawcall per object.
    *Can be used on skinned characters,but currently only blurs by the character root movement,not by individual bones.Still quite useful in most situations.
    *You also get Camera-Based motion blur,which blurs the whole scene on quick camera rotations and is similar to the system in Valve's Portal for example.
    *Zoom Blur shader is the cheapest,only forward/backward camera movements are blurred,ideal for racing and space games.
    *Camera Based Blur and Zoom Blur are purely post-processing effects,no scene modification needed
    *Also included is a shader that adds grain,vignetting and subtle chromatic aberration,for a more filmlike,kinda Mass Effect look.
    *All those effects are separable if you want to use just some of them.
    *If your card supports pixel shader 2.0,it supports all these effects.
    *Needs Unity Pro,as it is rendertexture based.

    It doesn't come through very well in pictures,so you can view all those effects in the updated demo here:
    :arrow: Shaders Demo
    Try picking up the bottles with LMB and throwing them with RMB
    Note that all effects are quite exaggerated here for demo purposes.

    I want people to use these effects in their games,but making this system work took a fair bit of work and I don't want to just give it away.:wink:

    So please pay a sum that you think this system is worth at the link below and you will be sent the download link and password.
    If I make some improvements,which is probable,all customers get them for free,of course:)
    :arrow: PayPal link
     

    Attached Files:

    Last edited: Oct 7, 2010
  2. Tinus

    Tinus

    Joined:
    Apr 6, 2009
    Posts:
    437
    Beautiful stuff, man! Just donated a modest amount (I'm a student 'n stuff). My game is nowhere near the production stage yet, but with this the sense of speed would no doubt improve quite a bit.
     
  3. oblivionfeet

    oblivionfeet

    Joined:
    Jul 24, 2010
    Posts:
    481
    Looks great, but...

    Don't call it a donation when it's a required payment. It's not a donation, don't claim it as such. Either sell it, or give it away and ask for donations from happy users.
     
  4. dogzerx2

    dogzerx2

    Joined:
    Dec 27, 2009
    Posts:
    3,967
    Hey, looking great! I still need to find out how paypal works, I hate going to the bank so I've been postponing it but I really should do the long waiting and everything in order to ask them how do they work with paypal. But I'd certainly conciser paying an amount for it.
     
  5. theinfomercial

    theinfomercial

    Joined:
    Sep 9, 2008
    Posts:
    1,000
    I'd LOVE to have this for a project that involves speed. You should forward the project to Unity Tech so they can include it in their image effects package. The motion blur we currently have is ages behind the new algorithms. This way we can all have the old motion blur as well as your full screen motion blur.

    I hope you can do this, because the built in motion blur is stuck in the stone age. Your motion blur would get used more if UT incorporated it. :)
     
  6. multivac

    multivac

    Joined:
    Oct 27, 2009
    Posts:
    133
    Thanks for the kind words,I might try to get them to take a look at it once I have ironed out the last annoying bug,namely the camera motion blur doesn't do translational blurring,only rotational for now.
    Should take nothing more than modifying the matrixes sent to the script,but there's zero documentation for them and its slow going with trial and error. :?
     
  7. Tinus

    Tinus

    Joined:
    Apr 6, 2009
    Posts:
    437
    Hey Multivac, got an idea how soon I can get my hands on this? I've got my graduation exposition this weekend, and I'm looking for ways to dress my game up a little. :)
     
  8. Pulov

    Pulov

    Joined:
    Feb 20, 2010
    Posts:
    824
    Looks fantastic.

    Looking forward to see this translational blur in the near future, it seems pretty interesting for my project (racing game).

    I'm not in a hurry, so when it is released I'll consider buying.

    The comunity is proving again that is going ahead the dev team.

    Despite of beast, most of the new features that directly "affect" me where too obvious that shoudl be there such snaps, selection mode etc...

    But the comunity is providing the goods that are making unity a real pro thing such this shader, visual logic, visual shader editor and this kind of powerfull tools.

    In short, good job!!!

    just curious, this shader would work on a console?
     
  9. Deleted User

    Deleted User

    Guest

    finally!
    quick question.. does this work in Unity 3?
     
  10. multivac

    multivac

    Joined:
    Oct 27, 2009
    Posts:
    133
    I'll do my best to get it running by that time.

    As for Unity 3,I'm sure it will work,but it might need a little modification.I'll do it once the Unity 3 Pro trial is released.
    About the consoles,I have no idea.If consoles use the base Unity's renderengine and support image effects,then it should work out of the box.
     
  11. RElam

    RElam

    Joined:
    Nov 16, 2009
    Posts:
    375
    This is nice work, well done. I'd like to see a toggle for the effect in the demo though, or perhaps apply the effect to only half the screen. Would make it easier for people to see the impact.
     
  12. Tinus

    Tinus

    Joined:
    Apr 6, 2009
    Posts:
    437
    Cool. :)

    I've done a small bit of testing, and I'm getting some jittery results. The blur definitely seems to be working, but it looks like something is out of sync. Video here: http://www.youtube.com/watch?v=ZIK__aLxgCU. The jitter is smoothed out a bit by the compression, but is still visible in some sections.

    Any idea what might be causing this? I'm using rigidbodies with interpolation for the character. I've had other update ordering issues before, but they seemed fixed by using interpolation.. Anyway, you'll probably need some more info to help me out, but I wouldn't really know where to start.

    Good stuff though! I now have an idea of what it'll actually look like, and am quite impressed. It already does a good job at conveying a sense of speed and depth. Once the code is a bit more robust this shader will blow Unity's default motion blur out of the water. :)

    Edit: Getting this problem no matter how I animate the camera, not just with rigidbodies.
     
  13. multivac

    multivac

    Joined:
    Oct 27, 2009
    Posts:
    133
    What effects are active?
    Looks like it might be the camera motion blur getting too large values on fast turns,its values aren't clamped yet.I'll update the package as soon as i get back to my workstation(tonight probably)
    Object motion blur is clamped and updates in fixedUpdate,so it should be fine.
     
  14. Tinus

    Tinus

    Joined:
    Apr 6, 2009
    Posts:
    437
    That sounds about right, the glitch is definitely most pronounced on fast turns. Oh, and no other effects are in play. Cool, looking forward to the update. 8)
     
  15. multivac

    multivac

    Joined:
    Oct 27, 2009
    Posts:
    133
    Updated the shader with clamping controls and I now interpolate the camera positions based on Time.smoothDelta.
    strength of 1-2 and 0.5 of clamp is about as low as i can get before artifacts and jittering.Address and pw are the same.

    Still working on the translational blur,but it seems kinda hopeless,I can't even multiply two builtin matrices and get a correct solution,i suspect something might be broken in Unity.

    EDIT: Disregard the last sentence,I think I just got a breakthrough.Why does it always happen when I have already kinda admitted defeat? :x
     
  16. Tinus

    Tinus

    Joined:
    Apr 6, 2009
    Posts:
    437
    Excellent, things are working fine now. It's proving to be an essential addition to my game already.

    Congrats on the breakthrough! Absolutely cannot wait to see translational blur in action. :)
     
  17. Pulov

    Pulov

    Joined:
    Feb 20, 2010
    Posts:
    824
    breakthrough


    EDIT: Disregard the last sentence,I think I just got a breakthrough.Why does it always happen when I have already kinda admitted defeat? Mad


    LOL>>

    The windsuit video looks awesome!!!
     
  18. slashdotray

    slashdotray

    Joined:
    Dec 3, 2006
    Posts:
    77
    Hi this is awsome,

    i bought already, is there a chance to have it for unity3
     
  19. Deleted User

    Deleted User

    Guest

    He said that he will work on it as soon as Unity 3 comes out.
     
  20. Tinus

    Tinus

    Joined:
    Apr 6, 2009
    Posts:
    437
    Volo was a big success at my graduation exposition, and many people commented that the motion blur worked wonders for the sense of speed. Now I really cannot wait for translational blurring. :eek:
     
  21. Pulov

    Pulov

    Joined:
    Feb 20, 2010
    Posts:
    824
    Hi

    Did not tried yet as my pc is nealy cracked, but giving a look to the readme just wanted to comment:


    The object motion blur currently needs to have a unique material instance per object.It is a limitation of the Unity's pipeline-the script that updates the necessary transforms of the previous frame can only send info about one object.


    I think that this is a great (annoying) limitation for big scenes. I'm building a quite huge urban model and many pavements do share a unique material. Also this is good cause by modifying it onde it does change all along the model.

    Also having to reasign the material to blurred objets is time consumming, speccially if you have a large scene like the one I do have to manage.

    I would suggest:

    Instead of having to reasign manually to each blurred objet a new material do it on the fly. how:
    By using a remapping table that assings each standard shader in unity its mimic in the blurred version.
    This could be done just before during game building process. I do a similar process when converting CAD drawings from one format to another and just came this to my mind.

    Multimaterials would be welcome, as a model such a building, once collapsed in 3dmax uses to have several materials (its my case, but I believe will be aplicable to others).

    ANyone tried to use this shader with vegetation? I think that it should not work due to the material limitation ,,, does it?
     
  22. slashdotray

    slashdotray

    Joined:
    Dec 3, 2006
    Posts:
    77
    Ah ok, that thing is realy cool !
     
  23. imaginaryhuman

    imaginaryhuman

    Joined:
    Mar 21, 2010
    Posts:
    5,834
    I think it looks sorta neat except that it looks blurry.

    Motion blur is actually an artificial effect produced by trying to capture a snapshot of a small slice of time using a camera. e.g. trying to photograph a fast moving object using a fairly long exposure time, resulting in a streaking effect. It's symptomatic of having a slow shutter speed. If your 3d game is capable of generating 60+ frames per second, many objects aren't going to be moving fast enough to generate any kind of noticeable motion blur.

    The other thing is, now you're displaying to the viewer a sequence of freeze-frame snapshots of blurred images. The human eye wouldn't see things in terms of snapshots because it's more of a gradual progression of movement. It doesn't freeze-frame on a specific digital frame of reality and hold it in place and then instantly switch to another one. To properly simulate the eye's `motion blur` using digital still frames, I think you'd need a really high framerate so that it is the eye which blurs things together not the computer. I just don't see how this really helps the image quality other than making moving objects look streaked. Why would you want to ADD this streaking when you can have fast 60fps graphics which are always in focus?
     
  24. Pulov

    Pulov

    Joined:
    Feb 20, 2010
    Posts:
    824
    Because it geaves a very nice effect and enhances the feel of speed.
    Check GT madrid track. It runs at 60fps but the buildings in the "corners" of the screen are motion blurred and the effect is pretty nice.
     
  25. Vectrex

    Vectrex

    Joined:
    Oct 31, 2009
    Posts:
    267
    Actually your eye does motion blur. The eyes pesistance of vision is a bit like an open shutter. Which is why we see animation above a certain framerate as a moving object and not a flickery series of images.
     
  26. spiralgear

    spiralgear

    Joined:
    Dec 13, 2007
    Posts:
    528
    Also vision tends to blur in real life for spinning objects like a fan. TBH this effect doesn't mimic that kind of blur as it is more of a "smear" than a blur, but thats the kind of thing you only notice if you are looking for it. Its a subtle effect that adds a bit to the realism, but if you asked someone the couldn't tell you why.


    Its like the old interior design rule of thumb, you know the room is the right color when no one can remember what it was.
     
  27. Tinus

    Tinus

    Joined:
    Apr 6, 2009
    Posts:
    437
    As far as I'm concerned, I think spiral gear is right on the money. While it may not be the most realistic way of simulating this particular phenomenon, nothing in games ever is. Everything in games is a caricature that represents something we recognize from real life. Smearing images together is not really what happens in our eyes, but the effect is evocative enough for our purposes. It makes everything seem a lot more dynamic, even when deployed very subtly.
     
  28. multivac

    multivac

    Joined:
    Oct 27, 2009
    Posts:
    133
    Updated the package,it now has translational blurring.
    It is separated into two shaders,CameraMBlur is for horizontal and rotational blurring,CameraZBlur is zoom blurring for forward/backwards motion.The zoom blur is cheaper than Camera blur,and is enough for racing games for example,so you can use only this effect.
     
  29. chkkll

    chkkll

    Joined:
    Jul 20, 2010
    Posts:
    40
    hey man. congrats on the shader, its great. i donated a humble amount a week ago. when is it possible for me to get the script?
    thnx
     
  30. Tinus

    Tinus

    Joined:
    Apr 6, 2009
    Posts:
    437
    Excellent news! Testing right away. :)
     
  31. multivac

    multivac

    Joined:
    Oct 27, 2009
    Posts:
    133
    whats your email?
    I did send the link to everyone who paid,but maybe it ended up in your junk folder.
     
  32. chkkll

    chkkll

    Joined:
    Jul 20, 2010
    Posts:
    40
  33. x46085

    x46085

    Joined:
    Sep 18, 2010
    Posts:
    12
    Multivac,

    My school project teammate sent the donation (named Jan Stec) since I don't have pay pal, can you send him or I the link? I was hoping to play with it this weekend. Thanks and I appreciate the hard work!
     
  34. multivac

    multivac

    Joined:
    Oct 27, 2009
    Posts:
    133
    Updated the package again:

    *shared materials are automatically cloned now,so no need to assign the material copies by hand anymore.
    *Zoom Blur can now be controlled even when the view is static,great for subtle attention drawing or insanity/vertigo effects :)
    *the whole package should run a bit faster too

    use the same link and pw you received in the mail.
     
  35. Tinus

    Tinus

    Joined:
    Apr 6, 2009
    Posts:
    437
    Cool features! And yeah, I'm noticing the speed increase.

    I'll upload a video of the package in use soon, it really works quite well. :)
     
  36. Pulov

    Pulov

    Joined:
    Feb 20, 2010
    Posts:
    824
    Nice looking new features! I've an important exam and I cant check this now.. but soon!

    Anyone tried this with vegetation?? with so many trees the thing will generate thousands of materials, no?, might this affect (noticeabily) the performance?

    Shared materials are auto cloned but we need to keep converting standard one to blurred, is that right?.
    Dont what to sound like a loop, but by assinging the blur script to an objet would rock that the material was reasigned to the same mat but in blur mode automatically.
    _________________________

    About the limitation unity places for the one mat per object for this stuff, you could place a post in the wishlist or in the page built for this matter and see if this issue gets focus. You would have my votes :)
     
  37. Tinus

    Tinus

    Joined:
    Apr 6, 2009
    Posts:
    437
    The unique materials are only required for objects with the blur script put on them, not for the camera blur scripts right? Since vegetation is fairly static, I don't think it would make much sense putting blur scripts on them in the first place.
     
  38. Pulov

    Pulov

    Joined:
    Feb 20, 2010
    Posts:
    824
  39. multivac

    multivac

    Joined:
    Oct 27, 2009
    Posts:
    133
    That's what camera based blur is for,blurring the whole screen if the viewport moves.Object based blur is more expensive,but it blurs objects which move by themselves.Generally you want to avoid assigning Object based blur to large static objects.
    I'll probably get around to automatic assigning of the materials too,should not be too hard,just dull :)
     
  40. Tinus

    Tinus

    Joined:
    Apr 6, 2009
    Posts:
    437
    Yeah Pulov, those effects are exactly what the camera blur scrips can achieve for you. :)
     
  41. Pulov

    Pulov

    Joined:
    Feb 20, 2010
    Posts:
    824
    LOL>> I guess I missed an important basic concept.

    CAMERA blur

    PER OBJECT blur.

    Camera blur has rotational or translational blur ( may be both at the same time too).
    With camera blur, in tranlational in particular, do objets get different blurring depending on their distance from the cam or its more like a "global" blur ?


    And objet blur wich blurs objets based on its center of gravity movement. And this is the type wich requires a particular material. This would be aplicable to a car rim, or a whole car or a missile or so.

    Right? :)

    So, camera blur would not require any additional material assignments to have trans or rotational blur?? if yes, that would be fantastic.
     
  42. multivac

    multivac

    Joined:
    Oct 27, 2009
    Posts:
    133
    yup,thats correct.
    I do scale the blur based on depthmap,that's what the Multiplier does on the CameraMblur script essentially.
    I'll try to get an updated demo up soon too,the current version is sorta outdated.
    EDIT:Updated the demo.
    also,a typo slipped into Zoom Blur shader,which made it blur only in the world's z-direction,not camera's local space.This has been fixed.
     
  43. Tinus

    Tinus

    Joined:
    Apr 6, 2009
    Posts:
    437
    Ah, I was meaning to tell you about that one but you've already caught it. Much better now.

    About the rotational blur: As of the latest version the effect it seems to ramp up too fast for me. If I hold perfectly still the effect is off, but if I move even an inch the effect is turned up to max. I'm trying to tweak things to be more gradual (spreading the transition over a larger range of rotation speed), but I'm not really getting anywhere. Any ideas? :)

    Also: I think you'll be better of using 'camera' instead of 'Camera.main', this way you always get the camera on the local gameobject. Camera.main doesn't always point to the camera you want in scenes with multiple cameras, in split-screen gameplay for example.
     
  44. multivac

    multivac

    Joined:
    Oct 27, 2009
    Posts:
    133
    hmm,there's a commented line called //fix2.z=-fix2.z in CameraMBlurScript.js,try uncommenting it.It should make it smoother,but could also cause it to "fight" with ZoomBlur at high speeds.But let's hope i have managed to fix that bug somewhere along the line :p
    I don't have access to my workstation atm, so this is the best solution i can offer currently,let me know if it works.
     
  45. Tinus

    Tinus

    Joined:
    Apr 6, 2009
    Posts:
    437
    Marvelous, that seems to have fixed it. :eek:

    I'll test it thoroughly tomorrow, but at first glance it seems to work fine with Z blur.
     
  46. Tinus

    Tinus

    Joined:
    Apr 6, 2009
    Posts:
    437
    Hah! That's certainly how things always go for me when I'm changing or tweaking my physics.

    What part of translational blur are you working on exactly? A bug fix, or some other improvement? After some more testing it really doesn't seem to interfere with the other blur script. I do think the rotational blur looks better than the translational blur currently, so that might be what you're getting at?

    Anyway, your work is already adding a tremendous sense of speed and scale to my game even though it's all work in progress. Combining some modulated camera shake with your shaders (along with some very noisy audio) makes zooming past mountains extremely tense, even without any pretty artwork in the game. Really, great work! I'll be sure to recommend your shaders to anyone who'll listen, and I've started to look forward to the incremental updates as they come. :)
     
  47. multivac

    multivac

    Joined:
    Oct 27, 2009
    Posts:
    133
    well,the thing is,translational blur is still buggy.Rotational blur is (soon) as good as it gets,but translational leaves much to be desired. However,its passable,and I have decided to press on for the moment,maybe it'll come to me.
    The matrix conversion sorta works,but some tiny thing is amiss.

    I'm thinking about steering the zoom blur based on movement vector,and letting the user position blur center to an arbitrary object on the scene.Normalmap controlling the "turbulence" of zoom blur would be great too.
     
  48. Tinus

    Tinus

    Joined:
    Apr 6, 2009
    Posts:
    437
    I was thinking about that actually! So here's some quick 'n random notes from my end.

    I use the velocity vector and some simple trajectory predictions of my character to modulate many things already (sound, gui indicators), so why not this effect as well? I'm finding that it is very good feedback for players to see this vector visualized in some way, as it helps them anticipate on what to do next. :)

    An example along this line of thought: When I'm flying towards a specific ridge or ring, I'd want to focus on that thing specifically and blur the rest. Right now the Z blur enhances the sense of speed, but it sometimes also blurs the very objective that you're flying towards and are trying to hit, hampering your ability to steer. As you say, using data from the game to steer the blur's focus could make it more 'intelligent', focusing your attention where it needs to be, as you would expect (and want) it to work.

    It would really help to have the motion blur focus on important geometry, kind of like saying "if you keep flying this direction you'll hit this". I'm getting moments where the blur seems to provide visual cues like these already, but they are purely coincidental. Still, they make you think of the possibilities! Handling spatial feedback in this way is way cooler than using GUI icons, anyway. :eek:

    A friend of mine played around with tilt-shift effects on some wingsuit footage, see here: http://news.flylikebrick.com/2010/08/pf-taking-it-slow.html. While the nature of that effect is (I think) a bit different, it really shows how you can direct people's attention to important spatial information by cleverly applying blur.

    Here's to hoping something like this will work! *cheers*
     
  49. Tinus

    Tinus

    Joined:
    Apr 6, 2009
    Posts:
    437
    After tweaking things with the 'fix2' line in effect I must say: Sweet jezus, these shaders are very good!

    Turns out it wasn't even the Z blur causing much of the unwanted effect, but rather the M blur working when it shouldn't. I'm starting to get a really nice 'breathing' effect that ebbs and flows with the action.

    This is really great stuff, Multivac.

    Edit: http://www.youtube.com/watch?v=SFnxdRysKz8 -- First results using a first person camera. Most of the effect got lost in compression, I'll have to figure out a way to avoid that. Other than that, I'm really happy with it. :)
     
  50. thomasmahler

    thomasmahler

    Joined:
    Mar 18, 2009
    Posts:
    181
    Am I the only one who has trouble with that demo? The mouse should stay in the game and not move out of the executable unless I press escape or something. I can't grab those bottles, since the moment I move the hand around, the mouse goes outside of the browser and selects something else - fix that.