Blender is getting CRAZY!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] [Music] [Applause] [Music] blender now has a super cool feature called the volume cube which allows us to create whatever we want basically whichever object you know the math of and you're probably thinking you know blender already had the mana bulb and yes theoretically in a volume shader like fog but they were never an actual object you couldn't add materials like glass or metal like you see here right i won't be making heavy explanations on the math part but on patreon i will show you some other fractals like jewel assets and the burning ship so if you want to get some top-notch fractal assets this is the place to go so as the first thing let's open up blender and let's keep the cube here let's commit the scene you know and let's open up geometry notes by opening a new tab and clicking here geometry note 8 right let's add new geometry notes and now the very thing you need is actually the volume cube as i mentioned right so uh you need to have a version of blender which has the volume cube listed here right so the volume cube basically works in a way that it has a density input right and we can add different values here so for example if you want to remove the bottom part of this cube here how should i do this well i should remove everything that lies below zero on the z-axis right so to get access to the z-axis and any calculations which are dealing with position i'm just going to take the position node here right and i'm going to add a separate x y z connect this here and also add a math node um to compare basically if something is larger than 0 then it should be kept right so i'm going to connect this here and as you see now we have this thing just cut in half and you can control this thing here to our liking and now we just have to introduce the mandible formula here to get a mana bulb out of here right so we need to create a float variable of wr which is square root of the dot product of something and something right and what this operation does it basically calculates the length of our vectors right it calculates the length from the center to each point of this volume cube so this should create a sphere and let's see if it creates we're going to go to plot distance and density it does not well it's true it just creates like a gradient of a sphere but we have to cut this off at some point so we're gonna use um less than for example one and now this is fair right i'm gonna have some more resolution 128 for the voxel resolution and to see well we have a sphere and that's because this is kind of a length operation now this is a bit too complicated i mean let's do this with fewer nodes so let's just use uh this vector math with the length operation which does exactly the same thing so if i disconnect this and plug this here you see it is exactly uh the same thing right so let's delete those.product things here and now we have this thing and this is our variable float wr right so i'm gonna press ctrl j f2 and i'm gonna type your wr right so these names here basically come from the fact that uh in this code the vector itself the position vector is called w and this r here is basically just one of those angles that is used to determine this location of our object in this polar coordinate system space this is basically our first thing and the next thing is float w o which is our r cosine of w y divided by w are right so uh first of course let's add the arccus cosine operation write the math node our cosine make the r cosine out of the y component of the w vector which is divided by w r so to get the y component of the w vector we're just gonna add a separator right and separate x y z and then we're gonna get this y component here and we have to divide divide components by this wr right so we just need a math node we add a division we plug them like that y divided by the wr and we take an arc cosine out of it and now let's just you know group those and let's call this our w o a variable right all right this here is done and now we have the last and the third formula uh the variable which is wi and this is arctangent of x component divided by the z component right so i'm just going to duplicate this one here and i have to take an arc tangent of those two right so uh if you open up a math node you see it in some operations here right and we have the arc tangent here right but this is not the right one because this one only has one input so actually we need the arc tangent two which has two inputs and the first of those has to be uh the x and the second one has to be the z right so x and z and this is now done we're just gonna group this add f2 and let's call this our wi right now uh how do those things look right like well this one here is length from our center right as you see and this is how it looks the w o is basically like a little cone like that and w i is an angle around the x z plane right so for x z plane like that so this is basically the system of our polar coordinates the next thing that we have to do is scale and rotate the points right so with the first variable wr we have to do basically a power like we have to put this to the power of eight now the number eight here is can be anything that you want the shape of the manual bulb is gonna be different because of that so for example in the intro i used the exponent of five which means it has five of those little like the shape is like five-sided right to take to the power we have to add the power node right and we're gonna take the wr to the power of eight currently uh but i'm actually gonna do so that i'm gonna take the eight and move this out from here and i'm gonna put this here like that because i want to control this afterwards so when i group everything i have access to it from outside right and i'm gonna maybe call this one exponent and also let's ctrl j on f2 and let's call this again our wr so that we can see where this thing flows to right the next thing is uh w o right w o has to be multiplied with eight as well as wi has to be multiplied with eight so let's uh duplicate another math note here and let's uh multiply w o with eight right i'm gonna track the eight here and also the same thing with wi i'm gonna drag the eight here and also let's group those all right this is how the notes should look something like uh that and i'm also gonna shift right click track uh sorry shift uh right click drag over those and drag this one here so that is a bit more uh readable now this is pretty much ready the last things that we need is to convert back to cartesian coordinates which means the x y and z system so that blender can actually do something with it right so which means we're gonna take the wr and we're gonna multiply this with sine of the w o times sine of the w i right so take math notes sine of w o and sine of w i and we have to multiply those together and in the end we have to multiply this whole stuff here with our wr again right and like that press h to make them smaller press s to scale them on some axises to make them also smaller this is our w dot x right simple this is our x coordinate our future x coordinate right now the next thing is very simple just r times cosine of w o which means we're going to take a multiplication and of w o right like that and put this into here and multiply w r with it and this is ready ctrl j f2 this is our w dot y our future and y coordinate the last one will be our z coordinate of course which means we're just gonna do so that we're gonna multiply w r with sine of w o like that times cosine of w i cosine here and we have to multiply those together right something like that and move this one here all right again in your box and your name w dot z all right let's move this here now these are this is our formula right so i'm gonna select everything here i'm gonna move this here all right this is how the nodes look and let's go on now and let's actually make another bulb out of those right so now i'm going to group this but first i have to connect those x y and z into a vector right so for that i have a combine x y z and i'm going to plug the x to x the y to the y and z to the z right and this vector here is basically iteratively be going due to our like in from here again and again and again and this is gonna create the mandelbrot right so i'm gonna group this right i'm gonna drag the exponent here i'm gonna add a shift right click drag a little reroute here and now i'm gonna just drag over here keeping out the value and the position and ctrl j it is now this is grouped and the input here is going to be our position vector right so i'm going to press n group and here this one is gonna be our w the exponent is gonna be our exponent i mean it's pretty simple and in the end we're gonna also have our uh w right coming out from here and now if i make the smaller uh things here right i have this little note group that is actually my mandible seed right but i mean i cannot iterate this very well because this actually is missing one thing let's read what inigos says to us we only have to add c to w now and iterate it in the regular way so this means uh when this thing is ready in the end here in the end of the note group we have to add a c to it a certain c which is actually the same input right so we're gonna add a vector math addition here and i'm gonna drag from this group input a new uh node to the vector here right and this one is gonna be our c right and i'm going to move this up right that like that and the c also has to come through the node group so that when i for example add multiple of those you know i can connect the w but i cannot connect the c anymore right so what i have to do is um select the c input again and drag this all the way until the end and output this under the name c right so now i have those here right and i can plug those together right but the exponent is still missing so i still need to connect the exponent also to the end like that i'm going to call this exponent and let's go out from this node group now and connect also the exponent right now the c here the input for the c is going to be the same position like that and now our mandelbrot is ready so where is it well to see our mandible what you have to do is to i'm just going to delete this i'm just going to keep one node group for for a moment and you have to add a vector math node and calculate the length of this w vector and output this to the less than and look at that this is demandable pretty simple right um these are the notes i mean if you want to see the order of things or anything and now we just have to iterate this to add more detail right so to iterate this i'm just going to disconnect this for one moment and i'm going to add one more and i'm gonna now press on alt and right click drag like that so it automatically connects the right things and scientists say that you only actually need four iterations for this mental bulb to look nice this is like perfectly enough of resolution i'm gonna add this to that length and you see well this is like something but not something really good the threshold has to be two it looks pretty jacked because it doesn't have too much resolution right now so let's first make sure that the volume cube and the volume to mesh both have the same resolution so switch the grade to amount and i'm going to now add an integer right and i want to type 128 here i'm gonna plug this into those things and also into the voxel amount here i'm going to have some more resolution like 256 but you see it is cut off in some areas and that's because the volume cube has a little bit too a small bounce here so i recommend using -1.1 and also 1.1 on all the axises and now this should look pretty much the nicest middle bulb you will get keep in mind that the resolution thing here the integer is actually very can get very heavy very quickly it's not real time so if i put this like 128 i can now change the exponent here right and i can have very like loads of different mandelbrots here and you can also create a julia set out of it which is i mean can be interesting for example if you disconnect this position here and you just use an orbit arbitrary values here like that for example you can like remove the inside of this fractal and do things like that so just play around and always connect the position if you're not happy with it now you add materials for this thing what you have to do is to add a set material node right so you're going to take a set material make this a smaller resolution for a moment and add this material here and i'm going to calculate the huge mandelbrot back and let's go to the shader editor where we can add some nice materials right so a trick for this mandelbulb is actually i mean you can render this in ev of course it will look fantastic and nice but in cycles when you use some glass materials it's going to look even nicer now there are no ways to actually use like iteration based colors currently because you cannot take like those attributes out of volume and put those on those polygons right now but what we can do is that we can actually use ambient occlusion which is going to give us pretty much the same result right so see i'm integration gives us basically the crevices i believe or like some tighter spots on the mesh here so we can use this i for example do make some areas uh made out of metal right so uh i'm gonna move this like that here switches to constant actually and put like 0.8 here and now we have this mask for the metallic parts if the mask is a bit too smooth for you you can use like 32 here and this is gonna get a lot uh more more samples more quality right and you can connect this to the metallic right so now we have some areas that are more metallic i mean it's not visible right now but we can use this for the color as well so i'm going to drag another color ramp here and i'm going to put this to the color and what i want to do is i want this to be white and i want metal metal part to be like something golden and a bit orange like that and i also want this to be really glossy right so again i can use this ambient occlusion and drag from this color to here and now glossy values as you know are zero right so where i want to close it to happen i have to add i have to have a zero there black and those areas i'm going to put like 0.5 and now i'm gonna connect this to the roughness and this looks like uh that pretty nice but you know the metal bulb is pretty like plain and has no character to itself so i'm just gonna multiply the the colors true with the m and the occlusion right so do something like that multiply and turn the factor up i mean definitely looks better right and i can also change the color of this ambient occlusion that it gets multiplied with so for example i can make darker areas like a little bit more like like that and i can see how this looks something like that and now i can for example turn up the transmission like that and this looks exactly as the one in the as i showed you in the beginning of this video looks really really cool i really like this and if you want to get some more information about the mandelbrot and the math behind this and how to make this in blender how i made this kind of like liquid flowing mino brought in the beginning of this video and also you know burning ship some duel assets all this stuff there then you can check out patreon where you can also download the project file for this video and loads of more fractals so see you there and have a nice day
Info
Channel: Bad Normals
Views: 973,661
Rating: undefined out of 5
Keywords:
Id: xuLIJ-FNkSI
Channel Id: undefined
Length: 17min 49sec (1069 seconds)
Published: Thu Aug 04 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.