mikkelm2 Posted January 26, 2015 Share Posted January 26, 2015 (edited) HiCan someone shed some light on how to render a velocity pass, from a flip fluid vdb mesh, for compositing? Here's a reference videos: Edited January 26, 2015 by mikkelm2 Quote Link to comment Share on other sites More sharing options...
Guest tar Posted January 26, 2015 Share Posted January 26, 2015 Doesn't the search box work for you? Typing 'Velocity pass', the first hit after your post is: http://forums.odforce.net/topic/21713-velocity-pass-render-from-flip-fluids/?hl=%2Bvelocity+%2Bpass Quote Link to comment Share on other sites More sharing options...
mikkelm2 Posted January 26, 2015 Author Share Posted January 26, 2015 My bad, i did try searching. Thanks Marty, i'm looking at it right now! Quote Link to comment Share on other sites More sharing options...
mikkelm2 Posted January 26, 2015 Author Share Posted January 26, 2015 In the other post, he said he simply "Just added a parameter to export the 'v', velocity, in the shader" - Now i've got my mantra setup to export V, but where in shader did he add the parameter, can't find it in the scene file? Quote Link to comment Share on other sites More sharing options...
mikkelm2 Posted January 26, 2015 Author Share Posted January 26, 2015 Oh shoot.. I dont mean a motion vector pass, sorry. I want to render a "indirect refraction pass" like in this example Quote Link to comment Share on other sites More sharing options...
Guest tar Posted January 26, 2015 Share Posted January 26, 2015 Indirect Lighting 'refract' is built into H14 - check the Mantra node - screengrab attached Quote Link to comment Share on other sites More sharing options...
mikkelm2 Posted January 27, 2015 Author Share Posted January 27, 2015 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. 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? Quote Link to comment Share on other sites More sharing options...
eetu Posted January 27, 2015 Share Posted January 27, 2015 - 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 2 Quote Link to comment Share on other sites More sharing options...
mikkelm2 Posted January 27, 2015 Author Share Posted January 27, 2015 Thanks eetu, i'm looking at the file right now! Your answer is really helping me understand, thanks! I will let you know how it goes. Quote Link to comment Share on other sites More sharing options...
mikkelm2 Posted January 27, 2015 Author Share Posted January 27, 2015 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.. Here's my scene file and exports i did. Download link: http://files.m2film.dk/FLIP_V2_VelSpeed_Export.zip Quote Link to comment Share on other sites More sharing options...
Ahmed Saady Posted January 27, 2015 Share Posted January 27, 2015 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. Quote Link to comment Share on other sites More sharing options...
Ahmed Saady Posted January 27, 2015 Share Posted January 27, 2015 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.. Here's my scene file and exports i did. 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. Quote Link to comment Share on other sites More sharing options...
mikkelm2 Posted January 27, 2015 Author Share Posted January 27, 2015 Where in the shader do you add a parameter to call the cooked velocity? Quote Link to comment Share on other sites More sharing options...
Ahmed Saady Posted January 27, 2015 Share Posted January 27, 2015 i just follow same as these guys told me : http://forums.odforce.net/topic/21713-velocity-pass-render-from-flip-fluids/ Quote Link to comment Share on other sites More sharing options...
eetu Posted January 27, 2015 Share Posted January 27, 2015 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.. 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 1 Quote Link to comment Share on other sites More sharing options...
eetu Posted January 27, 2015 Share Posted January 27, 2015 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. Quote Link to comment Share on other sites More sharing options...
mikkelm2 Posted January 27, 2015 Author Share Posted January 27, 2015 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. 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? Quote Link to comment Share on other sites More sharing options...
Ahmed Saady Posted January 27, 2015 Share Posted January 27, 2015 This is really nice topic guys and such a great information. Let me ask about the vorticity pass how can we get it? Quote Link to comment Share on other sites More sharing options...
eetu Posted January 27, 2015 Share Posted January 27, 2015 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 2 Quote Link to comment Share on other sites More sharing options...
eetu Posted January 27, 2015 Share Posted January 27, 2015 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? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.