Jump to content

FLIP Fluid - Mantra Velocity Mesh Pass


Recommended Posts

So i tried some testing with the .hip file from the other post you linked Marty.

- I'm not sure if i'm using this pass correctly, but i basicly just made it black/white and used screen or add mode. 

 

ZcSTIpJ.jpg

 

I still don't understand the .hip file 100%, it looks like a basic flip setup with "v" added as an extra image plane.

- I can't seem to find the velocity export in the shader/shop?

Link to comment
Share on other sites

- I'm not sure if i'm using this pass correctly, but i basicly just made it black/white and used screen or add mode. 

- I still don't understand the .hip file 100%, it looks like a basic flip setup with "v" added as an extra image plane.

- I can't seem to find the velocity export in the shader/shop?

 

1) Just converting the vector value to grayscale is not right. You need to calculate the length of the vector represented by the velocity buffer, and use that. For some pixels the simple grayscale might be close, but if the velocity vector is e.g. (-1.0, -1.0, -1.0) it will surely fail.

You can either do the length calculation in the shader, or probably within your compositing software.

 

2&3) the "magic" in Marty's hip is the lone parameter node within the flipfluid material node. It both imports the v point attribute and exports it for rendering as an image plane.

 

Attached is a small modification to Marty's file, doing the above mentioned velocity->speed calculation within the flipfluid material.

Flip V2.hip

  • Like 2
Link to comment
Share on other sites

The setup you did is definitely working, i can see the speed pass in the mantra1 render.

 

nOzmqKk.jpg

 

GQCLgJc.jpg

 

I found your nodes with the speed calculation, but i still can't find this "lone parameter node" within flipfluid material node.. i'm looking in shop > basicliquid

 

For some reason my speed pass is a corrupted file when i export it, i've tried using .tif and .exr. When i change the VEX Type from Float Type to Vector Type, it exports a working file but it's empty.. it only contains an alpha channel..  :huh:  Here's my scene file and exports i did.

 

8grGaII.jpg

 

Download link: http://files.m2film.dk/FLIP_V2_VelSpeed_Export.zip

Link to comment
Share on other sites

Hey guys 

Iv trying to make like this before and i asked about 

so what i know till now is you have first to calculate the vel from Vop sop by using its length with ramp , then its going into the attripute create ( v) 

then u just put inside your shader a parameter to call your cooked vel .

then in your mentra add an extra image with ( v ) .

 

i added some photos to show you guys what i mean 

but i do not know if this is really the best way to do it or not.

 

Also i wonder if anyone explain about how to get the  vorticity pass that will be great.

 

 

 

 

post-11123-0-77696900-1422359273_thumb.j

Link to comment
Share on other sites

The setup you did is definitely working, i can see the speed pass in the mantra1 render.

 

nOzmqKk.jpg

 

GQCLgJc.jpg

 

I found your nodes with the speed calculation, but i still can't find this "lone parameter node" within flipfluid material node.. i'm looking in shop > basicliquid

 

For some reason my speed pass is a corrupted file when i export it, i've tried using .tif and .exr. When i change the VEX Type from Float Type to Vector Type, it exports a working file but it's empty.. it only contains an alpha channel..  :huh:  Here's my scene file and exports i did.

 

8grGaII.jpg

 

Download link: http://files.m2film.dk/FLIP_V2_VelSpeed_Export.zip

I think you are getting this high white value bcoz you did not calculation your vel , so use your length to calculate it in vop sop , then i think you will read it in Mentra correctly. 

Link to comment
Share on other sites

The setup you did is definitely working, i can see the speed pass in the mantra1 render.

 

I found your nodes with the speed calculation, but i still can't find this "lone parameter node" within flipfluid material node.. i'm looking in shop > basicliquid

 

For some reason my speed pass is a corrupted file when i export it, i've tried using .tif and .exr. When i change the VEX Type from Float Type to Vector Type, it exports a working file but it's empty.. it only contains an alpha channel..  :huh:  Here's my scene file and exports i did.

 

"The lone parameter node" referred to Marty's original .hip, in my amended .hip I replaced that node with the three nodes you have a screenshot of.

The lone node only passes the v attribute from geometry through the shader to the exported vex variable. Then the extra image plane set up on the mantra rop picks up that variable and puts it on an image plane.

The three node version does the same, except in the shader stage it calculates the length of v and passes along only that one float value instead of the vector of three floats.

 

The attached hip file (which is pretty much the same as the previous one) does export working exr files. There is a COP network beside the mantra rop that has a file node inside, I used that to verify the .exr.

Flip V3.hip

  • Like 1
Link to comment
Share on other sites

Where in the shader do you add a parameter to call the cooked velocity? 

 

The terminology here can be a bit tricky;

 

v is an attribute on the geometry.

 

The shader needs to bind that attribute to an input variable. This is nowadays done with a Bind VOP, but Parameter VOP performs the needed binding as well. Parameter VOP creates a parameter on the shader interface, but in case there exists an attribute with the same name as the parameter, the shader binds the attribute value instead of the UI parameter value. (This can sound confusing, but is really a good thing.) Bind VOP just does the binding, without the UI parameter.

 

For creating an export variable, usually a Bind Export VOP is used. Here as well, Parameter VOP actually creates an export too.

 

Marty took advantage of this, and with a single Parameter VOP managed to take care of both import and export of the variable. In my 3-node version, I used a Bind VOP for importing v, Length VOP to calculate speed, and then a Bind Export VOP to export v.

 

The extra image plane setup on the Mantra ROP can be used to pick up a variable that a shader exports, and put that value on an extra image plane.

 

 

Apologies if I am unnecessarily verbose and you already grokked all this, but I wanted to be extra clear here.

Link to comment
Share on other sites

No apologies needed, i'm really glad you took the time needed to explain.. really appreciate it man!

I definitely have to study more, but this is a great starting point and a huge, huge help. :blush:

 

And you are correct about the working exr file, i also tried exporting tif and i can verify that both formats work with the speed channel!

However i am not able to view the file on windows, and when trying to import to my compositing program (After effects)i get an error..

It's like the speed channel in the tif/exr is only supported by houdini? How can i render speed to a flat .tif?

Link to comment
Share on other sites

Let me ask about the vorticity pass how can we get it?

 

Sure, here's a quick implementation. Vorticity is not calculated by default, so we need to add that to the solver inside the dopnet. First, a Gas Match Field DOP to create a temporary vorticity vector field that matches the vel field, and then a Gas Analysis DOP to calculate the curl of the vel field. Within fluidtank_fluid, vorticity is added to the list of volumes being imported to sopland, and the vorticity vectors are transferred to the surface points. What we want to see in the end is the magnitude of the vectors, so there is a quickie Attribute VOP SOP to do that.

 

As above, the vorticity is bound to a vex variable within the material, and an extra imageplane is added to the ROP.

Flip V4_vorticity.hip

  • Like 2
Link to comment
Share on other sites

And you are correct about the working exr file, i also tried exporting tif and i can verify that both formats work with the speed channel!

However i am not able to view the file on windows, and when trying to import to my compositing program (After effects)i get an error..

It's like the speed channel in the tif/exr is only supported by houdini? How can i render speed to a flat .tif?

 

Nuke and Fusion should surely read those, I don't know about Aftereffects. Maybe the channel names need to be R G B A or something? No idea really.

Another thing you could try is set the quantization to 8bit integer, perhaps AE doesn't like float tiffs?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...