Using PNG for a 3D game.

Started by
43 comments, last by Nathan Baum 18 years, 2 months ago
I want to decided on a primary image format that I can use for a 3D video game that I am developing. I've done some research and I'm leaning towards the PNG format since it is free of any patents, has lossless compression, and has a library for the format. Anyone have any suggestions or comments?
Advertisement
Go for it!
On the other hand, you might try using an image library (SDL_image, DevIL) that supports a lot of different fileformats so you gain a little more flexibility.
baumep
Hrm, I might do that, but as a primary image format do you think PNG would be a good choice?
Yes ;-)
baumep
Agreed.

Niko Suni

with all the pluses with PNG, it also means having to fuss with graphic compression. unless you're totally hellbent on lots of little graphics, or relatively few high-res / photo realism graphics, probably settle for a more moderate format. Well, thats if you had to pick just one... which of course you dont
|aaap.penopticon.com| My website, including game projects. Collaboration/comments are welcome, please visit :)
.PNG is the only format I ever use anymore for anything except photographs, which are usually .JPG (unless I'm looking for lossless, anyway).

As far as AAAP's post about "fussing with graphics compression", there are many free libraries out there for loading .PNGs, so you don't have to write them yourself (SDL_image for OpenGL, or the built in DirectX functions are a few).

Check out my new game Smash and Dash at:

http://www.smashanddashgame.com/

well ok, fair enough. I guess I havn't mentioned in this forum that I'm very much relentlessly opposed to using SDL in any project :o
|aaap.penopticon.com| My website, including game projects. Collaboration/comments are welcome, please visit :)
Quote:Original post by AAAP
well ok, fair enough. I guess I havn't mentioned in this forum that I'm very much relentlessly opposed to using SDL in any project :o


Why?

And yes, PNG is just fine. It's a very solid format that also stores alpha information (RGBA)

here are two methods
SDL + SDL_Image
glpng
_______________________"You're using a screwdriver to nail some glue to a ming vase. " -ToohrVyk
Usually, you want a format that allows artists to control the texture in quite some detail (compression, bit depth, MIP maps, etc) for your on-disk delivery format. PNG doesn't do so well there.

Similarly, you want as rich as possible a format for the source, so that you can go back and tweak certain layers of a texture. PNG is hopeless there, as it collapses everything to a single raster.

I use DDS for the delivery format, and PSD for the source format (because my graphics tool is Photoshop). DDS is not patent encumbered, is well described, and supports niceties like 3D textures, cube maps, built-in MIP maps, DXT compression, 16-bit textures, 32-bit textures, float textures, etc. It's very easy to parse, too, and the data is not, actually, DirectX specific.

enum Bool { True, False, FileNotFound };

This topic is closed to new replies.

Advertisement