Announcement

Collapse
No announcement yet.

Pixel Motion Blur

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Pixel Motion Blur

    Hello! Wasn't sure where to put this as it could be:
    • A Feature Request
    • Solved with UnrealScript
    • Solved with Content


    It all depends really.

    Anyway. In Ye Olde UT2004 there was an awesome framebuffer motion blur effect. Try as I might I can't recreate this same effect in UDK with the existing post-process options.

    The motion blur that is available only appears to work when the camera rotates which in my game never happens and doesn't appear to affect particles or anything without depth information (which as all my materials are additive I don't have).

    As it stands the current effect seems to only operate if the camera moves. The effect I'm looking for would affect things that move on screen even if the camera was perfectly still.

    If anybody knows of a way I can achieve a similar effect then I will be most appreciative. There may even be a hug in it for you.

    #2
    This requires a bit of higher-level knowledge and the short answer is no. Per-pixel motion blur is not an option.

    Comment


      #3
      Originally posted by KazeoHin View Post
      This requires a bit of higher-level knowledge and the short answer is no. Per-pixel motion blur is not an option.
      I considered building my own FrameBuffer type effect using a RenderToTexture but I have the feeling that this would end up being ridiculously slow if it was at all possible.

      Comment


        #4
        Its possible if you can write HLSL. If you can, try using a custom shader node in the material editor.

        Comment


          #5
          Just looked into the code for SceneCapture2DComponent and it looks like it would be possible to keep an array of TextureRenderTarget2D objects that can be fed into a Material Effects texture parameters.

          Will look into an HLSL solution as well I have some friends who are more familiar with it than I am.

          Comment


            #6
            One of my friends just pointed out that I should only need to buffer the previous frame if the effect itself is being rendered into the frame I'm buffering so I'm going to try this out later today and see what I get.

            Comment


              #7
              Ya that could work, but the scene capture stuff is hideously slow for full-screen res captures, so it's likely to decimate your framerate.

              Comment


                #8
                That's certainly no reason not to try! I'll post back here if it works and what the performance implications were like.

                Comment


                  #9
                  Agreed, well worth a try May be able to petition for a UDK update to implement it natively though, which would be much nicer.

                  Comment


                    #10
                    For the purposes of a motion blur effect, I reckon you could probably quite happily get away with using a lower res capture anyway

                    Comment


                      #11
                      Well performance capturing at 1280x720 @ 30fps hasn't been a problem but that is more likely a result of how fast my game runs as it has no lighting or complex materials/environment.

                      However I haven't yet found a way to control when the Texture gets updated yet and have discovered an odd frame-drag with regard to either the camera or the SceneCaptureActors. It seems that the rendered version of the texture is 1 frame ahead of what the camera is seeing.

                      Also when I enable postprocess rendering in the scenecapturecomponent I just get a default green texture. No bloom or anything.

                      Comment


                        #12
                        More progress: Seems the UberPostProcessEffect is not compatible with SceneCaptureComponents. Any other combination of Post Effects will work but just one Uber effect and you get a green texture.

                        Also annoyance: The PostProcessChain used for the SceneCapture actor is a new instance so while I've gone into the Material Effect to update the texture parameters I'd have to do it over again to update the instance used by the postprocesschain.

                        Comment


                          #13
                          Note: This is alot of work for something that sounded as simple as "Cache the previous frame" oh well I'm getting closer. So long as the UberPostProcessEffect is after the Material Effect that renders the cached frame it will apply bloom etc to it so that should be enough.

                          Comment


                            #14
                            Well got it working using my original idea of storing an array of cached frames and then adding them into a material fading them out over time.

                            Result wasn't very good and I don't think it's worth putting any more time into this to try and make it better. Shall just have to do what I can with particle effects.

                            Comment


                              #15
                              Sounds like you've made some pretty great progress to my ears. Can't wait to see a version in motion (excuse the pun).

                              Comment

                              Working...
                              X