Jump to content

[SOLVED] Import terrain from Houdini


photo

Recommended Posts

I finally decided to settle on Houdini for terrain generation starting from geodata.

Using geodata I created a terrain, exporting next the textures for height map, normal map, ambient occlusion, cavity.

image.thumb.png.d577a11e842c7c43f645673148c8276c.png

Using this data in Unigine result in some problems

- terrain is blocky instead of smooth

- albedo map seems to be wrongly rotated

- no data from OSM are preserved for roads, rivers etc

- no extruded buildings are preserved

image.thumb.png.18237e0740e25c7e8d483fe3eaeee37c.png

From Houdini I was able to export the terrain mesh, might have more sense to use this one?

Edited by davide445
Link to comment

Hello Davide,

Could you please explain how exactly you imported Houdini terrain into Unigine?

Quote

terrain is blocky instead of smooth

Could be caused by 8-bit heightmap. Use 16-bit instead.

Quote

albedo map seems to be wrongly rotated

How exactly is it rotated? Is it flipped?

Quote

no data from OSM are preserved for roads, rivers etc

Did you make *.shp file? How you transferred this data to Unigine?

Quote

no extruded buildings are preserved

Have you tried saving building to the FBX and dropping them to the Unigine scene as assets?

Thanks.

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment

Thanks morbid.

Confirmed it's a 16 bit height map. I was reading its possible to procedurally refine the terrain inside Unigine using Houdini Engine. But the Houdini installer didn't give an option for an Unigine version. Need I to download in some other specific location? 

The Albedo map show rivers in the wrong place and also cities up to the mountains, but it's difficult to say exactly how is arranged. There is any way to rotate this map so to better understand what can be his right position? 

No and no for the last two, sorry I'm lazy didn't checked by myself. I just used the GameDev Terrain Texture ROP node for generating the textures. 

Link to comment
2 minutes ago, davide445 said:

I was reading its possible to procedurally refine the terrain inside Unigine using Houdini Engine. But the Houdini installer didn't give an option for an Unigine version. Need I to download in some other specific location? 

We have an integration with Houdini 16.0.600 and it works only with commercial license. BTW, I can't assure you that we will continue to support this in the future.

5 minutes ago, davide445 said:

Confirmed it's a 16 bit height map.

And it gave you "blocky" terrain? Can you show me the texture?

5 minutes ago, davide445 said:

The Albedo map show rivers in the wrong place and also cities up to the mountains

Which SDK is this? We had issue with Flat terrain mode in some old version, but this was fixed. I suggest rotating the albedo texture in the 3rd party raster editor, then generate albedo only.

8 minutes ago, davide445 said:

No and no for the last two, sorry I'm lazy didn't checked by myself. I just used the GameDev Terrain Texture ROP node for generating the textures. 

There are two ways of getting geometry on the terrain in Unigine:

  • Import already existent models. Beware float mesh coordinates limits. If the mesh is bigger that 10 000 x 10 000 units it can give you some artifacts.
  • Generate them via shapefile in the Landscape Tool

Thanks!

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment

The documentation wrote "Houdini Engine version 16.0.600 or higher must be installed" so I supposed the last version 17.5 I'm using was fine.  It's an Indie license. Can attach later the map. 

2.8 SDK. 

Edited by davide445
Link to comment

When we made this feature when the 16.0.xxx was the latest, In 17.x.xxx they changed the API and integration broke. And it wouldn't work with indie license (non-commercial).

In 2.8 terrain textures orientation should be preserved as is during generation. So, if you can, please attach both: highmap and albedo.

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment

Not a problem just need to know, but I suggest you to update the documentation on the topic, specifying only 16 version is supported. Indie license is supposed to be "limited commercial" and does provide the Engine, but if the API changed there isn't so much to do. 

Will attach the maps later on. 

Edited by davide445
Link to comment

My bad was just checking again the various maps before posting and discovered the original height map was indeed the attached 32 bit image Landscape_sop with 19774 unique colors (attached also the Albedo map), but when creating the heightmap with Houdini resulted in the attached Terrain_H 24bit image but with 256 unique colors, even telling Houdini to create a 32bit file.

