carl45456 Posted November 9, 2021 Share Posted November 9, 2021 Hi guys, I have a pig head which I have sliced and packed, I am trying to randomize the color of each chunk by using a attribute random on the Cd, and a color node with a ramp from attribute after. The problem is that the color node doesn't assign the new colors to each chunk of the pighead, it mostly "overlays" it. Thanks! frac.hip Quote Link to comment Share on other sites More sharing options...
DonRomano Posted November 9, 2021 Share Posted November 9, 2021 In a wrangle : // Get a random float between 0.0 and 1.0, and add a seed to test and randomize per frame, or however you'd like float randomFloat = rand(@primnum + 8439 + chi("seed")); // Create a ramp (that you'll need to edit to rgb ramp in the interface parameters) and map the random float to it // then output the random color mapped on the ramp to the Cd attribute @Cd = chramp("color_ramp", randomFloat); Quote Link to comment Share on other sites More sharing options...
Atom Posted November 9, 2021 Share Posted November 9, 2021 You can also use the ramp from attribute feature built into the color node. This doesn't pick a "random" color, but bases the color selection from a ramp on the piece id. You could randomize the i@id attribute in the range of 0-piece_count for a truly random effect chosen from the ramp colors. ap_color_by_id.hiplc 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.