L3DT users' community
Large 3D terrain generator

Import Design map and Mosaic map error

Please report software faults here.

Import Design map and Mosaic map error

Postby Philippe Le Miere » Tue Apr 07, 2009 1:43 am

Have tried to use the Mosaic map feature on an imported jpg and am getting the following error:



calc_HF_InflateMosaic error

- Cannot use non-native/non-mosiac format 'jpg'.

- Please select a 'native' heightfield format in the file->preferences dialog.



calc_HF_InflateMosaic error

- source heightfield not initialsed



calc_HF_InflateMosaic error

- source heightfield not initialsed



DesignInflate::DesignInflate64M error:

An operation has failed



CZeoFunc::CallFunction error:

- The function 'DesignInflate64' in the plugin 'DesignInflate' returned an error.

Basically understanding it as the Mosaic map not supporting .jpg. In reference to a recent post: http://www.bundysoft.com/phpBB2/viewtopic.php?p=5901#5901 regarding image file format support for L3DT, I actually would rather not be using the .jpg format anyhow.

However, is this something that might also happen to other file formats if I do manage to get an uncompressed 16-bit in, for example?

Thanks,

Philippe
Philippe Le Miere
Contributing member
 
Posts: 36
Joined: Fri Mar 27, 2009 10:12 pm
Location: Melbourne, Australia

Postby Aaron » Tue Apr 07, 2009 11:15 am

Hi Philippe,

Thanks for the bug report. I think in this case L3DT is behaving more or less correctly, but perhaps counter to your expectations. I did however find a few small related bugs, so I'll leave this thread here in 'bug reports', rather than move it to 'help and support' as I was tempted to do on first reading.

To explain what L3DT is doing, and what you have to do to avoid the error message you reported, I must first explain some terms relating to file format support in L3DT. L3DT divides file formats into two categories:
  • 'Native' formats, which store enough information to ensure no (or little) data loss, and;
  • 'Non-native' formats, which do not store critical map information and thus may result in data loss.
Let's now consider the JPEG format. When using JPEG to store heightfield data, this image file discards the height scaling data, and instead clamps all values between 0 and 255 greyscale units. Thus, JPEG is considered a non-native file format for heightfields, and should only be use for import or export*.

Anyway, getting back to your issue. As we've discussed previously, mosaics maps load/save map tiles to/from disk during calculations. To prevent map data corruption, this operation must not lose information, and thus the mosaic map must internally use a 'native' format for each map tile. Now, as you know, you can import or export mosaics in non-native formats, such as a heightfield as a mosaic of JPGs. However, after you import a mosaic in a non-native format, you have to convert it to a native format before L3DT can do anything useful with it; for instance, running the inflate algorithm.

If you use the 'File->import->heightfield' option to load the heightfield mosaic, this will automatically convert from non-native to native mosaic formats. However, I've just noticed in the current build that the file filter list in the import wizard is incorrect and doesn't include MMF, and I have fixed that in the next dev build.

The option I assume youy used ('File->Open') also loads mosaics, but it doesn't do the format translation (I will make it do so now.) Instead, users were recommended to manually update the file format using 'File->Format preferences' menu option, selecting the 'Project maps->Heightfield->HFZ' tree option, and pressing the 'Use format' button. This will re-save your mosaic in L3DT's default native heightfield file format 'HFZ'. At least, it does in most cases, but when I just tested it with a JPG mosaic heightfield opened using the 'File->Open' option, it didn't work until I toggled the format a few times (convert to TER, then back to HFZ). This too will I fix for the next dev build.

However, is this something that might also happen to other file formats if I do manage to get an uncompressed 16-bit in, for example?


You'll get the same behaviour with any image file. Images don't store the true floating-point height scale, so L3DT considers the lot to be 'non-native'. However, in the next build, you shouldn't have to worry about it because L3DT will do the translation automagically. I'll let you know when it's ready for download.

Best regards,
Aaron.

* Aside: Conversely, the JPEG format is considered a native format for light map and texture data, as it stores colour data with sufficient accuracy for this purpose. Hence, a format may be both native and non-native, depending on its suitability for each map type.
User avatar
Aaron
Site Admin
 
Posts: 3696
Joined: Sun Nov 20, 2005 2:41 pm
Location: Melbourne, Australia

Postby Aaron » Tue Apr 07, 2009 12:58 pm

Hi Philippe,

I've included the above bug-fixes in L3DT release 2.7 build 5, which is now on the downloads page. Specifically, both the 'File->Import->Heightfield' and 'File->Open' options will automatically convert mosaics of non-native formats to native formats.

Please let me know if there are any problems. Thanks again for reporting this issue!

Best regards,
Aaron.
User avatar
Aaron
Site Admin
 
Posts: 3696
Joined: Sun Nov 20, 2005 2:41 pm
Location: Melbourne, Australia

Postby Philippe Le Miere » Wed Apr 08, 2009 6:15 am

Thanks Aaron for taking a look at importing Design maps into L3DT.

Yeah, I agree, it sort of wasn't a bug, but then it did throw up an event log. So thought it might go in the 'bug basket'.

The difference between native and non-native makes sense. In fact I was at first surprised to discover that 'non-native' Design maps could be imported into L3DT. It's a fantastic feature and I perhaps pushed things when I turn on Mosaic maps.

I actually didn't use the File > Open to get the Height map in. Rather I was using the import function, as a Design map, turning Mosaic maps on, and then calculating a Height map.

It turns out that it was the following piece of the jig-saw puzzle that was missing for me:

aaron wrote:Instead, users were recommended to manually update the file format using 'File->Format preferences' menu option, selecting the 'Project maps->Heightfield->HFZ' tree option, and pressing the 'Use format' button. This will re-save your mosaic in L3DT's default native heightfield file format 'HFZ'.


Thanks for that. Works great. Making L3DT know that once it's imported a bitmap and made a Design map of it, that it should work with it as a native HFZ, was the trick. Needed that one explain :wink:

Have download the latest build and all is good.

Cheers,

Philippe
Philippe Le Miere
Contributing member
 
Posts: 36
Joined: Fri Mar 27, 2009 10:12 pm
Location: Melbourne, Australia


Return to Bug reports

Who is online

Users browsing this forum: No registered users and 19 guests

cron