[Plib-devel] texture compression
Brought to you by:
sjbaker
From: <tia...@sa...> - 2006-01-10 16:51:34
|
Hello I was wondering if i or someone else can add texture compression support to plib, which i believe can be done without disrupting the current plib behaviour and with few files being affected. Below is my original post to the FlightGear devel list, with a quick hack patch. Currently we're still discussing this, so no further details, but if we go ahead with it, is it alright regarding plib? Thanks Cheers, Tiago *********************************************************************** *********************************************************************** Hello I'm having a HW problem and i can't enable AGP in linux, which makes the hunter, b1900d and the Nimitz lower FPSs dramatically, which i believe is caused by the NVRAM filling up with textures thus forcing texture transfers to the card (GF4 MX 440 64MB) so after Surge mentioned texture compression, i added it in plib, with amazing performance improvements in those situations, It also appears to be improving FPS in general in other situations. it doesn't check for the extension, **before trying**, check glxinfo for the presence of "EXT_texture_compression_s3tc" it's just an ugly hack, works for me and likely everyone else with s3tc, but it's bad code, i know, a brief explanation: http://www.digit-life.com/articles/reviews3tcfxt1/ spec: http://oss.sgi.com/projects/ogl-sample/registry/EXT/texture_compression_s3tc.txt i have no experience with patches, but here it is, against plib 1.8.4,for those interested. added one line, made one token change: diff -cr plib-1.8.4/src/ssg/ssgLoadTexture.cxx plib-1.8.4ext/src/ssg/ssgLoadTexture.cxx *** plib-1.8.4/src/ssg/ssgLoadTexture.cxx 2003-06-27 08:15:15.000000000 +0000 --- plib-1.8.4ext/src/ssg/ssgLoadTexture.cxx 2006-01-07 16:44:17.000000000 +0000 *************** *** 24,29 **** --- 24,30 ---- #include "ssgLocal.h" + #define PROXY_TEXTURES_ARE_BROKEN struct _ssgTextureFormat { *************** *** 161,167 **** total_texels_loaded += w * h ; glTexImage2D ( GL_TEXTURE_2D, ! map_level, zsize, w, h, FALSE /* Border */, (zsize==1)?GL_LUMINANCE: (zsize==2)?GL_LUMINANCE_ALPHA: (zsize==3)?GL_RGB: --- 162,168 ---- total_texels_loaded += w * h ; glTexImage2D ( GL_TEXTURE_2D, ! map_level, /*zsize*/ 0x83F3, w, h, FALSE /* Border */, (zsize==1)?GL_LUMINANCE: (zsize==2)?GL_LUMINANCE_ALPHA: (zsize==3)?GL_RGB: |