RAW format on the heightmaps



Users browsing this forum: No registered users and 2 guests

Next topic
Previous topic
Post new topic Reply to topic  NeoAxis Forum Index » General » Feature Requests
Search for:
Author Message
Professional License
Professional License
User avatar

Joined: Mon Jul 07, 2008
Posts: 77
Location: Sweden
PostPosted: Fri Jun 18, 2010 8:00 am Post subject: RAW format on the heightmaps
Bottom of Page Back to top
Is it really, really, really, REALLY nessesary to have the heightmaps in RAW format. A bmp would be my choose. Easy, simple to use, bla, bla, bla,......
Got any good reasons for using RAW? :?

 
 Profile  
Moderator
Moderator
User avatar

Joined: Wed Nov 28, 2007
Posts: 1508
Location: Vancouver, British Columbia
Country: Canada (ca)
PostPosted: Fri Jun 18, 2010 8:15 am 
Bottom of Page Back to top
The RAW format is used because you don't need to the overhead of the BMP in general because it is not the image data we want but the color values that make up height of terrain itself.

Most converters can use BMP as source and you can convert this to a RAW format that is compatible with NeoAxis. I hope this helps you, here is also a link to a couple tutorials on creating custom heightmap from image.

Text Tutorial with Code:
http://www.neoaxisgroup.com/phpBB2/viewtopic.php?t=1729

Video Tutorial on Creating Heightmap:
http://www.neoaxisgroup.com/phpBB2/viewtopic.php?t=3878

PS> If you want to use BMP you could write importer program in MapEditor yourself for your project. Realize this functionality yourself for your projects and maybe share with others to improve NA :)

_________________
I'm NOT paid or work for NeoAxis. I only help moderate these boards. My opinions are not the opinions of NeoAxis Group LTD.
 
 Profile  
Unlimited License
Unlimited License
User avatar

Joined: Tue Sep 16, 2008
Posts: 1278
Location: Imatra
Country: Finland (fi)
PostPosted: Fri Jun 18, 2010 9:46 am 
Bottom of Page Back to top
Another way to see it is the terrain heightmap is not a texture and is never loaded into the GPU.

The reason to use them is because they can contain 16-bit grayscale images. This is a necessity for any landscape unless you are doing a sequel to the Tron.

Only bad thing I see in RAW files is that they are too dumb to know what they contain. Instead you have to type in it's width and height whenever you are opening it.

To get the 16-bit color grayscale, other viable candidates are .png, .dds and .tif
In my opinion if I have to choose from all these, I'd choose .raw for the heightmaps.

_________________
if(obj as PlayerCharacter is PlayerCharacter)
 
 Profile  
Professional License
Professional License
User avatar

Joined: Mon Jul 07, 2008
Posts: 77
Location: Sweden
PostPosted: Sat Jun 19, 2010 3:56 pm 
Bottom of Page Back to top
I know how to convert them and all that stuff. Its just that they are "#¤%%?. They are just a hassel that could be avoided and should be. The overhead can hardly affect the speed of a modern computer, and one bottelneck in the engine less.

Color c = m_Test.GetPixel(height, width);
PixelColor = c.R;


This is just my future request "Get rid of RAW format, and give us something easy to use."

Thank for replying and helping, I was just realy frustated with converting.

 
 Profile  
User avatar

Joined: Wed Apr 07, 2010
Posts: 248
PostPosted: Sat Jun 19, 2010 6:19 pm 
Bottom of Page Back to top
Raw is easy to use, that is why god invented Gimp ;)

_________________
"Gaming is a artform, when the gibs explode all over the screen, pure art!"
 
 Profile  

Joined: Sun May 02, 2010
Posts: 108
PostPosted: Sun Jun 20, 2010 11:15 am 
Bottom of Page Back to top
Most modern terrain generation software can export in .raw . I don't see a reason why we should get rid of it. Maybe adding new format support, but raw is fine.

 
 Profile  
