### How to use distance for effect fall off ?

1857   19   2
Member
13 posts
Joined: 9月 2023
Offline
Hello guys, how can i do something like fall off for distance, for example i want to use distance from target node, or any other node to drive terrain noise intensity (i want for effect to be stronger in the middle and fall off towards the edges of the plane)
How can i do that?
Member
442 posts
Joined: 11月 2016
Offline
I do it this way with vex.

Attachments:
Screenshot from 2024-04-24 14-01-00.png (1.6 MB)

Member
13 posts
Joined: 9月 2023
Offline
Tanto
I do it this way with vex.
Thank you this was very helpfull, had a bit of problem but that was due to initial scaling of grid being different

Attachments:
screen1.jpg (418.5 KB)

Member
7954 posts
Joined: 9月 2011
Offline
Another option without using any code would be to use the distancefrom nodes (geometry, target, etc) to get the distance, and use the mask section to remap the values or the attribremap node after the fact to shape the falloff. I don't think there's a non-code way to do a power function, but it would be a lot less code The remap attribute ramp set to b-spline could give parabola-ish falloff. Then use attribcombine to add the noise masked by the falloff attribute to P.
Edited by jsmack - 2024年4月24日 20:30:04
Member
4602 posts
Joined: 2月 2012
Offline
Hi,

You can also compute the geodesic distance (surface distance) to measure the shortest path between points which follows the natural curve of the surface rather than Euclidean distance which measures the straight line between two points:

Falloff:

```vector origin = point ( 1, "P", 0 );
vector p = minpos ( 0, origin );

int pts [ ] = pcfind ( 0, "P", p, 1000, 1 );
int ptclosest = pts [ 0 ];

float sdist = surfacedist ( 0, itoa ( ptclosest ), "P", @ptnum, -1, "surface" );
@sdist = sdist;
```

Blend:

```vector p = point ( 1, "P", @ptnum );
float sdist = fit ( @sdist, ch("dist_min"), ch("dist_max"), 0, 1 );
sdist = chramp("dist", sdist);
@sdist = sdist;
@P = lerp ( @P, p, sdist );
```
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]

Member
13 posts
Joined: 9月 2023
Offline
jsmack
Another option without using any code would be to use the distancefrom nodes (geometry, target, etc) to get the distance, and use the mask section to remap the values or the attribremap node after the fact to shape the falloff. I don't think there's a non-code way to do a power function, but it would be a lot less code The remap attribute ramp set to b-spline could give parabola-ish falloff. Then use attribcombine to add the noise masked by the falloff attribute to P.
Could you provide an example, i'm new to houdini stuff i don't know how to remap values, or how would it achieve what i need. I'm definelty intersted though how to do that with nodes. Thank you!
Member
13 posts
Joined: 9月 2023
Offline
animatrix_
Hi,

You can also compute the geodesic distance (surface distance) to measure the shortest path between points which follows the natural curve of the surface rather than Euclidean distance which measures the straight line between two points:

Falloff:

```vector origin = point ( 1, "P", 0 );
vector p = minpos ( 0, origin );

int pts [ ] = pcfind ( 0, "P", p, 1000, 1 );
int ptclosest = pts [ 0 ];

float sdist = surfacedist ( 0, itoa ( ptclosest ), "P", @ptnum, -1, "surface" );
@sdist = sdist;
```

Blend:

```vector p = point ( 1, "P", @ptnum );
float sdist = fit ( @sdist, ch("dist_min"), ch("dist_max"), 0, 1 );
sdist = chramp("dist", sdist);
@sdist = sdist;
@P = lerp ( @P, p, sdist );
```

Very cool, even though i'm a noob with vex, it amazes me how many choices and options it provides.
Member
13 posts
Joined: 9月 2023
Offline
General question to you guys, so i have a very bad geometry and math learning experience, is there a good resource for specifically 3D math stuff with visual examples maybe not only in Houdini, i'm noticing same functions are used also in Unreal sometimes, so can someone share a good 3D math learning resource in general this would be very helpfull.

