JP Shep Posted April 1, 2018 Share Posted April 1, 2018 Hello, I have a ripple sim created with a sphere moving through a grid and the points deforming based on the velocity transferred to said grid. What I am trying to do is isolate the geometry based on where there are ripples via colour then as the rippled geo begins to settle back into what it was originally have that colour fade back to black. I'm halfway there I think. I was able to isolate the rippling parts of my grid by using a facet to compute its normals and then a point SOP to add colour based on the normal in it's Y (@N.y < 1). I was thinking of trying to use a vop or another point sop to make it so when the normal is between x and y multiply the color by 0.95 to get it to fade over time but was wondering what other ways I could try to do this. Cheers, JP ripple_example_1.hipnc Quote Link to comment Share on other sites More sharing options...
Yon Posted April 1, 2018 Share Posted April 1, 2018 vector up = {0,1,0}; float min = ch("Min"); float max = ch("Max"); float dot = dot(up,@N); float threshold = fit(dot,min,max,0,1); @Cd *= threshold; You had the right idea and this is what the dot product does ripple_example_2.hipnc 1 2 Quote Link to comment Share on other sites More sharing options...
JP Shep Posted April 1, 2018 Author Share Posted April 1, 2018 That's almost exactly what I'm looking for, thank you so much! My knowledge of wrangles isn't so great so what I'm assuming is that: you're defining the up vector and the min and the max values for the channels you created then you're getting the dot product from the up vector and the normal then you're defining the threshold by fitting all the attributes between 0 and 1 then you're multiplying the colour by said threshold so any point being disturbed begins with a colour value of 0 which fades to 1 overtime. I think that's correct? Regardless I think this will work with what I need to do and I'm assuming I can rebuild what you've done in a VOP in order to have more control? Thanks again! 1 Quote Link to comment Share on other sites More sharing options...
Yon Posted April 1, 2018 Share Posted April 1, 2018 yup thats it except im not fitting all the attributes, only the dot of the N and up to 0-1 so it will make a visible difference when we multiply color by it. Because it is returning a narrow range (.995 to 1) as there is not a big difference between the vectors. It also does not fade by time, it is only by the dot - which in this case is basically the difference between N and up, so the further it points away from 0,1,0 the more it is scaled down. You can make this in a VOP pretty easy yea. Quote Link to comment Share on other sites More sharing options...
JP Shep Posted April 2, 2018 Author Share Posted April 2, 2018 I tried recreating your method in a VOP and have something almost identical (I think). There is still a difference in the amount of colour your way picks up compared to mine. I defined my up vector before the vop using the old point sop node and didn't create the min and max values because I assumed they were for your fit in your wrangle example so I just promoted the source min and max in my vop after I fit the dot product. Then I multiplied the colour by the dot product and hooked it back into the output color. Screenshot from your method Screenshot from my VOP ripple_example_4.hipnc 1 Quote Link to comment Share on other sites More sharing options...
Yon Posted April 2, 2018 Share Posted April 2, 2018 you were dotting with @P.y instead of the up vector u created ripple_example_5.hipnc 2 1 Quote Link to comment Share on other sites More sharing options...
JP Shep Posted April 2, 2018 Author Share Posted April 2, 2018 shoot... I saw that it was a vector attribute and got confused. Thank you again for all the help, I really learned a lot from this! 1 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.