Using PNG for a 3D game.

Started by
43 comments, last by Nathan Baum 18 years, 3 months ago
Another simple way to create an image with multibit alpha in Photoshop (or GIMP for all that):

1. Create a new image with transparent background.
2. Draw to your heart's full content.
3. Save the image as .TGA

If for any reason your Photoshop copy is broken and you can't create a transparent new image, replace step 1 with:

1.a Create a new image with default solid background.
1.c Create a new transparent layer.
1.b Delete the background layer.

All right Gaffa!
Hack my projects! Oh Yeah! Use an SVN client to check them out.BlockStacker
Advertisement
I hear you shouldn't use use compressed DDS textures as normal maps, because they will look awful. Uncompressed DDS textures will work fine, but these will be larger on the disk than PNG or JPEG textures (they'll be the same size in memory).

I'd recommend accepting BMP (ugh), GIF, PNG, JPEG and other formats widely supported in graphics programs for customizable graphics such as player skins, faces, GUI widgets, logos, or whatever makes sense for your game.

I'd also recommend using one of the many free image loading libraries to make this possible. DevIL, for example, supports most common formats including DDS.

I should note that whilst it is strictly true that DDS is not encumbered with patents, the various DXT compression codecs are. Via (the current owner of the patent) appears to be quite clandestine about their policy; Google reveals virtually nothing about what the patent actually covers, what the licensing fees are, or who is expected to pay them.
Quote:Original post by zedzeek
a couple of things, theyre not native to d3d but are an api independant fileformat thus can be equalibly usable with opengl.

DirectX supports DDS textures natively. DDS is native to DirectX. Both these statements seem reasonable to me. You may be confusing "native" with "magically unable to be used by any other library".
Quote:DirectX supports DDS textures natively. DDS is native to DirectX. Both these statements seem reasonable to me. You may be confusing "native" with "magically unable to be used by any other library".


thats incorrect, d3d doesnt support dds at all differently than any other format the d3dx utility library does have dds image loading routines though (i believe this is where youre getting confused)
taken from the ms website
"What file formats are supported by the D3DX image file loader functions?
The D3DX image file loader functions support BMP, TGA, JPG, DIB, PPM and DDS files."
following your reasoning then d3d also supports BMP, TGA, JPG, DIB, PPM natively as well or do u claim otherwise? ;) (smartass mode off)

What I meant by DDS being "native" format for D3D is that a DDS file is a Direct Draw Surface dumped on the disk and reloading it back to D3D isn't big deal for D3D. Of course, there is no reason why DDS couldn't be used elsewhere too.

Sorry for being inaccurate about the support for DDS file. I meant that older GPU's might have trouble with compressed formats. But as far as I understand, D3DX will try to convert unsupported surfaces to format supported by the GPU.

Cheers
Quote:Original post by zedzeek
following your reasoning then d3d also supports BMP, TGA, JPG, DIB, PPM natively as well or do u claim otherwise? ;) (smartass mode off)

Yes, it does. Any image format which DirectX is able to load without needing recourse to some external library is supported natively. Is there some problem with the word "native"?

This topic is closed to new replies.

Advertisement