xjorma / EarthMeshHoudini

Generate real world meshes in Houdini using the Google API.
Apache License 2.0
216 stars 22 forks source link

EarthMeshHoudini

Generate real world meshes in Houdini using the Google API. Title Turntable Sagrada Familia Chryster Building

Prerequisites

Google Cloud Account

You need a google account to be able to use this HDA. The process is easy:

  1. To begin click-on this link.
  2. Click Start free on the top left corner, you need to be logged in with a google account like gmail. If start free is not present it's probably because you already use google cloud, so instead link on Console on the top right (should be here if you are logged), then click on the combo box on the top left, and you could jump to the step 6.
  3. Fill your country, your organization description (I personally put Business idea / startup idea) and agree to terms of service and click Continue.
  4. Fill your personal information and your credit card (but you should not be charged if you don't overuse it, the free tier is relatively big and the Tile API is supposed to be free for a year, but check it yourself) and click Continue.
  5. Fill the survey.
  6. Click on the top-right on My First Project, and them click on Create a new project.
  7. Give-it a name (I personally called it Geospacial) and choose no organization a press Create.
  8. Click on the Hamburger Icon on the top right. choose API and Service then Library.
  9. Search for Map Tiles API and Enable it (It should give you a key at this Stage Keep it and do not share it with anyone).
  10. Search for Maps Elevation API and Enable it.
  11. You can test if your key supports the Map Tiles API by trying this link on your favorite browser https://tile.googleapis.com/v1/3dtiles/root.json?key=YOUR_API_KEY, replace YOUR_API_KEY by your key, if you see an error message it's not good, and you need to check again your account.
  12. You can test if your key supports the Elevation API by trying this link on your favorite browser https://maps.googleapis.com/maps/api/elevation/json?locations=39.7391536%2C-104.9847034&key=YOUR_API_KEY, replace YOUR_API_KEY by your key, if you see an error message it's not good, and you need to check again your account.

Additional Python Packages

You need to add 2 additional python packages, pygltflib to load gltf files, DracoPy to uncompress mesh compression from google used by the 3D tiles.

Note: Some user had to install PIP, in this case follow the instruction here.

SideFX Labs

I use this node from Labs, so you need to install the Labs Package.

(Optional) Increase the viewport material setting

If you don't do that, most of the things you will see in the viewport won't be textured. It's optional but very recommended.

Material Warning

How to use the HDA

EarthMesh

Place the EarthMesh node in your scene.

Earth Mesh Node

Configure the node with the right parameter for your usage. I suggest you start with the parameters in the screenshot, or use the test scene EarthMesh_Test.hip at the root of the repo.

HDA Parameters EarthMesh Node

Be patient it takes couple of minutes to dowwnload and build the meshes.

1 unit in Houdini, is 1 meter in real live, the X axis point to the North, the Z axis point to the East.

TextureAtlas

Using countless lots of 256x256 textures, it is not practical and also slow to render (Too many draw calls), this node is here to help you..

HDA Parameters TextureAtlas_Node

If you don't want to see pixelated textured in your houdini viewport, you probably want to uncheck Limit Resolution on the Texture tab of Display Option .

Display Option Limit Resolution

Trouble shooting

To optimize and also limit the number of requests to the google cloud, I use a cache in a folder specified in the digital asset. If a file in the cache is corrupted (it's never happened to me, but for example if Houdini crashes or is killed while generating the mesh) it might result in various issues like crashing Houdini, if you suspect the cache to be the source of your problems don't hesitate to delete all the files inside. There is nothing in the cache that can't be downloaded again from the cloud.

Know issues

There are currently a few warnings related to the labs's QuickMaterials node just after loading the HDA. I'll do some follow-up with SideFX, and figure out what the solution is.

Material Warning

Planified Improvement

Warning

I am not a legal expert, but the meshes from google are copyrighted. Be careful when using them in a project.