Houdini Algorithmic Live #039 - Edge Bundling with Kernel Density Estimation

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
okay testing the sound let me see if this is on air can anybody see or hear okay i'm not really sure if this is on all right okay all right so sorry for being late this is junior horikawa and today is the day for the vidini tutorial live that i'm doing weekly and topic for today is to create a edge bundling simulations which will be able to create this kind of simulations creating a bundle of and edges using a rather simple to understand method or algorithm called as kernel density estimation which is from the paper explained in the link which is on the description page of this youtube video so you can also go to the page to look for the actual paper which is this one open it right now uh it is called as a graph bundling bicarnal density estimation and i'm gonna explain a bit about this um algorithm then explain how you can implement this in houdini and rather a simple method okay all right still opening by using this it's i have done a edge bundling algorithm implementation for other algorithm before which is based on more on the calculations like a stretch forces but in this case it's more dependent on the graph um maps graph maps just looks like these i'm going to explain what these are right okay so first of all uh the kernel density estimation is a type of a smoothing technique you can use to get the the smoothing value out of a really complex values if you search for kernel density estimation and if you go to the wikipedia page let's say you have the original value like these orange values and you see those uh black lines here so by using estimations by using the kernel density estimation you'll be able to get this kind of smoothed out value and we you can use this we are going to use this same technique for the um graph bundling graph edge bundling now in this paper say we had a bunch of network like this previously as the initial steps what it's ask you to do is to create a height map like this based on the density of the edges so if you have more edges you have more height mountains high mountains like these so say so it works like this if you have like several edges and on say consider this is on 2d and on 2d you create a mountain based on the density of these edges so if there is a edge right here you have a mountain height maybe it's better to drill in red so you have a height like this so and you have a height for each of the edges and if you have multiple edge and same positions the height of the mounting get higher and higher and higher by adding the edge height for every every edge high for every edges as a result you'll be able to get a map a graph a 3d graph something something looking like this okay and what it's doing right here after you have got this graph it's moving by using this graph as a gradation map gradient map it's moving the point on edge consider you re-sample this edge into several points like a polygon with a several number of points and moving each of the points using these curve of the mountain as a gradient to move forward to those valley direction so if the points are on the top of the mountain then the the point will start to drop off to the valley direction use that direction to move the point and and a result if you do several iterations doing that calculation you'll be able to gradually change the point position like this from straight to something more bundled edge to something like this in the end and the graph the density map could also would also change if you also update it as well so that's the point of this uh algorithm you know in order to create edge bundling you need to create some kind of a height field for those edges and use that height field to calculate the gradient then moved it move the each of the point with this gradient and in the end when it's optimized enough you'll be able to get something like this so i'm going to show you how you can do that how you can actually do that using the using houdini in 3d now previously it was explained in 2d but by using a volume you can also implement this in 3d as well okay so that's what i'm going to show you today okay so i'm going to create a new houdini file to implement all right okay i'm not sure if this sounds okay right all right i hope let's hope so all right so first of all we need to have some kind of a network we want to create a bundling so let's just create some random line network it could be anything so i'll start with a really simple sample let's say create a graph or maybe create a i'll create a grid then create a scatter point on top of this grid all right then move this grid translate transform move this grid upward to y direction it looks like this so i have just moved the grid y on y direction by 10 then let's also create another scattering points using the same number of points with this one so i'm going to copy the total force count here and paste it right here as a reference so that it will be linked now i'm going to change the global seed for the second set of the scatter point so that the position of each point on the top and the bottom will be different now what i'm going to do is to connect a line between the bottom and top using the same point number so i'm going to use the point triangle to do that connect the first point to the first input second point to the second input and say create lines and i am going to retrieve the point position from the second input using [Music] point p and i'm going to create a new point at that point and create a primitive which is going to be a polyline to connect the first point and the second point from the second input all right okay simple enough so let's try to use this as a sample uh edge to create a bundling all right now we want to do next is to in order to make it like curved we need to have several points on top of this edge so let's just create let's just resample this as much as you want so i'm going to use resample to create a bunch of points on each of the edge now you can create as much point as possible if you have more points you have more high-res bundling but let's try to keep it a low val low number for now to make it so that we have a bit more faster calculation the result uh let's try half these end point number as a parameter so i'm going to create a no na no node named as controller and first of all i am going to create a parameter to define how many edges you want using some so let's say 10 000 is the maximum and also i'm going to set the resample edge lengths so or we sample as let's say from zero to one okay for the number of edges i'm going to keep it at 1000 for now and for the resample let's say like point two for now maybe thousand is too much yeah let's copy this to here all right now let's reduce the number of edges to 500 for now okay all right now uh let's i think everything is good for now now next thing i would like to do is to so as i said in the paper we need to create from those edge network we need to create this kind of a map a gradient map in 2d it was it was it can be done in order to create in order to like create a 3d map 3d high density or height field map from the 2d button if you're having the 3d geometry or 3d curve what we can do is to first create a density map based on the density of these edges using something like volume and then from that density map we could calculate or we could estimate the gradient which is going to be the vector direction which can be estimated by calculating the the difference between the difference of the edge density or density map using the neighboring information okay and there's just a function for that in the or a node okay so first of all we need to have some kind of a density map here from the edges so let's try to create that and more edges you have more density you want or you you need to create and there is a way to think if you want to calculate the height density map in every iterations or just once previously calculating the simulations i'm going to show you the way to use this pre-calculated high density and use it as use it for whole simulations but later on if i have time i could try try calculating the density map through the iterations in this case using soft solver okay so first of all we need to specify the the boundary for the volume or to create the high density map for these edges so we could use this as uh use this to calculate first of all the boundary box okay and let's give let's make it a little bit bigger than the current size okay so i could either set a padding value or use the transform scale or something to make it a little bit bigger i'm going to try to give a padding scale let's say one one one for lower padding and one one one for upper padding so that you have a padding value for all x y and z to the positive and negative direction okay all right now let's convert this into a volume using a volume node doesn't really matter i mean it doesn't matter about this uniform sampling divs doesn't need to be that high in order to calculate the uh density map because um this itself is just going to be used as a guide but higher you have higher like estimation you could create so i'm going to keep it as 50 for now and if if i found it too slow i'm going to reduce the value later on okay so 50 and let's name this as density and let's keep the default value to 1 to see the boundary it's based on the bounding box here now i can just keep it to zero again now okay let me just save this somewhere so that i don't lose the process i don't want to crash this thing so it's on the link okay now i am going to use the volume wrangle to estimate the density map from the edges to update this empty volume so i have caught i've connected the volume empty volume into the first input for the volume wrangle and for the second input i'm going to connect those edges that i want to calculate the density map so more lines you have the part where it has more lines i want to create more high density right so that's pretty straightforward and what i want to do is for those 3d edges first i'm going to retrieve i mean in develop in the volume or angle you're looking at each of the voxels right okay and each of the box all has its position value like at p and from at p what i want to do is to look for the nearest primitive or the primitive which is close to these points so let's say if you have multiple primitive which is close to this point primitive in this case is the edges right so let's say you have two edges which is close to this point and in terms of the the definition of closeness you have to define some search radius okay so say you have a search radius r and if the this radius the search radius intersect with these edges then you want to calculate the distance between this point on a voxel and the minimum on and the projected point on those lines so for those for this lines the projected point is somewhere around here for this line the projected point is somewhere around here it's a bit hard to see so the distance between these should be always less than i'm going to say d1 and d2 and d1 and d2 is always less than a search radius that's for sure and there's there might be other um distance value that has been found right from this point now for each of the distance for each of the primitive closest distance i am going to use this value to calculate to estimate the height the density map if it's so let's say this is the point and this is the edge and this is the point that has been found this is the d now if the edge is closing closer to the point position then you want that that means you have you want to apply you want to have uh or you can say that you have high density close to this point positions so based on that distance if the distance is close to zero then you have like highest density let's say that's one and if it goes farther and farther and if it goes at the edge of the search distance which in this case r then the density will become zero so based on the range from zero to r distance the the density uh will be varied from one to zero based on this distance value so i'm going to remap this distance into the value between one to zero based on the based on its value and then add it up at this value v to the point position iteratively so you will be able to get b1 b2 and bn and we want to add add up all those values to its point position as a in this case a density attribute for the volume so that's what i want to do in order to create a volume density map and as a result what i'm expecting to see is if we have edges like these we'll be able to have a fog like volume which is surrounding surrounding those edges and if it if the fog is close to if the if the position is close to the edge the fog is more dense if it's go farther and farther from the edge then the fog will become less dense okay so this is the density map that i want to create in 3d in order to calculate the gradient later on all right so let's do that i'm using volume wrangle first of all we need to specify the search radius right so let's create that parameter um let's say search disk okay and let's have this and the control as a parameter as well i'm going to make this 4-bit blinking and i'm going to drag and drop this value to here okay so it's from 0 to one for now i guess that's fine for now i'm gonna keep it as to okay now first thing off uh i want to collect all those primitives which is in this range from each of the voxel point now i can what i can look through all the primitives by just using all the primitive like numbers like n primitives but if you have like tons of primitives then that's going to be a bit too um [Music] that's going to be a bit too high uh cost calculations right so uh in order to prevent that we need to have uh we want to know we want to have get the minimum number or primitive as much as possible which is in this search research distance so to do that what we can use is this function called trim find so if you use this prim find you can set some bounding box range to search for the intersected primitive within a specific range okay with using set set by setting the minimum and maximum for the bounding box okay so let me check the usage so you have the geometry number and vector minimum and vector maximum that will be the position for the boundary box for the minimum maximum okay so we want to check the second input which is the list of edges and then a for the minimum since the starting point is the current box of position so that's at p and the minimum we can create a negative vector using the search distance uh value so let's make this sd to make so that i can reuse it a little bit easier so sdsd sd work will create a minimum point position for the bounding box and for the maximum point position for the bounding box i'm going to say the current point position plus set sd sd and sd okay as a result for each of the point on the box source you'll be able to find the necessary the minimum necessary point numbers or primitive numbers which can be used to calculate the minimum distance which is in which is in the range of from 0 to sd well there are some distance that's higher than sd being included in this prim find because uh this prim find is not using a sphere as bound as uh intersecting searches but you instead it's using a box so there are some unnecessary values being included but that's not a big problem what's pro what's good about here is that we can at least reduce the number of primitives to search for okay now we have a list of primitives we can loop through all those using for loop okay now uh after we have get the after we got the primitive number what we can do is what we want to do is just calculate the shortest distance from the voxel point to the primitive which can be done by using a function like x y z disc from the second input and i can [Music] create a filter like using i2a with the primitive number so that only those primitives will be used for the searching to calculate the shortest distance and from the current point position on the voxel right now uh we i think this distance is already less than sd but just to make sure i'm going to create i'm going to say minimum distance max or sd so that the distance will always be clamped at sd if it's more than sd okay now i can first remap this using fit function which is currently from 0 to sd and i'm going to remap this into 1 to 0 meaning if the distance is close to the original point position if the edges are close to the boxer point position then you want that means the voxel will be able to get the high density value in this case one if it's far from the zero um if it's far from the point then you want to set it at zero which is good which is over sd okay now this is the part now currently you have just created the linear um uh linear a different linear remapping from the based on the distance but if you look at this paper it says we need to kind of create a we need to do some kind of um diffusion or not not to make it a linear but you need to make it something like let's explain i forgot which part in the paper is mentioning about but it says we need to make the curve uh so currently let let me show you in a section view right so let's say so from the top view you have line like this and let's say if you cut this section at this point and looking at this view and it's so then the density map looks like this currently the one that i have just calculated okay so if it's close to the uh point that i'm looking at if it's close to the edge this is the edge position which is around here then you have a high value high density value here if it's far from the edge you have a less belt density about here as you can see what i have just calculated is looking like this looking more like a triangle mountain but if you look at the paper of those images doesn't look really look like those triangle edges but looks more like a mountain like this smooth mountain like this okay so we need to have this kind of mountain like uh changes rather than the linear straight line mountain okay so we need to do some kind of a convergence here in order to change this map this mountain shape so the easiest way we could do is to either use like uh trigonometry like sine cosine wave or using like a power function or other way is to graph the graphically change the value using the ramp parameter and i'm going to use that way so i am going to create a ramp parameter named as ramp like the distance and as a result you'll be able to see this as a default you'll be able to see this linear uh shape we can change this to something like this here for the end point and at several points to make it looks like a curve a mountain curve like we want to have now in the paper it asks you to do some equations but since we are designers we don't really need to follow that but let's try to create our own curve using those graphs right okay a mice i guess i need to maybe it's better to make all these as these spline i'm gonna say the spline okay that's better okay i guess i have too much points i'm gonna keep it like this for now and see what it goes how it goes all right so this kind of also indicates how fast this movement drops from top to bottom now the edge tends to go from the high density to i mean the edge tends to go to where the density is really high in this case by calculating the gradient and this curve will indicate the speed how fast the edge goes it travels based on the density map okay now let's go back and as a result you will be able to have a some kind of density value which ends in between zero to one so what i'm going to do afterwards or maybe before getting into the for loop i'm going to create a total density value starting from zero and i'm going to add up this distance that i've calculated as a density to this total density and finally i am going to update the density for this volume with this total density okay and as a result you'll be able to create this kind of um density map for each of the edges now currently uh it seems like the the edge radius of search radius is a bit too small um not much volumes are being intersecting so i'm going to raise up this search radius a bit like 0.5 all right and all right now after doing this what we can do here is to check if this point if this um density map is actually you can create a gradient that we want so let's name this as a density map creation and in order to create a density in order to create a gradient map from a density map you can use a volume analysis node from a volume you can extract some information like curvature gradient replacing detect edges we can choose this gradient now the type of the volume becomes velocity now the vector now you have x y and z value this indicates that this value has become as a directional value now let's check this directional value where those direction is forwarding to or facing toward and if it can be really used as a value in order to create a edge bundle right the easiest way to do that is to just visualize this using a volume trail so i'm going to create a volume trail as well as scattering the point is from this volume let's have enough points like 10 000 okay like this and as a result okay let's also reduce the edge thanks now currently i do see some um direction from edges to for each edges but seems like we still have a bit of separations for each of the edges we don't see much aligned here yet so i'm going to raise up this search distance to 1 to see if there are any changes okay i might need to raise up a little bit of numbers here like three thirty thousand okay now i start to see some flows and if i look at the center it does seem to create some flows maturity which already looks like coming the bundling edges which is really not it's just just a guide though and we can use this in order to move the point on the edges okay [Music] i think we are good to go at this point we could try maybe let me try to raise this up a little bit more what if i say five that's it it fits too much if you have too much value here then you have more smoothed out volume smoothed out um vectors and like this in this case all the points will try to go to the center so it doesn't really make sense so if it's two the value becomes this is still high so one at least one is good okay well we could try with one star somewhere around one and see how it goes okay i'm going to reduce this to 10 000. leave this aside this is just to check how it looks like how the volume looks like okay and all right so everything looks good and i do have this resampled point and now it's time to actually calculate the edge bundling simulations so for the first input i'm going to input this resampled edges and for the second input i'm going to input this volume as a guide where those points should travel through all right now everything after is pretty simple you just need to for each of the points you just need to refer to the closest velocity value from the gradient map so using point wrangle like this this is the volume yeah and let's say respond link all we need to do here at first get the velocity value 5 volume sample so vector val is volume sample v from the second input the name was density at current point position now we also need to specify some moving threshold or moving values so moving move scale let's name this smooth scale this created a parameter and the value for this one depends on the size of the geometry half currently the size of this box is around 10 so not sure what's the best value for it i'm just gonna keep it like point zero one for now my need might need to make it smaller i might need to make it bigger than current then update point position using the velocity multiplied by this move scale or maybe it could be set as moving speed okay now let's have this as a parameter inside a controller as well so going back [Music] and and check for bit linking and this one here all right okay and finally to to make it uh to make the result a smooth edge i'm going to apply a smooth node okay and i'll just keep the parameter as default value okay let's check at this point how this will create how well how this will work if i play i already have some result here and the speed seems a bit really too fast but it does seem to create some edge bundling effect here so first tried it's not bad and i also see some caches here so let's try to reduce the speed to now 0.0 also going to click this real time toggle point zero zero one okay not bad in terms of speed all right so it does seem to create a bundling effect already now the point here is that the amount of bundling depends on the search radius uh create based on the high density map right so if you change the search radius which i don't have it's a parameter right now do i i think i did this one so making this bigger or smaller you can also change the size of the bundling like i make this point five then the bundling should be smaller should become smaller now in this case i might want to raise up the speed so you see you might want to see that the bundling size becomes a bit smaller so it looks nice right okay looks nice and you might also want to check how these simulations will change if you change the ramp curve as well right so let me reset and go back to the density map so what i'm talking is some around here if i change this to a curve looking more like these what i want what i want you to see is this the change of the speed how the speed of the change the edge bundling will change uh create the curve like this okay all righty oops okay i'm having a slow update here i guess this the calculations with this volume angle is a bit slow okay now let's try with this see how the result look like now i'm not sure if you have noticed it but the speed of the change has been changed a little bit from the previously it goes slower first then becomes optimized slowly and slowly and slowly this way so i mean any curve might work but i guess having this value will create a fastest result with for optimized result like this see that the result the estimation seems to be a bit more faster well maybe i just think so all right okay so another things that i could do here um let's keep this search distance to one and if you look at this carefully the thing is thing here is that currently the edge point of the edge point of each of the edges is also moving you see while it's creating the bundling the edge the the starting point and end point of the edge is also moving like this every point that is because every point is affected by the gradient so there might be a situations you want to fix some of the point positions in the current point position um so that these points won't be affected by the gradient by the edge bundling in that case you need to specify some constraints to these points that you don't want to move okay so to do that we can create an additional attribute or group to those points so maybe applying some groups to those points will be an easy way to do easy way to create a constraint so uh what i could do where i could do that maybe after doing the resample i could create some point wrangle or primitive angle maybe primitive wrangle and let's name this fix endpoints and each of the primitive you'll be able to get a number of points using prim points and the first point on the end point of this ira is the first point and the end point so you can access to that first one the pt1 is or pt1 is ets 0 pt2 pts the length of pts minus one so this is the end point now for each of the point i could set some group to make it as a constrained point set point group like fix pt one one do the same for the pt2 like this now let's check it out going into the geometry spreadsheet and let's make sure that you have some points being fixed okay i think it's good now going back to the solver and inside the edge bundling we can ignore those fixed points for calculations so i can just say approximate fix all right now let's do this again if i play it those edge point will not be affected by the edge bundling anymore and create this kind of formations right looks good okay now um what we could do next is to well in terms of simulations which this is pretty much done i mean another thing i could think of is to calculate this high density map inside the solver so that each at each iterations you recalculate the density map to recalculate the gradient map to calculate more um high estimated value like what it's doing here i think this one is i think in this paper it is recalculating the gradient map for each iterations like this so we could do the same things here but uh the calculation for this density map cost a little bit high so i'm gonna keep this as it is for now and um if i have time i will continue doing that but for now i'm going to try to visualize this a bit more prettier and and try to end this sessions now what i want to do is based on the density of these edges i want to colorize the edges so if you if there are many points if there are those points those positions where you have many points being gathered and bundled i want to make the i want to make it as a high dense color and those edges point which is not bundled that much i want to make the color a bit more less dense color so to do that i need to find out for each of the point if if its point is at the dense location or not and i could do that by looking at each of the point and search for the nearest point and how many points are there on the nearest search distance and based on that number i could estimate the density of this bundling right so i'm gonna do it using point wrangle let's say near points and it's pretty simple i'm going to use a near points function current p using some search radius the search radius is different from the search radius in order to create a high density map and let's also set the maximum number to search for okay and create an attribute for each of the points which is going to be the number of points okay so for the search radius let's say 0.3 for the maximum number i'll say 100 okay and let's see at this point if i have any values now seems like i don't have much points in the range of three the maximum seems oh wait i do have a lot okay okay this might works okay so i'm going to keep it like this for now let's have these as a parameter as well so going back to the new controller this is for the visualization so i'm going to separate it from the edge bundling parameters drag and drop search and max number and let's rename this biz search so that you can understand this is for the visualization purpose of this max number is max number let's say from zero to three hundred all right now what i wanna do now is to well i think we can just try to use the color note at this point i know that the maximum number here for the length in this attribute but the point attribute is hundred which i've set it as a parameter so i can copy this and for the color attribute i can change this ram from attribute and use length to color the points and the maximum f of the range is 100 like this okay and that should change the color but it doesn't seem to okay let me check so currently it's lengths and the color node i do still have lengths here okay and the range is from 0 to 100 so i was hoping this will change some colors but doesn't seem to change anything is it because of the cache or anything oh yeah yeah okay now if i do calculate the high dense area start to have whitey colors and less dense will have a black color but instead of the black color i'm going to change to something else like blue or dark blue or blue and in between i'm going to create some xeon okay looks nice looks like a snaps now let's try to change some radius search radius to see the changes the max number okay well i guess 0.3 and 100 is a good number okay now i am also going to change the switch to such distance to 0.7 0.6 and redo the calculation edge bundling simulations looks nice looks really nice all right now let's raise this up raise up the number of edges currently i have 500 if i have like 2 thousand does this still works all right it looks pretty high danced it is a bit slow and i might need to set the visual search to a less value here like point one all right and also i'm going to set the search distanced a bit more smaller like 0.3 since i have enough points to search for the closest edges so let's see slowly i get some interesting pattern here and there now i do see a lot of tension on the center i guess that's because there are a lot of edges which cross which go through the center so there are high density in the center i guess all right looking nice isn't it looks really nice well if you want to have more bundling for all those edges i think you could also raise up the moving scale and also some search distance as well again optimization happens start to see a lot of bundling here and there and after some optimization some of the points won't move anymore based on the gradient value all right looks good well let's try out with different kind of line network other than this one okay so [Music] what i could think of let's create a box similar size to this one so box 10 yeah pretty similar then i'm going to create a bunch of points inside this box using iso offset scatter point and let's use the same number here so i'm going to copy this parameter and paste it right here okay and try to create a network i by connecting two of the points inside this box so point point triangle or maybe i can just try to create try to pick the pair for each of the points and try to create some network a random network here so for each of the point i'm going to pick some random point number in random index is equal to n points multiply by rand p and make a flow value okay and let's say if the all index is not equal to yourself then create a polyline between those two lines two points so in line equal to at prim zero polyline [Music] our index right okay so let's try to have this let's try to use this as a new network random network okay now what i could do is to want to replace this with this one but instead i'm going to use switch first of all i'm going to use new node to connect all these and then you switch like this okay so if it's zero you have a random network if it's one you have those straight line network from bottom to top top to bottom okay now maybe i can have this as a parameter as well so shape zero to one copy this parameter paste it right here all right now hopefully the same setup can be used for this other kind of network let's see if it does go to the end and see if i play it let me first set some paragraphs here so for let me also check the volume trail here how the that would look like well it might not be like maybe the search radius is a bit too small if i set it to one all right now i seem to have more affection based on the neighbors looks good and the move scale 0.25 let's just keep it as it is and let's see the result play it that looks a bit fast but you've seen some result interesting results cool now if i reduce the search radius switch distance to something like 0.6 you can see more networks like this and if i have more edges like let's say three thousand might be interesting all righty all right looks nice looks really nice doesn't it maybe i can make the color for the blue to be a bit darker it's a bit hard and maybe i can control it right here it's a bit hard just keep it as previous value 0.15 okay maybe yeah like this all right yeah i think i like it now as i said um i'm making it i'm making the simulation as fast as possible by bringing bringing this density map creation outside the full loop or sub solver but if i make this calculated inside then i will be able to create a bit more high estimated value like this one since this one is also calculating a high density map a gradient map inside the solver so i guess i should do that let me try to do that in the last and see if i have if i get something different out of the simulations so i don't want to lose this setup so i'm going to copy the part like this and so that i can also compare the result all right and for this one i am going to just drop in this volume the empty volume to the second input because i'm going to recalculate the density every step every iterations maybe i'm going to create another volume angle this one for this one i it am pretty sure that the calculations are going to be pretty slow if we have like 50 by 50 by 50 so i'm going to keep it as 20 for now all right and let me reset this okay now what i want to do is just calculate and do this calculations inside the soft solver so i'm going to copy this one and paste it right here and do the calculations right here and the edge value comes from the previous value here so i'm going to call connect like this so each iteration the edge network is updated so based on that updated edge i'm going to recalculate the density map make sense hopefully and calculate the gradient map again connect this to the edge bundling second input so it's like uh like how do i say own feedback feedback using the map information and the current object information this connection looks pretty interesting itself all right now hopefully let me also calculate the time to check where it is taking a bit of time to calculate now yeah it is obviously very slow somehow the movement looks pretty fast going too fast on the center making something like a square-like network how's that possible okay that looks a bit weird i might have something [Music] wrong oh that's looks interesting but it doesn't look correct now let me see let me see what's wrong here ah okay i think the parameter here is not linked this one because it's inside a stop solver that's one thing so i should add several dots here so that i can refer to the up stream value okay now it's done this one as well um but i'm not sure how i can change this d well i guess well the shape looks okay this for this one so i'm gonna keep it as it is let me just delete the channel so that this will be independent okay all right and for this one okay somehow the parameter is being oh okay well it's just this one for this one it's fine everything else looks fine all right now as you can see the this has a red highlight meaning the calculation is taking a lot of time with this volume wrangle even though i use this frame fine here oh if it was zero then i shouldn't be able to find any primitives though but let's see what i get as a result let's clear this and play this again play it okay now it becomes a lot more slower well how i would i be able to make it faster than slowly slowly i am getting the result here what i want to check if what i want to check here is that if the result looks better than the one that i have set up previously if it's not then using the previous setup it just makes sense if it if this one looks better then this might be this might have some meaning there are some meanings to use this one instead of the previous one in previous faster setting although the calculation is pretty slow here if anybody knows the faster way you could think of um give me a comment i'll be appreciated oh let me end this at this point let's see how looks like it looks like oops let it go where did it go now i am guessing that i do see some networks but it looks pretty straight i guess that is because it the movement of the smooth skin was a bit too big so to make it a bit more smoother i needed to make it less high all right but the hard thing about this one is since this is really slow it's a bit hard to check the visual all right let me also copy this one to check the gradient map or the which has been created right here okay all right looks pretty busy here let me reduce the okay i'm also seeing the these edges which i don't want to see well it's pretty slow it is pretty slow here oops let me also okay that loose now it's gone okay we may reopen the file what was the time where i have when okay one minute to go that's good okay now go inside again if i check the volume trail now it's a bit hard to see because i'm also seeing those edges or anyway the calculation is a bit too slow in this method i mean this paper paper is explaining the simulations using gpu so i guess it does make sense using in houdini might be able to make it faster using opencl something like that a lot of volume especially for this calculation the place where it's taking a lot of time not really sure here probably this loop maybe i could reduce the number of primitives here that i found here which doesn't really create the correct density map but let's see if that's change anything so minimum let's say 10 so just just use if if you have if you find more than 10 parameters then just use 10 primitives to calculate the density now this doesn't obviously calculate the correct one but i just want to check if this calculates faster or not and i need to also check if the parameter is being properly okay why it doesn't look okay it looks all white and i think it's another cache here does anybody have any idea how we can like get rid of these like silver cash which i tend to see this at every time i use subsolver gotta reopen this all right okay see it now am i seeing anything here i do seem to see some color changes gradually gradually on the center the calculation speed became a map much faster for sure but i don't see much network changes here do i i guess it's based on depends on the this value here so it does seem to create some net great uh bundling here and the speed is not that slow compared to previous one but the movement is a bit too slow maybe i can raise this value up like point zero two all right okay well i did get the result i'm not sure if if i can call this better or not i mean i did limit i did create the limitation to the number of primitives so i cannot really say this is the best answer this is the best result so if you just want the fast estimation of the graph bundling i'll just go stick with the faster way which is this one just to calculate the volume gradient map previously before doing any calculations then just use this which will be much faster to calculate and or maybe like you can recalculate the graph density every like 10 frames or every several times then that might make more sense in this case i'm just i'm trying to calculate in every step so which makes the calculations really slow but if you do it like every 10 frames or every like 30 frames or so then that might make more sense that might make the calculation a bit more faster wouldn't it all right now obviously this one for this one the speed is too fast reset it and the color i could control it yeah looks nice i think with this fast setup you could still create a decent result in terms of the visuals so i say why not use this but if you have like a dynamic edges that's moving around and you want to use that you want to use the edge bundling for that kind of situations then you need to recalculate the density map every second with this kind of setup which makes it a bit slower i am not sure if there is a better way to optimize this one other than limit the number of primitives that you can get which will obviously create a bit low res result or maybe we could also reduce the volume for this one to like 10 which makes the gradient resolutions a bit lower as well but i'll will create the simulation faster for sure okay let's try that out it's just doing anything and what i want to do here let me try to set the limit to 20 see the result okay all right and try to move this faster okay am i seeing anything here it became faster for sure the network seems bigger maybe that's due to the resolution of the gradient map not really sure all the network seems really big here that could also be dependent on those search distance here so if let's see if i reduce the value to 0.3 that's change anything uh not really sure here do i see any changes his point moving yeah gradually it does it does let's also try to raise up the color range okay so slowly it's creating the dense area all right maybe i should also should have also raised up the move scale value to make it faster okay but it does seem to work with a decent speed but the the result that i get comes pretty slow i guess that is because based on the every estimation the value for the gradient becomes lower and lower so to make it a bit more optimized if it's been being more optimized and the speed becomes slower so it does make sense i guess let's speed this up a lot faster like 0.1 all right okay um there might be a too much of a stretch for each of the edges if i i look at this there's too much of a stretch here so that's like creating more like a straight network which doesn't really look beautiful enough it's pretty hard it's pretty hard to estimate because this net the simulation itself is pretty slow so it's a bit hard to test out all those parameters so for those who wanna if we want to calculate the high density map or the density map for the edges and or the gradient map in solver might be better if you could use a opencl instead of x instead of wrangle for especially for this one this calculations here if not if you don't need to move those edges around dynamically i would suggest using this faster setup just calculate the density map preview before then inside soft solver just refer to that ready calculated density map to move the points visual wise that's also do the job pretty fine which not which might not be the exact things explained in the paper but do pretty much the same thing and i myself is pretty much satisfied so fine okay i have a question recalculating dense team up each time makes high density parts attracts each other becomes closer and results bigger network probably it seems like so although each time the i am starting to calculate recalculate the density map from zero but each time the edge becomes closer and closer so there are some parts where the density becomes higher and higher so the speed uh index in that case the speed of the optimization should be should become faster and faster in this way in this case um which might leads to a bigger network probably not really sure probably i might need to test this out a little bit more but overall this is what i wanted to show you how you could create a edge bundling simulations let me know if you have any questions if not i will like to end this at this point okay does look good if i change the shape here okay recalculating the density map i guess now obviously it's taking a lot of time here oops started all right looks already great love the flow here yeah looks really cool this isn't it looks like fire fire all right so i mean this is already not that fast since i have like 3 000 lines so if you try to estimate the density map inside the soft server which gonna make it more i mean much slower so keeping this set up i think it's good enough you want to have if you want to get this kind of network this will do pretty much what you want i mean in terms of the physically correct edge bundling this might not be the answer for you so i just won't mention about that okay so thank you all for watching if no questions here i would like to end this tutorial here and would like to see you all next week if you guys are kind enough to join again sorry for being late for today i had a bit of problem with the setup with the network but i'll try to start in the time for next week okay so uh okay so we forgot to answer one question do you going to let this live available later um yes i am going to keep this as a recorded video after i have finished this so you can watch this later and i am going to upload the file that i've created here to the video description page so you can just download it to test it with your scene i'm using the indie version so the extension is hip lc so consider that all right now that's pretty much it thank you very much and if anybody you are kind enough to support me i have also started the patreon page so if you uh have some kindness you could go to my uh description page again to the for the video and go to the patreon page yeah that's it okay thank you very much and good night everybody and see you next week bye bye wait you
Info
Channel: Junichiro Horikawa
Views: 3,641
Rating: 5 out of 5
Keywords: houdini, sidefx, live, tutorial, procedural, procedural modeling, parametric modeling, parametric design, parametric, fabrication, digital design, computational design, 3d, design, isosurface, lattice, structure, 3d modeling, modeling, computational, generative, line drawing, drawing, illustration, fractal, reaction diffusion, celullar automata, simulation, trail, particle, vfx, mitosis, magnetic field, magnet, field, volume, rendering, computer graphics, visualization, algorithm, motion graphics, graphics
Id: T5eR8ZofZEc
Channel Id: undefined
Length: 102min 34sec (6154 seconds)
Published: Wed Dec 09 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.