Houdini 14 Scatter node - Attribute bias

   31661   25   6
User Avatar
Member
4 posts
Joined: April 2013
Offline
In Houdini 14 the scatter node has been rewritten and now the “attribute bias” has been removed.
Is there an alternative way to use it?
User Avatar
Member
12 posts
Joined: Oct. 2012
Offline
I believe that they have replaced attribute bias with relax iterations. It doesn't do exactly the same as attribute bias, but it gets close.
User Avatar
Member
1743 posts
Joined: March 2012
Offline
If you describe what you're actually trying to do, I can (hopefully) describe how to do it.

The “Alternate Attribute” option was mostly used with the old Scatter SOP for a very complicated way of getting points to stick to deforming geometry, which is now much easier and faster to do by Scattering once on the rest geometry, outputting the Prim Num Attribute and Prim UVW Attribute on the Output Attributes tab, feeding that into the first input of Attribute Interpolate and feeding the deforming geometry into the second input. You can see this in the SpikyDeformingTorus help example.

However, that presumably isn't what you were looking to do, because that wouldn't use the old Attribute Bias parameter, (or at least it would be 1). Maybe you want to vary the density, in which case, you can turn off Force Total Count, and turn on Density Attribute. It will smoothly vary the density across each polygon/tetrahedron if it's a point or vertex attribute. If you want something like the Attribute from before, you can start out with a constant density attribute and add to it, e.g. with Paint, or use simple things in Attribute Wrangle, like:

float t = ch(“bias”);
float constantvalue = 1.0;
@density = t*@density + (1-t)*constantvalue;

Anything along those lines, or was my guessing way off? :wink:
Writing code for fun and profit since... 2005? Wow, I'm getting old.
https://www.youtube.com/channel/UC_HFmdvpe9U2G3OMNViKMEQ [www.youtube.com]
User Avatar
Member
4 posts
Joined: April 2013
Offline
Hi ndickson.

I used to scatter points based on a color attribute to drive where the points would be scattered and set the attribute bias to < 1 so the points would generate not only in the areas where I painted.
User Avatar
Member
1110 posts
Joined: Aug. 2008
Offline
I used it alot to for placing mesh close to walls etc…

With Cd attribute transfer from a wall segement to floor, then using the transferd color gradient on the floor as bias so I would get more junk closer the floor/wall corner.

So I am following this thread closely
/M

Personal Houdini test videos, http://vimeo.com/magnusl3d/ [vimeo.com]
User Avatar
Member
1743 posts
Joined: March 2012
Offline
revan
I used to scatter points based on a color attribute to drive where the points would be scattered and set the attribute bias to < 1 so the points would generate not only in the areas where I painted.
That makes sense. Now, the painting will produce an actual density if you use Density Attribute, instead of acting like an area override, so you'll get more consistent results if you have unevenly refined meshes. If you try the old Scatter SOP on the attached example, it'll have sudden jumps in density where the polygon size changes, (and it won't interpolate across polygons, but that's less visible with small polygons).

To have a mix of uniform and painted, you can either start with a non-zero uniform density and paint changes to that density (example_1 in attached), or you can make the density more uniform after painting (example_2 in attached). The latter is closer to the Attribute Bias behaviour from the old Scatter SOP, but the former is simpler and still fairly close.

Attachments:
ScatterPaintPlusUniform.hip (96.5 KB)

Writing code for fun and profit since... 2005? Wow, I'm getting old.
https://www.youtube.com/channel/UC_HFmdvpe9U2G3OMNViKMEQ [www.youtube.com]
User Avatar
Member
4 posts
Joined: April 2013
Offline
Thank you ndickson!

Both examples are really good, i particularly like example 1.

As you said, example 2 is closer to the old Scatter SOP behaviour (it is even more precise thanks to the “uniform density” slider) but it's a bit trickier to set up.

Thank you again, your time and support were much appreciated!
User Avatar
Member
1743 posts
Joined: March 2012
Offline
No problem! Maybe I should add something like this as a help example, possibly a case with density transferred from walls, plus uniform, plus painted, so that MagnusL3D's case has an example too.
Writing code for fun and profit since... 2005? Wow, I'm getting old.
https://www.youtube.com/channel/UC_HFmdvpe9U2G3OMNViKMEQ [www.youtube.com]
User Avatar
Member
4 posts
Joined: April 2013
Offline
That would be great!
User Avatar
Member
1110 posts
Joined: Aug. 2008
Offline
I agree, sounds great
/M

Personal Houdini test videos, http://vimeo.com/magnusl3d/ [vimeo.com]
User Avatar
Member
2 posts
Joined: May 2014
Offline
In Houdini v14.0.201.13 , the “ Scatter ” node does not have the option “ Keep Original Geometry ” which exists in Houdini V13.0.376 , is there an alternative way to use it ?

Attachments:
Houdiniv14_Scatter_Node.hip (132.0 KB)

