Scatter points on surface with falloff density near the edge

   3314   5   1
User Avatar
Member
1 posts
Joined: July 2019
Offline
Hi.
How i can scatter points on surface with falloff density near the edge?

Attachments:
quastion.jpg (198.8 KB)

User Avatar
Member
475 posts
Joined: July 2005
Offline
Hi,

you can use the xyzdist() function to measure the shortest distance from any point of the surface to the border. After this you can use a ramp for example to set the @density attribute, which can be used in the scatter node. Make sure that you have enough surface points (for scatter).
Edited by Aizatulin - July 8, 2019 13:24:28

Attachments:
border_density.hipnc (85.0 KB)

User Avatar
Member
900 posts
Joined: Feb. 2016
Offline
Maybe less efficient than Aizatulin's solution, but a code-less approach is to use a falloff node.
Have a look at the example file (play with the parms in the colored node to change the effect)

Also, a more exotic approach would be creating the density map in a cop network.
Import your shape with a geometry node and try to shrink and blur it with some filters.
I tried a bit, with no much luck, the shrink/expand cop node seems buggy.
It would interesting to see it implemented..

cheers

Attachments:
border_density_falloff.hipnc (122.3 KB)
borderdensity.JPG (249.9 KB)

User Avatar
Member
193 posts
Joined: Dec. 2016
Offline
Annyone know how to do this with volumes ?
User Avatar
Member
4515 posts
Joined: Feb. 2012
Offline
NicTanghe
Annyone know how to do this with volumes ?

If you have an SDF, you can use it to remap density using a ramp:

float density = fit ( @surface, ch("min"), ch("max"), 0, 1 );
@density = chramp("density", density);


Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]

youtube.com/@pragmaticvfx | patreon.com/animatrix | animatrix2k7.gumroad.com
User Avatar
Member
3 posts
Joined: Sept. 2023
Offline
And do you have the SDF file? If so, in the case of volume, you can most simply use it for the next density mapping using the ramp. This is a proven solution that I have had the opportunity to use on more than one occasion.
  • Quick Links