[SOLVED] ETM heightmap pixel format


14-02-2008 12:21:52

Hi guys.
I have one problem: When I try to use splattingManager.LoadMapFromImage method, to load my heightmap, program crashes and in the log is:
OGRE EXCEPTION(2:InvalidParametersException): Given image is of invalid pixel format. in CoverageMap::loadFromImage at .\src\ETSplattingManager.cpp (line 178)

When I use this heightmap with classic Terrain Scene Manager, everything is OK... Can you tell me which pixel format of heightmap I need and which program should I use to convert to this format?



14-02-2008 12:40:14

Well, what kind of pixel format is it? Unless I have overlooked something, it should accept any image format with 1 to 4 channels (RGBA) und 8 bits per channel. Can you provide any more information on file format and number of channels in it?


14-02-2008 12:55:01

It is a grayscale image (8-bit). I tried png and jpg.


14-02-2008 13:00:44

Hm, you could try and make it a 16bit grayscale image. For terrain quality considerations you probably want to use 16 bits, anyway.

There is a possibility I might have overlooked some possible pixel formats for single channel 8 bit formats, I'll have to double-check that.


14-02-2008 16:30:10

I found the problem. Heightmap must be loaded using TerrainInfo class.

Mogre.Image image = new Mogre.Image();
image.Load("..\\media\\terrain.png", "General");

TerrainInfo terrainInfo = new TerrainInfo();
TerrainInfo.LoadHeightmapFromImage(terrainInfo, image);


There was no problem with pixel format... :roll:
CABAListic thanks for your reply.