User Avatar
Member
1743 posts
Joined: March 2012
Offline
karyn-kiran kewlani
In Houdini v14.0.201.13 , the “ Scatter ” node does not have the option “ Keep Original Geometry ” which exists in Houdini V13.0.376 , is there an alternative way to use it ?
I know it's a bit clunky, but you can use a Merge SOP afterward.

For most workflows with Scatter, the intent is to do something with just the scattered points afterward, so it only complicated cases I was aware of, (apart from visualization; templating the input sometimes works for that). There are also already a ton of parameters, and people have asked for a ton more. Maybe if you described your use case, I could suggest a better option, or get a better idea of what you're looking for.
Writing code for fun and profit since... 2005? Wow, I'm getting old.
https://www.youtube.com/channel/UC_HFmdvpe9U2G3OMNViKMEQ [www.youtube.com]
User Avatar
Member
2 posts
Joined: Sept. 2013
Offline
hi ndickson,
I am scattering based on color attribute. Which works fine on when set to generate is set to density, however the geometry I am using is deforming, so when generate is set to density it causes the points to jitter on the surface. I have overcome the jitter problem by using generate in texture space option, however by using this I am not able generate the scatter based on Cd.

I know I could use a texture map, however if it's possible I would prefer to scatter based on Cd as the workflow is quicker. Do you have any suggestions?
User Avatar
Member
1743 posts
Joined: March 2012
Offline
Adam Redhead
I am scattering based on color attribute. Which works fine on when set to generate is set to density, however the geometry I am using is deforming, so when generate is set to density it causes the points to jitter on the surface. … Do you have any suggestions?
Check out the SpikyDeformingTorus help example. One of the biggest advantages of the new Scatter SOP is that you can easily scatter once on the rest geometry, and then use Attribute Interpolate to move the points to the corresponding positions on the deforming geometry on every frame. It's also WAY faster than re-scattering on every frame.
Writing code for fun and profit since... 2005? Wow, I'm getting old.
https://www.youtube.com/channel/UC_HFmdvpe9U2G3OMNViKMEQ [www.youtube.com]
User Avatar
Member
2 posts
Joined: Sept. 2013
Offline
That's perfect! Thanks for your help!
User Avatar
Member
2 posts
Joined: May 2014
Offline
ndickson
karyn-kiran kewlani
In Houdini v14.0.201.13 , the “ Scatter ” node does not have the option “ Keep Original Geometry ” which exists in Houdini V13.0.376 , is there an alternative way to use it ?
I know it's a bit clunky, but you can use a Merge SOP afterward.

For most workflows with Scatter, the intent is to do something with just the scattered points afterward, so it only complicated cases I was aware of, (apart from visualization; templating the input sometimes works for that). There are also already a ton of parameters, and people have asked for a ton more. Maybe if you described your use case, I could suggest a better option, or get a better idea of what you're looking for.

Hi ndickson , thank you for your help .
User Avatar
Member
1 posts
Joined: Oct. 2013
Offline
Thanks a lot for the example ndickson, it has been very useful to me too.
Make it nice or make it twice.
User Avatar
Member
7 posts
Joined: Dec. 2014
Offline
ndickson
Check out the SpikyDeformingTorus help example. One of the biggest advantages of the new Scatter SOP is that you can easily scatter once on the rest geometry, and then use Attribute Interpolate to move the points to the corresponding positions on the deforming geometry on every frame. It's also WAY faster than re-scattering on every frame.

Hi ndickson, spikydeformingtorus help file is really awesome technique to stick scatter points to deforming mesh but unfortunately it's not happening on my alembic file spitting out error “couldn't find integer attribute for primiteve number” (picture and hip attached), wat could possibly be the reason?

thanx in advance.

Attachments:
chk.zip (11.1 MB)
err.jpg (149.6 KB)

www.ahmedsheeraz.com
User Avatar
Member
1743 posts
Joined: March 2012
Offline
Just two simple things:

1) (optional due to 2) The Copy SOP isn't copying over sourceprim or sourceprimuv from the template points. You can fix that by turning on the “Use Template Point Attributes” toggle on the Copy SOP.

2) Because each box has 8 points and P is being interpolated based on a single point for all 8, each box will have its 8 points moved to a single position. To fix this, put the Scatter into the first input of the Attribute Interpolate, then copy the boxes to those points afterward.

Hopefully that's what you were looking for!

If you also need to avoid any possible rotating of the box orientations around N, you can add an “up” attribute, so that the boxes will be copied in a way that uses N and up to determine the orientation, instead of just N. It'd need to be animated with the geometry, though, so it could be difficult if you need it; there might be some way to do it with PolyFrame.

Attachments:
ScatterInterpolateCopyBoxes.png (13.5 KB)

Writing code for fun and profit since... 2005? Wow, I'm getting old.
https://www.youtube.com/channel/UC_HFmdvpe9U2G3OMNViKMEQ [www.youtube.com]
User Avatar
Member
7 posts
Joined: Dec. 2014
Offline
very nice ndickson. very clever you just changed the position of the copy sop and problem solved. thumbs up!!
www.ahmedsheeraz.com
  • Quick Links