How much does it COST? - shortest path mask

  Рет қаралды 7,495

Peter Claes

Peter Claes

4 жыл бұрын

For anyone who wants to learn how to drive shockwave pattern fx with gradients running over meshes. Add me on Instagram: pclaesvfx
Hipfile: bit.ly/shortest_path_hipfile
Today I want to cover one of my favorite nodes in Houdini: the shortest path node.
FIRST: Closed test geometry.
We use the rubbertoy (Flippy!) test geometry and turn it into a watertight mesh by converting it to a vdb (sdf) and then back to polygons. After remeshing we have a fairly even triangulated topology.
SECOND: Select the roots and compute the cost.
Select one or more points and group them as your 'group_roots'. Append the 'Find Shortest Path' node and put the group_roots in the start points field. Turn off 'Output Paths' as we only want to compute the cost attribute. Also set the calculation to 'From any start to any end' (this will combine multiple cost array values into the minimum cost in case you have multiple roots).
THIRD: Inspecting and understanding the cost attribute.
In a spreadsheet sort the points by the cost attribute and notice that the cost value of the root(s) is zero. The cost represents how much it costs in terms of distance to traverse the mesh starting from the root(s). We end up with a gradient that covers the entire mesh if the mesh is a connected. If the mesh is not connected and some areas are not able to be reached, then those areas would get a cost value of -1.
FOURTH: Normalizing the cost attribute.
Attribute promote the cost attribute to the detail attribute to get the maximum value of the cost, we name this: cost_max. Inside of an attribute vop we can normalize the attribute by fitting the current cost value between zero and the maximum cost (cost_max detail attribute). Connect the result to the color value so we can see grayscale gradient in the viewport, or also connect it to a rainbow ramp so we can visualize the range of the attribute better. Bind export the normalized cost as 'cost_n'.
FIFTH: Map cost to frame values.
In an attribute vop we remap the normalized cost to absolute frame values. The minimum can be frame 1 and the maximum can be frame 100. We can use these values to trigger a shockwave. These absolute cost values represent the temporal representation of the cost attribute.
SIXTH: Shockwave over the surface.
In another attribute vop we fit the frame between 'cost_absolute' as the minimum input and 'cost_absolute + duration' as the maximum input, the output range is mapped between 0 and 1. When we output the result of the fit function to the color we have a nice gradient that runs through the mesh. It travels along the mesh and nicely spreads out, it is not radially spreading out.
We can run the 0 to 1 gradient to a ramp where we define the profile of the shockwave.
SEVENTH: Displacing the surface.
The output of the shockwave ramp can drive the magnitude of a 'displacement along normal'. You can use the ramp to emit particles, control the pscale of points that are scattered on top of it.
EIGHT: Art directing the variation in cost.
Before computing the shortest path, we can create a 'resistance' attribute. We create a custom noise that creates areas of high resistance (white) and areas of low resistance (black). On the shortest path node on the path cost tab, we can specify 'resistance' as the Point Cost Attribute (enable checkbox). Some areas will now grow quickly (black patch) and other areas grow slowly (white patch).
NINTH: Slow down the growth on the flipper.
We can use the point inside of a primitive sphere and move it nearby one of the flippers. Assign a pink color to the sphere and attribute transfer this pink color onto the blue surface. This gives a pink to blue gradient. In an attribute vop we can add the value from the red channel to the existing resistance attribute. When we look at the final output we see that the cost wave travels last over the flipper.
TENTH: Recap most important parts.
Fun effect for gradient based operations. The most important part is the cost attribute and understanding what it does. Resistance attribute to modulate cost as it traverses the mesh.
For business or one-on-one visual effects consulting inquiries, you can reach me at peterclaesbusiness@gmail.com

