PICNIC CLOTH (with blender. procedurally)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hey guys welcome back to another default cube CG matter tutorial and in this one I want to show you how to make picnic cloth which has both a shading components and the simulation component but I guess the twist for this one is that it's procedural meaning that we can control stuff like the where is it like the size of this checkerboard so here it's like twice as dense and it has subsurface it looks really nice and I guess let's just get into it should be a very nice and easy project but goes over some nice principles that maybe you didn't know so ok your blender looks like this we're all squared up this is how you're going to start what I'm gonna do is I'm going to start off by making the material but to display it we're not going to use a cube instead we're going to use a plane to be our cloth so at a point then go to the shading workspace which is where we're gonna make our material and I'm just going to go to the top view so we can see what we're doing I'm gonna create a new material with a creative name it can be whatever we want like for example whatever I want very creative and what we need to do now is create the picnic cloth which I'm sure you've seen this you know kind of like it's also on the lid of jelly cans and stuff like this I don't know why it's there maybe it's because you bring goe to picnics but um it's this checkerboard that's like pink red and white and the issue is we can't just use you might think okay just take a checkerboard texture throw it in there the issue is we can't do that because it has three colors not just two so we need three cells instead of two so here is the trick for how to make it it's actually very simple we're gonna add in a wave texture which looks like this by the way but we want to turn this more into like crisp edges right now we have linear fall-off so there's a couple ways to do that but the easiest is we're just gonna add in a math a note set this to greater than and by default it's greater than 0.5 which gives us these stripes a nice zebra pattern although if you change this value kind of changes you know the width between black and white stripes but we want these of course to be the same so that's a one direction but for checkerboard we also need the other direction and have them overlap so I'm just gonna duplicate these set this 2d y-axis which looks like this so we have our horizontal we have our vertical and then to combine them we are going to there's a couple ways to combine them but the way that makes sense is we're going to add them together so they're both kind of contributing to this overall texture and you can see we've kind of created a nice picnic kind of design in the sense that we have black tiles grey tiles and white tiles now we do want to do a bit of a conversion on this because technically these areas these super white tiles have a value of two why well because this is where we have both the white stripes vertically and horizontally so it's a one plus one in those areas which is a two and the issue what that is is we want to our shading or we want all our values really to be between zero and one inside that interval so right now we're going from zero black all the way up to two so we're just gonna you know add another math node and multiply by 0.5 or divided by two so now we're going from 0 to 0.5 to 1 and everything's in that zero to one interval and notice that again because it's procedural like I showed you before we can take our scale and make a value node that you know controls both of them and now we have a very procedural setup which which is cool you're not gonna find this in a ducky tutorial you actually would but uh okay cool so now how do we take this black and white great it's not really a gradient but the this texture that we essentially made how we had we take it and give it to correct colors well what I'm gonna do is I'm going to add in a color ramp node and feed everything we did in here which we can just group if we want to so select control G now we have them in a nice picnic group so everything we made here we're gonna feed into a color ramp and we're gonna have the black tiles be white if I remember correctly that's what uh I have one over there yeah I think it's white so we're gonna have white tiles over here and then for the tiles that were you know of value one we're gonna make those red that's a loud cat okay so now we have I might have reversed it but either way we now have a white tiles red tiles and pink tiles but the pink tiles should be a bit Pinker so we can just take the slider and bring it until we like the colors we have cool so now we have a procedural thing that is controlled by the scale and you know that that's essentially how you make it but of course just because we have this shader doesn't make it look like a picnic aasif first of all needs to be in a position that looks more classy so we need to give it a simulation and then we need to feed this through you know this principal B SDF that we need to do a lot of things too so let me actually save it's a good idea okay so how do we do the simulation at least the basic one where I had it hanging off the ball and of course you can do the same thing with it hanging off a table or on the floor or whatever well to do this I'm just going to take the cloth raise it up so it's above the floor and add in a our we're gonna add in our collision object being this UV sphere which we can scale down something like this so we want the cloth to fall on this ball and kind of like hang off of it or maybe slide off of it whatever you want so what we're gonna do is with our picnic loth you want to subdivide it you want to subdivide it and give it a but a bit more geometry because the more geometry you have the more accurate your simulation can be so you need a lot of geometric data so I'm going to go with 30 subdivisions if your computer can't handle it 20 is fine as well and if your computer is very good go up to 40 and 50 okay so we have our cloth subdivided go to the physics tab we're gonna make this a cloth object which when we play this you know it falls all at the same time but it doesn't collide so with our collision object we want to make this a collision object and now you can see we have physics that make a bit of sense but it looks horrible and it's self intersecting and it doesn't really work so to fix this we're gonna select our cloth physics tab again we have our cloth we're gonna live inside the physics tab and you want to go to collisions and enable self collisions which means the cloth isn't only interacting with our collision objects but also with itself meaning that's not going to intersect itself because it would collide with itself is the idea so now when we play this we get something that looks a bit better you can see there's not really any intersection you jagad but there's not any intersection so to deal with all the jaggedness what we can do is after right now all the cloth physics stuff you can think of as a modifier that we're applying to this plane so we can actually add modifiers after the fact and still have our simulation be the same so a modifier we might want to add is either a smooth modifier but probably what's better is a subdivision surface which you can see kind of cleans up what's going on here so let's have two levels in the viewport and you can see we get something that looks a lot nicer and just to make this look more aesthetically pleasing I'm gonna make this plane a bit bigger which means you know more cloth so it hangs a bit lower there we go and before we make this look better I just want to you know say one thing about the whole simulation there are a bunch of settings that I'm not gonna really explain in this tutorial like tension compression shear bending and that will affect what this cloth will look like but there are a couple presets you click this button and there are presets for different kinds of a fabric so if you want something like silk it will automatically change these values for you and it's gonna interact a bit differently you can see kind of looks lighter and it's a kind of has less folds in it versus something like a leather or denim but a leather should just bounce I think because it's a very hard yeah you can see it's very rigid so you can just play with that I'm gonna keep it at cotton kind of like a cotton cloth that you'd use for this but um there you go let's say you're happy with your simulation how do we make this look a bit better because we have to design but it just doesn't look good so to start off with of course we're gonna switch over to cycles cos V's trash which you know a lot of people probably don't like that statement but whatever we're switching to cycles next we want better lighting that's probably the main thing we can do so take your white delete it because we want to replace our lighting with something else and instead of that what we're gonna do is we're going to go to the world tab and instead of just this gray background what we can do is that in a environment texture which is you know how we're gonna load in our HDRI whereas my HDR eyes have a folder for it I forgot Loden and HDRI and you might be thinking okay we have our nice lighting however our picnic loss looks exactly the same it's not even casting any shadows there's no ambient occlusion and remember because I didn't remember this is because right now we're feeding this as in a mission right it's just going directly into the surface essentially so we want to feed this to a principal be SDF first and then we're gonna get all these nice lighting interactions and already looks a lot better so let's high to our background so render tab film transparent makes it the world's active but you can't see it so it's completely transparent and now let's make our cloth look a bit better so first thing this is cloth not like glass or a mirror or something it's not supposed to be that reflective honestly so I'm gonna take the roughness my laptop's are dying I'm gonna take the roughness and bring it up a bit so it's not reflecting as much something like point seven point eight just so that we can't literally see a reflection off of it which you know it's cloth it's not supposed to reflect you might even want to bring this closer to one honestly but um okay cool next does when you zoom in there's really not any detail except for the color data we can shade smooth on that so we want to add a bit of normal mapping to do this I've lost my nodes to do this what we're going to do is we're gonna create a noise texture and a bump node and the bump node is going to convert this height information essentially into normal information so take the factor height this into normal and you can see we already get a bit of detail if we bring up the scale it looks a bit rocky and you might be thinking oh how are we gonna turn this into something that makes it look better if it actually makes it look jagged and you know like some kind of rough material well if you take the scale and make it very very big something like a thousand or two thousand you can no longer see the individual ridges but it kind of looks a bit more like cloth if we zoom in you can see there's a bit of detail there and we can make that less intense maybe fifty percent strength 0.5 and just with this it already looks a lot more like cloth so this is it without it kind of looks very shiny and yeah a bit two or five to add that normal information and it looks a bit more like cloth next thing we can do and there's a bunch but probably the next best thing we can do is since this is a very thin material and just the nature of it light can kind of seep through it usually kind of like subsurface scattering with your fingers you could see the red if you have a flashlight up against your hand kind of like that we want to add that to our cloth just to give it a touch of realism so I'm gonna choose a subsurface color something like red or orange some kind of warm tone and when you increase the subsurface you can see the light is leaking through you don't want it to be this much so something close to zero maybe like 0.1 and that just adds a bit of render time honestly but it also adds a bit of realism and there you go you've made a procedural cloth and you can also simulate it like we talked about you don't actually need to apply this to a plane the shader you know this whole setup we have over here you could just apply it to anything that has a UV map honestly or just use generated coordinates but remember the nice thing about this is we can after the fact control how many tiles we have which is better than a texture because doesn't take any space and it score and use nodes to make it so anyways I hope you guys enjoyed this tutorial that's pretty much the show hopefully you learned something about shader is about simulation etc if you enjoyed this tutorial and want to support the channel the best way to do that the only way to do that is via the patreon if you have the means to donate there and you want to I do have a patreon there's a link in the description not only is it a donation but you do get some tutorial files you get some early access to stuff I have made a couple private videos and private tutorials that you can also watch if you want to but um yeah if you have the means to do so anyone - think of it as a donation up to you but yeah otherwise hope you enjoyed this tutorial and that's it that's all I got
Info
Channel: Default Cube
Views: 23,606
Rating: undefined out of 5
Keywords: blender, tutorial, picnic, cloth, simulation, shading, nodes, vfx, cg, cgi, 3d
Id: iAgmiBbOeBk
Channel Id: undefined
Length: 13min 7sec (787 seconds)
Published: Thu Apr 30 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.