No VEX Houdini: Organic Modelling Using Winding Numbers

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] admittedly we might hang around on twitter a bit too much but it's such a good source of inspiration if you have the right people in your feed people such as daniel at kangaroo physics who posted this animation a few days ago and of course we were curious what's going on and luckily is quite open in sharing how he creates those types of setups so what's going on here well the blue surface you're seeing here is the iso surface of those two triangles winding numbers what does that mean so let's go about this step by step the iso surface you know this from vdbs that means you can store a mesh surface in a volume and then by cleverly choosing which value in set volume you want to regard as the surface of a mesh you can generate said mesh that is the blue one here and if you want to learn more about that technique and the underlying theory i can highly recommend our premium course on volumes the other part in here is the winding number so what is a winding number this example on wikipedia is pretty brilliant a winding number for this red curve here at this point where the person is standing is just the number of turns this person has to perform to follow the whole length of that curve here in this case resulting in a winding number of two as the person has to make two turns and now what we need to do to set this up here is generate some curves in this case those two triangles and then for a given area and space for a given volume for each point in this area or for each voxel in this area calculate the winding numbers of those two triangles here by just summing up those individual winding numbers and thus generate a volume that encodes a bunch of values and then we just have to make sure to convert this volume into a surface in this rather brief tutorial i want to go over a non-vex way of doing that and i want to address some issues or observations that i made by going this route so in houdini as always the first thing i want to drop on is a geo node and then dive in there and in here i'll just create two grids in this case i'll just be working on rectangles so i'm going to set this to be two rows by two columns and switch my display to be smooth wire shaded so it displays the outlines of my grid so in this case just this one quad here let's scale this a bit to i don't know 1.6 by 1 and just use those tool handles here to offset rotate and move it around in space a bit and let's just copy and paste that grid and move that to another position again rotating it around a bit so we just have another grid sitting here and let's merge those two grids using a merge node just like so so now we have those two grids here next i need to create a volume for which i'll evaluate the winding number at each discrete position in the volume and in this case i'm not going to use a traditional houdini volume or vdb but instead i'm going to use a grid of points in space and i'll go about why i do that in a second let's just create that grid first by first dropping down a bound note which will give me the bounding box for the incoming geometry in this case my two grids up here i want to make sure that this bounding box is a bit bigger than the enclosed geometry here and i can do so by increasing the lower and upper padding and instead of typing in those six numbers individually what i want to do is just increase my padding in this first slot by 0.2 then right click in here copy that parameter and paste that as a relative reference in the remaining five slots just like this final one is this one here so now i can dial in the upper and lower padding with just a single value like so let's leave it at 0.3 and now let's convert this box here into a quote-unquote volume made out of points so basically a three-dimensional raster of points to do that i can abuse the points from volume stop here which creates exactly that a rasterized grid of points in space in this case the initial point configuration is said to be a grid with those points sitting in this cubic grid here however i want to set this to tetrahedral for now like so so i get a better packing of points and also i want to decrease the point separation to 0.05 making this grid a good bit denser and now to prevent artifacts i want to jitter each individual points position a bit make this whole grid a bit more irregular by increasing the jitter scale to one so now we have this fully filled box with points why do we need those points and not going to work on volumes because the stop we're going to use to calculate the winding number and sum those up of those two grids is only able to work on points and usually the winding number sub is used to determine if a point lies within a given geometry or outside of it so let's drop that down it's called winding number has two inputs the first one just takes in the points at whose position we want to evaluate the winding number and let's move those over here the second input slot takes in the geometry for which we want to evaluate the winding number that means checking for each of those points if this point lies inside or outside of that geometry so if we highlight this it executed well no errors so far and we created a new attribute called winding number into which we start the winding number onto each of those points so let's visualize that using a visualize node here let's wire that up after the winding number here and under the visualizers tab let's set the attribute not to p but select point and then select the winding number here and you can see we're getting this so how do we turn that into a surface well the easiest way i found was to turn this bunch of points into a vdb first and then convert this pdb into an sdf which is a volume representing a surface so to turn a bunch of volumes into a vdb i'm going to use the volume rasterize attributes node here which i'll wire in below the winding number here let's move that to the side i want to highlight this here and set this up so the attributes i want to rasterize is just the winding number here my voxel size should be the same as the point separation here so let's just link those two by maybe just going in here setting this voxel size to 0.05 and right clicking in here copying that parameter going up to my points from volume selecting this here and right clicking again and pasting as a relative reference so now with my volume rasterize attributes voxel size i can also drive the points from volumes point distance the particle scale in my case should be the same as the voxel size so again i'm gonna mark this here right click and paste the relative reference here and i had good success with increasing the minimum filter size a bit and that is it so we just rasterized these point attributes here into this fog volume this fog vdb now what we can do is straight up convert this to an sdf that means a surface representation or even to a polygonal surface by using a convert vdb node which will wire in after the volume rasterize attributes and this one we're gonna set up to convert this to polygons now you can see that's a bit weird so what we could do is try dialing in that iso value here we can see the higher we dial this in the better our surface becomes resolution is quite coarse so we could feel tempted to just increase our resolution by decreasing our individual voxel size here and you can see it works and also we are getting these jacked artifacts so we might feel tempted to between the volume rasterize attributes and the convert vdb add a vdb smooth to just blur out this volume a bit like so now let's go back up here and maybe copy and paste the grid a third time wireless into the merge as well and then let's move that third grid around to maybe just i don't know down here somewhere and we can see we are generating these surfaces these blobby surfaces now to open up those surfaces what we could do is just take this merged geometry here extrude it and then use it to select those facing points here in the final mesh and just delete them so we could get an open mesh such as daniel did in his preview animations and that is it a very easy and very straightforward setup to model organic surfaces in houdini using the winding number of a mesh the advantage of the setup is that admittedly it is quite fast and i was surprised how fast it is that is because the winding number saw up here is i assume implemented in c plus directly that means the algorithm works very efficiently although we have to first run this on those points here which we can then convert into a volume and blur out and convert back to a mesh but it's working fine and also you don't have to use any special notes so this is all standard stops no scripting involved however there is one thing that bugs me about this which is this part that we are first calculating the winding number on points which we then convert into a volume and that volume we convert back to a surface and i think the whole setup at least to me would make more sense if instead of running this over points which we then convert into a volume if we run the setup over a volume to begin with however for that we're going to dive deep into scripting and the math involved behind the winding number so i decided to make this a premium tutorial in our course on advanced setups which we're going to publish this thursday so if you want to support us or gain access to said premium courses you might want to consider becoming a patron of ours and if you happen to be a patreon already thanks so much it's through your help that antagoma in this form is possible with a very special thank you going out to rodeo effects important looking pirates sean edwards chris a bear and rafikanado thanks so much folks as always we're intrigued to see what you guys cook up using this or other techniques so don't be shy sharing your artwork and until next time it is cheers and goodbye
Info
Channel: Entagma
Views: 11,523
Rating: undefined out of 5
Keywords:
Id: xDUqMQ3Xck4
Channel Id: undefined
Length: 8min 30sec (510 seconds)
Published: Mon Oct 04 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.