I have shattered geometry broken up into n primitive groups. With a point SOP, I color the points with $BBX in the diffr field. This gives me a black to red (0-1) ramp across all of the points.
Now, for each primitive, I want to determine the lowest value of $CR for that piece and set all points to be that same value.
So if “piece3” has $CR values of .2, .23, and .256, I want to set all points to have the same diffr of .2, and so on for each piece.
Someone smarter than me showed me how to do this once, and I'm trying to replicate it (to no avail).
chris
assigning minimum $CR to all points in a primitive group
5452 4 1- toonlets
- Member
- 15 posts
- Joined: March 2010
- Offline
- graham
- Member
- 1909 posts
- Joined: Nov. 2006
- Offline
- toonlets
- Member
- 15 posts
- Joined: March 2010
- Offline
Thank you. The AttributePromote example almost does what I'm after… I was able to accomplish what I wanted, but I wonder how you would do this…
Each shattered piece is made up of multiple primitives forming a primitive group. While I was initially able to get the minimum $CR value for each primitive and copy it to the other points of that primitive, I still had different colors per primitive in the overall primitive group.
I got around this with an add SOP. By deleting all of the primitives in a group, keeping the points, and then creating a single, new primitive (0-$N), I was then able to sample for the minimum value. I then copied this $CR back onto the original primitive group in a point SOP.
Is there a better/different way?
Each shattered piece is made up of multiple primitives forming a primitive group. While I was initially able to get the minimum $CR value for each primitive and copy it to the other points of that primitive, I still had different colors per primitive in the overall primitive group.
I got around this with an add SOP. By deleting all of the primitives in a group, keeping the points, and then creating a single, new primitive (0-$N), I was then able to sample for the minimum value. I then copied this $CR back onto the original primitive group in a point SOP.
Is there a better/different way?
- graham
- Member
- 1909 posts
- Joined: Nov. 2006
- Offline
As long as each piece is a group you should be able operate over the entire piece to get the minimum value.
In the attached file I've got a bunch of spheres with different Y coordinates acting like fractured pieces. Each sphere is a group. The ForEach works on a per group basis. Inside the ForEach we get the minimum value and apply the color to the whole piece. Hopefully it's what you are going for.
In the attached file I've got a bunch of spheres with different Y coordinates acting like fractured pieces. Each sphere is a group. The ForEach works on a per group basis. Inside the ForEach we get the minimum value and apply the color to the whole piece. Hopefully it's what you are going for.
Graham Thompson, Technical Artist @ Rockstar Games
- toonlets
- Member
- 15 posts
- Joined: March 2010
- Offline
-
- Quick Links