Rock Pile Tutorial: MASH instancing

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey everyone so it's been a while since my last tutorial so I thought I'd come back and give another tutorial based on an old tutorial so if if you're familiar with my tutorial videos you'll know that I did a rock pile tutorial roughly two years ago using a process called particle instancing where I just scattered some rocks on a on a surface to create a convincing rock pile it's not it's not a hundred percent like I wasn't a hundred percent convincing but like it was it was getting there so um I now I've recently learned a new technique thanks to mayor 2016 extension - because there's this new tool in this version of mayor and it's it's called mash and so it does a similar thing it's able to instance objects on an another surface but it does a really good job of it so here I've got the rocks instance and I have also got this grass instance these are just assets which I produced in a different scene brought them in and then created this environment pretty quickly using this technique I'll also have these rock assets available and this scene with the lighting and everything I'm not going to be I'm not going to be supplying the grass but yeah the all this stuff will be on my gum Road so if you want some cool rock assets and also a breakdown like you'll be able to go into the scene and like look through how I did everything and yeah you can look at my lighting yeah I'm gonna provide everything so yeah that'll be available to you as well so let's get started so for starters I've got these five rocks I just quickly sculpted these in ZBrush and then used zremesher to generate the the mesh so I created these really quickly I've got heaps of tutorials around which deal with my creation of rocks so you can go check those out if you want to know how these were produced so a big thing using mash is the pivot point of your objects so the pivot point determines how it's going to reproduce on the surface the surface of your object let me just unhide this group I've just got my outliner over here I'll drag it out if whenever whenever I need to explain something but I'm just looking for this guy and I'm gonna hide these so this is the base that we're gonna be scattering on so it's the same one which I used in my last rock scatter tutorial I just went and grabbed it brought it in this was just generated in ZBrush with some really rapid sculpting and I made sure to delete off the the base polygons otherwise I'd get rocks scattering on the base as well and that's unnecessary so it'd be unnecessary instances so yeah back to pivot points so as you can see my pivot point of his hide this for a sec again so yeah I've got the pivot point in the center of the object what this means is when it does scatter it's going to scatter with the pivot point so let me take it up here it's gonna scatter with a pivot point there and so it's it looks like it's sticking halfway and halfway out but for the final result of this asset this this some base is gonna be hidden because I'm gonna have so many rocks I'm not gonna need this base anymore so this is just my personal choice if you you could also have the pivot point at the base so you can have the pivot point at the base of the object which means it'll scatter like this but when we add random rotation what's gonna happen is sometimes the rock might look like this but are we touching so it'll look like this and so maybe that'll create a cool result because you'll have some like more internal than external but I have a feeling that you may have to produce more a higher scatter count so it's hard to like I haven't really tested that out yet but I just thought by having the pivot point in the center you kind of get the best of both worlds so yeah having the pivot point in the center let me just undo this to go back having the pivot point in the center means that it will be sitting about here and so then when I put on the random rotation it's just like this it's just any way like this or like this so yeah I find that some a lot better for what I'm trying to achieve anyway but there's no hard and fast rules here okay so let me just zero this guy out another thing to keep in mind is see how I like I've kind of like all these rocks have little transformations just so they're all sitting on top of the grid plane here because I was doing some test renders of them as long as you don't freeze these out this is okay because what will happen is if I freeze it out now the match is going to think the pivot point is here and so that's where it'll be attaching to the mesh which will be an even bigger issue if it's this one and I freeze transforms that then the pivot points here and it's not going to it's not going to scatter correctly on the surface so let me undo that so when I zero all these out what should actually happen oh whoops zero this one out zero this one yeah let me just go I'll select these three because they're the only ones not zero down so zero all them out and all their pivot points should be right in the world zero so yeah just make sure like when you're when you're ready to scatter and an asset that's how you set it up cuz you'll get the best results okay so I got my five rocks fired the five rocks are gonna help with variation within my rock pile so the first thing we want to do is we want to select these rocks and we want to go create mash create mash Network now I'm gonna go to the settings to show you this hide original object I don't like to do that because I may want to make some adjustments to my rocks in scale or something like that and if they're hidden then yeah I can't make those changes so I'd prefer to keep them visible and then you can choose whether you want it to be an instance or a mesh now I actually already had recorded this tutorial and then I found out something which was quite important so mash allows you to actually switch pretty freely between these two modes so it's not a big issue if you do if you use mesh and then you're like wow this assets getting really heavy I really need to go I should have done this as an instance sir and then you can switch it but I'll show you how to do that later on instance so basically just make some makes the process more lightweight it's just gonna be taking copies of these rocks and assigning them whereas mesh is more or less like duplicating the object and then putting it on scattering it on the surface so I'm gonna go with the lightweight option but we're gonna have to convert and convert to the mesh option at some point and I'll explain that later on so let's go instance I'm gonna play and close and so by default what's happened here if I go bring over my outliner here's the mesh No then we all that attribute and then we go to attribute editor and then it automatically assigns a linear a linear distribute node so you can switch this to a bunch of stuff radial pretty cool so it's putting them in a circle it's very cool so and then we want to crank this up it's gonna be in a sphere yes so this is your count so let's do for the start a hundred you can see it's all the same rock all facing the same way so it's not exactly what we want but I'm gonna show you how to change this so for the distribution type we're going to want to use mesh and that says please connect a mesh so if you go under the mesh settings and you'll see there's an input mesh setting here so I'm obviously gonna want to use my base so I'm gonna unhide that so there it is and then I'm gonna go to mash and then I can middle mouse click and drag this base under here and then it automatically just scatters all those guys on the surface now an important thing to note which took me a little while to work out is this scatter uses face area when you when I select this geometry you'll see that the faces aren't really uh they're not exactly similar in size and shape so like see this polygon here is very different to say this polygon or even this polygon here what mash does by default I'm pretty sure what it's doing is it's gonna start it's gonna scatter more in areas where there's some polygon density and less where there's less polygon density with the default settings by ticking this it's going to randomize it a lot more so it's not going to take into consideration the polygon size so let's say you're scattering an object across a character you're gonna get most of your density in the face and on the hands and feet and the rest of the body is gonna get not much at all so if you like scattering like little micro hairs or something like that that's just a something to keep in mind and then calculate rotation is cool you so what that does is it's taking into account the normal of our base mesh the normal the direction of the normals on each face and it's then assigning that rotation to each object the rocks that's not really useful because I don't want them all facing in the same direction I want them to be random but for example if we were scattering trees right now trees grow towards the Sun so I would want all my trees basically sticking up with some very slight random rotation on them but in this case I don't want that I want them to be more I want them to be obeying the the surface curvature of this mound so yeah that's basically it for the distribute I'm gonna be coming back in here and adjusting my points as I go I like to kind of keep it low in the beginning and then once I've added all my nodes I come back here and crank it up to make sure that I'm getting full coverage so let's go back to mash the first important one is ID so we'll go ID and add to ID I wanna make this random basically what this is doing is it's taking all our five rocks here and it's using all of them so now you can see we don't have the repetition of just one rock this is all five rocks just being duplicated again and again so that's already helping with some good variation next we'll go back here and we'll go to random lets go random scale yeah let's go scale so I'm working in decimeters if you're working in centimeters then you won't have it explode like this it's exploding like this because it's making it ten units negative ten units in one direction and positive ten units in the other direction and for me if you're working in decimeters there's 10 decimeters in a meter so this is basically scaling all my rocks by a meter which is not what I want if you're dealing in centimeters you won't have them explode like this yeah anyway so I'm gonna set this to zero and zero just to begin with you also have settings here to scale them in X Y Z and then in uniform uniform random so I'll explain that in a second so I'm gonna want some scale variation let's go negative 0.5 and 0.5 so now we've got some which is becoming smaller some which are becoming bigger which is exactly what we want but we have a situation where some of these rocks are getting really stretched out which like I like if you have a pile of rocks a lot of them they're gonna be quite similar you do have rocks like this in nature they're more sedimentary rocks than than anything else but yeah I'm not really going for for a variation in my rocks I want them to be more similar so more similar in rock type I should say because they're using very similar they're using they're all using like the same textures and stuff like that so by clicking this it makes sure that the scales are more uniformly so for example if I click on this shape we hit R so if I make this bigger or smaller it's that that's a uniform scale that's basically what this tool is doing by the way it should be important to note that yes you can adjust your ground plane even after you've scattered you can do anything to it you can delete faces you can move stuff around move vertices and and it won't break your your scatter your mash scatter anyway back to random scale so and then this allows you to choose like oh I don't want them to get taller so you can turn that off or I don't want them scaling in the X only want them scaling into Z so you have a lot of selection you know a lot variations that you can add but I'm pretty happy with this vanilla let's go back to mash and we'll go random rotation so this time I don't want it to be uniform because I want them to be as random as possible and I'm gonna say negative 360 by positive 360 so they're basically just gonna be rotating to any to any direction if you don't want them like we're getting some which are pointing straight up and stuff like that but what you could do is limit limit it to to only rotate a little bit so let's say we might only want it to rotate 45 degrees in the negative and 45 degrees in the positive now we still have some sticking up and to fix that I'm pretty sure if I go in here and I turn off calculate rotations now they're all like that they're not gonna rotate further than 45 degrees and you don't have any which are vertically pointing up that's because I'm not allowing them to go past the 45 degree rotation mark but I know I'm not too bothered about that so I'm just gonna go back here and turn it oh I don't want wait this is rotation yeah and I'm gonna make it back to 360 by 360 negative by 360 negative 360 by positive 360 so okay cool we're getting a lot of random rotation we're getting random scale in here I'm pretty happy with how this is coming along so let's go back to the distribute mode and let's increase the count because I want to get some more coverage here so let's take it up mm and the because these are instances it's not gonna slow down my scene at all like you can see my face count is still 12 twelve thousand which is just the poly count of these rocks so if I select these rocks you can see that they're twelve thousand because all it's doing is it's just making a little instance copies of those and just propagating them so this speed of my scene just it does not change anyway if this was math should be a lot heavier it would be there'd be a lot more polygons in the scene so number of points a thousand so this is probably too much let's go to 500 by selecting my base mesh I can see where the holes are now the holes aren't a bad thing because if you have a look at a pile of rocks with like some large rocks in it you actually get some negative spaces where all the rocks are kind of sitting on each other and they cause like a cavity like a little hole so I'm not too worried about a few holes this is actually pretty good I might actually increase it a little bit more though so let's go let's say 600 and that looks pretty solid can't really see my base anymore well yeah so I got a couple of holes over here but no big deal but I want this rock pile to feel bigger like I want it to feel in scale I want it to feel larger and a good way to do that is to make everything smaller so by making all the rocks smaller and then scattering more of them yeah like you that that's basically by having more smaller details and stuff in there that's one way to help you achieve more scale so at the moment this to me looks like it could be I don't know five meters by 5 meters like if one of these rocks is like I don't know foot long but yeah I want this to feel bigger so if I go under where do I want to go wait awhile ago ah so if I so there's two ways I can do this I could go to random scale and I could keep reducing this but I kind of like my variation the variation I have in the moment for negative 0.5 and 0.5 wait is that negative 0.5 yeah yeah I know that's what I want negative 0.5 by positive 0.5 yeah so then I can select the rocks and I can actually just scale them from here so if I scale them down and if I go into my channel box editor I can really see this and I'll go like point 6 so now I'm like okay now I have a lot more negative space on the top here so I need to increase my scatter so we'll go back to mash distribute and let's make it 750 still a lot of negative spaces let's go a thousand don't be afraid to like just ramp this up there's still a lot of negative spaces but I'm pretty happy with the scale of these rocks now so let's go back to my rocks so I've got them selected here and I'm gonna take them up 2.7 in scale all right so we still have a few holes here and there maybe I'll increase the scatter a bit more in distribution distribution so let's go one 100 all right this is looking pretty solid now yeah okay yeah this should be good another thing to note is like say I'm like I really wish there was some rocks down here I can go down to em strength and then you got random seed and you can just like run this around and then I'm like oh there we go I've filled out yeah no I think that looks better like there's a gap there but that's fine there's a couple of gaps here that's fine so now I'm confident in hiding that and like even though this might look weird it's gonna be dark in there not much light it's gonna be able to get in there so it's still gonna look ok it's not gonna look that yeah so I'm pretty happy with this scallop by the way that random seed that's attached to most of these so random seed is here for um for scale it's here for random rotation so yeah if if there's just something like say you this stick did this rock sticking out here say I'm like I don't really like that being there then I can go random rotation and now it'll pop in and it's gone yeah so that's about it so I'm gonna bring in my ground plane and I'm gonna bring in my camera now I can look at it through camera I should probably mention that I'm using a redshift to render to GPU rendering a render super fast this is not sped up this is just rendering right now this is 1920 by 1080 just rendering in a matter of seconds it's amazing so if you want to look into redshift I highly recommend it just for really fast renders so that was 19 seconds to render this and it's pretty good and this is that default samples so you can actually go higher to reduce like noise like this but um yeah anyways yeah so I'm pretty happy with how this rock piles looking hmm I think something that it could really something that could really help is have like having like smaller little rocks which have kind of fallen off the the primary mound and just like lying on the ground around it rather than it being this clean just like rock pile so let me just close this and I'm gonna create another mash Network for you which I think will be good in showing you the process again but without me explaining it so much so bye alright so let me just create a cylinder I should have had this prepared earlier but I don't so bear with me so I'm just gonna create a cylinder here going to delete these bottom faces and then I'm going to send a pivot and then go zero zero zero scale that out and so I'm just gonna be using this as a basis for where I want these smaller rocks to scatter make it a little bit bigger alright so that's kind of I don't want it quite in the center I just want it like around and then let's go through camera and that looks pretty good that's where generally they're going to be scattering on that surface so yeah you just need to determine your surface also other times you don't even need to determine your surface you can just use the scatter but just make sure it scatters on the grid so yeah anyway let me just hide this base for now and I'll select my rocks again 1 2 3 4 5 let's create a new mash Network so create mash Network using the same settings as I had before over here you can see it's scattering them linearly like it does by default so I go distribute switch this to mesh increase this to let's say 50 to begin with and then we'll go to mesh input that cylinder I just created I'm gonna drop in here so now it's scattering them I've got a mash I'll get a ID add to ID set this to random they're all going in the same direction actually because of the polygon issue here I'm gonna kick this on so it's more random cuz I'm pretty sure they would have been bunching in the center yeah they not necessarily but anyway just to be safe that looks like a more random generation back to mash go random scale let's go negative 0.9 and let's go negative 0.5 cuz I want to meet these ones to be small I want this to be uniform scale cuz I can't imagine like one of the big rocks toppling off and rolling over here if it didn't probably just stop here but smaller ones I could see like just being scattered around the base so yeah it's my thinking on that let's try negative 0.75 and negative 0.25 that's probably a bit better in scale range all right go back to mash go random rotation so the rotation negative this for this time I've got negative 45 by 45 because I don't want any of them sitting up on their ends and pointing up to the sky cuz I don't know just wouldn't be as realistic I don't think another node which I didn't touch on you've got our transform here so I'm gonna add a transform and just because I want to increase their position to like I'm gonna push them up a bit but I don't want them to be floating like this one so it's go point to five point two and where's the smallest rock I don't want them to be floating he's not floating some of them might look a bit weird like this but then I can go into my random rotation and I can run the random seed it looks a bit better not for this one though all right I think I'm just gonna leave I'm gonna remove this transform so if you create a node and then you realize oh I didn't really want to do this you can go delete delete this node yes and then it's gone so you can keep your node Network quite clean I'm gonna look through camera now we've got a few scattering but I'd like a few more like all we can see from camera is a little bit of this one then one two three four five we can't really see that many so over here I'm just clicking on my mash to to bring up my network and then I'm gonna go to distribute and I'm gonna increase I'm gonna double this so let's make it 100 now you can see a lot more rocks the scale now to me looks a bit off so now I'll go back to scale and I'm gonna the negative point nine and negative five so now they've all gotten considerably smaller and this is what I had originally and this is what I'm gonna keep it at now I can hide this base and I can bring back the surface I had previously and we can do another end up so here's our previous render and I'm gonna render from camera one okay yeah I think this helps I don't really like these ones here all in a row that doesn't look very natural to me even though this is completely random so what I'll end up doing is I'll minimize this and I'll go back to random distribute and I'll run through my random seed and then I'm like okay okay mmm that looks pretty good yeah let's stick with that then I can open my render view back up and we'll just render this area yeah so that's that's about it um I actually know that's not about it haha I just forgot one important thing that I was explained began explaining in the beginning so what I found the first time I did this it's kind of hard to tell from this distance but um my my rocks they're getting their displacement I've got displacement on these guys but they're not getting their subdivision and if they have their subdivision the displacement would be even more apparent than it is now at the moment because there is no subdivision the the displacements just being assigned as a bump map so that's just the way the rendering engine works it that's the way a number of rendering engines work so yeah I had to work out a way around this and a way to fix this so now that I'm happy with this primary rock pile what I can do is I can in here go to the instance actually no you want to go to the mash attribute and I know this is the mash one attribute because it's mash one instance or and that's the pile of rocks so I can click that and if I want to be able to because sorry at the moment if I go to my attribute editor for my instance are there is nowhere that I can set subdivision levels which is something you need to do if you're generating displacement either that or you have very heavy mesh in your scene but anyway so we go to mash one and then we need to go up to modify sorry create mash utilities and we want to go switch mash geometry types so what that's going to do is remember right at the beginning how we had the choice of instance or a mesh this is going to really quickly convert that pile into mesh and so now you can see our poly count is really kicked up so we're running with 500 1,300,000 raw faces just on these rocks alone so that's pretty heavy my sink can still run pretty seamlessly even though that's a lot of polygons so I look back through camera one and I can and now that it's been converted and the cool thing is I can at will I can now like by selecting this i if I want to now switch back to instance say if I was like oh wow this is way too heavy you can do that by just doing the same process I just showed you so now by selecting the repro mesh I now have the ability in my attribute editor the redshift ability to add tessellation which is the same as subdivision so I'll enable that and set my max some div to four because I've tested this and I know four is all I need and I'll also enable displacement and then it's gonna enable auto bump mapping which was so I think it was able to hold on to its displacement which is why we were getting the bump in the last render but I want to be able to enable tessellation or subdivision so now with that setting changed I'm gonna come back into my render view and I'm gonna Renda okay so now you can see from this render like this is kind of far away but if we had any close-up shots of this rock pile like closer than this then this would be more significant but you can see here as I flip between them I am getting some more detail and variation to the rocks like for example if we zoom in here see the edge of this rock here before it was like a lot more flat and now it's got more detail to it same with like along here before it was flat and now it's got that little knotch taken out of it which the light is catching so yeah it does help but in this case it may not have been 100% necessary and if it's more important to me to keep this as instances than it is to use the displacement then yeah you just got to make that call with the asset so um yeah that's about it that this is um this is one that I prepared earlier the one that I showed at the beginning this is using the exact same technique but I added in my grass asset as well just to make it kind of sit in a world rather than just on a flat plane so yeah as I said in the beginning like the these rocks with their textures and this lighting scene and all that will all be available on my Gumroad if you if you want some cool like rock assets these rocks are actually even though you can't see it here I made sure that they're like really high-res so that they can be used on all sorts of different scales so this is just an example of the sort of the level of detail on the rocks so yeah I'm pretty happy with these assets I generated and there for my own personal library but I just thought I'd share them with this tutorial so yeah that's about it I hope you guys learned something and I hope you got something out of this and yeah it's a lot more simple than the particle distribution in my old tutorial like you don't have to put in any expressions or anything like that so thanks for watching and I hope you learned something and got something out of this and good luck creating your own assets in the future
Info
Channel: Tom Newbury
Views: 50,827
Rating: undefined out of 5
Keywords: rock, pile, tutorial, instancing, MASH, asset, environment, tool, education, how to, generate, create, rock pile, rubble, stone, rocks, maya, redshift, zbrush
Id: OhZW8cCu6KU
Channel Id: undefined
Length: 33min 47sec (2027 seconds)
Published: Fri Jun 03 2016
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.