Could someone share their thoughts on motion graphics approach with Houdini:
I started to toy around with Houdini with hopes of making simple motion Graphics, not very complicated simulations or hyper real renders, stylized and abstract for some kind of music video.
When i was searching for information as to what approach to take there was 2 camps of Houdini and C4D, in general i decided that Houdini is vast tool and would allow me to achieve more even beyond motion graphics if one day i decide to try something new, (i'm also trying to create some simple Unreal engine scenes from time to time)
What i'm asking is Houdini good tool for Motion Graphics, or am i trying to use wrong tool, and should look towards C4D instead, have any of you tried both and can share some experience as to what tool to use when, perhaps even there is a way to combine bot strengths in one pipeline, what approache would you suggest for Muisic video themed motiion Graphics?
Member
7954 posts
Joined: 9月 2011
Offline
woltiel
jsmack
Another option without using any code would be to use the distancefrom nodes (geometry, target, etc) to get the distance, and use the mask section to remap the values or the attribremap node after the fact to shape the falloff. I don't think there's a non-code way to do a power function, but it would be a lot less code The remap attribute ramp set to b-spline could give parabola-ish falloff. Then use attribcombine to add the noise masked by the falloff attribute to P.
Could you provide an example, i'm new to houdini stuff i don't know how to remap values, or how would it achieve what i need. I'm definelty intersted though how to do that with nodes. Thank you!

the nodes to use to replace VEX code for remapping and combining are Attribute Remap, Attribute Combine, and Attribute Adjust. To apply the displacement to position, use another attribute combine or a transform by attribute. I like to use nodes that imply what they do. In my example I've only used one bit of vex, and that was to generate a group of the closest point for uses with the surface distance node since it requires a point group to compute distance along the surface towards.

Attachments:
falloff_example_no_wrangles.hip (330.0 KB)
falloff_example.png (1.8 MB)

Member
4602 posts
Joined: 2月 2012
Offline
woltiel
General question to you guys, so i have a very bad geometry and math learning experience, is there a good resource for specifically 3D math stuff with visual examples maybe not only in Houdini, i'm noticing same functions are used also in Unreal sometimes, so can someone share a good 3D math learning resource in general this would be very helpfull.

I created a VEX course for this exact reason:

You can watch the free chapters here:

https://www.sidefx.com/learn/vex [www.sidefx.com]
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]

Member
13 posts
Joined: 9月 2023
Offline
jsmack
woltiel
jsmack
Another option without using any code would be to use the distancefrom nodes (geometry, target, etc) to get the distance, and use the mask section to remap the values or the attribremap node after the fact to shape the falloff. I don't think there's a non-code way to do a power function, but it would be a lot less code The remap attribute ramp set to b-spline could give parabola-ish falloff. Then use attribcombine to add the noise masked by the falloff attribute to P.
Could you provide an example, i'm new to houdini stuff i don't know how to remap values, or how would it achieve what i need. I'm definelty intersted though how to do that with nodes. Thank you!

the nodes to use to replace VEX code for remapping and combining are Attribute Remap, Attribute Combine, and Attribute Adjust. To apply the displacement to position, use another attribute combine or a transform by attribute. I like to use nodes that imply what they do. In my example I've only used one bit of vex, and that was to generate a group of the closest point for uses with the surface distance node since it requires a point group to compute distance along the surface towards.
THank you for the example project, it's really nice example how to do it with nodes
Member
13 posts
Joined: 9月 2023
Offline
animatrix_
woltiel
General question to you guys, so i have a very bad geometry and math learning experience, is there a good resource for specifically 3D math stuff with visual examples maybe not only in Houdini, i'm noticing same functions are used also in Unreal sometimes, so can someone share a good 3D math learning resource in general this would be very helpfull.

