Jump to content

[SOLVED] Problem with heightmap generation using terrain_x64.exe


photo

Recommended Posts

We use terrain_x64 to generate heightmaps from meshes.

If we have intersecting surfaces on the terrain mesh, we get non-deterministic output. Sometimes the heightmap contains the upper point, and sometimes the lower point.

This causes our models to go beneath the terrain if a lower point is selected.

Note : We also tried merging all surfaces into one surface before generating the heightmap.

 

Here is an image our artists thought might help post-225-0-09076100-1336735924_thumb.jpg

 

 

Also, on a related note, is there any way of editing the R16 images generated by terrain_x64.exe in Photoshop? Our artists have been hunting for a plugin that can load R16 images for a long time.

 

Thanks.

Link to comment

Hi,

 

That seems strange. Terrain tool clamps z values from 0 to 65535, but before clamping it will resize to your mesh to (terrain_width, terrain_height, 65535) size.

 

Could you provide this mesh?

 

Also, you can convert R16 texture to full RGBA texture then edit it in Photoshop and convert back using usc and Image class.

Link to comment

Hi unclebob,

 

The problem is not with the XY dimensions of the heightmap, it is with the Z dimension.

If there are two vertices with the same XY coordinate and different Z coordinates, how does the heighmap tool resolve this? This was the essence of my question.

Is this method of resolution not deterministic?

 

About the other question, converting R16 to RGBA8 - will this not cause loss of precision? If I am imagining it right, RGBA8 wil have all the R16 values lowered to an R8 channel. I don't think that would be a good idea. Or is there something that I'm missing here?

 

Thanks.

Link to comment

Hi Ashwin,

 

Thanks for your use case. :)

 

You're right, it's undefined behavior because of division by zero error. The problem is that we can't render 'vertical oriented' triangles from top-down view properly in this case. By 'vertical oriented' I mean triangles with same x or y coorinate for all vertices. I think we probably should skip that triangles.

Link to comment

Thank You unclebob!

Our artists are blocked because of this, could you suggest a workaround for this for now? And any idea when we can expect a fix for this?

And also, could you address our concerns about loss of precision when converting R16 to RGBA8, editing and converting back to R16?

Link to comment

Hey Ashwin,

 

We'll fix this issue ASAP.

 

Also, you can save your r16 image as png or psd (just pass proper extension to terrainmesh -o flag) and simply edit it in photoshop. No plugins required.

Link to comment
×
×
  • Create New...