Here's a fun waste of time i've been having to get some obscure 1997 killed-by-3dfx card to work.
PCX1/2 have no blendFunc. It always blends
everything as an alpha whether you like it or not. To 'simulate'
how a PCX2 behaves, just have this in GL_State
default:
dstFactor = GL_ONE; // to get warning to shut up
ri.Error( ERR_DROP, "GL_State: invalid dst blend state bits\n" );
break;
}
srcFactor = GL_SRC_ALPHA; dstFactor = GL_ONE_MINUS_SRC_ALPHA; } // for pvr debug only!
qglEnable( GL_BLEND );
qglBlendFunc( srcFactor, dstFactor );
}
else
{
qglDisable( GL_BLEND );
}
}
I'm currently hacking in a weird method to force control alpha channels on textures. However, this is difficult as shaders are read in sequence. Right now my current method is an 'alphahack' command like
thisisashader
{
cull disable
{
//PCXHACK alphahack add // Generate alpha channel from averaging RGB
map models/weapons2/thisisagun/bang.jpg
blendFunc add
}
}
For more compatibility i'd like to parse blendFunc add
BEFORE THE TEXTURE GETS UPLOADED so I can tell the Upload32 function that this texture is used in a fashion where it is blended additively so it can generate an alpha channel for a card that doesn't support it. I actually already did the parts of generating/demoting alphas, etc by telling it with the alphahack command (where it would then be marked in a new field in texture_t, in the bundle, and be carried all the way to upload32). I just can't seem to do any shader pre-parsing to get a lot of the existing work cut out.
I'll post a diff later, as it's currently a mess. It also appears IoQ3 got rid of the whole GLHW_ detection and compatibility mode setting for some dumb reason, along with r_glDriver (which is necessary for pointing to minigl wrappers)
it's also possible that this work can lead to optimizing the game for a "fast-and-dirty" software renderer, if there's anyone ever brave enough to make one. Doing these PCX2 hack fixes makes me want to do Mystique hack fixes (adjust alpha threshhold, GT0'ing everything) and Rage hack fixes (GT128ing everything, additiving a few alphas).
I have a lot of faith in getting this card to work good. I've compared performance of Angelyss's highest LOD (13fps) to OA3's Sorceress' highest LOD (31fps), at 1024x768x16 with r_drawworld 0 so the future is certainly looking bright for performance.