Houdini 14 Scatter node - Attribute bias
31514 25 6- revan
- Member
- 4 posts
- Joined: April 2013
- Offline
- stouffle
- Member
- 12 posts
- Joined: Oct. 2012
- Offline
- neil_math_comp
- 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:
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]
https://www.youtube.com/channel/UC_HFmdvpe9U2G3OMNViKMEQ [www.youtube.com]
- revan
- Member
- 4 posts
- Joined: April 2013
- Offline
- MagnusL3D
- Member
- 1110 posts
- Joined: Aug. 2008
- Offline
- neil_math_comp
- Member
- 1743 posts
- Joined: March 2012
- Offline
revanThat 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).
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.
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.
Writing code for fun and profit since... 2005? Wow, I'm getting old.
https://www.youtube.com/channel/UC_HFmdvpe9U2G3OMNViKMEQ [www.youtube.com]
https://www.youtube.com/channel/UC_HFmdvpe9U2G3OMNViKMEQ [www.youtube.com]
- revan
- 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!
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!
- neil_math_comp
- 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]
https://www.youtube.com/channel/UC_HFmdvpe9U2G3OMNViKMEQ [www.youtube.com]
- revan
- Member
- 4 posts
- Joined: April 2013
- Offline
- MagnusL3D
- Member
- 1110 posts
- Joined: Aug. 2008
- Offline
- karyn-kiran kewlani
- Member
- 2 posts
- Joined: May 2014
- Offline
- neil_math_comp
- Member
- 1743 posts
- Joined: March 2012
- Offline
karyn-kiran kewlaniI know it's a bit clunky, but you can use a Merge SOP afterward.
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 ?
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]
https://www.youtube.com/channel/UC_HFmdvpe9U2G3OMNViKMEQ [www.youtube.com]
- Adam Redhead
- 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?
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?
- neil_math_comp
- Member
- 1743 posts
- Joined: March 2012
- Offline
Adam RedheadCheck 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.
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?
Writing code for fun and profit since... 2005? Wow, I'm getting old.
https://www.youtube.com/channel/UC_HFmdvpe9U2G3OMNViKMEQ [www.youtube.com]
https://www.youtube.com/channel/UC_HFmdvpe9U2G3OMNViKMEQ [www.youtube.com]
- Adam Redhead
- Member
- 2 posts
- Joined: Sept. 2013
- Offline
- karyn-kiran kewlani
- Member
- 2 posts
- Joined: May 2014
- Offline
ndicksonkaryn-kiran kewlaniI know it's a bit clunky, but you can use a Merge SOP afterward.
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 ?
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 .
- DocWhite
- Member
- 1 posts
- Joined: Oct. 2013
- Offline
- ahmedsheeraz
- 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.
- neil_math_comp
- 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.
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.
Writing code for fun and profit since... 2005? Wow, I'm getting old.
https://www.youtube.com/channel/UC_HFmdvpe9U2G3OMNViKMEQ [www.youtube.com]
https://www.youtube.com/channel/UC_HFmdvpe9U2G3OMNViKMEQ [www.youtube.com]
- ahmedsheeraz
- Member
- 7 posts
- Joined: Dec. 2014
- Offline
-
- Quick Links