bridgecommand / bc

Bridge Command ship simulator
https://www.bridgecommand.co.uk
Other
61 stars 25 forks source link

I am having trouble using more than one images in a world description #31

Open dpservis opened 3 years ago

dpservis commented 3 years ago

Hi,

I am trying to build a world from several images. I have a main image and height map and everything works fine. But when I add more pairs of images then the 3D terrain is degenerated. There is no exception or problem to read the files, it just seems like irr fails to render them. Any ideas?

bridgecommand commented 3 years ago

Are you able to share an example so I can take a look? Thanks!

On February 19, 2021 9:19:46 PM GMT, dpservis notifications@github.com wrote:

Hi,

I am trying to build a world from several images. I have a main image and height map and everything works fine. But when I add more pairs of images then the 3D terrain is degenerated. There is no exception or problem to read the files, it just seems like irr fails to render them. Any ideas?

-- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/bridgecommand/bc/issues/31

dpservis commented 3 years ago

I have built an application that given a min/max lat/lon it builds a 3D model of the earth terrain as well as the terrain.ini file for BC.

output.zip

P.S.: willing to share it if it is of interest, it's a quick hack but it works. Also I promised to make a restructured BC repo public, I need to find the time to do this but I will :-)

bridgecommand commented 3 years ago

Thanks, I'll test this over the coming week. Automating the world building process would be very interesting.

On 20/02/2021 10:43, dpservis wrote:

I have built an application that given a min/max lat/lon it builds a 3D model of the earth terrain as well as the terrain.ini file for BC.

output.zip https://github.com/bridgecommand/bc/files/6014678/output.zip

P.S.: willing to share it if it is of interest, it's a quick hack but it works. Also I promised to make a restructured BC repo public, I need to find the time to do this but I will :-)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/bridgecommand/bc/issues/31#issuecomment-782604299, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACSJLS6MFVIBD66APC34HGTS76G67ANCNFSM4X5BPKGQ.

bridgecommand commented 3 years ago

Hi,

Two main things I noticed:

  1. For all of the secondary maps, you had TerrainHeightMapSize(*)=2049, instead of the correct 256 to match the actual files.
  2. The secondary height maps should be (2^n)+1 in size, so 257 instead of 256. (There's an overlapping pixel so the last pixel one one map should be the same as the first one on the next)

To test this out, I automatically resized the gradient.png images from 256x256 to 257x257, and changed the terrain.ini file so for all except the first TerrainHeightMapSize() from 2049 to 257.

Making these two changes, it seemed to load OK for me.

dpservis commented 3 years ago

Thanks for the hints! I made the fixes but I still do not get a nice environment as I do when I do not have secondary images.

output.zip

dpservis commented 3 years ago

Hi, I am coming back to this, I shared the code with you are you interested to check it out?

bridgecommand commented 3 years ago

Hi, yes, I will have another look at this shortly.

bridgecommand commented 3 years ago

Hi, I'm still looking into any problems on the Bridge Command side, but a few observations so far:

  1. Your detail heightmaps (e.g. gradient1221002031321.png) seem to have a line of black pixels at the right and bottom. This is giving the 'ramp' effect seen at the edge of each tile. Screenshot 2021-05-21 at 21 32 23
  2. The overview map doesn't seem to be aligned with the more detailed one. It's possible that it's a Bridge Command bug, but please could you double check this.
  3. Checking a few of the detail tiles where I'd expect a reasonable depth (e.g. 1221002032111, 1221002032131, which are used for the detail map 21 and 39), the SeaMaxDepth is set to zero, i.e. there is a maximum of zero water depth here. This doesn't seem right.

I think there may be an issue in Bridge Command about the exact alignment of the detail tiles, but could you check these points?