Announcement

Collapse
No announcement yet.

Pixel Tracking Methods: Optical Flow Methods

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

    #31
    Originally posted by bluearc View Post
    [ATTACH=CONFIG]145560[/ATTACH]
    I can use this cmd to visulize velocity, Is it help a bit?

    Cmd: VisualizeTexture velocity
    That yellowish color means 0.5 red, 0.5 green (0 in both x and y).

    Does the color change when blur is visible in the scene?
    Also, does the material node setup posted before work for you? It should show the shame velocity image as you see with that command.

    Comment


      #32
      That might be a bit of help I guess, before the command "VisualizeTexture GBufferVelocity RGB UV0" showed the motion vectors, so I guess now it would be "VisualizeTexture velocity RGB UV0", that should make it fullscreen, modify the code of the visualizetexture command and remove the info text in the center of the screen. But still, I don't think you can export this pass in high bitdepth so its kinda useless.

      Oh also, when I did "VisualizeTexture GBufferVelocity RGB UV0" the texture resolution was like 1280x600 so it didn't work with every aspect ratio, and when having different FOV it would be also mismatched.
      Last edited by overfuze; 06-20-2017, 02:42 PM.

      Comment


        #33
        Yes, of course. this is color changes while obj moves per-pixel.

        I have try your custom code in shader, but shows error. how could you do that?
        Click image for larger version

Name:	pp_Velocity_Error.png
Views:	1
Size:	223.2 KB
ID:	1130008

        Comment


          #34
          Originally posted by bluearc View Post
          Yes, of course. this is color changes while obj moves per-pixel.

          I have try your custom code in shader, but shows error. how could you do that?
          [ATTACH=CONFIG]145700[/ATTACH]
          Try maybe with PostProcess0 instead of SceneColor in your SceneTexture bloc

          Comment


            #35
            Originally posted by EkstraReality View Post
            Try maybe with PostProcess0 instead of SceneColor in your SceneTexture bloc
            I tried that but when I enter the PP volume, my whole unreal engine crashes. If i set the return GBData.Velocity; then the screen is just black image.

            Comment


              #36
              Originally posted by overfuze View Post
              I tried that but when I enter the PP volume, my whole unreal engine crashes. If i set the return GBData.Velocity; then the screen is just black image.
              Try with GrohBot's code:

              Code:
              MaterialFloat2 UV = MaterialFloat2(ScreenAlignedPosition(Parameters.ScreenPosition).xy);
              FScreenSpaceData ScreenSpaceData = GetScreenSpaceData(UV, false);
              return ScreenSpaceData.GBuffer.Velocity.xy;

              Comment


                #37
                Originally posted by overfuze View Post
                I tried that but when I enter the PP volume, my whole unreal engine crashes. If i set the return GBData.Velocity; then the screen is just black image.
                Same Here, Just black, no matter mul a larger number or normalize it, just black.

                Comment


                  #38
                  Could some Epic dev enlighten us? Is the velocity exposed through the GBuffer? Where should we be looking at if we wanted to expose velocity to the GBuffer, and, ultimately, to a render target?

                  Comment


                    #39
                    Originally posted by Sithdown View Post
                    Could some Epic dev enlighten us? Is the velocity exposed through the GBuffer? Where should we be looking at if we wanted to expose velocity to the GBuffer, and, ultimately, to a render target?
                    I found some codes might relate with.
                    Please found and open DeferredShadingCommon.usf at \Engine\Shaders\

                    in line 344:

                    // Velocity for motion blur (only used when WRITES_VELOCITY_TO_GBUFFER is enabled)
                    float4 Velocity;

                    in line 448:

                    #if WRITES_VELOCITY_TO_GBUFFER
                    OutGBufferVelocity = GBuffer.Velocity;
                    #else
                    OutGBufferVelocity = 0;
                    #endif



                    So where is this WRITES_VELOCITY_TO_GBUFFER? how to enable it?

                    And,there's more Gbuffer.velocity in these usf shader files.


                    Hope these can helps a little bit more.

                    Comment


                      #40
                      I found Definition.usf

                      line 154:
                      #define GBUFFER_HAS_VELOCITY 0

                      Seems epic disable in purpose.
                      So I change is 0 value to 1.
                      and still waiting UE compile all shaders.
                      maybe it's hopeful.
                      Than I use the GrohBot's code, but still gets black.
                      Last edited by bluearc; 06-22-2017, 05:57 AM.

                      Comment


                        #41
                        Originally posted by Sithdown View Post
                        Could some Epic dev enlighten us? Is the velocity exposed through the GBuffer? Where should we be looking at if we wanted to expose velocity to the GBuffer, and, ultimately, to a render target?
                        Get any idears for .usf shaders?

                        Comment


                          #42
                          I have change this BasePassCommon.usf
                          line 30:
                          #define WRITES_VELOCITY_TO_GBUFFER (USES_GBUFFER && GBUFFER_HAS_VELOCITY && (!SELECTIVE_BASEPASS_OUTPUTS || !(STATICLIGHTING_TEXTUREMASK || STATICLIGHTING_SIGNEDDISTANCEFIELD || HQ_TEXTURE_LIGHTMAP || LQ_TEXTURE_LIGHTMAP)))
                          to
                          #define WRITES_VELOCITY_TO_GBUFFER (USES_GBUFFER)
                          this might make WRITES_VELOCITY_TO_GBUFFER true.
                          Still can't use this code to get velocity. by the mean time,VisualizeTexture Velocity still works.

                          If I change WRITES_VELOCITY_TO_GBUFFER to false.
                          VisualizeTexture Velocity won't works.

                          So I assume, the Velocity GBuffer is being written to.
                          The reason of this code or this shading graph not working, caused by other problems.

                          Comment


                            #43
                            Originally posted by bluearc View Post
                            I have change this BasePassCommon.usf
                            line 30:
                            #define WRITES_VELOCITY_TO_GBUFFER (USES_GBUFFER && GBUFFER_HAS_VELOCITY && (!SELECTIVE_BASEPASS_OUTPUTS || !(STATICLIGHTING_TEXTUREMASK || STATICLIGHTING_SIGNEDDISTANCEFIELD || HQ_TEXTURE_LIGHTMAP || LQ_TEXTURE_LIGHTMAP)))
                            to
                            #define WRITES_VELOCITY_TO_GBUFFER (USES_GBUFFER)
                            this might make WRITES_VELOCITY_TO_GBUFFER true.
                            Still can't use this code to get velocity. by the mean time,VisualizeTexture Velocity still works.

                            If I change WRITES_VELOCITY_TO_GBUFFER to false.
                            VisualizeTexture Velocity won't works.

                            So I assume, the Velocity GBuffer is being written to.
                            The reason of this code or this shading graph not working, caused by other problems.
                            Yep, I tried something similar too, to make sure WRITES_VELOCITY_TO_GBUFFER and GBUFFER_HAS_VELOCITY were true, but doesn't show anything on the material.

                            Comment


                              #44
                              I add new texture for velocity and write them in shader,change motion blur post process shader , take like argument VelocityRt in PostProcessing.cpp , and set Render Target my texture. Then Add this texture in material template for take this data in material editor.

                              Comment


                                #45
                                Originally posted by Katod View Post
                                I add new texture for velocity and write them in shader,change motion blur post process shader , take like argument VelocityRt in PostProcessing.cpp , and set Render Target my texture. Then Add this texture in material template for take this data in material editor.
                                Wooh,So you already can extract velocity from gBuffer? Awesome!!
                                Do you mind to share some details with it?

                                Comment

                                Working...
                                X