PnP TerrainCreator - Forum

The PnP TerrainCreator Forum
It is currently Thu Sep 21, 2017 1:15 am

All times are UTC




Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: what's in the header of bmp export (raw)
PostPosted: Mon Sep 07, 2009 2:34 am 
Offline

Joined: Fri Aug 28, 2009 4:01 am
Posts: 7
I export the texture as bmp with the raw format. It take me a whole day to find out that there are 14 bytes header in the raw file.

So what's the format of the raw file header?

Thanks


Top
 Profile  
 
 Post subject: Re: what's in the header of bmp export (raw)
PostPosted: Mon Sep 07, 2009 8:41 am 
Offline
Programmierdochfix
User avatar

Joined: Tue Apr 27, 2004 12:53 pm
Posts: 891
Location: Braunschweig
Well... to be honest... I don't know what's in the header of the RAW bitmap format. It is written by the DevIL lib.

If you want to have a plain RAW file format. use the "Heightmap to RAW" exporter instead.
This exporter also gives you full control over the data format to be written.


Top
 Profile  
 
 Post subject: Re: what's in the header of bmp export (raw)
PostPosted: Tue Sep 08, 2009 2:30 am 
Offline

Joined: Fri Aug 28, 2009 4:01 am
Posts: 7
Thanks for the information. I read the related devil library code and found

Width (4 bytes)
Height (4 bytes)
Depth (4 bytes)
Bytes per Pixels (1 byte)
Bytes per Color Channel (1 byte)

for a 64 x 64 RGBA raw, you'll get

64, 64, 1, 4, 1

But I'm not quite sure what's the meaning of depth in this header. It seems to be different to the normal one. It would be nice if you can clarify me on that.

Thanks


Top
 Profile  
 
 Post subject: Re: what's in the header of bmp export (raw)
PostPosted: Tue Sep 08, 2009 2:39 am 
Offline

Joined: Fri Aug 28, 2009 4:01 am
Posts: 7
I think I know the meaning of depth now.

This raw format should also support 3d images.

So the width=x, height=y, depth=z

Thanks


Top
 Profile  
 
 Post subject: Re: what's in the header of bmp export (raw)
PostPosted: Tue Sep 08, 2009 7:27 am 
Offline
Programmierdochfix
User avatar

Joined: Tue Apr 27, 2004 12:53 pm
Posts: 891
Location: Braunschweig
Yes, you are surely right; depth in this context is usually the third dimension of a 3D texture.

As I said...if you just want to have raw height data, you should use the other exporter (Heightmap to RAW), as it gives you more control over the exported data format.

You can for example directly export float values, so you will have no loss in precision/resolution. With all the bitmap formats, you will have an integer conversion, which results in loss of data/precision.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron