Shadoh Posted April 6, 2014 Share Posted April 6, 2014 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 Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted April 7, 2014 Share Posted April 7, 2014 Remember that the terrain you create in the editor needs to be of the same size as the heightmap you are going to import. If you create a terrain of 256 x 256 and you try to import a 1024 x 1024 raw file, it is not going to work. Quote Link to comment Share on other sites More sharing options...
Rastar Posted April 7, 2014 Share Posted April 7, 2014 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. Quote Link to comment Share on other sites More sharing options...
Shadoh Posted April 8, 2014 Author Share Posted April 8, 2014 ok, I'll look in to it, if I come up with something I'll share Quote Link to comment Share on other sites More sharing options...
Shadoh Posted April 9, 2014 Author Share Posted April 9, 2014 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. 1 Quote Link to comment Share on other sites More sharing options...
Shadoh Posted April 10, 2014 Author Share Posted April 10, 2014 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 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.