Moderator
Moderator
User avatar

Joined: Wed Nov 28, 2007
Posts: 1508
Location: Vancouver, British Columbia
Country: Canada (ca)
PostPosted: Mon Nov 29, 2010 6:56 pm 
Bottom of Page Back to top
Dead rising aside maybe Map Editor could have option to import/convert image into a NA compatible RAW file?

I would imagine this being in the properties for HeightmapTerrain object simple button "Import Heightmap from Image..." loads a file open dialog or something like this.

Anyone else like the way that sounds?

_________________
I'm NOT paid or work for NeoAxis. I only help moderate these boards. My opinions are not the opinions of NeoAxis Group LTD.
 
 Profile  
Professional License
Professional License
User avatar

Joined: Sun Nov 25, 2007
Posts: 1112
PostPosted: Mon Nov 29, 2010 7:49 pm 
Bottom of Page Back to top
Personally I hate the raw format myself.. It really is a huge hassle to make the raw format.. And when it is made it is hard to find the right program that can open it.. I would much rather use the PNG format personally.. Or as said above bmp.. Anything is really better then raw imo.. Least with png and bmp you can open it without haveing the worry about problems.. And half the time when you open it in a paint program it still wont open right..

I personally think NA should be able to use several formats.. Because most other engines already does.. Like leadwerks, udk and others.. And that would atleast give NA more to be able to work with..

People who dont know how to make raw files that works with NA will have major trouble figgureing out how to make them.. I also agree with maxwolf, a importer for NA would be great.. Though personally I would rather be able to load most of the common height map files that there is.. Which is jpg, tga, png, raw, and bmp.. also dds.. Atleast that way if we want to change something it can be done easier in just about any paint program out there..

Without much hassle..

Also it would be nice to be able to load bigger height map sizes, 2048 and up..

_________________
Assault Knights:Reign of Steel
Donate to the Assault Knights project
 
 Profile  
Professional License
Professional License
User avatar

Joined: Mon Jul 07, 2008
Posts: 77
Location: Sweden
PostPosted: Thu Dec 02, 2010 9:30 am Post subject: Making .raw for NA
Bottom of Page Back to top
This works......

Code: Select all   Expand view
    private void TurntoRaw(Bitmap bmp)
        {
            int p = 0;
            int i;
            int m;
            //Converting Bmps back to raw Files
            byte[,] targetPixels = new byte[bmp.Width * bmp.Height, 2];
            //Fill the array
            for (m = 0; m < bmp.Height; m++)
            {
                for (i = 0; i < bmp.Width; i++)
                {
                    Color c = bmp.GetPixel(i, m);
                    targetPixels[p, 0] = 0;//  Channel 0
                    targetPixels[p, 1] = c.R;//Channel 1
                    p++;
                }
            }
            i = 0; p = 0;
            using (BinaryWriter bw = new BinaryWriter(File.Open(filePaths[3], FileMode.Create)))
            {
                //use a while statement here for every pixel
                for (i = 0; i < bmp.Width * bmp.Height; i++)
                {
                    bw.Write(targetPixels[i, 0]);//Channel 0
                    bw.Write(targetPixels[i, 1]);//Channel 1
                }
                bw.Close();
            }
            // Hole map NA
            using (BinaryWriter bw = new BinaryWriter(File.Open(filePaths[5], FileMode.Create)))
            {
                for (i = 0; i < (bmp.Width - 1) * (bmp.Height-1); i++)
                {
                    bw.Write(targetPixels[p, 0]);//Channel 0
                    p++;
                }
                bw.Close();
            }

        }

 
 Profile  
Unlimited License
Unlimited License
User avatar

Joined: Tue Sep 16, 2008
Posts: 1278
Location: Imatra
Country: Finland (fi)
PostPosted: Thu Dec 02, 2010 10:33 am 
Bottom of Page Back to top
Nice!
However .bmp files don't naturally support 16-bit channel information, but they can be done assigning a custom RGBAX scheme so the channel information is spread using multiple DWORDS.
Too bad tools such as Photoshop most probably don't understand them.

