Announcement

Collapse
No announcement yet.

Vray to nuke Velocity Tutorial

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

  • Vray to nuke Velocity Tutorial

    Hey Guys,

    I thought I'd post this really quick tutorial about passing velocity data from vray to nuke. This setup is done in maya but also works for 3ds max.

    Often there are questions on the web on how to properly output vectors for 2d motion blur and often people have strange results. I will try to cover the setup as well as explain why some of the problems occur and what to do to avoid them.

    I have created a scene where two cubes are moving, one in Positive X and one in Positive Y. The reason I did it this way is that I know what to expect in motion vector result, one should have more or less pure X (red) color and one should have Y (green).

    At first I have just simply added the velocity render element to my scene and rendered it.



    If you measure the value of the Y vector, you can see 1.0 which means the cube is indeed moving properly on Y.



    For reference I have rendered an image with true 3d motion blur out of vray. The settings for proper motion blur should be duration of 0.5 and interval center of 0.0



    Lets bring this into nuke and setup the vector.
    What we need to do is copy the R and G from velocity pass to forward u and forward v of the rgb beauty using copy node.
    For motion vector, set the uv channels as forward, multiply to 0.5, method to forward and check use rgba.alpha
    The alpha is necessary for the proper edging of the motion blur.
    After this setup however there is no motion blur. This is problem number one. Lets go back to maya for the explanation.



    Since the default value in velocity is set to clamp, any information above 1 will be clipped. So for that one must use a max velocity value to offset the multiplier inside nuke to get accurate motion blur length. We wont do that. Instead we will uncheck clamp velocity and render again. You can see now that the vector Y has 28.526



    When we bring the new motion vector to nuke there is another problem. Since vray computes vectors against gray background that color contributes to the motion vector offset. For this to work properly, we need to apply a grade node and set the black point to be 0.5, note that we also must remove "black clamp" since motion vector contains both positive and negative data.

    If we measure the value of the Y and compare it to the value from vray in maya the Y vector is the same, meaning we do not need to multiply the amount in the vector blur, we set the vector blur to 0.5 which is 180 deg of the shatter, and let the 3d vector provide us proper data.



    You can see the result now in comparison to 3d motion blur is nearly the same.



    Setup files are attached.
    Let me know if you have any questions/requests.
    Attached Files
    Dmitry Vinnik
    Silhouette Images Inc.
    ShowReel:
    https://www.youtube.com/watch?v=qxSJlvSwAhA
    https://www.linkedin.com/in/dmitry-v...-identity-name

  • #2
    Very nice, thanks for sharing

    Best regards,
    Vlado
    I only act like I know everything, Rogers.

    Comment


    • #3
      Bookmarked and saved, this is something that was going to creep up on me in a couple of weeks, thank you.

      Comment


      • #4
        Thanks a lot for this short but essential presentation

        Comment


        • #5
          Hey Vlado,
          Can we get a fix so that the velocity pass gets rendered in a way that we don't need to do the offset/grade?

          Rob
          throb
          vfx supervisor
          http://throb.net

          Comment


          • #6
            Originally posted by throb View Post
            Hey Vlado,
            Can we get a fix so that the velocity pass gets rendered in a way that we don't need to do the offset/grade?

            Rob
            good idea, it can be a check box in the render element.
            Dmitry Vinnik
            Silhouette Images Inc.
            ShowReel:
            https://www.youtube.com/watch?v=qxSJlvSwAhA
            https://www.linkedin.com/in/dmitry-v...-identity-name

            Comment


            • #7
              It shouldn't need the offset if you render to a multi-channel OpenEXR file and then Shuffle the velocity out of it.

              Best regards,
              Vlado
              I only act like I know everything, Rogers.

              Comment


              • #8
                Originally posted by vlado View Post
                It shouldn't need the offset if you render to a multi-channel OpenEXR file and then Shuffle the velocity out of it.

                Best regards,
                Vlado
                Ah excellente

                Comment


                • #9
                  hi everybody.

                  First of all, thanks for the tutorial, this workflow is working like a charm for most situations when you have all the objects in separated layers.

                  But happens that we you render some objects and you have one object overlapping the one behind it, some artifacts begin to appear.

                  Friday we decided to render one scene not separated, but everything together, and we cannot manage to have a nice motion blur in Nuke.

                  We tried in fusion and the same channels work like a charm.

                  Any hints ?

                  Thanks.

                  Comment


                  • #10
                    can you post some examples?
                    Dmitry Vinnik
                    Silhouette Images Inc.
                    ShowReel:
                    https://www.youtube.com/watch?v=qxSJlvSwAhA
                    https://www.linkedin.com/in/dmitry-v...-identity-name

                    Comment


                    • #11
                      Fusion uses something like rsmb:vector + rsmb. It is not pure vector, look at the blue channel. Blurred as hell.
                      I just can't seem to trust myself
                      So what chance does that leave, for anyone else?
                      ---------------------------------------------------------
                      CG Artist

                      Comment


                      • #12
                        Originally posted by Morbid Angel View Post
                        can you post some examples?
                        Not from the project what I'm doing right now, tomorrow we'll recreate the problem and send some images.

                        Thanks for replying.

                        Comment


                        • #13
                          Hi Morbid.

                          Here I have a weird example of what I'm saying.

                          The direct form 3D is the Motion Blur straight from Vray.

                          Click image for larger version

Name:	DirectFrom3DLayer.jpg
Views:	1
Size:	109.5 KB
ID:	846978

                          Samelayer.jpg is 2 elements rendered together and composited with VectorBlur.

                          Click image for larger version

Name:	SameLayer.jpg
Views:	1
Size:	104.6 KB
ID:	846979

                          Two layer is the motion blur applied to the torus and merged with the brain.

                          Click image for larger version

Name:	TwoLayer.jpg
Views:	1
Size:	112.7 KB
ID:	846980

                          As you can see, the only one that works for us is in Nuke the one composited separately.

                          But .. then we tried the everything together version in Fusion ... and volia !

                          Click image for larger version

Name:	mblur.jpg
Views:	1
Size:	116.8 KB
ID:	846981

                          Comment


                          • #14
                            You can't really do this, because you don't have the full information about the object below. You can make a mask for the object above, and blur it with the velocity, but what you will use for a background? I suppose it is up to the compositing program to do some magic there and somehow blend the two objects in a more realistic way.
                            V-Ray/PhoenixFD for Maya developer

                            Comment


                            • #15
                              In this case I would suggest to try RSBM and see if it gives you better result.
                              Dmitry Vinnik
                              Silhouette Images Inc.
                              ShowReel:
                              https://www.youtube.com/watch?v=qxSJlvSwAhA
                              https://www.linkedin.com/in/dmitry-v...-identity-name

                              Comment

                              Working...
                              X