Generating HeightField Terrain Textures in Houdini | Alex Dracott | GDC 2018

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi everybody my name is Alex troika and I'm gonna be talking to you guys about texturing height fields in unity 16.5 and this will be taking around a half an hour and by the end of it hopefully we'll get something that looks kind of like this what we're gonna do is we're gonna start by building a really simple terrain and then I'm gonna cover generating different textures based on your masks and a cop network and then how to bring those back onto your terrain and a couple of the different techniques that I use so I'm going to go ahead and start and switch over into a blank terrain file the first thing we want to do is plop down a height field generate that super quick that down and the height fields gonna generate a nice little hop graph for us with the height field node in it where we can control grid spacing which is our resolution so really quickly and I'm not going to go into too much detail because this is going to be a focus on texturing I'm gonna whoops not that noise I'm gonna place in a height field noise just to give us some variation and then I'm actually gonna take advantage of of Houdini and I'm gonna do something a little different which is I'm going to scatter some geometry around the surface of this to get some more interesting detail in a way that really you can't do in other terrain generating programs so the first thing I'm going to do is I'm not go ahead and generate the sphere out that down it's gonna be pretty small make it a little bigger make a geometry and there's a node that you can use called the height field scatter and a height field scatter is going to place a bunch of points all over your terrain by default that's doing it based on a mask which I don't actually have so we'll just we could do it based on the height or if we just clear this field it's going to just distribute it evenly and we're gonna drop the max points down to 25 and then what we're gonna use is the copy stamp node to distribute these spheres all over the terrain which is which is just ridiculously cool that we can do that what we what we'll end up doing is we'll actually end up using the height field project and the height field project is gonna let us predict geometry down oops onto onto the under the terrain oh that's cuz I'm feeding in the scatter so you want to make sure to feed in the noise itself and actually put it in the right order geometry on the right terrain on the left there we go and you can actually see it's going in and and projecting those onto the terrain so we do a couple things really quickly not that we're gonna go in and we're going to tessellate our sphere a little bit it's an extra geometry and then in the stamp section of the copy stamp node we're gonna stamp inputs onto each one of these and this is gonna let us modify the basic basic parameter of of each sphere a little bit so if I go ahead and place a transform node we can reference that stamped parameter in this case I'm randomizing a just a single floating point and we're gonna use that to change the size and to do that it's a tip and stamp and then you want a three parameters the first one is referencing a copy node and and that and then we want to reference the name of the parameter from the copy node and then finally a default value and you can see immediately we're getting a bit of a random scale I'm gonna go ahead and actually add just a little bit of a value under that just point to that it's not 100% random and we'll just random it all or apply it to every single area so that it's uniform and now if I go back I can and kind of control the size distribution and the other thing we're gonna do is we're gonna put a transform node down under the copy node just so that we can offset it a little and create some some interesting little domes and if you want to go in and even make it more interesting you could flop in a mountain node we're here we can go in and and play with some noise and make that 825 and like this drop the roughness down a little we don't we don't actually have our sphere tessellated that much if I were to update that and go back down to the mountain node kind of start to get some interesting noise and that's gonna make it look like we've got these giant weird rocky boulders all over our terrain I'll turn off my grid really quickly but this is cool because it's just another way for us to start influencing our terrain we could grab this as a mask later and use that if we wanted to but for the time being what we're gonna want to do is we're going to plop down a road and the erode in in Houdini is going to be a simulation that actually runs over time so if I drag my time slider along and I let it think about it a little it's actually gonna do that work more every frame it's also gonna generate a bunch of different masks and masks are really important for the texturing process it's gonna create stuff like where the water is and where the deposits were it's also going to create a little visualization which by default is just set to this range but you can compute the range based on your height map it gives you something quite a bit nicer so the time being we're probably just gonna set this to somewhere around here and I'm actually gonna turn off the visualize and and just lock this node so that I can move my time slider back and forth if I ever needed to but you can see it started to create some interesting shapes now the resolution that I picked by default and I left it pretty close that if all it says we're 60 by 460 more or less which actually isn't that much so there is another node that we can use which is a height field resample and that's gonna let us up the resolution by varying factors so if I were to now up the resolution scale by almost three and look at it again I've got close to a you know 12 or 1 point 2 K or 1.3 K upping and changing the resolution will change how certain nodes behave for example the height field a road node tends to tense the change it's its detail a little bit based on that extra additional information but this is a really good scenario for potentially using the take system and if you're not familiar with the take system houdini essentially lets you run in a variety of different passes and you can link values to those passes so I can go to my take list I'm gonna rename this final so I could then go back and you you switch between the takes up here and you can also add those takes from here so I'm going to go back to the final take go back to my height field resample and then if I hold right click I can include this value and take and set that resolution to actually be really really high so if it was time to do the final terrain render I can up it here and then if I go back to my main take it just jumps back down and that stays consistent as you work down through your train so just a small thing in case you want to wear um we're gonna stick right now with just the take that I had we're gonna keep it to around 2.5 the resolution get that ain't it close to 1k just because we want to keep working and now I'm gonna are now I'm gonna work with some distorting but before I do that I'm actually gonna plop down a height field visualize just so that we can we can look a little bit at the masks um I turn it back on in the erode but the arose been locked and I want to just keep it that way I can compute the range and actually you can see here if I if I color you know thing vibrant something like red or blue we can plug in different masks into our different layers into into this visualize so I can visualize the bedrock which is very close to the height I can visualize the flow I can visualize the the water deposits and I can visualize the debris and this will be important in just a sec but for the time being let's talk about distorting um distortion is a another really really fun node that can work off of a mask for adding nice high fidelity to your terrain it works with different noise types you can play the simplex or curl noise it can run off of a mask and it can do some pretty crazy things can add some pretty interesting patterns you can see pretty quickly I've gotten some cool stuff just by slowly bending and tweaking now here's the problem is that a distort gets applied to a layer by it right now it is just applying to the height layer so if I were to look at my water mask which I believe this is no this is debris so let's look at water the water did not distort with the with the height field together so what we're actually going to want to do is we're actually going to want to have a duplicate of this distort and up here at the top we're just going to change that to water and we're gonna actually do this for every single layer that we wanted to keep and it's it's important to know what happens as you pass the layer information down you have to keep track of it because in the end assuming that it's important to keep track of assuming you want to use it for the texturing process I'll put it as some kind of mask or something like that not necessarily a requirement but if it is it's something to track so we've got water let's make this debris and then we'll do one more we'll just call this low so now we need to combine this and and the way to do that is with the high field player node and the high field layer node is your or your general blend node you have input 1 input 2 in a mask so I'm going to go ahead and and we'll stay stuck on the visualize right here it's replacing every layer from the second one but we're gonna just want to replace the water so now you can see the water is distorted in the exact same way as the height field was or the height layer was I should say it's all high field and we're gonna actually do this a couple times so everything is rican bind and you could theoretically parameterize all of this and you could make it you could even make a little tool or a little sub graph that would do all this for you but for now I wanted to keep it exposed to guys could kind of see what's going on a field this one is debris so we want to come by and that there and then we'll duplicate it one last time and we'll plug in the low and now if we were to go in go back to our visualize node and if we were looking at our debris or if we were looking at our flow map we could see that all that information is still accurate and now if you know convenience you just wanted to go in and edit all these together you could we wanted to tweak that but well we'll kind of keep that how it is cuz we want to get moving onto the texture I'm going to disconnect this visualizer really quickly and I'm going to talk about another way to get organic features and visuals for your terrain and that's the slump in evident unlike the erode node which run this over the time line the slump node is just going to kind of do it all at once and the slump node takes a lot of the sediment and it redistributes it out over the terrain it also likes to run off of a mask so by default it's actually not going to do that but if we plop in a height field masks by feature which is the go-to masking node you can see it's gonna give us we can do mask by slope mask by height stuff like that so go in I'm gonna go in a mask by height just to start compute range pull all that in create a bit of a soft fall off here so I want to I want to I want this to apply more to the bottom of the map than the top and then if I were to like that in you can kind of see it's not mask for really quickly you can kind of see that redistribution of sediment and if you select the slump node you can actually change the spread rate you can change the number of iterations it's running and kind of see it zoom in really quickly here you can kind of see as I change it as it's got more distribution it's gonna leave more of the rock exposed and kind of flatten everything out but you can see why I like it which is that it's giving us that cool grass on rock look or snow on rock depending on the kind of project you had in mind it's also going to output a mask of that which could be potentially really important so we're gonna we're gonna we'll clear it out but we may grab that information later or the time being though let's talk texturing so the the basic way to apply and we'll keep that clear in there okay the basic we may go back to that the basic way to look at materials on your high field in the viewport is the quick shade and the quick shade is gonna let you plug in different textures based on different based on different masks so I could plug in a layer like the debris and put in a texture and have a tile a bunch and stuff like that but we're actually going to use it to preview textures that we're generating real time so the only thing we're really going to concern ourselves with is this base texture area so we're gonna do our textures and actually on the side note here I'm actually gonna I'm actually gonna create an output from this okay I'm no node called it'll make it green practice and call this out and yeah we're also going to plop down a cop Network which is the image processing part of Houdini and you can can pop over to the render view or this are the depositing view and we could take a look at things but the very first thing we need to do is we need to get oops we need to get a texture from this cop Network onto this texture or us are under this terrain so I'm going to dive in here and I'm just going to generate some noise and we can switch over to that composite view look it's our beautiful colorful noise and I'm going to make another null call this out oops out underscore color so to link this up we have to type in our reference by hand so I'm going to go back to the quick shade and then here under map name I'm gonna go ahead and type tilled operate when and then we're just going on reference the object I field one slash cop to net one slash out color and just like that we have we have our we have our our color reference directly onto the texture and and this is this is an important part I've had people ask me about this before so just one more time we are directly in the base texture map name referencing the output node of this cop network rather than loading a texture file from the disk which you could also do because if I could I could go in here and and browse for something like that yeah so unfortunately Turing does not look like a like a bunch of melted candy so we're gonna want to get information from that sup network into indoor compositing view and actually there is a note for that which is the SAAP import node so if I type that down I can now browse to the output of the terrain and we look at that we can immediately see some information coming through it doesn't look very correct and there's a couple things we want to do to set this up correctly the first is we want to set this the resolution from the stop network and this is going to now set the resolution of this image to one 139 which is what we had before we're also going to want to set planes because the compositing setup works on image planes and we can see all the different planes now populate here but would be bouncing back and forth between these quite a bit so look at the water debris flow even still have that mask from the slump node which is super cool yeah so the the last thing we want to do is we want to remap everything to 0 to 1 and that's great because that lets us work with consistent stuff for ramping and creating gradient textures and that kind of thing but yeah so let's make some let's make some textures when when it comes to generating terrain textures we're gonna probably focus on just the diffuse for this for this set up a really common technique that you can see in warp machine and other other programs is to use gradient mapping um and so we're gonna go ahead and create a bump cop to filter node and this is going to let us customize a little chunk of code that can run over our image and what we're gonna want to do here is we're gonna want to have some kind of input which is gonna be the Alpha we're gonna want to put in a ramp parameter and a ramp parameter is the you know the kind of gradient mapping that we're used to and then really quickly on the ramp out we're gonna want to go a vector to float and plug these into red green and blue so now if we were to plug in and alpha into our call this our gradient mapping node call this rock let's say let's make our rock texture but unfortunately everything here is in a bunch of different channels fortunately there is a node to move channel information from one to another and that's the channel copy so we'll call this you know which we call this call this a slump mask actually if let's work on that let's work on the grass so in this node we can say hey we want to be making a new plane I want to make it an alpha plane and the source we want the mask that we had before plug this in and now if we look over at the color output we are seeing a black and white image of what we were making I'm going to go ahead and make make something that kind of looks like grass forgive the the low quality this will be a quick demo so we're not going to go super crazy on this but you know just some some variation in here kind of create some interesting interesting patterns maybe a little bit of orange or something yeah just looking kind of fun and if we were to take this color now look this into our out color go back to our scene view we can actually see that information showing up here I actually don't like the orange and it's cool is I can now just edit this here and look at the output in the window update that so that is our very basic how do we get some information all the way through here so I'm going to go ahead and delete that noise and at this point really it's it's it's just about the the terrain pipelines that you may be used to so I've got this slump mask and actually a quick tip is it's still showing the height channel here I can go in here and actually show the Alpha Channel so we can now see that the slump mask looks like mask I'm gonna go ahead and combine this with some noise well pull the noise off from this just so that we're generating noise in the Alpha Channel and I want to blend these together because I want I want some noise to have some influence on top of this so the blend merged all planes alpha and alpha a little weird placing the Alpha Channel and then here you can see we're slowly adding in some some interesting noise there so let's go back to our compositing view and look at the noise itself and get some get some more interesting stuff the Alpha channel can really pull up the roughness a little and add some some turbulence and now we're getting some cool hyper detail which we can now blend on top of the slump mask that we had before and as a result get a more interesting color output if I select a blend node and kind of see what how much of each one we want to pull in getting some nice interesting little noise there and again we could be working back on our terrain but I think this is looking pretty cool so let's bring in some other additional layers really quickly the big one that we want to do is we want to blend between where the slump mask is and everything else to make rock so I'm actually going to duplicate this over we'll call this one gradient mapping rock I'm gonna kill most of that really quickly and make something like a D saturated darker of orangish rock color and this is still we're using a gradient mapping so we're looking at the noise up back over here to the this yeah there we go plop in much darker value um and we'll we'll just generate a different noise just to keep things different uh maybe switch to something like that maybe not as rough some softer some softer noise in there and then we're gonna want to blend these two together and we're you're gonna want to blend blend based off of our slump mask because our slum mask kind of had that initial information but you can kind of see it's it's doing a it's doing the work but it's still it's still pretty low contrast and the fact that this is image processing means we can go in and put in a nice levels node to really pull up the contrast left to go over to the the alpha alpha tab on that let's go look at a positive view oh there we go so make that nice and nice and high contrast which then in turn is going to create a blend we off stuff to tell it what to blend off of we're blending off alpha and yeah and now if we go back to our scene view you can see that I got the values backwards I'm gonna swap that really quickly we started to see now a rocks are starting to look like rocks and our grasses staying like grass at this point we could really do whatever we wanted we could output this we could render that image down with a rot file output we could start working on getting these into splat maps and outputting that on the terrain we could start setting up for an actual render we could go in and plop down a skylight to start getting things to look a little bit more lively and the nice thing is all of this is just set up so that we can we can go back to you know the slump for example if we wanted to drop those iterations the textures will just update for us and that is really really cool to have that information to have that kind of control you know if I wanted to pull up the slump node into those rocks could do that quickly and get that to a nice height range anyway that's about it for this recording feel free to reach out to me I think my website is www.antakungfu.com
Info
Channel: Yao Rongzhen
Views: 4,199
Rating: 4.9661016 out of 5
Keywords:
Id: 0YcChUjvE1o
Channel Id: undefined
Length: 28min 44sec (1724 seconds)
Published: Sat Jan 11 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.