Пікірлер: 67
@Mr_Ponzo
@Mr_Ponzo 4 жыл бұрын
Im amazed of how much I learnt with this tutorial. Love the way you explain things.
@peterclaes5918
@peterclaes5918 4 жыл бұрын
That’s great to hear! I’m happy that you are learning a bunch!
@ilirbeqiri
@ilirbeqiri 6 ай бұрын
4 years too late, but thank you for explaining it in a way that makes sense.
@jaaypeso
@jaaypeso 4 жыл бұрын
I just stumbled onto your page and I loved this tutorial and your clear teaching style which is great for an intermediate user like me. I learned a ton and subscribed. Please keep teaching as I will watch your other videos as well.
@g_rant_
@g_rant_ 4 жыл бұрын
Another really great one. So much information and so good. Please keep them coming, they are great and presented really well!!
@peterclaes5918
@peterclaes5918 4 жыл бұрын
Glad you like them! Next one will be released in the coming days!
@andreyluccahannes5377
@andreyluccahannes5377 2 жыл бұрын
This tutorial is awesome! Such a great learning experience because it teaches a concept which you can apply to so much things and not just a particular effect. I would love to see some new tutorials ;) Thanks for teaching
@Dominic-du4ow
@Dominic-du4ow 4 жыл бұрын
Thank you for sharing this. It's very well explained, great advice and very useful as a learning process. Looking forward to more videos like this one.
@peterclaes5918
@peterclaes5918 4 жыл бұрын
I’m building a series of fundamental tools first and then I’ll probably cover combinations of setups for more advanced Fx.
@travislrogers
@travislrogers 3 жыл бұрын
Really great tutorial! Well explained. Thanks for this!
@utubeparpankaj
@utubeparpankaj 3 жыл бұрын
Highly knowledgeable stuff man.Pls create more Tutorials .:).Cheers...:)
@milad_savar
@milad_savar 4 жыл бұрын
super excited u come in the KZfaq Roll , please Keep up , you knowledge is so Strong , thx
@peterclaes5918
@peterclaes5918 4 жыл бұрын
Thanks & that’s great to hear. The next one will be online in a few days :). I’m trying for one per week at the moment. Laying down some foundational knowledge first.
@cgchameleon7567
@cgchameleon7567 Жыл бұрын
Such a legendary teacher! Thank you very much.
@yehonataniiii
@yehonataniiii 10 ай бұрын
Thank you for teaching us the hidden ways of houdini! You are a great teacher!
@arnaudgiretphoto
@arnaudgiretphoto 4 жыл бұрын
Mapping space over time... that is just amazing. When i saw this happening i had like a bug to conceptualise it, and it is amazing ! Really super structured well temporised and explained and straight to cam > it's unique. Keep on, that's so cool /
@peterclaes5918
@peterclaes5918 4 жыл бұрын
Glad you liked it. At the end of the day it is ‘just data’ and we apply our concepts of space, time, color, normals,... to interpret that data in different ways. Another fun one to try is to rotate a color in the same way you would rotate a normal.
@xrossfader
@xrossfader Жыл бұрын
You make it so accessible. Thank you.
@blainklitzke6393
@blainklitzke6393 4 жыл бұрын
Thank you for the share! Very helpful to have this walk through.
@blainklitzke6393
@blainklitzke6393 4 жыл бұрын
Would love to hear more about arrays of cost and their usage. Thanks again, really great to find this information posted on the web in such an articulate manner. cheers!!!
@4rysc
@4rysc 4 жыл бұрын
Really great videos. Super at explaining and pleasant to listen to
@peterclaes5918
@peterclaes5918 4 жыл бұрын
Thank you & enjoy learning!
@user-ci7zk4lr3v
@user-ci7zk4lr3v 4 жыл бұрын
so nice!! learned a lot. Thank u
@aboldmule
@aboldmule Жыл бұрын
Amazing content, thanks for sharing.
@humayan91
@humayan91 3 жыл бұрын
Amazing tutorial. Thank you :)
@floydafcg
@floydafcg 4 жыл бұрын
Great tutorial! Thank you for posting.
@peterclaes5918
@peterclaes5918 4 жыл бұрын
Hope you learned some fun tricks!
@massimobaita7178
@massimobaita7178 4 жыл бұрын
Thank You very much, Peter!
@electrich1
@electrich1 4 жыл бұрын
Insane tuts bro, thanks!! Hope u make one about cross product or other math topics, i watch ur dot product explanation and is amazing how ur examples are so clear, amazing work man
@peterclaes5918
@peterclaes5918 4 жыл бұрын
Hi Richard, it took a while, but I just published one on the cross product here: The Cross product: Theory (1/3) kzfaq.info/get/bejne/h72UlbV5usrDl5s.html
@pixelfound
@pixelfound 4 жыл бұрын
I always wondered about creating this effect on a mesh! Tried using UV, point groups, attribute painting and what not! THANK YOU SO MUCH FOR SHARING! AS A BEGINNER I LEARNT A LOT!
@peterclaes5918
@peterclaes5918 4 жыл бұрын
Great to hear that! Good luck on your journey!
@pixelfound
@pixelfound 4 жыл бұрын
@@peterclaes5918 Thank You so much!
@vinesun4699
@vinesun4699 4 жыл бұрын
Great tutorial ! Thanks
@peterclaes5918
@peterclaes5918 4 жыл бұрын
Glad you liked it!
@cmolfino
@cmolfino 3 жыл бұрын
Great tip Peter! thanks for sharing. You mentioned how to calculate cost over not-connected geo... is that possible?
@antoniopepe
@antoniopepe 4 жыл бұрын
thx. great explanation
@PawelGrzelak
@PawelGrzelak 4 жыл бұрын
Great tut.
@peterclaes5918
@peterclaes5918 4 жыл бұрын
Thanks! Glad you liked it!
@Nitram-xw9ei
@Nitram-xw9ei 3 жыл бұрын
Subbed! Great stuff. I'd love to try my hand at making this in VEX but that may take some time as I'm still a beginner! It's great to have the VOPs explanation in order to try and think through what the coding process would be. EDIT: I managed to create the workflow in VEX, just up to the main mask part. I kept it in three separate Attribute Wrangle nodes in order to keep it consistent with the video. I'll look into resistance part once I have more knowledge of using noise in VEX. Just in general, though, this is an amazing way to create animated masks and particle emitters and a million other things. Thanks once again. Cost_Normalized // Bring in the two attributes that were created in the nodes above. The cost and the cost_max. float c = f@cost; float cm = f@cost_max; // Normalize the cost by remapping it and the cost_max between 0 and 1 c = fit(c, 0, cm, 0, 1); // Create a colour ramp using the normalized cost for visualisation purposes @Cd = chramp("colour_vis", c); // Create and promote and attribute called cost_n to be used later. f@cost_n = c; Cost_Absolute_Deform // Create our min and max variables float min = chf("min"); float max = chf("max"); // Bring in the normalized cost we just created. float cost_n = f@cost_n; // Refit the normalized cost to the range we set. float cost_absolute = fit(cost_n, 0, 1, min, max); // Create and promote and attribute called cost_absolute to be used later. f@cost_absolute = cost_absolute; Deform // Create our attributes float dur = chi("duration"); float t = @Frame * chf("time_multiplier"); float ca = f@cost_absolute; // Use the duration as an offset to the size of the mask float max = ca + dur; // Normalize the mask so we can put it into a ramp to further refine the shape. float mask = fit(t, ca, max, 0, 1); float ramp = chramp("edge_shape", mask); // Plug in the shape to the colour. Boom, mask. @Cd = ramp; // Move the P position by adding the normal to it. // The normals are controlled by the mask shape and also by an overall scale factor. @P += @N * ramp * chf("bulge_scale");
@andremonteiro1434
@andremonteiro1434 4 жыл бұрын
Thanks a lot Peter, truly it is a pleasure to learn with you. I am wondering how you can loop or create a cycle animation with this effect? I tried the solver sop to make the Cd attribute loop but no luck. Anyway, thanks a lot and keep it up.
@peterclaes5918
@peterclaes5918 4 жыл бұрын
You would be using a modulo on your frame value. Eg: frame % 100 will return values that loop between 0->99
@StephaneSOUBIRAN
@StephaneSOUBIRAN 4 жыл бұрын
Nice tut, thx you.
@peterclaes5918
@peterclaes5918 4 жыл бұрын
Glad you liked it!
@PawelGrzelak
@PawelGrzelak 4 жыл бұрын
How come you can talk and create at the same time!? Unique skill man.
@peterclaes5918
@peterclaes5918 4 жыл бұрын
Thanks! I phrase what I’m thinking, and then my hands catch up to dropping the nodes in Houdini. I visualize the effect in my head first, then reverse engineer the steps to get there, see the node tree in my head and then I drop down the nodes in Houdini. If I would not be talking the speed goes up, but this is a tutorial and pacing is important when teaching. After doing this for over ten years, it’s more about the algorithm and setup and less about the individual nodes.
@PawelGrzelak
@PawelGrzelak 4 жыл бұрын
@@peterclaes5918 Still, it's an unique skill. Most of pro tuts have voice-over recorded later, as well as footage is all sliced and merged. Pacing is good too. The only thing that I could be better is the name of the video ;) More descriptive.
@peterclaes5918
@peterclaes5918 4 жыл бұрын
Thanks for the feedback, I’ve updated the title!
@PawelGrzelak
@PawelGrzelak 4 жыл бұрын
@@peterclaes5918 Much better;)
@probiner
@probiner 4 жыл бұрын
Nice vid, thanks
@peterclaes5918
@peterclaes5918 4 жыл бұрын
Thanks! Have fun creating gradients to trigger your Fx!
@demonhunter4709
@demonhunter4709 4 жыл бұрын
Thanks again😇
@peterclaes5918
@peterclaes5918 4 жыл бұрын
Have fun with it!
@theagileaardvark
@theagileaardvark 4 жыл бұрын
Really nice idea! I would have solved this problem with... the classic "infection solver". Another trick added to the "toolbox" in the head :) Thanks a lot!
@peterclaes5918
@peterclaes5918 4 жыл бұрын
Nice! Running a solver gives you more control as you could ‘jump gaps’ in the topology if you wanted, but if you have connected topology then the shortest path runs much faster than a solver.
@theagileaardvark
@theagileaardvark 4 жыл бұрын
@@peterclaes5918 Exactly. And in many cases, the added "features" of a solver-based solution aren't really necessary if you can get the same or visually very close result with a custom ramp curve and findshortestpath while saving quite a lot of CPU time as a free bonus :) If you don't have a connected topology you could always cobble up something from the original mesh for the spreading process and transfer the result back to the original mesh at the end. Thanks again, I never thought of this before.
@MyLanista
@MyLanista 3 жыл бұрын
Great tutorial! I was wondering if there is a way to make this work on an animated mesh. It seemed the mask was flickering which makes sense when the mesh is deforming the path is changing I guess?
@peterclaes5918
@peterclaes5918 3 жыл бұрын
There is a way to do this if you have a stable point count. Use a time shift on the incoming animating geometry, set the frame to 1. This frame will become your ‘rest pose’. Then calculate the cost attribute with the shortest path on this rest frame. Then use an attribute copy, to copy the ‘cost’ attribute from the rest geometry onto the animating geometry. Then use your displacement deformer that is driven by the cost attribute on the animating geometry. Hope that makes sense! If you don’t have a stable point count, then it gets harder. You could create helper proxy geometry and compute cost on that. For example, you could wrap a sphere around the high res geo that you want, ray the sphere on the high res and try to make it ‘stick’ to the animating underlying geo. Eventually you can then perform an attribute transfer to transfer the cost attribute from the proxy onto the deforming high rez.
@boole_cat
@boole_cat 4 жыл бұрын
Super
@kate2326
@kate2326 3 жыл бұрын
Is it possible to delay path start times for time-dependent points?
@jluisroga
@jluisroga 4 жыл бұрын
Nice title! Lol Thanks for your insights
@peterclaes5918
@peterclaes5918 4 жыл бұрын
I’ll cover some finance and investing related advice in the future on a second channel :). Different kind of cost.
@kiranirugalbandara1908
@kiranirugalbandara1908 4 жыл бұрын
Really amazing tutorial . Only problem is your titles ! Atleast add "in Houdini" to the end
@peterclaes5918
@peterclaes5918 4 жыл бұрын
Thanks! I’d have to add ‘in Houdini’ to all my titles as the entire channel has Houdini videos, so instead I add it in the description and in the tags so people who are searching should be able to find it.
@kiranirugalbandara1908
@kiranirugalbandara1908 4 жыл бұрын
@@peterclaes5918 Your decision mate ! Anyways I'm lucky I found the channel , great content , keep it up !
@salil808
@salil808 2 ай бұрын
why did you promote the cost to a detail attribute?
@peterclaes5918
@peterclaes5918 2 ай бұрын
The goal is remap the attribute between the minimum and the maximum value. Have a look at the values in the geometry spreadsheet. At the point level cost is all unique values, but at the detail level there is only one 'cost_max' value as there should only be one maximum value. I want to store this maximum value once (at the detail/object level) vs storing that same value on all the points. If a value is the same for all points or all primitives, it is more memory efficient to store it as a single data value at the detail level. Then we remap the point cost value between the minimum (a value of zero) and maximum so we get a nice range between 0 and 1. This is 'normalizing' the attribute. The 0 to 1 range is easier to work with. Since this attribute normalizing operation is such a useful thing, the Sidefx Labs team made a tool for it 'attribute_normalize_float'. You can take a look inside of that as it also does the data promotion to detail, both for a minimum as well as a maximum value.
Understanding the DOT product!
47:56
Peter Claes
Рет қаралды 10 М.
Find shortest path
6:17
Yonni de Haar
Рет қаралды 8 М.
Получилось у Вики?😂 #хабибка
00:14
ХАБИБ
Рет қаралды 6 МЛН
World’s Deadliest Obstacle Course!
28:25
MrBeast
Рет қаралды 145 МЛН
Guiding shortest paths - Houdini Tutorial
18:32
Konstantin Magnus
Рет қаралды 30 М.
Will it ADVECT? - advect curve by volume
25:10
Peter Claes
Рет қаралды 11 М.
How Ray Tracing (Modern CGI) Works And How To Do It 600x Faster
32:06
Josh's Channel
Рет қаралды 562 М.
A problem so hard even Google relies on Random Chance
12:06
Breaking Taps
Рет қаралды 1,1 МЛН
What are Attributes? - Speedy Houdini
7:20
Nine Between
Рет қаралды 7 М.
I Tested Every FREE Drawing App
22:15
viyaura
Рет қаралды 234 М.
Do you need a formal education for FX?
33:24
Peter Claes
Рет қаралды 2,5 М.
The Problem with Wind Energy
16:47
Real Engineering
Рет қаралды 879 М.