Shading based on velocity

   9642   10   2
User Avatar
Member
245 posts
Joined: Sept. 2011
Offline
Is it possible to shade the diffuse color based on a surface velocity?

I was playing around with FLIP Fluids and I noticed on the surface creation that it also exports a V attribute, checked it in the details view and I can see its available..

The next step is.. how can I apply this inside a SHOP network?

My global variables do not show the V attribute, I tried importing the attribute with the “Get Attribute” node but no luck there.. I must be overlooking something Obvious.. ops:
User Avatar
Member
197 posts
Joined: June 2012
Offline
I'm probably wrong but I'd try a parameter node and set the parameter to V and float, I'll look into it tomorrow and email you if I get the chance (It's Benjamin).
User Avatar
Member
245 posts
Joined: Sept. 2011
Offline
Hey Benjamin, good to see you in the forum!
I actually tried that but I did not have much luck with it..
Maybe I did it incorrectly, I'll give it another shot.. :wink:
User Avatar
Member
245 posts
Joined: Sept. 2011
Offline
Ah shit I think I know how to fix this.. right now everything has velocity.. I should use the current velocity and subtract the previous frame velocity from it so I get the bigest changes in velocity..

I'll try that out and get back to you on the status!
User Avatar
Member
197 posts
Joined: June 2012
Offline
I'm pretty sure velocity's attribute is called ‘vel’ and that V is viscosity, this is most likely the problem. Just like Density is ‘density’, not ‘d’
User Avatar
Member
373 posts
Joined: March 2009
Offline
v is definetly velocity, viscosity is viscosity. I didn't spend much time on it, but I couldn't quite get it working just in the shader, but I attached an example where I use point color (Cd)transferred to the mesh, and enabled “use point color” on the shader… this is how I'd usually do it anyway.

Attachments:
Flip_ColorbyVel_Mantra.hipnc (1.0 MB)

Ian Farnsworth
User Avatar
Member
197 posts
Joined: June 2012
Offline
When creating fields in sops for dops, i thought you called them vel?
User Avatar
Member
373 posts
Joined: March 2009
Offline
Yes. Field is vel, point attribute is v. In this case I believe he was talking about the point attribute.
Ian Farnsworth
User Avatar
Member
197 posts
Joined: June 2012
Offline
Thanks for the insight.
User Avatar
Member
245 posts
Joined: Sept. 2011
Offline
Thanks for the tip solitude, I did the same thing but then I let it subtract the previous frame from the current from to see where the biggest changes are.

Got this idea from Scott Keatings H12 waterfall video, tought it also applies to this part.. 8)

Smart thing to put the vopsop before the surface.. I put it after the surface.. its almost the same result but your way is faster to test

I've attached a video to see my result, my results are black/white so I can use this in shop as Cf and apply it to other aspects than surface color!

Attachments:
meshvel.mp4 (4.1 MB)

User Avatar
Member
245 posts
Joined: Sept. 2011
Offline
Tought I might share this here:

http://www.youtube.com/watch?v=hAf_oYkKulc [youtube.com]

I used it in one of videos, currently rendering the final now..
Works really great this! (so far)
  • Quick Links