I think some strage info it's in the original heightmap so I can't just convert it in grayscale.

About roads I didn't find a way in Houdini to generate a Shapefile .shp from OSM data, did you normally use some GIS app such as GlobalMapper or QGIS to generate it? The feature it's available in Landscape tool in Entertainment license? 

 

Landscape_sop_mapbox1_terrain_color.jpg

Landscape_sop_mapbox1_terrain_height.png

Terrain_H.tga

Edited by davide445
Link to comment

I've converted your hightmap to the grayscale image in Photoshop. It indeed had three channels, please remember, that Landscape Tool works with single-channel heightmaps only.

As for converting raster files from Houdini, keep in mind the following:

  • Use automatic normalization with diapason from 0 to 1
  • Set Output Range to Remap

I've attached 2 images that shows how to export heightmap.

Thanks.

houdini_2.png

houdini.png

  • Like 1

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment

I remember the red channel is used, simply seems I can't achieve this simple task :-)

Exactly what heightmap did you converted in Grayscale? The Landscape_sop.png or the Terrain_H.tga?

Attached the heightmap generated connecting heightfield_output to the soap_mapbox terrain output and using your same settings I got this file, with the same properties as before so a 24 bit image with 256 unique colors as from IrfanView info. Anyway seems to work better in Unigine so didn't consider this more a problem.

Terrain_H.png

Regarding the other topics

- I tried to generate details masks starting from the very same albedo image, but no mask is generated staring from three tags

image.png.1c4a45272e1ada6109c16fa0ec7d5c5f.png

image.png.8f54fb3e1c5f31ab7f2bc62dceae832d.png

- Didn't find a way in Houdini to extrude the OSM data into correct roads, and next export them in fbx format. Tested with PolyExpand2D, Straight_Skeleton, PolyExtrude, sop_sweep_geometry but the best I can achieve is with polyextrude these odd twisted geometry, all the others give error (I suppose for intersecating curves) or didn't result in anything. The .osm data file can be downloaded at this link.

image.thumb.png.7f2029f4dab5565ef14865840a345ba2.png

Edited by davide445
Link to comment
15 hours ago, davide445 said:

Exactly what heightmap did you converted in Grayscale? The Landscape_sop.png or the Terrain_H.tga?

The attached one — Terrain_H.tga.

15 hours ago, davide445 said:

- I tried to generate details masks starting from the very same albedo image, but no mask is generated staring from three tags

Check the basics first: have you selected details in the terrain generation window? Are these masks selected in the Masks window? Is hex number used correctly? I've attached a couple of images.

16 hours ago, davide445 said:

Didn't find a way in Houdini to extrude the OSM data into correct roads, and next export them in fbx format. Tested with PolyExpand2D, Straight_Skeleton, PolyExtrude, sop_sweep_geometry but the best I can achieve is with polyextrude these odd twisted geometry, all the others give error (I suppose for intersecating curves) or didn't result in anything. The .osm data file can be downloaded at this link.

Sorry, I just checked your SDK version, should have done this earlier. Entertainment SDK doesn't support OSM/SHP import. It works starting from engineering. So the best option for you is to export FBX from Houdini.

Thanks.

image.png

image.png

  • Like 1

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment

You was right, I didn't enabled the masks in the Masks window (just a suggestion, maybe make more sense to have them enabled by default).

Progressing in creating the vegetation I was creating trees impostors, but the result seems to me not so good, such as if they was created in Other Objects mode instead of Vegetation mode. I'm having wrong expectations, o there is anything i can do.

Since there will be some trees even nearby my construction their quality need to be better than so.

image.png.2165deb9ebae64cf00eb6fad36cf6580.png

image.png.088de3398c69ca10e5a6f41646cb751b.png

Link to comment

Experimenting more discovered for some reason playing with Aspect ration it's a bad idea. Both using 4/1 as suggested in the documentation and 1/4 (as from the UI popup info) result in previous distorted image.

Using 1/1 Aspect result in a more reasonable image. Still appear to ne lacking self shadowing, even trying with 8x supersampling, any way to improve this.

