Hello! Recently we had a project with landscapes from a satellite data.
And we tried to figure out what possibilities are.
In Houdini 17 there is a node called Mapbox. You can find it in Game developement toolset.
We started here.
You need to install the game developement toolset for this node to appear.
If you don't have it, press the Update toolset button here.
Run Houdini as Administrator if you have any issues.
Mapbox allows to create what we needed.
It downloads satellite maps, height map, diffuse color map
and creates the heightfield form them.
So here we have a usual Houdini terrain.
Middle click and here we go.
Here it is, a heightfield, 2048x2048.
What is the Mapbox? It's a service.
it allows users to download different map data.
Create an account on the Mapbox.com
You need to register, enter your account
And here you have this Access token.
It's a long string. Copy it.
And paste it into the Mapbox node in the Api key field.
Next click the gear icon and choose Save as permanent defaults to save the key.
Here we have a limited set of options.
Push the lookup button.
Choose the map region you want to download.
It will change these coordinates, lat, long and zoom.
And the map will be downloaded.
A couple of settings. Height scale.
You can change the height of the terrain.
It's 1 by defaults, so it's a real scale.
Resolution scale allows you to change the resolution of the heightfield.
You can downgrade it, for example like this.
0.5 and the reolution is 1024.
Also you have an option to blur it a bit.
If you have some spikes or sharp angles.
On the first output we have the terrain
and on the right we have the OSM data.
OSM data downloads with the import OSM hda.
Here it is.
It downloads the OSM data as curves. Roads, houses and so on.
We have a lesson about it.
This curves rays to the heightfield level.
As you can see it here.
It's just a Ray node inside. First they raise them up and next ray them down to the terrain.
You can add the resample so there will be more points on the curves.
To fit it better.
That's all the options here.
You can uncheck Snap to terrain here.
That's all.
This node has several problems
And we were not able to use it in our project.
First it has these watermarks here. Not a big deal.
But next problem is huge.
The map has a limited resolution.
It downloads the textures with the resolution of 2048x2048. But.
It's actually 1k texture upscaled to 2k with some ugly filter.
Some kind of sharpen. Here it is in full size.
You can see a lot of artifacts.
It's clear that it's an upscaled version.
So you can not use close-ups.
So I examined this asset.
Everything was simple enough.
There is a Python module inside.
And inside there is a code which downloads textures from mapbox.
Next I started to read the mapbox API documentation
and I can barely recall next couple of days.
Let me present you my own version of the asset.
I called it Mapbox on steroids.
You can download it for free, link in the description.
Just put zero in the price field.
Common settings are the same.
Height scale, resolution scale, blur and so on.
Api key is here as well.
Now you can choose the resolution of the maps.
It's here in the menu, from 1k to 16k.
In theory it can work with 32k as well, I didn't test it though.
You can choose the resolution for the Color and height maps accordingly.
Also you can download the water mask image.
It looks like this.
It's a black and white texture. And the water is white.
Use it in your shader to change the look of water.
Not only oceans, but rivers and lakes as well if your zoom level is enough.
It can be downloaded separately.
You can choose the style of the map.
Like satellite, streets and so on.
Also mapbox has so called Mapbox Studio.
Here it is.
It's a simple editor to create your own styles of the map.
It's how I created this water mask.
There are a couple of examples here.
You can create your own style.
Choose the Map style - Custom. Put your username here.
And put the style name here.
It can be found here.
Choose share and use.
And in the URL you can see your name and this long string untill the .html is your style name.
Just paste it here.
And you can download your own map style.
It's the Satellite by default.
Also you have an option
to turn off the OSM download
If you don't need them.
In the old asset OSM will be downloaded every time and it's a huge waste of time.
And the download paths.
The standard asset downloads so called static image.
It's just one image per map.
Therefore the limitations.
In my version tiles are being downloaded.
All the satellite data consists of so called tiles.
They like 256x256 pixels each.
My code dowloads them in order to fill the map.
It downloads all the tiles you need, stitch them and next cut the image to fit into your region selection.
The downloading time can be huge.
Like 256 pixels tiles to 4k map.
It's a lot of tiles.
Therefore the script searches for the existing tiles in the Tiles cache folder and doesn't download them twice.
You can create one tiles cache for all your projects.
Tiles are lightweight.
If some tiles are broken, like server error or something.
Just uncheck this parameter, Use cached files.
And they will be redownloaded.
Here they are.
A lot of them.
They names mean: zoom level_lat_long.
It's important to understand
When you choose the resolution of the texture
when the resolution goes up, the zoom level goes up as well.
Here it looks like this.
When I zooms, it changes.
Different zoom levels look different.
Every time you increase the resolution
it zooms a couple of levels.
Mapbox is not the best service.
It has a lot of broken tiles on high zoom levels.
In case of ocean it can be acceptable
You can hide them with the water mask.
But sometimes they can appear in the middle of the land.
Just remember it.
If you have this issue, just change the zoom level.
That's all. Use it wisely.
If you have an idea on how to improve the asset, post a comment.
I hope this HDA will help you to create great landscapes.
If anything doesn't work, post a comment as well. Be happy, work in Houdini!
