Poll

Should glest support dds?

Yes
3 (60%)
No, because...
2 (40%)

Total Members Voted: 2

Voting closed: 11 December 2008, 15:45:22

Author Topic: Better pixmap support  (Read 9384 times)

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Better pixmap support
« on: 11 December 2008, 15:45:22 »
Wouldn't it be nice for glest to support some better compression image types? Such as jpg when alpha is not needed, and 32 bit png when alpha is required? I know that partial transparency is only possible in tga, but still...

EDIT// I know a better alternative to tga! DDS! DDS or Direct Draw Surface files are the same as TGA but with better compression. Normally used for DirectX models, they should work for this too.
What do you think, should glest allow more image types?
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

mictes

  • Guest
Re: Better pixmap support
« Reply #1 on: 11 December 2008, 15:49:44 »
I have much expirience with dds. I think it is not easy for new users to hanlde with this fileformat. But I totally agree:
Fileformats like .png could be very helpfull ! And what about animated gifs ? New ideas for GAE !

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: Better pixmap support
« Reply #2 on: 12 December 2008, 15:11:50 »
Animated GIFs would be sweet! Imagine a unit that has a color changing skin, or a glowing eyes that blink? Yes, GIF would be sweet, and it would be nice to have. Nothing is wrong with the tga, since it allows partial transparency, but it is just too large in filesize.

Quote from: "mictes"
I think it is not easy for new users to hanlde with this fileformat.
What do you mean? I think that if you change the xml when converting units from C:/Users/Owner/file.tga to file.dds it could work. All we need is support for it. Of course, it would be optional, but it could save a lot of time... Notice how *.x models can have dds or tgas for textures. Same could be for *.g3d!
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

modman

  • Guest
Re: Better pixmap support
« Reply #3 on: 14 December 2008, 22:47:48 »
I think it would be great in theory, but in reality, nobody is going to make a mod with a .dds skin--it'll take forever!
And if nobody is going to use it, then why bother code its availability?

mictes

  • Guest
Re: Better pixmap support
« Reply #4 on: 15 December 2008, 09:39:07 »
Why not ?
Please explain what you are "philosophising"...

modman

  • Guest
Re: Better pixmap support
« Reply #5 on: 16 December 2008, 04:03:22 »
Who's going to code it?
daniel.santos is way too busy fixing the particle proj bug.  Maybe a LONG term thing.

mictes

  • Guest
Re: Better pixmap support
« Reply #6 on: 16 December 2008, 13:00:28 »
Ah, that's the cause you voted "no", rigth ? Sorry, but are you crazy ?
That have nothing to do with daniel.santos , it is a good idea and I definetely agree with this!
And I can't imagine that this should be too hard for a pro like Daniel.

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: Better pixmap support
« Reply #7 on: 16 December 2008, 15:52:05 »
It is totally unneccesary. Now that I think about it, it would be better to just have GIF compatiblity. Imagine your fury of the tiki opening its mouth and blinking its eyes via gif. This is quite easy, and will work great! The problem is, most people have no idea how to animate GIFs. (Take frames and use something like Beneton Movie GIF to import the frames and then set a delay).
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

modman

  • Guest
Re: Better pixmap support
« Reply #8 on: 17 December 2008, 02:11:55 »
GIF yes.  I like that.  But dds?.... ::)
I like the fact that it would make a lot of animations so much easier.
(BTW Omega I could use some discussion help on Tuning Magic in the Mods forum.  I need fresh ideas.  It's becoming a two-way conversation.)

mictes

  • Guest
Re: Better pixmap support
« Reply #9 on: 17 December 2008, 10:25:20 »
Png is a must, too!
I prefer the portable network graphics format cause the good compression and everyone easily can edit and create them with every software! (BTW: Png have alpha-channel ability, too - of course  8) )

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: Better pixmap support
« Reply #10 on: 17 December 2008, 15:20:38 »
PNG is nice, and 32 bit png has good colours with alpha. However, while PNG has better compression, I just can't help but feel that DDS can do everything PNG can do and more (think partial transparency). Say, is all of this possible? Where's daniel?
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

