repeatable scatter in a window

   2083   3   1
User Avatar
Member
10 posts
Joined: April 2015
Offline
That's the best title I could think of to describe what I'd like to do.

I have an enormous piece of geometry onto which I'd like to scatter points so I can point instance plants from them for my forest. The geo really is too big to comfortable scatter all the points on the entire geo and the render time was too long anyway, so I set about thinking of a ‘cheat’.
I think if I use a backdrop texture and only render plants close to the camera, I can get the effect I want. I can create a bounding sphere around the camera, crop out the local geo, and then use that for the scatter. So far, so good.
But this idea fails when I move the camera (ultimately I'd like to fly over the landscape) because the cropped geo will generate a different random scatter for each frame.

Is there a way to solve this? or is my plan flawed? maybe there's a better method someone can suggest me?
Any help gratefully received!
User Avatar
Member
1746 posts
Joined: May 2006
Offline
Maybe this? If you use a primitive seed attribute, so the scatter is run per-prim rather than everywhere, it keeps it stable.

Or does, as long as you don't need relax iterations. If that's enabled, points on the edge of the delete pop a little bit.

See attached file.

Attachments:
stable_scatter.hip (134.6 KB)

http://www.tokeru.com/cgwiki [www.tokeru.com]
https://www.patreon.com/mattestela [www.patreon.com]
User Avatar
Member
1746 posts
Joined: May 2006
Offline
Ah, now working with relax!

The relax pops on the edges because the number of points changes on the edge. If we tag the prims on the edge of the delete region, scatter points with relax, then delete points that sit on the edge prims, it stays stable.

Attachments:
stable_scatter_with_relax.hip (148.3 KB)

http://www.tokeru.com/cgwiki [www.tokeru.com]
https://www.patreon.com/mattestela [www.patreon.com]
User Avatar
Member
10 posts
Joined: April 2015
Offline
Wow, that's spot on! thanks mestela!
  • Quick Links