Jump to content
smbell

looping over pointcloud in mat/shading context (SOLVED)

Recommended Posts

Posted (edited)

I'm trying to create rings in mantra that are larger where my scattered points are brighter. I've got a setup that works for that, but what I'm looking for iis for the rings on top of each other and overlap one another.

I figure I need to loop over my point cloud one point at a time and then multiply the result on top of each other maybe.  I can't seem to figure out how to get a loop that does what I want. I tried to follow the documentation for the point cloud nodes, and it even mentions that a few of them are useful in a loop situation but it's just not working correctly. Is what I'm trying to do even possible. I don't have a lot of experience with mantra.

Screenshot_13.jpg

mantra_pc_lookup.hip

Edited by smbell

Share this post


Link to post
Share on other sites
Posted (edited)
2 hours ago, Librarian said:

I think Entagma had on some Show that approach (solution) Siggraph CG.
https://www.youtube.com/watch?v=tKzDvvpP7G0

29:54
Hope it Helps!

 

 

Thanks for the link, unfortunately that setup seems to have the same effect as I have now of all the points being rendered together and they don't overlap.

Edited by smbell

Share this post


Link to post
Share on other sites

@smbell
I found this, maybe someone Can Help, to find a solution for MAT-Vop .
 

float maxradius = chf("radius");
vector nb_color;
float dist;
 
int handle = pcopen(@OpInput2, "P", @P, maxradius, chi("handle"));
 
while(pciterate(handle))
{
    pcimport(handle, "Cd", nb_color);
    pcimport(handle, "point.distance", dist);
    @Cd = lerp(@Cd, nb_color, dist/maxradius);
}

 

mattC.jpg

  • Like 1

Share this post


Link to post
Share on other sites

@Librarian Holy crap I got it working!. Thank you for your time in responding to me, while it didn't solve my issue exactly, I did one more search and found a 10 year old Peter Quint video that shows how to use Point Clouds in a loop in VOPS. I would have never figured it out, wow. What a bunch of Houdini mumbo jumbo to get it working, haha. If you're interested the video is "Point Clouds II" It won't let me link it for some reason.

Screenshot_14.jpg

mantra_pc_lookup_3.hip

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×