Argh, your argument about losing color profiles is still incorrect. PNG supports color profiles. At any rate your image software will set the color profile correctly on export. Besides, if you're designing screen graphics in CMYK color space you're doing it wrong. It sounds like an argument for no real purpose because for all
practical reasons PNG is lossless. Arguments about performance differences need to be backed up by figures or I simply don't believe them. PNG has no verified drawbacks over TGA or TIF for use in Spring, end of story until you prove otherwise.
Argh wrote:I know Spring's ripping DDS, but I'm not sure about how it's shoveling that into the GPU.
with glCompressedTexImage2DARB() (run once for each mip level).
By default all s3o with
non-dds texture have mipmaps generated for them:
Code: Select all
CBitmap bm;
if (!bm.Load(string("unittextures/"+tex1)))
throw content_error("Could not load S3O texture from file unittextures/" + tex1);
tex.tex1 = bm.CreateTexture(true);
The true flag passed to CreateTexture enables the mipmapping. Then in the CreateTexture function:
Code: Select all
if(mipmaps)
{
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_LINEAR);
glBuildMipmaps(GL_TEXTURE_2D,GL_RGBA8 ,xsize, ysize,GL_RGBA, GL_UNSIGNED_BYTE, mem);
}
then in glBuildMipmaps:
Code: Select all
void glBuildMipmaps(const GLenum target,GLint internalFormat,const GLsizei width,const GLsizei height,const GLenum format,const GLenum type,const void *data)
{
if (gu->compressTextures) {
switch ( internalFormat ) {
case 4:
case GL_RGBA8 :
case GL_RGBA : internalFormat = GL_COMPRESSED_RGBA_ARB; break;
case 3:
case GL_RGB8 :
case GL_RGB : internalFormat = GL_COMPRESSED_RGB_ARB; break;
case GL_LUMINANCE: internalFormat = GL_COMPRESSED_LUMINANCE_ARB; break;
}
}
// create mipmapped texture
/* if (!gu->atiHacks && glGenerateMipmapEXT_NONGML) { // broken on ATIs and NVs (wait for their OpenGL3.0 drivers :/)
// newest method
glTexImage2D(target, 0, internalFormat, width, height, 0, format, type, data);
glGenerateMipmapEXT(target);
}else*/
if (GLEW_VERSION_1_4) {
// This required GL-1.4
// instead of using glu, we rely on glTexImage2D to create the Mipmaps.
glTexParameteri(target, GL_GENERATE_MIPMAP, GL_TRUE);
glTexImage2D(target, 0, internalFormat, width, height, 0, format, type, data);
} else
gluBuild2DMipmaps(target, internalFormat, width, height, format, type, data);
}
In short, as long as gu->compressTextures is true and the user enabled texture compression:
Then ALL textures are compressed (S3TC) and use mip-mapping. If there really are quality differences then yeah, it's the compressor at fault. If your seeing higher than expected vram usage then it's your spring settings.
The actual texture conversion time is going to be dependent on the number of textures and the quality of your drivers. I suspect some of it is done in hardware. Would like to see some actual benchmarks.
Other than that I imagine there's no real drawback in terms of game speed to using PNG,TIF,etc since it all eventually ends up in the same S3TC format (i think).
In my opinion creating mipmaps manually is a wate of time. Others may disagree but I don't see this feature as making DDS vastly superior to PNG. Again this largely depends of the quality of the mip-map generation and compression internal to Spring and OpenGL.