 Howdy guys IndiePixel here and what I wanted to do in this video was first off make the transition to Houdini 17 alright, so now I'm going to be doing everything in Houdini 17 from now on All right, so all the intro to vex stuff will be in Houdini 17 but in this video what I wanted to do was actually walk through just kind of my research and a little bit of development R&D as they say With the new map box node that comes with The game development tools alright, so I really wanted to go through in this first video just how to set it up and how to start to extract data from The information that comes back from the API calls. Okay, so This is an example That we're going to walk through throughout this particular Intro video and really what I'm going to do is just kind of as I learn more about it I'm just going to update videos throughout the process. So let's actually get started and Learn how to create something that looks like this. All right, so we get splines for the rivers We get splines for all the streams and we get a nice Height map from all this or height field I should say and this is Hopefully you might recognize. It's the the Grand Canyon. It's a part of the Grand Canyon All right, and what I wanted to do is walk through the workflow just to show you how everything's working right now with The map box node over here, which is in beta right now. Okay, so let's start to learn How powerful this node can be for game development? Okay? So let's jump into it. So I'm going to switch to a different scene and we're going to get going All right, so let's start from scratch and Let's learn how we actually get all this functionality Inside of Houdini. So the first thing that we need to do is we need to make sure that we have the game development shelf installed so Inside of Houdini if you don't already have it installed you can always go here and say shelf sets I believe or I'd say new shelf Or actually we should go and say hit the little plus button here and go to the game development tool set and What you'll see if you haven't already installed the game dev tools for Houdini You'll just see a little icon over here that says update tool set and you just want to click it and then just update to ever to whatever the latest is okay and That will give you the map box node So the next thing that we want to do is we want to drop down a geometry node All right, so this basically is going to contain geometry. We're going to call this map box test All right, so I'm going to jump inside by hitting enter on the keyboard Okay, and what I want to do here is just hit tab and start typing out map box And what will happen is you'll see the game dev map box with the beta tag at least as of this recording It's in beta right now. So How do we actually get this to work and what are all of these particular parameters over here? All right, so there's a you know a bunch of parameters. None of it's actually too complicated just yet You know, I'm sure side effects will add a bunch of parameters to this as they start to get it out of beta but I Wanted to show how you can start using this right off the bat. Okay, so The first step in getting this working is to get an API key. Okay, so this particular node is actually utilizing the map box API and this is a different service. It's not a Side effects thing or anything like that. So what we want to do is we want to go up to map box So enter in you know the URL that you see here, okay, and this will take you to the map box Website and so what you want to do is you want to sign up for the free account? Okay, so they have a nice free account here So it's free to start up and you get a bunch of views and because all that we're doing is really just messing around with it The free account is totally fine for now. Okay, so it's not going to cost you any money And unless you start pinging at 50,000 times in a day so Or in a month, I should say so If you're just doing this for you know Terrain development or just learning how to use map box in general You're fine with a free Plan for now. So once you get a free plan in place. All right So once you get all that set up what's going to happen is you're going to receive a couple emails and They're going to then send you to your account dashboard And what you want to do is you want to go and copy your API key. Okay, so you can see this access token right here And what you want to do is you want to copy your default public token? Okay, and you want to go and then paste that back into Houdini Over here. Okay, so we're going to select that map box node and we're going to go to the API key Just expand the menu and though I'm just going to paste that in there Like so, okay, so once I you have the API key in place we can just fold that up and We can then do a lookup. So what we want to do is we want to fly find a place on the planet where we want to sample some terrain and you know What's actually happening on the surface of that terrain so in terms of roads and buildings and stuff like that so a Great place to start is the Grand Canyon because there's very impressive Terrain features there. Okay, so what I'm going to do is just use the map box Window that pops up here and I'm going to zoom in and I'm going to go find The Grand Canyon, which is right over around here. Okay Right around here, so we're just going to zoom in again And keep going until we get to the National Park There we go right down here. Okay, so let's select a little bit of a different location this time So let's do something over here. That looks like a cool little feature So you really want to zoom in so I should note Right now that your zoom level dictates how long it actually takes to download the satellite data. Okay, so if you have a very large zoom level Okay, so meaning you have many many kilometers or miles right whichever unit of measure you're used to It's going to take a long time So if you're just messing around with this I highly recommend just to zoom in all right I made that mistake a couple times just zoom in all the way in and You know find a good little spot where you're pretty close to the terrain. Maybe it's a couple miles You know four or five miles will download pretty quickly So at this point, I'm pretty happy with my selection. So I'm going to hit download And What you're gonna have to do is you're gonna have to wait at this point All right, so a certain point Houdini. It's currently it's not throwing up any sort of Progress bar or anything like that. So what you're gonna have to do is just wait for it to actually Download the data Houdini will freeze up on you. All right, but let it let it run and what'll happen is It's downloading all the data from map box. So it's sending an API call Okay, so We're gonna grab all the height field information and we're gonna grab all the curve information that's you know the USGS and a lot of the government agencies have provided and also a lot of you know just private Geo Caching type people have provided in terms of their GPS data. So That all the gets turned into curves once this is done computing So I'm gonna let this run for a little bit and then I'll be right back All right, so I finally was able to download the portion of the Grand Canyon here and this is just a subset. I went and changed the zoom level because It started going above All right, I was waiting about 20 minutes for the zoom level that I was at So I zoomed in a little bit more on that same sector latitude and longitude and that It downloaded a lot faster. So that's why we're seeing a smaller portion of what we actually selected All right, but we can still work with this data and if you look at it, we're giving all the color information We're getting all the height information. It's and it's quite impressive And you know, obviously we're looking at the Grand Canyon. So the height differences are quite extreme in this particular region of the United States, so It makes more a more impressive demo But what I wanted to show is how we go about actually working with some of this data now that we've got it. All right, so You can see up here, you know in the the base settings We have our latitude and longitude in our zoom level, which is at 11 You can also go and rescale the height if you want to anytime you do that. It'll actually re-cook The calculation so it might take a little bit longer for it to actually rescale it and Honestly, I usually just leave it at a height scale of one and then I just use a remap the height field remap Because if you notice that the output from the map box node is Set to height field, which means, you know, we just have a height field or you know a Houdini terrain Which is awesome because we have texture information and we also have height information So we can easily just go and you know pipe that into a height field remap and do a Compute range and then you can go and you know Do with it what you want from there, right? What I want to do is actually just get rid of the color information for right now because You know, I'm still working with a cop Network setup to extract this information and then to process it a little bit more but What I want to do is just do some basic stuff for for right now So we're going to do a visualizer So I want to do a height field visualize like so and I'm just going to Pump out the results of this first output here You can see that this node actually has two outputs. It has the height field information and we also have the OSM curves Both are extremely powerful in terms of information Okay, so you can see if we pipe that out that height field out into the visualize node that we are now visualizing the Terrain elevation so what I'm going to do is do a compute range right here All right, and I'm going to set the middle elevation down to zero and Actually, you know, I found that I can set this down to something like negative 50 and actually get a better result All right, so that gives me that full range now for this particular Terrain and that actually looks kind of cool Maybe we just leave it leave it like that for this particular demo Cool. Okay, so now we've remapped the color data and you know in cops You can actually extract all this information and actually turning that into a texture. Okay, so Again, I just want to keep this at a basic level and just kind of explain the the outputs and the workflow of using the Mapbox SOP node here in Houdini 17 Okay, so let's focus on the second output here So this these are the OSM curves. All right, so let's just pump that into a null node For now so we can you know, just view that data by itself All right, it might take a little bit to compute to depending on your zoom level But in this case because I zoomed way in we're able to actually extract the curves pretty quickly But still honestly, that's quite a bit of terrain to cover right there. It's at least a couple miles All right, so we're getting a bunch of curve data and Let's actually name this we'll call this OSM curves for it now and we'll call this terrain Colors and we'll drop down at a null node just to stay organized All right, so I'm gonna call this my out height field And that should have been a underscore there we go Okay, so I'm gonna just hold down control and Hit the template button so we can see our actual Height field there and we're not actually getting our colors anymore, which is weird Let's set this back down to zero. There we go the negative 50. That's that was an odd interesting bug All right, so there we go. So now we are able to visualize our terrain Let's template this and then turn this guy on there we go So now we can see all of our curves on top of the terrain. It's crazy cool Okay, you can see we're actually getting the main curve for the river for the Colorado River Right there and we're getting a bunch of other information. So let's let's talk about that really quick so if I were to select the null node here and go and split the paint top and bottom and then just set that to my Geometry spreadsheet Now if you've been following my videos, I do love having the Geometry spreadsheet down at the bottom here. It's might have followed up here as well Right, but you know usually when I'm working, you know during the day and stuff like that I get rid of all this stuff because I do spend a lot of time Just doing procedural modeling stuff So there we go What we're going to do is we're going to look through all the information that's provided to us. So in the point class You can see that we have a bunch of color information and positional data We're getting distance We're getting latitude and longitude Information and nor normals are all zero. So we have no normals and we have a hit group cool So the more interesting part is if we actually go to the primitives Okay, so the primitives are actually holding all the data That comes from all these different sources. All right, so all these things have actually been You know named and given, you know certain classifications in a data format So let me expand this here really quick So you can take a look you can see all the different attributes that we have here Um From the data here and it's all primitive data basically and so The one thing that i'm really interested in Is the waterway All right for this particular type of uh terrain, you know in my experience so far with the map box notice that If I turn this into a city or if I actually focus in on a larger Metropolitan city, I get a lot more data But because I'm out, you know in kind of the wilderness and you know over the Grand Canyon I don't get as much data, but One of the interesting things about this particular Dataset is I get a waterway attribute and this waterway attribute gives me this string value And this string value tells me if I have a stream Or if I have a river look at that So that's pretty interesting All right, so let's let's go take a look at how we can actually do something with that so What I want to do is drop down a blast node. All right, and I'm going to Get the rivers so let's get the rivers here And what I need to do is I need to say if the because remember We're looking for the waterway so we can actually filter it out over here if I put in a waterway You can see right here. We're focusing in on that particular attribute. All right Let's select this node here Because that has all the data and you can see that waterway is equal to a stream or to a string called stream. All right And so what we need to do is we need to say if the waterway attribute is equal to a stream Then let's get that. All right, and let's say delete none selected and let's actually just take a look at just that data And you can see it's returning for me all the streams And it's all in curve format. So we have points right And you can actually resample this too inside of that osm or inside of the map box note so you can say resample osm curves And it will go and resample it and we can actually set the segment length So I'm going to set like something like five Or let's do 10 this Sorry, it's massive. So you can see that Yeah, we're at about 15 000 meters Almost 20 000 meters. So it's a few miles for sure All right, let's do something like 30 Let's start to help out Let's do 50 Yeah, these things are super huge There we go. So you can see now that we're getting these curves All right, and they're all separated out into primitives and stuff like that But it defines all the streams all the major streams for this particular terrain All right, so let's template this again There we go. We're getting all the streams. That's incredible amount of data right there Just that by itself All right, but it gets even better, especially when you start dealing with cities and stuff like that So, uh, let's do an alt drag. So I'm going to select this and do alt Click left click drag and um, I'm going to call the streams actually so get streams Like so and we're going to call this one get rivers And so what I want to look for now is the river string value And voila, look at that. We get the Colorado River boom perfect curve There are two primitives in it. So we have zero and we have one So we'll have to do some processing there, but We'll save that for a later video Really, what I want to do is just show you how to start to extract data I mean, we're getting the height field already and this is an impressive Height field right here and we're also getting curved out. So let's actually do something with the curve data Something simple. So I'm going to colorize um The streams here Okay, so let's turn off our point display and get rid of the templating there. So right now they're all colored white Let's uh, let's color them something like a blue Something like that and let's take the original color. You can see they have an original color here. That's just coming from the the Satellite data. All right, so let's do a wrangle node Okay, so it's you know, we're talking about vex a lot lately All right, so we're just going to pipe this into the first input pipe this into the Second input there, which is actually input one All right, and what I want to do is I want to Take the current color value. So cd. All right, and I want to multiply it by the color that's coming in from geometry One or index one because remember it's zero one two three, right? so geometry one and I want to get the cd attribute and I want to get it from point num or pt num. Sorry Like so semi colon So there we go. So now we've multiplied the color over it Now we got, you know, some nice blue streams All right, so we'll just call this the color eyes streams All right, I'm gonna just Actually copy both these nodes and just Do a control c control v and let's colorize the river just so we can see it as well So for this one, I just want to colorize it. Maybe more of a like a dirty color dirty water type of color Not that it's like toxic or anything. It's just Because it's got so much sediment in it Right, so maybe we just go back over to it something like that. All right So let's merge these two data sets together. So we have streams and we have rivers Boom, look at that All right, we could do so much stuff with that right there Then if we just merge that with our terrain our height field Look at that Let's just maximize this here really quick And I'll close out the lecture. I know that was a little long, but you know super exciting stuff Really amazing Amounts of data being provided to us, you know basic for free, you know But this is amazing right here We could do a lot with this information. So that was my whole goal with this particular video It was just to kind of give you a nice gentle introduction to how to work with the mac box node And how to get everything set up and then how to start working with the data, you know Everything is an attribute when it comes in there and you know, the data isn't necessarily fully complete It's this whole thing is still embedded. So I'm sure more of those attributes will be supported here pretty soon hopefully You know by default I would say that you know just getting the river curve And getting the terrain is a huge win in terms of Game development and level design and stuff like that. So anyways, I want to leave you guys there Thanks so much for watching. I really appreciate all the support. I will see you guys in the next video. Thanks so much