Page 1 of 1

Change material only in deformed particles?

Posted: 04 Jan 2014, 10:02
by Bullit
I have a point cloud that a part of it is deformed by an object via raycast.
In the part that is deformed i want that it gets that object material.
And when i move the object those particles that get deformed get the object material and those that ceased to be deformed return to the point cloud material.

Any idea how i should approach this?

Re: Change material only in deformed particles?

Posted: 04 Jan 2014, 14:52
by Tekano
hey bullit it is really easy to mix materials in the render tree with a mix node and using an ICE particle attribute value as the weight parameter for the blend. and to assign the attribute is straight forward, if particles are raycasted then atttribute = 1 etc

Re: Change material only in deformed particles?

Posted: 04 Jan 2014, 18:44
by Bullit
Thanks Tekano, will look into that.

Re: Change material only in deformed particles?

Posted: 05 Jan 2014, 13:10
by Bullit
If this helps anyone i tried with Mix 2 colors and didn't worked.
I created my attribute directly from the hit output port of raycast node, so it was a boolean.
In rendertree i tried putting the boolean attribute with alpha in mix 2 colors node and it didn't worked.
But i was able to get it to work with color switch so all is okay.

Re: Change material only in deformed particles?

Posted: 05 Jan 2014, 13:25
by gustavoeb
Convert it in the icetree before storing it then, from Boolean to integer, from integer to scalar.
If you want to have a smooth transition have this attribute be the amount deformed or distance to surface or something.

Re: Change material only in deformed particles?

Posted: 05 Jan 2014, 21:11
by Bullit
Yes converting make it work in mix node. It is still boolean though.

To have scalar i have to check from where/how to get scalar data, i have the locations from raycast node maybe i can convert from there.