Scatter with weight ramp?

   1083   2   0
User Avatar
Member
13 posts
Joined: 12月 2014
Offline
I'm a beginner, so I'm probably going to explain this wrong or don't use the right terminology.

I'm doing a scatter HDA that takes packed geometry (grass tufts, trees etc) as an input, I then scatter these with HeightField Scatter. How can I control which of the packed prims have priority? I'm pretty certain I saw a tutorial video a while ago that showed how to control this with a ramp, but now I just can't find it. Any help appreciated.
User Avatar
Member
104 posts
Joined: 12月 2014
Offline
It is about the distribution of the randomness, and you can tweak that. So if you imagine that you have object 0, 1, 2 and then you decide that you want more of the object 2, then make sure that your randomness is driven by the ramp and set your ramp which is from 0-1 to favor higher number by setting the ramp to reach the higher number sooner. is quite simple to figure this out. As you already probably know how to scatter different objects on the heighField, you should plug the attribute random node just after your scattered points, before the copy to points node, and you can tweak your randomness this way, just make sure that you create the point attribute with the same name as you defined in name attribute for your packed prims. Maybe there is also something in heightfieldscatter, but you should check the documentation for that, I don't believe seeing such a thing, however they do have this new node, attribute from pieces, which is designed for exactly that: https://www.sidefx.com/docs/houdini/nodes/sop/attribfrompieces.html [www.sidefx.com]

https://www.sidefx.com/docs/houdini/nodes/sop/attribrandomize.html [www.sidefx.com]
https://www.sidefx.com/docs/houdini/nodes/sop/heightfield_scatter.html [www.sidefx.com]
User Avatar
Member
13 posts
Joined: 12月 2014
Offline
Drasko Ivezic
It is about the distribution of the randomness, and you can tweak that. So if you imagine that you have object 0, 1, 2 and then you decide that you want more of the object 2, then make sure that your randomness is driven by the ramp and set your ramp which is from 0-1 to favor higher number by setting the ramp to reach the higher number sooner. is quite simple to figure this out. As you already probably know how to scatter different objects on the heighField, you should plug the attribute random node just after your scattered points, before the copy to points node, and you can tweak your randomness this way, just make sure that you create the point attribute with the same name as you defined in name attribute for your packed prims. Maybe there is also something in heightfieldscatter, but you should check the documentation for that, I don't believe seeing such a thing, however they do have this new node, attribute from pieces, which is designed for exactly that: https://www.sidefx.com/docs/houdini/nodes/sop/attribfrompieces.html [www.sidefx.com]

https://www.sidefx.com/docs/houdini/nodes/sop/attribrandomize.html [www.sidefx.com]
https://www.sidefx.com/docs/houdini/nodes/sop/heightfield_scatter.html [www.sidefx.com]

Thanks for answering. I think I have it figured out when scattering using a for/each loop, but I'm having problems when using the heightfield scatter node. Heightfield scatter is magnitudes faster than using a for/each loop on my computer (don't know why), which is why I prefer it. In this video, https://www.sidefx.com/tutorials/h17-terrain-master-class-part-02-heightfield-scatter/ [www.sidefx.com] , Ari Danesh is adding a "weight" attribute to the scatter geo before scattering it, but I can't find any reference to that in the documentation and when I try to recreate it in my scene, it does nothing.
Edited by ManHatTan - 2020年12月16日 04:32:04
  • Quick Links