Hard Light Productions Forums
Modding, Mission Design, and Coding => FS2 Open Tools => Topic started by: z64555 on October 17, 2015, 12:14:25 pm
-
After a short discussion between me and m|m on IRC, we've decided it might be a good idea to switch to using a different image library than DevIL, since it hasn't been well maintained has proven to be a bit difficult to get newer versions of MSVS situated to build it. There has been some work done on github for DevIL to try to get cmake rolling on it, so things may change for the better in the coming months.
What are some possible alternatives to DevIL?
Aside from image format decryption and loading, I'm not sure of what the needs of PCS2 is regarding image formats at this point in time, so a second question would be: What are the needs of PCS2 regarding image formats?
Ideally, the image library that we end up choosing will support cmake, or otherwise have a number of packages available for download that developers can choose to suit their particular build system.
-
PCS2 needs to read the most common texture formats. Right now, these would be DDS, TGA and PNG. Everything else, I feel, can be safely ignored.
-
No more love for 8-bit paletted PCX files? :(
The world has truly changed.
-
I guess we'd need those too for retail compatibility.
-
I guess we'd need those too for retail compatibility.
Yer FSPort will throw a ****storm if they cant do retail compattible
-
We can use libpng easily enough, and I've got specs to and experience with .PCX so those two formats shouldn't be a hassle.
Just now grabbed the spec of TGA, shouldn't be too difficult to implement, but a lib that's maintained by smarter folk than I would be preferable. :)
So, that just leaves DDS. Doesn't OpenGL provide some sort of import lib for that?
[EDIT]I've been eyeing up the stb library (which is C) and one of its derivatives Cimg (which is C++ templates) and they seem like they're hassle free-ish at a first glance.
-
I looked for a DDS reading library before but I couldn't find anything good so I wrote one myself: https://github.com/asarium/libddsimg
-
What about Nvidia's texture tools? https://code.google.com/p/nvidia-texture-tools/ (https://code.google.com/p/nvidia-texture-tools/)
-
Why not libSDL_Image?
-
:bump:
So we're getting back to PCS2. Has anybody checked on the image libraries lately? I got sidetracked by life... :nervous:
-
Ok, so. I'm going to try giving wxWidget's libraries a shot, since it already comes with loaders that'll cover the bulk of the required image types, excluding DDS. I'm thinking we'll give m|m's loader a chance once the other formats can load up readily, although I'm not quite sure at this moment how that'll end up looking like when it comes time to shoehorn it in.
Texture loading process is basically:
1. Find texture. It's either a loose texture or it's inside of a VP somewhere.
2. Import the texture into a buffer.
3. Bind the buffered texture to OpenGL and save its index.
-
My DDS loader currently only support the compressed formats but not the raw RGB formats. If that's a problem then I could try adding that capability.
-
because I don't think anyone else mentioned it, why not ResIL (https://github.com/ScaledLizard/ResIL)? a fork of DevIL that has the added feature of being actively maintained!
should just be a drop in replacement I would think.
-
I have been working on a standalone C image loader library and so far it's working pretty well: https://github.com/asarium/imageloader
Currently it has support for DDS, PNG and the formats supported by stb_image (which includes TGA and JPEG) but it is plugin-based so a PCX plugin can be added later.
The code that handles texture uploads seems to be reasonable easy to work with. I'll try to convert it to use my library.
-
The PCX spec is real easy to do, I could make a plugin for ya.
-
I migrated the PCS2 build system to CMake which enables me to directly integrate imageloader and also unifies the build system across all platforms.
After doing that I replaced the DevIL loading code with code that uses imageloader and so far everything is working great:
(http://i.imgur.com/2YFZHha.png)