Jump to content

Uniform Surface Scattering


Recommended Posts

That's really nice stuff Christian! I love it!

Did you work out the algorithm or got it from somehwere?

Thanks a lot! Yes, I worked out the algorithm. But it's nothing magic, really.

The idea is to move points away from the other points. You just need a small number of iterations to get a stable state.

It's like a "separation" steering behavior used in crowd simulations.

On my blog I give a short description about the idea and technique used for the scatterer.

Link to comment
Share on other sites

Good stuff :) - especially nice to see it working in 3d as well. - I haven't tried your sop yet, but the algorithm should work for volumes too.

Perhaps consider uploading it to the exchange or vfxToolbox.

Also a next step would be to play with the distance between your neighbours so you can adaptively create more dense areas (say where the user would want more points (based on some painted attribute/texture map), but still evenly distributed).

There are threads on the forum that already do this, but mostly only in 2d and it's not wrapped up in an otl.

Another thing to consider is the curvature of your input geometry, again adding more points where curvature is high, so you get a better adaptive distribution (and representation of the object).

Link to comment
Share on other sites

Good stuff :) - especially nice to see it working in 3d as well. - I haven't tried your sop yet, but the algorithm should work for volumes too.

Perhaps consider uploading it to the exchange or vfxToolbox.

Also a next step would be to play with the distance between your neighbours so you can adaptively create more dense areas (say where the user would want more points (based on some painted attribute/texture map), but still evenly distributed).

There are threads on the forum that already do this, but mostly only in 2d and it's not wrapped up in an otl.

Another thing to consider is the curvature of your input geometry, again adding more points where curvature is high, so you get a better adaptive distribution (and representation of the object).

Yes, I already played with this idea and I am going to integrate a "density" to handle the distance between the points. Also volume scattering is possible. If I find some time I will make a update to the scatterer.

Oh, of course...I'll upload it to the exchange platforms.

Link to comment
Share on other sites

http://en.wikipedia.org/wiki/Lloyd%27s_algorithm ?

(Personally, I'm kinda disappointed with this wikipedia entry but oh well :) )

I know this wikipedia entry. An interesting algorothm....it is similar, but not the same.

My scatterer works completely without a voronoi computation ;)

Edited by schnelli
Link to comment
Share on other sites

Hi Gergo,

thanks for your post! I also tried out your otl and I like it. Great! Thanks for sharing.

Cheers,

Christian

Hi Christian,

I have tried your asset, it really works. Thanks that you shared this with us.

I have already tried this ixDartThrowEmission ice compound with Houdini.

However it is brute-force, it is not as slow as I expected.

Cheers,

Gergo

Edited by schnelli
Link to comment
Share on other sites

  • 5 weeks later...

How do you build and triangulate the mesh from points?

The Triangulate2D SOP is able to build a geometry from the given points. The problem is, the Triangulate2D SOP projects the geometry onto a 2D plane....so thats why it gets a little more complex....

For my porpuse, I needed small pieces of the geometry. So, the process can be:

- Split your source geometry into smaller parts (e.g. voronoi pieces)

- Uniform scatter each piece

- Create a triangulated mesh via Triangulate2D SOP and project the geo back onto the original one with the RaySOP.

- Finally, reconnect the pieces to get a triangulated mesh.

I attached a sample picture which shows this process.

post-5065-128066248301_thumb.jpg

Link to comment
Share on other sites

Really useful tool, thanks for sharing.

Is there a way to make the points not shift position if the surface is animated?

The Uniform Scatter is based on the houdini build-in Scatter SOP, which distributes the points randomly on the surface. So you get different distributions if the geometry changes, even if the change is minimal.

But there is a solution. Once you uniform scattered your geometry, you can "stitch" the points on the geometry by storing for each point the barycentric coordinate relative to the source geometry (see the "pointdist" expression function). On each frame you do not need do scatter again, just move the points on the new position, resulting from the barycentric coordinates.

This works fine, the points "glue" on your animated geometry. And another advantage is: you just need do scatter once.

Edited by schnelli
Link to comment
Share on other sites

  • 1 year later...

Hello Christian.

Really enjoyed your Uniform Scatter :-)!

i was playing around with it, but I want to use the normals as the ordinary scatter does. Do you have an idea how I can get the normals working?

Thanks

//Anders

Hello Anders,

you are right, the uniform scatter does not compute the normals.

My first idea is to use my csClosestPrimitive VEX node. It can compute the closest point to a specified geometry and returns the interpolated normal of this location.

You can find the tool on my blog:

http://schnellhammer.net/blog/2011/08/houdini-closest-primitive-vex-function/

Attached a simple hip file demonstrating this tool in combination with the uniform scatterer.

Cheers,

Christian

csUniformScatterNormals.hip

Link to comment
Share on other sites

  • 2 years later...

Hi!

This was very useful! I diged inside a little and added point distribution from the paint attributes. So fell free to use it too if you need it.

I added some parameters, they mostly edit point count. I made some assumptions so a little change of these numbers may help to achieve better results: 

post-12134-0-12301400-1411246950_thumb.j

post-12134-0-65211300-1411246953_thumb.j

uniform_paint_scatter.hipnc

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...