Jump to content

raw file import for terrain


Shadoh
 Share

Recommended Posts

Hi guys, anyone know how to convert a png to raw format for importing to Leadwerks?

I've tried the linux convert command, and it creates a Panasonic raw file, but this fails to import in to Leadwerks. Leadwerks does not give a reason other then

"Failed to load heightmap "/home/*****/Documents/Leadwerks/Projects/Terra.raw""

 

I've attached the original png, and the resulting raw file. (inside the zip file)

 

Check the bottom of the topic for a solution, if you have a grey-scale heightmap you want to convert to raw.

TestTerrain.zip

Link to comment
Share on other sites

I am not too familiar with the various raw formats (I think every manufacturer has one or even several variants containing some specific metadata). And I don't know if Leadwerks is able to skip this metadata. A "really raw" RAW file for heightmap import contains just the pixel values (only one channel) as floating point values (preferably is 16bit format, or two bytes per pixels). Maybe you can convert the file using Photoshop or a similar tool? Or you could write a little conversion routine.

Link to comment
Share on other sites

Hey, everyone I've almost finished an image (png, bmp, jpg) to raw (and back) file converter. It currently works on Windows, but is reading a blank image on linux, once I fix this bug, I'll give the source, and binaries.

  • Upvote 1
Link to comment
Share on other sites

ok done!

it's largely untested, I've been working extra hours the last couple of days, so if there's any bugs just post a reply here and I'll get on it as soon as I can. Or if you fix it yourself in the source, please let me know, so I can apply it! thanks!

 

I'll throw a copy in the tools section of my site too

 

on windows you can just drag the file on to the exe and it'll pop a raw file out right next to the image (or an image next to the raw). On linux just use the command line mono rawconv.exe [inputfile]

 

forgot to mention you need mono/.Net 2.0

 

Oh yeah, if it detects Cairo (included with mono) it'll use that to load the image file instead of System.Drawing, since I was having problems with System.Drawing on linux. But since most windows systems don't have Cairo, I've made it detect the assembly and load it at runtime, so windows users don't need to care.

rawconv.zip

rawconv_source.zip

  • Upvote 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...