@kukac@

  • Guest
Re: Better pixmap support
« Reply #11 on: 17 December 2008, 15:36:28 »
I think he is not reading General Discussion forums. We shall see.

hailstone

  • Local Moderator
  • Battle Machine
  • ********
  • Posts: 1,568
    • View Profile
Re: Better pixmap support
« Reply #12 on: 18 December 2008, 00:33:03 »
Is there a real problem with TGA?
Glest Advanced Engine - Admin/Programmer
https://sourceforge.net/projects/glestae/

mictes

  • Guest
Re: Better pixmap support
« Reply #13 on: 18 December 2008, 10:31:54 »
Yes of corse. Tga's filesize is very huge !
And with animated gifs we would have more possibilities.

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: Better pixmap support
« Reply #14 on: 18 December 2008, 15:55:19 »
The filesize is the only problem, and if allowed other formats, I could upload easier and from worse internet connections. However, if gif is implimented, animation can be done for stuff like mouths and etc;
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

hailstone

  • Local Moderator
  • Battle Machine
  • ********
  • Posts: 1,568
    • View Profile
Re: Better pixmap support
« Reply #15 on: 20 December 2008, 01:58:54 »
After some research I don't think GIF is a suitable format because it only has 256 16-bit colors, 1-bit alpha which I imagine would reduce the quality of the images in the game and I think there could be license issues with GIF too. I did find that PNG could be an alternative. DDS might also be possible, although it needs DirectX headers and might need hardware support that might alienate older hardware. Tiling can be added for animation.

This is interesting too on Blizzard's BLP format.
http://www.gamedev.net/community/forums ... _id=349893
http://en.wikipedia.org/wiki/.BLP

http://warp.povusers.org/grrr/PNGvsGIF/
http://forums.sun.com/thread.jspa?threadID=359366
http://www.ttlg.com/forums/showthread.php?p=1798554
http://en.wikipedia.org/wiki/Comparison ... le_formats
http://paleo.org/BKsamples/

Coding links:
http://www.codeguru.com/cpp/g-m/bitmap/ ... php/c1691/
http://en.wikipedia.org/wiki/DirectDraw_Surface
http://msdn.microsoft.com/en-us/library/bb943990(VS.85).aspx
http://www.gamedev.net/community/forums ... _id=488919
Glest Advanced Engine - Admin/Programmer
https://sourceforge.net/projects/glestae/

mictes

  • Guest
Re: Better pixmap support
« Reply #16 on: 20 December 2008, 09:34:01 »
Yes, but Png can't be animated. I prefer from this view png, too - but the idea behind was that it could be easier to "animate" some parts of models.
Does anyone know other fileformats that could be animated ?

hailstone

  • Local Moderator
  • Battle Machine
  • ********
  • Posts: 1,568
    • View Profile
Re: Better pixmap support
« Reply #17 on: 21 December 2008, 10:06:52 »
I know of games using sprite sheets for animated images but there might be performance issues using it on a model and it would increase the size and complexity.
Glest Advanced Engine - Admin/Programmer
https://sourceforge.net/projects/glestae/

mictes

  • Guest
Re: Better pixmap support
« Reply #18 on: 21 December 2008, 10:23:13 »
No, sprites are soooo outdated. I think when playing glest with its 36 units - and them all animated by sprites - my cpu will get melted...  ::)

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: Better pixmap support
« Reply #19 on: 21 December 2008, 21:44:24 »
Of course GIF can only hold 256 colors. 8-bit PNG can only hold that much too. Same for bitmap and many formats. Only JPG, newer formats of PNG, BMP, TGAs, and DDS can hold these extra colors. JPG has the best compression for holding any colors, but has no support for alpha. GIF can only have 256 colors and only pure alpha. Which means we can have just the mouth of a model being GIF for example. Lets pretend that we are animating the fury of the tiki for dark magic. We want to have the mouth open and close, and that mouth is quite large. We would have a normal model, with a single sided plane on the front. That plane would be linked to a gif texture, and it would have a mouth surrounded by alpha (so that we can see everything around). Now the only problem is the fact that most people can't make GIFs.

