Decals orientation to follow AO direction

   1399   6   1
User Avatar
Member
38 posts
Joined: 7月 2020
Offline
Hello, I hope someone can help me with this.
I am creating decals with a scatter node based on a density attribute created using a Mask by feature (AO).
The fact is that I would like these decals to have the correct orientation based on the propragation of the AO as seen in the attached image.
I don't know if I could add some attribute to these points that read that direction or be able to detect the edges of the geometry to see where I have to rotate/orient my decals.

Thank you

Attachments:
AO_Direction.png (448.6 KB)

User Avatar
Member
768 posts
Joined: 2月 2017
Offline
You can use the polyframe node for that. It can compute a vector from a gradient.

Cheers
CYTE
User Avatar
Member
38 posts
Joined: 7月 2020
Offline
Good advice to start working with.

Unfortunately it tells me that the attribute is invalid even though it is a point attribute with descending numbers as can be seen in the spreadsheet.

Any advice?
Thx.

Attachments:
polyframe.PNG (340.0 KB)

User Avatar
Member
768 posts
Joined: 2月 2017
Offline
you need to convert your density to a vector first.
use a wrangle like this :
v@gradient = set(@density,0,0);

Cheers
CYTE
User Avatar
Member
38 posts
Joined: 7月 2020
Offline
It worked!

Thank you so much.
User Avatar
Member
9119 posts
Joined: 7月 2007
Online
You can also use Measure SOP to get vector gradient direction of a float attribute
Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
38 posts
Joined: 7月 2020
Offline
Thank you for the adding some possibilites @tamte.

But the fact is I get cleaner results with the awrangle conversion rather than with the measure SOP. As you can see in the images below, the vectors are better aligned with the AO gradient with the conversion method. Maybe it's a matter of tweaking the measure SOP.
But again, thank you.




Edited by Haruko - 2023年6月29日 02:44:33

Attachments:
Measure.PNG (182.6 KB)
Awrangle conversion.PNG (159.5 KB)

  • Quick Links