Hello, this is my very first post to this forum so please be gentle if this all sounds terribly basic!
I'm attempting to import 3ds model meshes into the FlightGear flight simulation environment (version 0.9.10 to be exact). The 3ds meshes are coming across OK but the textures are not. The "stock" textures included with the 3ds are JPGs. However, FlightGear appears to want to use RGB format which from my basic reading is very low-level. The error message I get from FlightGear suggested to me to install ImageMagick and use it to convert the JPGs to RGB. Which I dutifully did !
I used the CONVERT command to create an RGB version of one of the JPGs as a test. However, when I now re-launch FG it eventually triggers a FATAL ERROR when it attempts to use this new RGB file. The exact error message is: Unrecognized magic number 0x6ec5.
If anyone here already has experience doing this (i.e. creating FG-compliant RGB) I would appreciate any advice or help.
Cheers and thanks in advance,
Jon
Converting textures to RGB for use in FlightGear?
-
- Posts: 3
- Joined: 2013-07-18T10:09:36-07:00
- Authentication code: 6789
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Converting textures to RGB for use in FlightGear?
Does FG give any specifications for what it means by RGB. Is that raw pixel format or does it mean it wants a non-compressed 24-bit RGB format such as png or tiff?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Converting textures to RGB for use in FlightGear?
according to http://wiki.flightgear.org/File_Formats
rgb format is SGI Image Format
"FlightGear uses plib to read SGI images. They must not use 16 bits per plane and must have side lengths of 2nx2m (powers of 2), the size must be at least 4 pixels when using compressed textures (automatic feature in the osg branch). For example: 64x64, 256x256 or 128x2048 (but textures have square size inside the graphic card so a 16x1024 texture is really a 1024x1024 texture). Note that other sizes will not work, and FlightGear will use a red/white chequered texture instead! FlightGear textures shall be RLE-compressed, and as 'aggressively' as possible."
So in IM
convert your .jpg images to the correct size and output to .sgi
see http://www.imagemagick.org/script/formats.php
rgb format is SGI Image Format
"FlightGear uses plib to read SGI images. They must not use 16 bits per plane and must have side lengths of 2nx2m (powers of 2), the size must be at least 4 pixels when using compressed textures (automatic feature in the osg branch). For example: 64x64, 256x256 or 128x2048 (but textures have square size inside the graphic card so a 16x1024 texture is really a 1024x1024 texture). Note that other sizes will not work, and FlightGear will use a red/white chequered texture instead! FlightGear textures shall be RLE-compressed, and as 'aggressively' as possible."
So in IM
convert your .jpg images to the correct size and output to .sgi
see http://www.imagemagick.org/script/formats.php
-
- Posts: 3
- Joined: 2013-07-18T10:09:36-07:00
- Authentication code: 6789
Re: Converting textures to RGB for use in FlightGear?
Thanks for the very thorough reply. I will try this technique right now.
Once in *.sgi format I assume I'd rename to *.rgb? I notice that all of the (working) textures in FG are *.rgb.
I'll reply again once I've tried all this.
Cheers,
Jon
Once in *.sgi format I assume I'd rename to *.rgb? I notice that all of the (working) textures in FG are *.rgb.
I'll reply again once I've tried all this.
Cheers,
Jon
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Converting textures to RGB for use in FlightGear?
I presume you do not need to rename the suffix from that article.
But you can try both ways.
According to IM http://www.imagemagick.org/script/formats.php
SGI RW Irix RGB image
so .sgi is and SGI Irix RGB image
But you can try both ways.
According to IM http://www.imagemagick.org/script/formats.php
SGI RW Irix RGB image
so .sgi is and SGI Irix RGB image
-
- Posts: 3
- Joined: 2013-07-18T10:09:36-07:00
- Authentication code: 6789
Re: Converting textures to RGB for use in FlightGear?
The conversion from JPG and PNG to SGI worked well. I used PAINT to resize a few JPGs which were of irregular size (i.e. to make sure they were some power of 2 dimensions, eg. 128x32, 128x128, 256x256).
Identify said the new SGIs were RGB but I renamed them with *.rgb extension anyways and FG was happy with this. My textures are now displaying OK.
Only Caveat was the single PNG source was a semi-transparent "metal railing" which came out as a black and white opaque texture but otherwise looks fine.
So I think this thread is resolved.
Identify said the new SGIs were RGB but I renamed them with *.rgb extension anyways and FG was happy with this. My textures are now displaying OK.
Only Caveat was the single PNG source was a semi-transparent "metal railing" which came out as a black and white opaque texture but otherwise looks fine.
So I think this thread is resolved.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Converting textures to RGB for use in FlightGear?
SGI format does support transparency. See ftp://ftp.sgi.com/graphics/grafica/sgiimage.html
This works fine for me
convert logo: -transparent white logo.sgi
convert logo.sgi logo.png
display logo.png
Try importing using .sgi suffix and see if that keeps the transparency. Otherwise, I suspect it is a FG limitation.
This works fine for me
convert logo: -transparent white logo.sgi
convert logo.sgi logo.png
display logo.png
Try importing using .sgi suffix and see if that keeps the transparency. Otherwise, I suspect it is a FG limitation.