image.png.dcaa0d46500b2c7364b59a668930db2f.png

Edited by davide445
Link to comment

Have you tried experimenting with impostor material? Start with Shadow offset parameter.

Aldo, I suggest checking vegetation scenes from downloadable samples.

Also, if you need nice trees in the area of interest (building and around) use low-res impostors for the background and create detailed clutters with impostors manually, without Landscape Tool.

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment

Yes was thinking the same, but is possible to delete automatically placed impostors nearby the construction, so to have free space for manually placed clutter? 

Can't try right now out of office. 

Link to comment

Using the brush edit didn't have any effect on the trees generated using the Landscape Tool. I'm forgetting anything?

Need to say I really didn't get the various infinite options for colors, overlap, etc, the result is a shame of unrealistic horrid mix of colors.

image.thumb.png.9abd8e783adf693cf2b992a66e0ca23d.png

Edited by davide445
Link to comment

You're using terrain brush?

Each Grass or Clutter object has a separate mask. You need to work with that one: https://developer.unigine.com/en/docs/2.9/objects/objects/grass/#masks or https://developer.unigine.com/en/docs/2.9/objects/objects/mesh_clutter/#masking

Clutter and Grass in your case are sharing the same texture, you need to change texture for only one object (Clutter OR Grass). Then save and reload world to see both objects changed.

8 hours ago, davide445 said:

Need to say I really didn't get the various infinite options for colors, overlap, etc, the result is a shame of unrealistic horrid mix of colors.

Not sure what do you mean. Do you need any help with detail layers?

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment

Trying to solve multiple problems I was working on the buildings. I'm square back at the beginning.

Generating terrain from the heightmap needed me to insert an arbitrary elevation scale of 0.05 to have "visually" correct proportions. 1 created a completelly flat terrain.

The problem come now that I want to position the buildings generated in Houdini. Being them spawned all around the mountain region, I discovered positioning correctly some of them placed on the mountains (small towns, in green) create a wrong position for the other positioned in the valley (in red, flying).

image.png.33b9d05f35a0fd64d7750fbc149f480a.png

So for sure my arbitrary defined elevation scale is wrong and produce wrong height proportions.

I see two possible outcome:

- There is any way to reliably generate the terrain from heightmap, preserving the correct proportions?

- Or I can use the Houdini generated mesh of the terrain, that for sure guarantee this. But is possible to treat it as a landscape, so to being able to use maks (painted by hand or imported from Houdini)?

 

Edited by davide445
Link to comment
11 hours ago, davide445 said:

There is any way to reliably generate the terrain from heightmap, preserving the correct proportions?

You need to normalize the heightmap. It's not something Unigine-specific, all heightmaps should be normalized before export.

After normalization all pixels has value from 0 to 1. In the Landscape Tool you'll need to set real min and values for heights.

Thanks.

  • Like 1

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment

Ok downloading 16k albedo map and 4k heightmap it's much better and I probably didn't need to add details masks, need to concentrate on buildings and some vegetation near the tower. Will try experimenting with masks and manual brush. 

Edited by davide445
Link to comment

Painting a map directly on the editorn didn't seems to be an option.

So I tried to paint the map as a new layer on top of the 16k albedo map, and export it as a png imag.

image.png.98bb9094792bfc9b7a11b2c40ee68bca.png

Using it to generate the landcover objects these are not aligned in the painted position, but shifted on the left and north, in the next image in green where was supposed to be

image.png.10574281b397329980b5fd804109b933.png

Attached the zipped mask file (for some reason didn't make me attach it), it's in 16k resolution as the albedo map.

terrain_color_trees_G8.zip

Edited by davide445
Link to comment

If you see the details map it's just a color map showing in the green channel the position where the landcover objects need to be positioned.

Here you can download the full 16k albedo map tiles, here the 4k heightmap.

I'm trying to positioning the trees on these green lines. Both the height and the position are misaligned with the albedo map and the height map. I can of course correct this by hand, but every time I want to change the details map and regenerate all I need to realign all the things by hand.

For sure I'm doing something wrong, not sure what.

Edited by davide445
Link to comment
×
×
  • Create New...