How to make Procedural Carbon Fiber

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone plans here it's been a while since I make some simple tutorials and pretty much all the recent tutorials are pretty hardcore so I think it's about time I make something a little simpler so today I'm going to show you how to make this very nice carbon fiber material procedurally of course now before we begin I want to give you a heads up that this tutorial requires some basic knowledge about the map notes within blender and if you are a beginner then I suggest that you watch some of my previous videos those are pretty old but the principles are pretty much the same I mean math is math right so I'm gonna put the link to the playlist in the description so please check out those videos before following this one okay with no further Ado let's get started the first thing to do is just delete the cube and create a plane now the carbon fiber texture is a 2d textures so it requires a UV map and this plane already have a UV map so let's switch to the shadow editor and let's get rid of these extra things all right create a new material and call in the UV map all right now by default the UV map will look like this all right but for the purpose of testing the material I'm going to move the UV map to the center so create a map node and subtract 0.5 from X and Y there we go and I'm going to scale the UV map up a little like so all right let's move everything back a little we're gonna separate the XYZ this is the Y Channel and since we don't have the Z Channel we don't use this now create a map node and divide it let's create a value node this value node will be the segment length there we go and let's set this to 2 for now and we're going to multiply this segment length by 2. like so and divide this I mean divide the X with this value all right and next we will fraction it like so and next we will multiply the fractioned value with this multiply node all right so now the values will go from 0 to 4. and next we will floor this so now we will have 0 1 2 3 like that we have four segments now we will add this with this y value like so so as you can see this operation basically move the Y value down by one unit all right let's continue now we will divide this with this value again like that and again we will fraction this value okay we have something like this and now we will compare this with 0.5 to get this mask like this so we have one texture Direction like this all right and then we have texture Direction like this okay and if we set this to let's say four then the length segment will be four unit like so and likewise the horizontal segments will also be four units like so but usually for carbon fiber we will use two like so at this point we have the mask for the alternating carbon fiber directions all right the next thing we need to do is to create the actual fibers all right so this time we will divide this add node with the original segment length and again we will fraction this divide node and we get something like this these gradients go from zero to one right I don't want zero to one I want zero to two or if the segment length is three then I want this to be from zero to three and so on so let's set this to 2 again so in order to do that we simply multiply this with the original segment length like so so now we have zero here and then transition to two and then jump back to zero and then transition to two again and so on all right so far so good let's move on basically what we're doing is to we are creating the Y channel of the UV of the tiles all right this will be the Y channel of the UV now we need to create the X channel of the UV as well so to do that we will simply fraction this value so duplicate this fraction node and connect the x value in there okay and let's move this here and now we can combine x y z so this will be X and this will be y so as you can see we have a very nice UV for each of the tile and if you put this into a texture let's say the noise texture you can see we have repeating noise texture for each tile all right and this is exactly what we want so let me just delete this noise and move this up here because we need to create some more data for the carbon fiber so let's duplicate this combine XYZ node and go back to this node copy this and change this to floor all right we have something like this this shall be the Y Channel and the X Channel should be the floor of the original X Channel just use floor it will be something like this all right and again we will combine the X and Y we have something like this now so basically this is the position of the cells so if we put this into a white noise we get completely random color for each cell like so so these two channels are very important later on now is a good time to create some node groups so let's move these back a little like that and this segment length as well move it back and select everything okay Ctrl G to create a note group and let's go ahead and rename our inputs there we go and we should set some limits for the segment length as well the limit should be one and default should be two okay we also want to prevent this segment length to be lower than one so create a maximum note and maximum width one all right so when the number here is smaller than one it will be one coming out of this value output and I believe we got the naming wrong so this should be Y and this should be X and swap the positions now duplicate this segmentation node and swap the X and Y like so so now we have some horizontal cells like this and let's increase this to four so as you can see by swapping the X and Y Channel we have basically rotate the sales by 90 degree from vertical to horizontal all right and let's go back into this node group and we need to create some more output this is the position there we go we also need the UV is up and we need this mask as well so connect this mask here there we go and finally I want to Output this particular fraction node so connect this to the group output as well and this will be our segment Factor okay and move this up here so we have these four channels and we can use these four channels to create our carbon fibers create a mixed node and we will mix some vectors this must go to the factor and first let's mix the UV okay so now we have some very nice UVS going on here let me just set this back to two and let's try one now let's leave it as two so now we can use this as the UV for let's say a noise texture and we can stretch this noise texture using a multiply Vector node and multiply the Y Channel with 0.01 like so and we have some very nice texture going on here however as you can see we have exactly the same noise in every single cell and in order to break up the repeating cells like that we just need to add this with the position so duplicate this mixed note and this time we shall mix the position and we will add this with this UV all right there we go so as you can see we have different noise for each of the cells and if you think that it's it's not random enough you can also scale this position by a certain number and it's going to increase the randomness and now we can find any repeating texture at all and let's increase the size of the noise a little more let's say 40 all right so this will be the micro texture of the carbon fiber but we still need some height information for the carbon fibers for example the curvature along the the direction of the fibers as well as some bevel at the edge all right so that's the next thing we want to do so duplicate this mixed node and this time we will mix the float value instead again connect this mask of the first segmentation node and this time we will mix up the segmentation Factor I mean the segment factor and we have something like this now we need to turn these One Direction gradient into mirroring gradient from the side to the center like so and the easiest way to do that is using a color ramp node create another key at the exact center and this key should be white and set the left and right key to Black now we have some very nice mirroring gradient but if we use this to create a bump it's going to create a sharp bump like this we need it to be curved like this right and to do that we can simply use a float curve and we turn this linear gradient to something like this so that's the curvature of the carbon fibers now the next thing we need to do is to create some bevels for the fibers and for this bevel we're going to be using the X dimension of the UVs so create a separate XYZ and connect this one over there we go now again we're going to turn this gradient into mirroring gradient like this so we're gonna duplicate this color Ram node and drop it onto the wire like so all right but this time we're not going to use this float curve we will use another color ramp node and bring the white key to the left like that the more we bring it to the left the more the sharper the the bevel I mean the thinner the bevel so I think the bevel should be something like this and finally I'm going to combine these two together using a map node and for this map node I will use minimum there we go so this will be the overall height of the carbon fibers and this will be the micro texture of the carbon fiber to combine this we will some simply use a reply map node like so all right we're almost there it's time to create the bump node and connect this to the height there we go and the bump is a little too much so we need to lower this to something small and let's test it out it looks nice let's bring up the metallic and bring down the roughness and also set the color to be something docker now let me just bring this light down here I think the light is a little too much so I'm going to lower the light I mean the intensity of the light a little there we go and I think the bump is a little too much so let's decrease this to 0.001 we're almost there but we need to create some color variations for the carbon fibers and to do that we will again use this mask create a mixed color node and connect the mask over like that and we will use some very dark color like this and for a color something even darker like that and connect this to the base color and let's see and there we go now we have some very nice carbon fibers already and yeah I think it's time to create a note group so that we can reuse this carbon fibers later on so let's move this scale forward and move these two back and also the segment length back a little like so and let's zoom out and select everything except the Shader and the three first nodes all right Ctrl G to group everything this is going to be the vector and this is going to be the segment length and again this should be 2 and the mean value should be one let's set this to 50 and also connect it to the group input to create the input for the scale here we go and let's rename this to carbon fiber okay let's go back in and create some more inputs for the carbon fibers for example I need to create some inputs for the color as well so connect these two to the output I mean the group input and this will be color one and this will be color two there we go and finally I want to create a scale factor for the depth I mean the height information so to set this to one and connect it to the group input node this will be Z depth there we go now there is one small problem with this Z depth that is if we set this scale to something really really high as you can see the z type is becoming a little too much because when the texture becomes very small the height information should also be reduced so I'm going to divide this Z depth with the scale like that and let's increase the Z depth a little okay let's increase some more there we go and let's see as you can see the height information is now consistent with the size of the texture all right finally we need to rename the output this is going to be the color output and let's move this above the normal output like that now there is one thing I forgot about this carbon fiber is to configure this segment length value now let's take a look at the texture itself and set this to 2.5 for example no maybe something different there we go so we have some errors right here because this carbon fibers only accept integers all right so we need to force this float value into integer and to do that we simply create a math node and floor it there we go and now the the error is gone and we can configure this number to get different textures like so okay the carbon fiber is basically done however at this point it's not that much better than emit textures and even more emit textures kind of render faster and easier to use so we basically went through a bunch of troubles of making this carbon fiber node and we don't get much benefit from it so we need to improve this a bit to utilize the full power of procedural node so let's go back inside this node and we will extract some information let's move this output node here and let's extract the UV as well as the position and rename this to UV and this will be position there we go and let's move this back here because this is procedural textures we can actually assign different colors for each thread of the carbon fibers and to do that let's create a separate XYZ and connect the position in here and let's have a look at the X Dimension this x Dimension is basically the ID of the thread so we can use this with a white noise texture a one lead white noise and we can create a random value for each thread and we can now use a mix color and let's use soft light there we go and soft light this with the base color of the carbon fiber there we go and let's change the color a bit okay so as you can see we have a random color for each of the threads within the carbon fibers and you cannot do this with imit textures all right as you can see we have no repetition whatsoever it doesn't matter how big or how small we want our textures to be you will never find any repeating pattern and also one more advantage of this carbon fiber node is that let's increase this to let's say seven and as you can see this looks very much like a floor pattern in fact you can actually turn this into a floor pattern with some more configuration so with some more configuration I managed to turn this carbon fiber into a floor pattern mask and then combine that with the wood texture that I created some time ago to create a very nice floor pattern and by the way I already made a series about creating this particular wood texture some time ago and this wood texture is also up for sale on my gum Road as well as blender Market store I'll put the links to the tutorial as well as the store in the video description please check those out if you're interested alright the carbon fiber is done and during the process of this tutorial I used quite a few technique and I hope you managed to learn something from this and use the knowledge in your future project okay thanks for watching I'll see you next time
Info
Channel: Lance Phan
Views: 2,613
Rating: undefined out of 5
Keywords: procedural, texture, carbon fiber
Id: Nr1y7Gow_d0
Channel Id: undefined
Length: 22min 16sec (1336 seconds)
Published: Sun Aug 13 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.