No VEX Houdini: Dual Surfaces

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hi this is manuel with entagma today i want to dive into some abstract art stuff by doing a voronoi surface treatment or as i call it a dual surface why dual because we are using the dual graph to a delony triangulation so what does that mean let's first look at the diagram on the left you have a dyloni triangulation it's just a triangle mesh basically with some rules applied such that the interior angles are in a certain way the details do not matter here but if you have this triangle mesh what you can do is to just find the bary center of every polygon as i indicated here on the right and if you now connect these berry centers you end up with a voronoi diagram and because you can refer to this triangulation as a graph this is the dual graph so the opposite graph so to speak this is easily constructed from the delhi triangulation and fortunately inside of houdini there is a node that can just compute this dual graph this voronoi mesh out of a deloni triangulation and we want to use this inside of houdini to do a pretty surface treatment to an object so let's dive in and get started so first things first let's lay down a file object and dive inside inside you will find a file stop and we want to load an object that i created for this tutorial inside of 3d code you can use this object it comes with the downloads or you can use your own object just make sure that the curvature of the object is varying smoothly so i will import my object called basemesh03 obj and it comes in huge because stuff in 3d code uses a different coordinate system so let's transform it by using a transform node and let's scale this down to 0.01 like so now this is the object i created and if you look at the mesh you see that the mesh is quite ugly and that is because i used voxel sculpting and that is a iso surface created by using margin cubes and that is definitely not a dyloni triangulation fortunately we can create a delonly triangulation directly inside of houdini by using the remesh swap so let's append the remesh top here make it visible and wait for it to compute and you see you are getting this looks a lot like a delaunity regulation the triangles are very even let's go down to 0.02 to have more triangles and here you have the delony triangulation to make the effect a little bit more interesting though it would be nice if the triangles wouldn't be all the same size fortunately we can just drive the size of the triangles by an attribute called target mesh size we first have to set it so let's use a verb a point warp in this case a point warp before the remesh so let's make the transform visible and add this point warp and let's call it set target mesh size like so make it visible and dive inside now inside i want to use an anti-aliased noise to just get some random values on the surface and then i want to fit them to set the target mesh size attribute so let's start with an anti-alias noise let's connect the position and let's see what this gives by wiring it to cd these very dark areas indicate that the ndalis noise is going into the negatives so let's append the fit node connect it here let's make the source minimum 0 minus 0.5 and the source max 0.5 that is roughly the range that the ndalis noise is outputting in and let's transform this to 0 to 1. now the dark areas are gone but we want a way of shaping this noise so let's lay down a ramp parameter ramp parameter switch this to be a spline ramp because we are dealing with floats here and connected after the fact now everything turns black and that is because if you go one level up you see this ramp defaults to zero but if you open this up and just move this second knot up you see that we have our values back and now you can just say that this noise should be a little bit more steep or the transition between white and black should be more steep like that nice now we can go into the and the earliest noise and maybe up the frequency to three well 33 is a little high three like so and that gives some nice random values but after the ramp we are confronted with values between 0 and 1 and the target mesh size has to be different so that is why i use a second fit fit range takes in a range between 0 and 1 and outputs a different range i want to be able to dial in these values on the operator itself so i right click on destination min and say promote parameter and same for destination max like this so what i can do now is to dial in the values here values that might work is for the minimum value 0.01 and for the maximum value 0.1 like so of course with color that makes not too much sense so let's dive in cut the connection to color and instead lay down a bind as we want to export this to a new attribute and this attribute is called target mesh size and that is a special attribute as it is understood by the remesh so now that we have this target mesh size in place let's check if this is actually the case by creating a color visualizer and just visualizing target mesh size like so a ramped attribute and you see here we have the target mesh size now if you make the remesh visible again you see that nothing changed and that is due to the settings of the remesh so go to the remesh at the moment the element sizing is set to uniform we want to set it to adaptive and as soon as we do that the re-measure re-cooks and it will eventually change its interface and now you can just open up this control attributes drop down and pick mesh size attribute and here you see target mesh size of course you could rename it but let's stick to the default and you see that we now have small and large polygons here the small ones are probably a little too small we can easily change that by going here and upping this to 0.02 let's wait for the recook and here we have it nice distribution of large and small triangles now that we have that it's time to create the dual mesh for dual graph and we do this by using the divide node so append the divide node after the remesh make it visible and check compute dual here and you see now this creates the dual diagram directly simple as that the basic structure is in place now we want to extrude the individual facets but we don't want to extrude all of them we just want to create crackles on the surface these crackles only look interesting if i don't create them all over the place that is why i want to use a measure to decide where to use these crickets and the measure that i want to use is curvature lay down a measure swap and append it here make it visible and if you switch to the handle tool it directly shows you the visualization at the moment it's computing area instead we want to compute curvature and we want to go for the mean curvature by default the measures op is set to calculate the value on primitives we want to calculate it on points instead which gives us this so now you see that you have concave and convex areas indicated by blue and red due to the nature of how the curvature is computed this is not very smooth so to make it smooth let's append an attribute blur attribute blur and let's blur the curvature to see what we're doing let's create another color visualizer and call this one curvature and the label should be curvature and the attribute to visualize is curvature like so ramped attribute close and now if we deactivate this well we have to actually go to center and width like so and if we decrease the width you see that we get our visualization back and now we can go with the attribute blur and use curvature as the attribute blur and we want to blur it with two blurring iterations to give a quite smooth curvature maybe even three like so now that is the curvature that we want to decide where to cut the mesh open so to speak to do that we want to use a node called vertex split the vertex split node decides where a vertex attribute crosses a threshold and where this is the case it will just cut the mesh open duplicate the points and open up the mesh so to speak so to be able to do that this attribute curvature that is currently on points has to end up on vertices so we could in theory just promote it to vertices but that would mean that the vertices on one polygon would have different values as the attribute is currently on points so let's do a trick and first promote the attribute to primitive level making sure that each polygon gets the same value at all of its corners and then promoted to vertex level so let's put down a promote attribute promote and let's promote the curvature the primitive curvature instead of furniture and you see now this makes sure that each polygon gets the same value throughout let's change the name as you might want to use their original curvature and shading later and tick off delete original and the new name should be curvature 2 like so and now of course i see the point attribute again so let's update this visualize it to curve it to two now we have it on polygons and now let's use a second promote adobe promote to transfer this attribute curvature to from primitive to vertex level not much changes visually because now it is on vertices but as every poly has a vertex in the corner the distribution remains the same but now that we have the attribute on vertices what we can do is to introduce a vertex split and this vertex split splits the mesh open we can see this if we switch to smooth shaded and you can see at the moment the mesh is entirely smooth but if we now use the attribute curvature to it gets split that of course breaks the shading but as you can probably tell it gets split everywhere and that is because the tolerance is too low the tolerance decides how far of a change of an attribute the node has to detect to create a split so go up with this tolerance value until you get a nice distribution of splits as you can see here now if i go to 0.03 say i have areas that are still smooth and areas that are split it's hard to see but i think you can figure it out by just moving the object around so now that this object is prepared we can go to the last step and that is extruding the surface and firming it into a subdivision surface to extrude the surface let's create a polyextrude a polyextrude and append it here and let's say we want a distance of 0.02 like so you see now that we created this that it extrudes all the polygons along the edge normals of the primitive normals and that means that these crackles now start to show so in the areas where the mesh is cut open the normals are different and that is why these crackles show up if you switch over to smooth wire shaded you see that we just have one extrusion now we can append a subdivision surface to smooth it out but that gives a very smooth result i mean it looks interesting let me switch to smooth shade again it's very very organic but probably we want to flatten the top of the extrusion so that is why i use a second polyextrude and append it here after the first one and this one should extrude everything again by 0.002 to create just a little second extrusion at the moment it is creating the extrusion everywhere and that means even on the sides on the extruded sides which leads to these artifacts how can we avoid creating desired effects well with the first polyextrude we can output a group let's output a front group called extrude front and then let's say that the second poly extrude only operates on this group by putting it here in the group field extrude front and that means that it's now only extruding the front faces and that gives just this nice little edge loop here and if you now switch to the software right now you see that everything is a lot harsher let's up the subdivide depth to two like so and if i now switch to smooth shade it we got this beautiful result where you have these very organic structures that remind me i don't know of reptile skin or something that grows underwater and by varying the threshold you can of course decide how much of these crackle structures you actually want to have so that concludes how you can create this interesting dual surface treatment to any object by just using standard houdini nodes without any wax to render this i used a dirt shader in octane where i inverted the normals to just emphasize the edges and then i just used a switch node to switch between two materials to make the edges metallic and everything else diffuse that is basically it so i hope you liked this tutorial and learned something and see you next time if you like what we are doing please consider becoming a patreon for supporting us and for access to more in-depth courses on topics like volume techniques or pdg or vellum and more to everybody who is already supporting us thank you so much without your continuous support and timer would not be possible
Info
Channel: Entagma
Views: 16,006
Rating: undefined out of 5
Keywords:
Id: RLgwcmwHgMk
Channel Id: undefined
Length: 15min 2sec (902 seconds)
Published: Mon Sep 20 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.