I created a VEX course for this exact reason:

You can watch the free chapters here:

https://www.sidefx.com/learn/vex [www.sidefx.com]
Oh, turns out there's whole VEX learning path, that's usefull to know, i simply never even noticed it, or rather was avoiding this magic VEX things.
I will try out free parts of your course, seems like exactly what i needed, thank you.
Member
248 posts
Joined: 8月 2018
Online
woltiel
General question to you guys, so i have a very bad geometry and math learning experience, is there a good resource for specifically 3D math stuff with visual examples maybe not only in Houdini, i'm noticing same functions are used also in Unreal sometimes, so can someone share a good 3D math learning resource in general this would be very helpful.

Could someone share their thoughts on motion graphics approach with Houdini:

If you're struggling with the maths side of things a reasonably good (paid) intro course is:
https://www.rebelway.net/math-for-fx/ [www.rebelway.net]

There's also:
https://www.houdini.school/courses/HS-223-Maths-for-Artists
But that's a little deeper I think.

Or for a more general maths intro there is also the excellent - and free: https://www.khanacademy.org/ [www.khanacademy.org]

To try and briefly answer your motion graphics question... Yes H is fantastic for mograph. However... it's an order of magnitude more powerful and flexible - and therefore more complex - than C4D. So, to tap that power and go beyond what C4D can do does take some significant 'learning investment' - time and effort.
Edited by Mike_A - 2024年4月26日 14:16:34
Member
30 posts
Joined: 5月 2007
Offline
For learning VEX, it's also worth mentioning Matt Estela's still-excellent free resources at his CGWiki site, particularly his "Joy of Vex" course with many animated GIFs demonstrating the principles :

https://tokeru.com/cgwiki/JoyOfVex.html [tokeru.com]

and three additional VEX sections - all available under his "Longform" drop-down menu
Member
13 posts
Joined: 9月 2023
Offline
rweston
For learning VEX, it's also worth mentioning Matt Estela's still-excellent free resources at his CGWiki site, particularly his "Joy of Vex" course with many animated GIFs demonstrating the principles :

https://tokeru.com/cgwiki/JoyOfVex.html [tokeru.com]

and three additional VEX sections - all available under his "Longform" drop-down menu
This is amazing resource, thank you
Member
13 posts
Joined: 9月 2023
Offline
Mike_A
woltiel
General question to you guys, so i have a very bad geometry and math learning experience, is there a good resource for specifically 3D math stuff with visual examples maybe not only in Houdini, i'm noticing same functions are used also in Unreal sometimes, so can someone share a good 3D math learning resource in general this would be very helpful.

Could someone share their thoughts on motion graphics approach with Houdini:

If you're struggling with the maths side of things a reasonably good (paid) intro course is:
https://www.rebelway.net/math-for-fx/ [www.rebelway.net]

There's also:
https://www.houdini.school/courses/HS-223-Maths-for-Artists
But that's a little deeper I think.

Or for a more general maths intro there is also the excellent - and free: https://www.khanacademy.org/ [www.khanacademy.org]

To try and briefly answer your motion graphics question... Yes H is fantastic for mograph. However... it's an order of magnitude more powerful and flexible - and therefore more complex - than C4D. So, to tap that power and go beyond what C4D can do does take some significant 'learning investment' - time and effort.

Thank you, the courses you suggested seems to be very good for explaining 3d math, in the houdini.school images they posted i wonder if those are the one that will be made throughout the course, or if it's just pretty image to fill the space, cause in the trailer it looked really more about explanation rather than presentation, i really like the results in the images gonna hope one day to do something like that.

About whole C4D theme, i agree with you it seems like Houdini is complex enough to do everything that C4D could it would just lack some sort of presets for effects and instead require artist to program the tools they need, but in return would offer you more flexibility in ways of achieving your goal.

