Particle Opacity Based On Velocity [SOLVED]

   2328   4   1
User Avatar
Member
78 posts
Joined: June 2019
Offline
I have a bunch of particles floating completely still in mid air.

When an object passes through the scene, the particles are attracted to it via a POP Attract.

I'm wanting those particles to be invisible until they start to move, then slowly become more visible the faster they move and finally fade opacity back down to zero again as they slow down and stop with drag.

Something fairly difficult?

File Attached. The scene doesn't have to be specifically setup like this. I'm a new Houdini user. Is there a better way to fill an object with particles rather than what I have done here?
Edited by GlennimusPrime - Dec. 1, 2020 15:55:21

Attachments:
Particle_Opacity_Velocity.hipnc (427.6 KB)

User Avatar
Member
676 posts
Joined: Feb. 2017
Offline
Hey GlennimusPrime,

after ur popnet you can use a wrangle or attribute vop to convert your velocity attribute v to a float value. use the length function for this. this new float value can be used to drive the opacity of the particles.

Cheers
CYTE
User Avatar
Member
78 posts
Joined: June 2019
Offline
Hi CYTE, thanks for your reply.

I'm fairly new to Houdini. I understand a little about vex and atribute vops, but not enough to completely understand.

In an attribute vop, if I pipe the v into a length vop, do I then pipe that into a bind export? Then use that bind export in an attribute wrangle?

Sorry I'm a bit lost!
User Avatar
Member
2528 posts
Joined: June 2008
Offline
Nah, don't use a VOP, use a wrangle.
f@Alpha = length(v);
The obvious flaw in this solution is that if the length returns a value greater than 1.0.
In that case, you need to know the minimum and maximum values of the length.
float min = 0.0;
float max = 2.0; //Use spread sheet to determine approximate maximum value.
f@Alpha = fit(length(@v),min,max,0,1);
Using Houdini Indie 20.0
Ubuntu 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
User Avatar
Member
78 posts
Joined: June 2019
Offline
Thank you so much Enivob, this is working well for me so far.

You are correct in playing with the two values to get the right amount of alpha. This should work for me, thank you!
  • Quick Links