Its quite easy. Just manually create two frames, one with an open mouth, one with a closed mouth. Now use a program such as BMG to make it into an animated gif.

Other option: AVI clips could be used, but that could easily be harder to use, and would use tons of memory.
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: Better pixmap support
« Reply #20 on: 16 January 2009, 05:21:15 »
Ok, I've had some spare time to take a closer look at file formats sizes. Of all the popular formats, a sample picture gave me these outcomes:

  • JPG (100 quality) - 125 kb
  • JPG (80 quality) - 27.2 kb
  • PNG (32 bit) - 371 kb
  • BMP (24 bit) - 1.37 mb
  • DDS (DXT3 format) - 468 kb
  • TGA (uncompressed) - 1.37 mb
  • TIF - 552 kb
  • GIF (8 bit) - 178 kb

Of these, JPG has the smallest size and best quality, but cannot hold alpha. PNG can hold as many colours as JPG (as long as either 24 or 32 bit), but only the 8 and 32 can hold alpha and of that it is only pure alpha. BMP is useless, being the same size as a TGA, but with no alpha. DDS is far smaller than a TGA, can hold all the data a TGA can, including partial transparency, but it may be confusing, having a large number of versions, and being based for DirectX models. TIF is basically useless, being no better than JPG, and having bad compression. Finally, GIF can hold animation, but that will increase the size, and GIFs are limited to 256 colors. Dithering levels can be set to choose how the image looks with those limited colors though.

So the results are that JPG can get the most for file size when no alpha is needed, DDS can reduce the file size by a third when alpha is needed, GIF can have a very small file size as well, and can hold animation, but is only capable of 256 colors and 1 alpha.

UNTESTED:
  • MNG - It's a animation format, but I can't get my exporter to work, and it isn't very common, so...
  • RAW - Too big, totally useless, very incompatible, and few exporters
  • Software specific formats, such as XSF (the GIMP), PDN (Paint.NET), and PSD (Photoshop). Naturally, they aren't very compatible

I still stand by my decision that animated GIFs should be implimented. DDS is optional, and since my programming skills are very basic, I don't know how difficult that would be (would need to check DirectX SDK). However, DDS would reduce filesize nicely. While we're at it, might as well improve the G3D format, but that's a topic for GAE.
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

modman

  • Guest
Re: Better pixmap support
« Reply #21 on: 17 January 2009, 03:25:47 »
What are you opening DDSs with?

mictes

  • Guest
Re: Better pixmap support
« Reply #22 on: 17 January 2009, 09:40:19 »
With Gimp and the specific plugin.
http://nifelheim.dyndns.org/~cocidius/dds/
« Last Edit: 17 January 2009, 09:45:46 by mictes »

wciow

  • Behemoth
  • *******
  • Posts: 968
    • View Profile
Re: Better pixmap support
« Reply #23 on: 18 January 2009, 00:53:23 »
Well it seems like DDS should be the new format. Basically the same as the current TGA but about 1/3 the size.
Check out my new Goblin faction - https://forum.megaglest.org/index.php?topic=9658.0

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: Better pixmap support
« Reply #24 on: 20 January 2009, 03:34:07 »
Paint.NET opens DDS. Also, DDS should not be the official format. Glest needs to be TGA compatible, but DDS can be an option to simplify things for modders. The DirectX SDK has more on the format. Basically, I wouldn't mind having .X compatiblity either (models) but thats a whole different topic (the plain text format of .x is handy, and it is extremely compatible, being the choice of many games).
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert