Author Topic: 2D Velocity Pass  (Read 9556 times)

2016-04-12, 13:46:05

FrostKiwi

  • Active Users
  • **
  • Posts: 686
    • View Profile
    • YouTube
Hey,
ReelSmartMotionBlur and AfterEffects both expect normalized image space motion vectors, as such only Nuke users or people who use 3dsMax's internal vector motion blur benefit from Corona's Velocity pass.
Is it possible to implement a 2D Motion Vector pass aswell?

I have yet to find a conversion application, so I gotta beg for Motion vector pass in 2D here.

Also concerning the current Velocity pass... the pass is supposed to be used with no AA, as such it should default to no filtering, also Filtering produced bullshit results with edges, that actually converge to an edge artifact and don't get better with more passes.
Under certain angles the edge (material indipendant) produces this black edge, which will ruin motionblur, as it currently defaults to AA on.
I'm 🐥 not 🥝, pls don't eat me ( ;  ;   )

2016-04-12, 14:38:39
Reply #1

racoonart

  • Active Users
  • **
  • Posts: 1446
    • View Profile
    • racoon-artworks
Corona outputs vector data with 0 velocity as black - so values go into positive and negative direction from there. Reelsmart expects data with a midpoint at grey (from the old days when nobody knew what floating point data is).
Additionally, you currently have to swap the green and blue channel to make it work with (most?) postwork vector motion blur tools which expect red = x and green = y.
Apart from that, there currently is a bug that some renderelements including velocity are saved with wrong gamma. At least with exr, but who's using something else these days :D

So, in summary:
1) Swap Green and Blue channel
2) add gamma of 2.2 (TEMPORARY FIX for wrong gamma output bug!)
3) add brightness of 0.5 (shifts blacks to mid grey)
4) make sure alpha values are between 0.0 and 1.0, possibly due to rounding errors from image operations before (or reelsmart will refuse to do anything)
Any sufficiently advanced bug is indistinguishable from a feature.

2016-04-12, 15:54:00
Reply #2

FrostKiwi

  • Active Users
  • **
  • Posts: 686
    • View Profile
    • YouTube
So, in summary:
1) Swap Green and Blue channel
2) add gamma of 2.2 (TEMPORARY FIX for wrong gamma output bug!)
3) add brightness of 0.5 (shifts blacks to mid grey)
4) make sure alpha values are between 0.0 and 1.0, possibly due to rounding errors from image operations before (or reelsmart will refuse to do anything)
Many thanks, testing it out, some problems but I will crunch a bit more.
I have one more question, if I may steal your time, while you are here :D

I experience strange Color space shenanigans only with Corona:
I know how to correctly do linear workflow, but EXRs from Corona seem to do a strange contrast increase, that cannot be fixed by shifting gamma. As if black levels were changed. No way of getting it correctly in Photoshop, Custom RGBs + Custom Gammas, preserved, discarded, any way I do, it just slaps on some random bullshit conversion. Also there is no option to kill Color handling. Only way I got it near VFB style in Photoshop is with my own applied RGB offset + gamma foolery, which is obviously wrong.

After effects has the ability to disable all color handling which is genius, this lets me import everything as Gamma 1.0 and apply my own gamma 2.2. Simple stuff.

I already gave up on it, tried it all, Changing Input/Output of 3dsMax gamma with MaxScript, since 2014 it's hidden, saved from different VFBs, all to no avail, if it was rendered in corona, my PC just poops on it, unless AfterEffects disable all Color handling. Did I miss something obvious?

edit: only concerns openExrs
I'm 🐥 not 🥝, pls don't eat me ( ;  ;   )

2016-04-12, 16:15:20
Reply #3

racoonart

  • Active Users
  • **
  • Posts: 1446
    • View Profile
    • racoon-artworks
That's an easy one of me...
I don't use photoshop. At all. Period. :D
I've given up trying to achieve anything in PS that requires accurate maths / workflow. I don't even have it installed anymore :) (6 months and counting - and happier than ever). Trying to do floating point stuff in PS is like defusing a bomb in an earthquake - it will eventually blow up into your face (rather sooner than later).
Any sufficiently advanced bug is indistinguishable from a feature.

2016-04-12, 18:32:31
Reply #4

FrostKiwi

  • Active Users
  • **
  • Posts: 686
    • View Profile
    • YouTube
3) add brightness of 0.5 (shifts blacks to mid grey)
How does that node work in Nuke? What does Brightness of 1.0 mean? All [0,0,0] Become [1,1,1]? So is the same as RGB offset?
I'm 🐥 not 🥝, pls don't eat me ( ;  ;   )

