L3DT users' community
Large 3D terrain generator

Import Texture Map

Got a problem or need advice?

Import Texture Map

Postby Fortran » Sun Sep 04, 2011 2:37 pm

Hi all, just started working with L3DT (currently on the professional trial) and I am in the process of creating a new map with terrain data, exported into L3DT as XYZ format which works great. I also have a huge satellite image of the exact heightmap area which I want to use as the texture. However trying File > Import Texture Map results in errors in every format in the list. I have tried BMP, TGA and JPEG but nothing will import. Is there a limit to the texture size I can import ? The entire point is to maintain the same high level of resolution. For the BMP (16bit) file I get


Code: Select all
L3DTio_BigBitmap::LoadMapFile error
 - unsupported compression mode

CMainFrame::OnImportTexturemap error:
 - load failed




For the Jpeg I get

Code: Select all
L3DTio_FI::LoadMapFile error
 - Error loading image

CMainFrame::OnImportTexturemap error:
 - load failed


Which resolution and what image format is the best approach for this. The help file indicates this is the correct method for importing external terrain textures such as satellite imagery. Im just hoping that this includes high-res imagry. The file I am trying to import is the same dimension as my heightmap area which is 21760 * 20736

Any help is greatly appreciated. Many thanks in advance!
Fortran
New member
 
Posts: 2
Joined: Sun Sep 04, 2011 1:48 pm

Re: Import Texture Map

Postby Fortran » Sun Sep 04, 2011 9:28 pm

Ok obviously my error, ensured my texture was at the same resolution power as my heightmap and now it all seems to be working perfectly. Heightmap ended up at 2049x2049 @10m resolution and texture map is at 20490x20490.
Fortran
New member
 
Posts: 2
Joined: Sun Sep 04, 2011 1:48 pm

Re: Import Texture Map

Postby Aaron » Mon Sep 05, 2011 11:47 am

Hi Fortran,

No, I'm pretty sure this is my error. L3DT should have been be able to load the texture map, regardless of any differences in resolution between the texture and heightfield. These maps don't have to be the same size, and usually they are not*.

Code: Select all
L3DTio_BigBitmap::LoadMapFile error
- unsupported compression mode


This error message from the bitmap loader suggests the image data in the BMP file was compressed using RLE, Huffman, JPEG, PNG or 16-bit (565) encoding. L3DT's importer does not support these modes, only 24/32-bit colour, 256 indexed colour, or 16-bit greyscale (for heightfields only). I probably won't add support for these other (relatively rare) compression modes, but I have updated the plugin to throw more descriptive errors when such files are encountered.

I would expect that if you load the bitmap in an image editor program such as PhotoShop and then re-save it in 24-bit RGB mode, it will load correctly in L3DT.

Code: Select all
L3DTio_FI::LoadMapFile error
- Error loading image


The error message from the JPEG loader is less descriptive, but what it means is that the image was too large to load into a single contiguous block of memory. The 3rd party image library used by the JPG/PNG plugin attempts to load the whole image into a single block of memory, and this will fail if the operating system doesn't have a sufficiently large contiguous block of memory available due to memory exhaustion or fragmentation. To fix this I need to write my own JPEG loader that uses non-contiguous memory, as was done with the bitmap plugin. This is on the dev plan.

Cheerio,
Aaron.

* However, if you want to view the terrain in the 3D viewer you should ensure that the texture/heightfield size ratio is an integral power of two (1, 2, 4, 8, etc.)
User avatar
Aaron
Site Admin
 
Posts: 3696
Joined: Sun Nov 20, 2005 2:41 pm
Location: Melbourne, Australia


Return to Help and support

Who is online

Users browsing this forum: No registered users and 10 guests

cron