Jump to content

Migrating the ObjectTerrain class


photo

Recommended Posts

Hi,

I am using the ObjectTerrain class (Unigine 2.7) to procedurally create a terrain from heightmaps, and want to upgrade to Unigine 2.11, where the class has been removed.

Are there any good examples on how to re-implement the ObjectTerrain class using the new ObjectLandscapeTerrain? 

 

 

Link to comment

Hi Paul,

There is a sample (but written in UnigineScript) that shows how to create ObjectTerrainGlobal: <SDK>/data/samples/objects/terrain_global_00.

Alternatively, you can use LandscapeTerrrain. Here is the small example in C# how to create a terrain based on two textures:

However, I'm not really sure if any of these approaches will work for integrated Intel GPUs and OpenGL (if you are still actively using these setups nowadays) since new objects are much more resource-intensive.

Thanks!

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

Link to comment

Thanks for the fast response, the example is exactly what i needed.

Unfortunately our target machines are integrated Intel GPUs and we're using OpenGL. When you say these new objects are much more resource intensive are there any metrics for the additional resources required?

Link to comment

Hi Paul,

There is a very high risk that these objects simply would not work due to overall OpenGL limitations on multi-threaded GPU streaming (especiall with integrated GPUs). We do not recommend to use any landscape object with integrated GPUs.

As an alternative you can use simple mesh generated from heightmap with albedo texture on top of it.

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

Link to comment

Hi,

I might have to go with the mesh generated from a heightmap. Are there any Unigine utilities for generating a mesh from a heightmap, or will i have to roll my own?

Link to comment

There is no utils available for that out of the box. How to construct mesh you can check here: https://developer.unigine.com/en/docs/2.11/api/library/rendering/class.mesh?rlang=cpp#addVertex_vec3_int_int_void

All you need to do it so to read heightmap pixel-by-pixel and interpret it's height by color value.

You also can use default built-in functions in 3Ds Max (or Blender) to convert heightmap to mesh and export it as FBX.

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

Link to comment
×
×
  • Create New...