2016-04-12, 18:37:23
Reply #5

racoonart

  • Active Users
  • **
  • Posts: 1446
    • View Profile
    • racoon-artworks
I don't remember how it is called in nuke, just add 0.5 to all values. So all [0,0,0] become [0.5,0.5,0.5]. RGB offset sounds good to me.
Any sufficiently advanced bug is indistinguishable from a feature.

2016-04-13, 10:51:26
Reply #6

FrostKiwi

  • Active Users
  • **
  • Posts: 686
    • View Profile
    • YouTube
So, in summary:
1) Swap Green and Blue channel
2) add gamma of 2.2 (TEMPORARY FIX for wrong gamma output bug!)
3) add brightness of 0.5 (shifts blacks to mid grey)
4) make sure alpha values are between 0.0 and 1.0, possibly due to rounding errors from image operations before (or reelsmart will refuse to do anything)
I have to paddle back, I'm pretty sure it's still the wrong format. As stated by their website [Screenshot below] , their system requires strict Image space vectors, the 3D stuff is being miss interpreted. Also these passes (although you obviously can't comapre visually) are Yellowish tinted and muddy in their appearance.

Look at the screen shots provided, the real Corona output is obviously correct, but the motion vector post process does not account for the camera movement canceling out the Reflective teapot movement and blurs that, although in image space it's almost still with no motion.
Also here is the test as an animation, I have adjusted Blur strength based on the 8th frame, so Badly multiplied strength is not the issue.
www.saires.de/corona-moblur
I have seen in a tutorial, Nuke taking 3D motion vector data and a mention for AfterEffects requiring Image space data.
I'm 🐥 not 🥝, pls don't eat me ( ;  ;   )

2016-04-13, 11:45:55
Reply #7

racoonart

  • Active Users
  • **
  • Posts: 1446
    • View Profile
    • racoon-artworks
Hmmm... the flying teapot looks indeed weird.
I also made some more tests now (only had a brief look until now) and it seems they are indeed not screenspace. We'll have to wait for an answer from the devs I guess.

Any sufficiently advanced bug is indistinguishable from a feature.

2016-04-13, 11:59:58
Reply #8

racoonart

  • Active Users
  • **
  • Posts: 1446
    • View Profile
    • racoon-artworks
I made a quick render with vray to show how it should look like. Ignore the colors (they are shifted by 0.5 for non floating point output), the important thing is that x is red and the other channels are basically 0, thus only moving to the right in screenspace.

Moving this to bug reports now.
Any sufficiently advanced bug is indistinguishable from a feature.

2016-04-13, 13:10:31
Reply #9

FrostKiwi

  • Active Users
  • **
  • Posts: 686
    • View Profile
    • YouTube
Moving this to bug reports now.
Thanks, hope on some official say on this.
Doesn't feel like a bug though, as the pass is probably meant to be 3D, not image space. Gamma 2.2 issue obviously is a bug :D
I'm 🐥 not 🥝, pls don't eat me ( ;  ;   )

2016-04-13, 13:27:12
Reply #10

racoonart

  • Active Users
  • **
  • Posts: 1446
    • View Profile
    • racoon-artworks
Well, as described in the image above, I've no idea which coordinate system these 3d vectors are meant to be in. I don't really think this is intended behavior (and if it is, it's not useful) so I consider it to be a bug.
Any sufficiently advanced bug is indistinguishable from a feature.

2016-04-13, 15:32:49
Reply #11

Frood

  • Active Users
  • **
  • Posts: 1903
    • View Profile
    • Rakete GmbH
(...) as the pass is probably meant to be 3D, not image space.

That´s the question. Seems a bit like both :) I have been also very confused when the velocity pass came available in Corona. I made a testscene and the results were not comprehensive at all for me.

But I have to admit that I never used a velocity pass because for mblur (camera) RSMB standard was enough for slow movement and object mblur has always been rendered if needed. Additionally I could not find good informaton about the different velocity passes in general so I just can´t explain this result:

All movement is world Y.

First picture: the greeble pit moves towards a static camera (-Y)
Second picture: the greeble pit is static and the camera moves positive Y


Good Luck

« Last Edit: 2016-04-14, 15:03:11 by Frood »
Never underestimate the power of a well placed level one spell.

2016-05-08, 11:22:54
Reply #12

Ondra

  • Administrator
  • Active Users
  • *****
  • Posts: 9048
  • Turning coffee to features since 2009
    • View Profile
camera mode added in RC5
Rendering is magic.How to get minidumps for crashed/frozen 3ds Max | Sorry for short replies, brief responses = more time to develop Corona ;)