The main problem still stands that there are only very few file formats for heightmap data and from those .raw format is most handy.

Maybe .png support would be good because you don't need to know the contents yourself, but the compression / decompression times of .png can be bad for large heightmaps.
For if we ever get 2048x2048 size terrains or even larger you don't want to mess with formats where content needs to be interpreted on load.

 
 Profile  
Moderator
Moderator
User avatar

Joined: Wed Nov 28, 2007
Posts: 1508
Location: Vancouver, British Columbia
Country: Canada (ca)
PostPosted: Thu Dec 02, 2010 11:58 pm 
Bottom of Page Back to top
I would agree on RAW being the best format, what I meant was to take a PNG or BMP or whatever the user wants and attempt to convert this for use on the engine.

Example workflow:

1. Make new map
2. HeightmapTerrain added
3. Export Heightmap as image from MapEditor
4. Work on heightmap in 3rd party program (ex. L3DT)
5. Export heightmap noise to image from 3rd party program to PNG, BMP
6. Import image into MapEditor heightmap takes shape from imported image noise.

_________________
I'm NOT paid or work for NeoAxis. I only help moderate these boards. My opinions are not the opinions of NeoAxis Group LTD.
 
 Profile  
Unlimited License
Unlimited License
User avatar

Joined: Sat Dec 18, 2010
Posts: 455
Country: United States (us)
PostPosted: Sun Jan 13, 2013 3:17 am 
Bottom of Page Back to top
I would say .raw format isn't the best either. The program you use as an example creates new stuff fine (L3DT) but if you import a .raw file to it , so far as I can see you can't use it. The format is all wrong based on the .map s terrain that was made.

L3DT doesn't import it right as far as I can see, unless I am obviously doing something wrong.
With the NeoAxis1.3 updates you can modify the the terrains with almost any graphic file( totally awesome). (This means importing a heightmap to make the new terrain). The .map is in square format and the .raw shows up as a 45 degree 45 degree square of the original. Not right..

But the problem now is porting a .raw file to L3DT and being able to use it.L3DT doesn't import the .raw file right. again unless I am missing something. You are almost limited to painting the whole terrain yourself instead of using a fine program like L3DT. Just my opinion.

Maybe I am missing another way to figure this out. Someone will eventually let me know.

_________________
Ms3d Exporter
 
 Profile  

Joined: Thu Dec 22, 2011
Posts: 16
Country: Spain (es)
PostPosted: Sun Jan 13, 2013 12:14 pm 
Bottom of Page Back to top
You can paint the terrain using L3DT mask layers and after asigning them a texture on neoaxis to fill it. Perhaps i don't understant your problem but i worked in l3dt raw + layers without any problem....

 
 Profile  
Professional License
Professional License
User avatar

Joined: Sun Nov 25, 2007
Posts: 1112
PostPosted: Sun Jan 13, 2013 12:26 pm 
Bottom of Page Back to top
You need to import the file into l3dt as a png or bmp file ect. Do everything you want done in l3dt. Like textures and stuff. Then export the file from l3dt to the .raw format. From l3dt. I too had problems loading .raw files into l3dt. But if you import as png then let l3dt do the export of the .raw file and alpha maps it should work fine. Loading .raw files is not too great in l3dt. I don't even use l3dt for heightmap files any more. I just use it to export the alpha maps. I use another program for exporting raw files to Neo Axis. And also use it to export .ter files for l3dt to use. Ter files are much better to use in l3dt then pngs or bmp files. But either way use l3dt just for exporting terrain files. and colormaps and stuff.

_________________
Assault Knights:Reign of Steel
Donate to the Assault Knights project
 
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  NeoAxis Forum Index » General » Feature Requests

Jump to:  

Next topic
Previous topic
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


All times are UTC




Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group