Geometry Nodes - Make BRILLIANT Fiber Optics

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
by the end of this blender tutorial you'll be able to make This brilliant fiber optics design in Geometry nodes let's get started let's control I to invert selection X to delete reselect the cube and go up to Geometry nodes tab We'll add a new geometry node setup and we actually don't need the incoming geometry we're going to create our own so the first thing I want to do is create the curve that will be shaping we can do that with a curv line node and we'll just right away connect this to the output and we can start looking at it in the 3D viewport so this is just 1 M tall but we want that to be an input value so let's add a combine XYZ and for the Z value We'll add a group input and we'll press n bring up the sidebar here and rename that strand length so right now it's default it defaulted to zero so we'll actually make that default one and bring one back so now we can adjust the length of the fiber optic strands now you'll notice in the spreadsheet that we have one spline and it has only two control points at the bottom and at the very top so to bend this or to reshape it that won't work we need a bit more resolution so we'll add a we'll shift a to add a resample curve now you can see there's a lot more control points here and that'll give us a lot more resolution and it would be useful to add a group input for the resolution which we'll come over here and call uh strand resolution so now we can adjust you can see in the spreadsheet how many control points are actually in this curve so we'll set this to 10 and we'll maybe add it as a single value all right so that is our basic strand setup we can grab all these nodes press contrl J and F2 and call this strand curve so now that we have our strand we can start Distributing those to do that we'll want a let's do a mesh Circle and this has a radius that we can specify and also resolution for now we'll just fix that at 12 but the radius again we'll want to be able to control that within the modifier so we'll rename this to be uh base radius this will be the base Circle and on this circle we'll distribute all the random points that will instance the fiber optic strands and you can press alt shift and left click on this node to automatically connect it to the group output so there's our Circle we'll actually want the fill type to B andon I think we'll do and on this circle we'll want to distribute points on faces but we have have all of these points now and instead of random I want to be able to control a little bit where these points are placed so by changing it to Pon disc poison disc whatever you want to say it gives us the ability to tweak a few more values so the distance between these points we'll actually want it to be whatever we decide the radius of the Strand will be so those spines will eventually be cylinders essentially and we want these points to not get so close that the cylinders intersect we want them to be separate enough so that their side by side that's the distance of two radi so to specify that we'll say minimum distance should be whatever the input of this radius is we'll call it the Strand radius and bring in a math node and say uh * 2 and that will prevent them from being so close that they will actually intersect so as we increase the Strand radius you can see that these points start to disappear because they're getting they would be placed too close to each other okay so let's name this we'll crl J F2 and call it base and here we'll group these together contrl J F2 and call it distribute so now that we have our points we can add a instance on points node this will go in the distribute group and let's bring in this curve to be the instance that we want to see on those points so they look pretty spread out we can of course change the radius of the base and The Strand radius we might set to a small amount and maybe let's increase the Strand length quite a bit all right so now we have these fiber optic cables but they are as mentioned these are perfectly flat which really doesn't look that interesting so we'll mix it up a bit what we'll do is we'll randomize the length a little bit and in the instance on points we have this scale input and if we adjust this Z scale you can see how the height changes what we can do is add some randomization to it and to do that we'll shift a to add a random value we'll change it from a float to a vector and we only want to affect the z- axis so we'll change the X and the Y values to zero and then we'll specify some amount we can start with maybe point uh5 to pos5 and that's the amount that we want to add to the current scale which is 111 so we'll add a a vector math node the current scale is 111 so we'll just click drag down to select all three fields and press one and enter now we want to add this random value and connect that to the scale input and you can see that the heights adjust but the randomness is a little bit too much so let's add another control where we actually scale the output of this random value so let's grab the vector math node shift d we'll change that to scale and let's add a group input slider here and we'll call that length Randomness and default to zero and subtype let's change to factor that will give us min max one all right so by specifying the Min and the max one we get this slider bar here it's full random no random and you can see in the 3D view Port that without any randomization we have that flat top but if we start to add in some randomization we get that variation that we're looking for and another thing you can do is add a group input to this randomization seed call that height randomization make it a single value and we'll just change that until we like how it looks super cool let's take these nodes here shift drag a box around all of them till they're selected contrl J F2 and call it height Randomness awesome all right this is looking great let's move on to the next part where we'll actually start to shape the fiber optics where they'll Bend more on the top and on the bottom they won't Bend as much before we jump to that I'm just going to actually going to clean up some of these inputs all right so how do we rotate these splines well a quick way to get some effect to see would be to bring in a vector rotate node and the output of this will be a vector which we'll use to set the position on these splines but before we can actually use this setup if you look in the spreadsheet we have only instances to work with those instances have positions which was the the points that we saw distributed on the base but we don't have actual control points in these splines in fact I called them splines earlier I misspoke they're instances right now so before we set the position we need to realize the instances so what that will do is basically promote the instances to actual curves actual splines that we can work with and this is overlapping but you can see that we have actual splines and then we have a lot more control points to work with and so the position of those control points is what we want to set so that we can give it a bending shape so now if we take shift a bring in a position input that's the vector that's the position that we want to start with and we want to rotate that around A Center on we'll say the Y AIS so that it will bend around this y AIS so if we say z0 y1 and plug that into the position and give it some angle you can see how it starts to rotate now I have some work to do though because it's rotating everything around that one center point so the first thing that we can do is make sure that each individual strand is bending around its own bottom position not everything in the center but in order to do that we need to actually not use this position node so we'll press X to delete that we want to use the position of the instance and at this point point we're actually past the realized instances so we're no longer working with instances so we need a way to be able to get information about the instance and its point and bring that into the vector rotate node so that we can set the position on the control points it's a little confusing but this will make sense in just a minute so that's what the capture attribute node does or the store named attribute these two nodes basically record data at some point in the node graph so that you can re Reve it later on and let's actually use the store named attribute so let's store a vector because we want to store the position and we want to store it in the instance domain let's call it instance position and the value will be the input from the position field so for every instance that exists we'll record the instance's position which is just the the points that we distributed on the base so then after we've realized instances convert it into actual splines to work with now we can take a named attribute node change it to vector and we'll use that instance's position to be the center point around which everything rotates so now if we bring in another position node this will be the position of every control point in these splines those are the positions that we want to rotate and now if we give that an angle you can see how at the very bottom everything stays in place it's bending around its own center point but we want to be able to rotate not much at the bottom a little bit more in the middle and rotate the most at the top so we need to be able to set some kind of scalar value as far as how much it's actually rotating depending on where those points exist within the length of this blind so the first thing we can do though is bring in a group input we'll call this Bend and it is an angle subtype default will say zero Min can be Pi I'm just throwing in values here and Max can be uh to which is 2 pi make it a single value and now we do have control in the modifier stack but this amount needs to be tweaked if we bring in a spline parameter node this gives us the factor in this Factor field will'll output the value between 0 and 1 one of where the point is within the spline so at the very bottom it's spline Factor Zer and at the very top its spine factor is one and it will give us values for all the other points in between so we know that at the bottom we're essentially bending it angle time0 and at the top will be angle * 1 so let's just do that let's add a math node we'll take the we want times it by the factor and now we have this shape where at the bottom It's Not Bent as much but at the top it starts to bend more and if we want to be able to shape that a little further we can bring in a float curve and with that float curve we can tweak that factor a bit and adjust how much it's actually bending so maybe about like that let's give this a bit more length and now you can see that's starting to look like that mushroom shape if you imagine it this way which will start and that will be the next step how do we bend it so that it bends basically in a circle and not just around one axis well going back to the vector rotate node we have this axis input well what does the axis look like if we option shift click the distribute points on faces and go to the top view you can see that all these points have some distance from the center so for example this point Point here we want it to curve this way away from itself and the axis is basically perpendicular to this Vector this angle so if we get this Vector rotate at 90° we get this perpendicular Vector if we rotate it this strand will actually Bend this way and the same here and I need to here this strand will bend this way and that's how you start to get all these different strands bending in a circle around their own Center points so if we take this named attribute output which is already the instance position let's normalize the vector so it's a length of one and then we can Vector rotate that vector by 90° and we'll rotate that on the z-axis and that will be the axis that these strands rotate on so if we go back to set position and we connect this to the geometry output you can see that they're starting to Branch out all around I don't like this length Randomness let's turn that down a bit that's looking better but let's bend it a little bit more give some more height now the next step will be to give this a bit of a dome so that we have longer strands in the middle so strands in the middle won't Bend as much we'll still have tall strand strands here and strands further to the outside of that base Circle will bend more so let's hone in on this setup here which maybe we'll call this we'll contrl J F2 and call it Bend less at the bottom and we want to add to this so let's go look at those points again option shift click top view we need some kind of mask so that points that are further away from this Center Bend a lot more than the points that are Clos to the center again we know that we can get the distance the length of this vector by just the instance position because it's based at 0000 0 it's based at the center point 00 0 so the actual position values of this will be the vector and we'll take its length so here will bend not as much in the center and here will bend as much as we would expect so basically we we just want to create some kind of factor a value of 0 to 1 that we can times this value by and ALT P will actually remove a node from some group so to create that factor let's bring in this named attribute which is the instance position again and if we take its length from the vector math node that will give us values of say zero if it was right at the center or values of R depending on the base radius specified here so if we crank this up to two the range of values would be 0 through 2 again we want to produce values from 0 to 1 so we'll need to take the length and use a math node to divide that length by the group input base radius and that will give us values of 0 to 1 so if we plug that into the second part here option shift click the set the position now we see that we have this kind of Dome shape so let's change the base radius to something so it's a little slimmer May we'll just go with one but let's crank the density really high up to maybe 100 and another thing I want to do is make the stem a little bit skinnier so let's reshape that a bit with this Factor here and tweak the base radius and since we may want a bit more density let's make this a group input default 100 and we'll call it uh strand density that'll let us add more or more strands if we want depending on what look we're going for in fact what does it look like if we really Crank that up to 400 I think that's looking pretty good if we go to the top you can see that all these lines are perfectly pointing back to the center and it doesn't look very natural so another thing we can do is with that axis over here and maybe we'll disconnect this so it's a little cleaner let's add a bit of randomization to the rotation so we'll again shift a to bring in a random value change that to a vector give it maybe minus one uh I guess it's on the Z on the Z value minus one to one and then we will bring in a vector math node add that and and it goes crazy so now a little too unnatural so let's dial that back let's get a bit more space to work with here let's dial that back by shift d this length and we'll change that to a multiply and this we just want the Z value to be affected so this will be a combine XYZ but the problem here is that every point is getting its own random value so we need to be able to basically group these points so that all the points from one instance have the same rotation have the same random value added to its rotation so that will require another capture attribute before we realize the instance here we'll store another named attribute called instance ID and that will be an integer and we'll grab the ID input and plug that in there so now if we we come back down take this named attribute here and bring back the instance [Music] ID that attribute will plug into the ID so as soon as you do that you can see it goes from Super Fray to more organized but still still random you can see how they kind of curve in different directions so again instead of every single point getting a random value now it's just one random value per strand all right so I think that's looking pretty good you can tweak it as much as you want with all the different inputs we have this length Randomness maybe I will make a single value before we jump over to the shading though I know that we will need some information in the Shader and I actually want to take out this multiply node I'll alt drag that out and I want to use that actually as a scale which I can control with a group input to be able to knock back that rotation Randomness again we'll make that default zero uh min0 Max one single value and that will let us change around how much these strands are rotated on a slightly different axis than that perfectly perpendicular axis so look a bit more natural that way all right I think we're getting close to being able to add some materials to this but a few more things that we need to do is let's actually convert this finally from a curve to a mesh we'll need a profile curve which will have a circle curve resolution for now we'll just say three and if we plug that in and add a group input strand radius and add just a group input let's pick that existing strand radius to plug in there that's super fine and then to hide all these inputs that we don't need we can control h and then we just see the one that we're interested in so now the Strand radius we can adjust to be o5 maybe whatever looks good and the Strand resolution if you bump it up to 20 you'll get a a smoother curve curve so that's looking pretty good I know that as we go into shading we're going to want to colorize this with different colors depending on how far from the center they are and we already did that calculation down here so let's take this output of this calculation which is basically it's Center offset and let's store that in this geometry l let's store a named attribute take that value we'll call it the center offset and again that's a a value from 0 to one so it'll be a float and we'll store it on I think if we store it on the point domain we should see [Music] it in the spreadsheet we can verify that it still exists as we're viewing this group output uh we have the column here so we have stored that properly awesome so now let's jump over to shading let's going to the shading editor let's collapse this just get set up here really quick and turn off the world opacity all right I'm excited for this part cuz this is the part where it really starts to come to life and I've set up this image here so that we can reference it the fiber optics they're brighter at least like these decorative cables um they're brighter more at the top of the Strand than they are in the middle of the Strand so we'll want to keep that in mind as we build out our Shader first thing though is Select this node press X to delete it and shift a to bring in an emission Shader we'll plug that into the surface [Music] go up to our viewport press Z make sure that we're in material preview and let's give this a name call it radial rainbow and we need to go back to the geometry nodes and add a set material and select the radio rainbow so now if we bump this value we can see that we are actually affecting the material great so let's give it some color right off the bat let's pull in a color ramp and I want to take the HSV and set it to far and let's pull in a red and then a blue at the very end of the spectrum this could be whatever colors you want of course uh could be a purple yeah let's go to purple and let's plug that into the emission let's give the strength for now we'll give it like a 10 just so that we can view it now I want there to be if we go to the top I want there to be a falloff from the middle outward I want this color to fade to this color so to do that we should have access to our attribute which we called I think it was Center offset so if we take that factor to drive it there's our falloff and let's go to let's go to the render tab go to color management um just kind of play around with this filmic is a lot more vibrant maybe filmic for now and maybe a medium high contrast and let's go to render engine Eevee give it some Bloom that's probably good as default for now so now we're starting to get the color the brightness but we definitely don't want color all mostly up through the Strand so let's dial that light back let's duplicate this attribute node and let's rename it to we'll have to check the geometry nodes which attributes did we store oh we didn't actually we didn't actually store the spline Factor we used the the spline Factor down here but we didn't store it up in this geometry so let's kind of backtrack let's take another store attribute node and we'll name this spline Factor uh it might have to come on this side actually it'll be a float and the value will be the spline uh spline parameter and that factor will plug into the value and we'll store this on the point domain hopefully and if we inspect over here in the spreadsheet we do have this blind Factor um that's one of the benefits of using the store named attribute instead of a capture attribute because capture attribute the capture attribute node is considered an anonymous attribute and so you don't actually see the values in the spreadsheet so for debugging and just confidence check uh using the store named attribute giving it a name and then verifying that that data does exist where you expect it is really useful so back in shading if we if we were to access those values using the spline factor and using that to affect our emission we can plug the factor right into the strength and now we can start to shape this factor which is just 0 to one but we want to be bright at the bottom maybe and brighter at the tops of the strands but not so much in between so if we set this to one add another stop here and then after that stop we'll make this darker change this to maybe Beast blind Cardinal darken this just trying to find the right shape here this should be darker as well maybe a little bit brighter as light starts to bleed in if you need a bit more resolution here you can drag this out I will actually darken this a little bit more that's looking pretty good I think though I think for this value we can blow this out right now we have value of one but we can make it super bright we can pump that if we we can only go between zero and one with the slider but if we pump that up to five manually what happens if we just crank it yeah it gets super bright so I guess this value here too we could go a little bit brighter let's go to rendered and see what it looks like um let's go to the world Shader and mute that and go back to our object let's also add in some glossy and we'll add in an ad Shader to mix these together or to add them together and we'll dial down the roughness and we'll maybe add a translucent Shader as well sweet so it's looking pretty good you can always tweak the modifier here I want to tweak this this black so we can do that with a brightness contrast node and we can just bump the brightness a little bit so we can see those strand a little bit better as if there is light still going through and finally let's animate this so that over time we'll get these colors Rippling across the fiber optics so let's pull in a value node and if we type #f frame if we press space bar to play the animation maybe I'll just pull up a timeline here so as these frames increase we get the same increase in this value so now we can use that value to drive say a hue saturation value change in this color and we can shift the Hue around right now it's going to be super fast if it works at all because we want this value the Hue the Hue value should be between zero and one so let's add some math here to divide this by some number let's say 180 for now and you can shift left Arrow to and shift right arrow to move between if you look at the bottom to move between the start and the end frames so shift left arrow press space bar to play and you can see how the colors change that might be a bit too slow so we can speed that [Music] up so one thing I did was I came over into the redend settings and at the very bottom uh I changed the exposure to be 2.5 and that gives it a bit more so you get that whiteness going on um I dial back the brightness here so I'm not actually using this node much so this brightness contrast node and I like the look of that a little bit more and that bloom now if I go back into the render settings the bloom intensity is a little bit too much so let's knock that back just a little bit maybe 003 so there's a couple things I want to do before we finish up just to touch this up a bit more let's actually go to the layout tab and let's give this a base if we shift a to add a cylinder change it to 12 vertices and we'll alt Z so that we can see through our mesh and grab that bottom face press s to scale that grab the top vertices press G and Z maybe grab all the vertices and scale that up a bit more and then I want to grab this bottom face by pressing three to go into face select mode click shift s and cursor to selected and what that will do is if we tab into object mode right click set the origin to the 3D cursor and shift s cursor to world origin and this is jumping around because I have the lock to 3D cursor on and then if we shift s selection to the cursor that will jump the base up to the ground plane now we didn't parent this so we'll have to move it up just a little bit more as well but I think that looks pretty good it might be a bit too tall so we'll select the base press Tab and two and ALT click one of those edges and G and Z just to move that down a little bit tab back to object mode so let's actually add a bevel modifier to this if we go into our be our modifiers tab here click to add bevel give it three segments and a bit more on the amount until it looks good and then press control 2 you can alt Z so that you're not in x-ray mode anymore and right click to shade smooth and finally let's actually give it some inset click and tab into edit mode with that top face selected uh press I to inset and about there and then e to extrude that down and then tab back to object mode lastly let's give that some shading if we select the base and go into our shading click new and let's go into material preview let's give this some transmission and turn our roughness down this will be just a really basic Shader now for Ev there's several settings that we need to turn on so that we can actually see that transmission if we go into the render tab here at the top go to screen space Reflections turn that on and expand that menu and turn on refraction now if we go to the material Tab and let's bump this refraction depth and at this point let's go to render to see what that looks like what I'm expecting to see is the light shine through and it's definitely not yet so I think the last thing is to turn on this Ray Trace refraction and now we start to see some of that light come through we can move this up a little bit more if we want so that's looking pretty good but I'm still not sold on how dark these strands are so let's click our strands and let's tweak this a bit so that we have actual light coming through these strands so the main thing that's driving that is this color ramp down here so let's play around with these values that's okay but I don't actually want bright light in the middle so maybe let's add in let's add in a mix RG a mixed color node so that we go from whatever this color is with some extra white coming up the middle so add another color ramp and let's flip this color ramp and let's make this the driver of this Factor this mix Factor so we see a little bit of color but let's actually drive this color ramp with the factor of the spline factor and I want the color to come through at the bottom I don't want there to be color in the middle but then at the top I do want there to be more color so let's just shape this and let's dial this back a little bit it's good not great let's maybe remove these black a here so that we're not timesing that by zero that's looking a lot better that's kind of what I was expecting and maybe give it a bit more a bit more white let's see I like where the light is there this might be too dark it's looking better it's a very faded color so it's not like it's full brightness which yeah I think I like that this might be too high so let's DIY that back a bit more just finessing this to get kind of the shape and the color that I expect for this fallof the the fallof of the light I think that looks pretty good I like that we can see the the white now it looks bright especially in this super black [Music] environment and to tweak this base I might go back here and make it a little more rough just so that it's more blurred and you don't see that those edges there so increase the roughness a bit more and give it just a bit more bloom all right so here's the result of the project let us know in the comments how yours turned out and if you enjoyed the video like the video and subscribe to see more blender tutorials in the future see you next time [Music]
Info
Channel: TiFi Design
Views: 1,276
Rating: undefined out of 5
Keywords: blender, 3d, modeling, howto, geometrynodes, tutorial
Id: l-OGJml_sRQ
Channel Id: undefined
Length: 37min 59sec (2279 seconds)
Published: Sat Jun 29 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.