Could you share some good starting points for learning Houdini specifically for abstract motion graphics, i found Entagma YouTube channel and i enjoy style of what they do and how they explain things
Member
248 posts
Joined: 8月 2018
Online
The images in the Maths course are definitely 'eye candy' - the course is about understanding the maths rather than building specific setups.

I came to H from C4D myself - about 2 years ago. The thing to understand about H is that it's very different to a 'standard' DCC like Cinema. Someone described it as: "A 3D tool development environment, that ships with a reasonable set of presets." - and that's not a bad description.

With H you must invest the time and effort to understand the absolute fundamentals to leverage the power. That takes time. I was probably a year in learning fairly intensively before I started feeling comfortable in just the geometry and rendering areas.

Entagma is good - but can be a little deep if you don't have the basics. I'd really suggest you dive into the basics of SOPs and get a firm grounding in all the critical stuff - working with points, normals, attributes... these are key elements in building good mograph setups - and fundamental to all of H.

Start here but focus on the SOP's stuff: https://www.sidefx.com/learn/getting_started/ [www.sidefx.com]

One free addon that you might like is MOP's: https://www.motionoperators.com/ [www.motionoperators.com]
That will ease you from C4D mograph to Houdini...

Enjoy the ride, but be patient. It takes time.

PS: and always make sure you have the 'Side FX Labs' set installed - full of really useful stuff.
Edited by Mike_A - 2024年4月28日 11:23:39
Member
53 posts
Joined: 4月 2013
Offline
Personally I would keep it as simple as possible when learning Houdini and stick with just using basic nodes, it's pretty mind blowing how much can be achieved with them.

If you *really* want to learn the math of 3D ...urgh, I remember being there....A great little book that I can recommend as a starting point is '3D Math Primer for graphics and game development' it has lots of diagrams and example explanations of most
of the formulas to give you a good start.
Edited by EZiniT - 2024年4月29日 04:17:41

Attachments:
BasicDropOff.JPG (94.5 KB)
Drop-off.hipnc (199.2 KB)

Member
13 posts
Joined: 9月 2023
Offline
Mike_A
The images in the Maths course are definitely 'eye candy' - the course is about understanding the maths rather than building specific setups.

I came to H from C4D myself - about 2 years ago. The thing to understand about H is that it's very different to a 'standard' DCC like Cinema. Someone described it as: "A 3D tool development environment, that ships with a reasonable set of presets." - and that's not a bad description.

With H you must invest the time and effort to understand the absolute fundamentals to leverage the power. That takes time. I was probably a year in learning fairly intensively before I started feeling comfortable in just the geometry and rendering areas.

Entagma is good - but can be a little deep if you don't have the basics. I'd really suggest you dive into the basics of SOPs and get a firm grounding in all the critical stuff - working with points, normals, attributes... these are key elements in building good mograph setups - and fundamental to all of H.

Start here but focus on the SOP's stuff: https://www.sidefx.com/learn/getting_started/ [www.sidefx.com]

One free addon that you might like is MOP's: https://www.motionoperators.com/ [www.motionoperators.com]
That will ease you from C4D mograph to Houdini...

Enjoy the ride, but be patient. It takes time.

PS: and always make sure you have the 'Side FX Labs' set installed - full of really useful stuff.
Thank you for your advice, i tried the learning path, but at some point it just felt like not what i wanted, i realise that i should finish it because fundumentals are very imporant, but at the same time it felt like i was diving into too many things and i personaly wanted some abstract stuff, so naturally i when i saw entagma stuff i switched to their houdini in 5 minutes course, it was very fun. Now i refreshed a bit and had fun i plan to come back to fundumentals.
Thank you for pointing out the motion operators plugin, looks very usefull, definetly gonna play with it after the learing path
Member
13 posts
Joined: 9月 2023
Offline
EZiniT
D Math Primer for graphics and game development
Thank you, i checked out the book and was suprised by how much positive feedback it had, i usually find it hard to learn by books, but i may give it a go