Alpha linear-filtered artifacts removed. Ditched the clean two-textures assembling process to just overwriting the fullbright texels (walls were in GL_ALWAYS and sprites are in LEQUAL). If any z-accuracy issues happen on fullbright pixels on sprites, I'll put it back.

git-svn-id: https://svn.eduke32.com/eduke32@246 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
Plagman 2006-07-23 16:03:43 +00:00
parent cf9f8a101c
commit 77b555a9c0

View file

@ -438,12 +438,9 @@ void gltexinvalidate (long dapicnum, long dapalnum, long dameth)
{ {
pth->flags |= 128; pth->flags |= 128;
if (pth->flags & 16) if (pth->flags & 16)
{
pth->wofb->flags |= 128;
pth->ofb->flags |= 128; pth->ofb->flags |= 128;
} }
} }
}
//Make all textures "dirty" so they reload, but not re-allocate //Make all textures "dirty" so they reload, but not re-allocate
//This should be much faster than polymost_glreset() //This should be much faster than polymost_glreset()
@ -458,11 +455,8 @@ void gltexinvalidateall ()
{ {
pth->flags |= 128; pth->flags |= 128;
if (pth->flags & 16) if (pth->flags & 16)
{
pth->wofb->flags |= 128;
pth->ofb->flags |= 128; pth->ofb->flags |= 128;
} }
}
clearskins(); clearskins();
#ifdef DEBUGGINGAIDS #ifdef DEBUGGINGAIDS
OSD_Printf("gltexinvalidateall()\n"); OSD_Printf("gltexinvalidateall()\n");
@ -489,6 +483,14 @@ void gltexapplyprops (void)
bglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,glfiltermodes[gltexfiltermode].min); bglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,glfiltermodes[gltexfiltermode].min);
if (glinfo.maxanisotropy > 1.0) if (glinfo.maxanisotropy > 1.0)
bglTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MAX_ANISOTROPY_EXT,glanisotropy); bglTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MAX_ANISOTROPY_EXT,glanisotropy);
if (pth->flags & 16)
{
bglBindTexture(GL_TEXTURE_2D,pth->ofb->glpic);
bglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,glfiltermodes[gltexfiltermode].mag);
bglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,glfiltermodes[gltexfiltermode].min);
if (glinfo.maxanisotropy > 1.0)
bglTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MAX_ANISOTROPY_EXT,glanisotropy);
}
} }
} }
@ -551,8 +553,6 @@ void polymost_glreset ()
next = pth->next; next = pth->next;
if (pth->flags & 16) // fullbright textures if (pth->flags & 16) // fullbright textures
{ {
bglDeleteTextures(1,&pth->wofb->glpic);
free(pth->wofb);
bglDeleteTextures(1,&pth->ofb->glpic); bglDeleteTextures(1,&pth->ofb->glpic);
free(pth->ofb); free(pth->ofb);
} }
@ -821,35 +821,21 @@ int gloadtile_art (long dapic, long dapal, long dameth, pthtyp *pth, long doallo
{ // regular texture { // regular texture
if ((dacol > 239) && (dacol != 255)) if ((dacol > 239) && (dacol != 255))
hasfullbright = 1; hasfullbright = 1;
if (dacol == 255) // translucent
{
wpptr->a = 0;
hasalpha = 1;
}
else
{
wpptr->a = 255; wpptr->a = 255;
dacol = (long)((unsigned char)palookup[dapal][dacol]);
}
} }
else if (fullbrightloadingpass == 1) else if (fullbrightloadingpass == 1)
{ // texture without fullbright areas
if (dacol > 239) { //fullbright colors and translucent
wpptr->a = 0; hasalpha = 1;
} else {
wpptr->a = 255;
dacol = (long)((unsigned char)palookup[dapal][dacol]);
}
}
else if (fullbrightloadingpass == 2)
{ // texture with only fullbright areas { // texture with only fullbright areas
if ((dacol < 240) || (dacol == 255)) { // regular colors and translucent if (dacol < 240) { // regular colors
wpptr->a = 0; hasalpha = 1; wpptr->a = 0; hasalpha = 1;
} else { // fullbright } else { // fullbright
wpptr->a = 255; wpptr->a = 255;
dacol = (long)((unsigned char)palookup[dapal][dacol]);
} }
} }
if (dacol != 255)
dacol = (long)((unsigned char)palookup[dapal][dacol]);
else {
wpptr->a = 0; hasalpha = 1;
}
if (gammabrightness) { if (gammabrightness) {
wpptr->r = curpalette[dacol].r; wpptr->r = curpalette[dacol].r;
wpptr->g = curpalette[dacol].g; wpptr->g = curpalette[dacol].g;
@ -901,13 +887,8 @@ int gloadtile_art (long dapic, long dapal, long dameth, pthtyp *pth, long doallo
if ((hasfullbright) && (!fullbrightloadingpass)) if ((hasfullbright) && (!fullbrightloadingpass))
{ {
// load the two textures that'll be assembled to make the final texture with fullbright pixels // load the ONLY texture that'll be assembled with the regular one to make the final texture with fullbright pixels
fullbrightloadingpass = 1; fullbrightloadingpass = 1;
pth->wofb = (pthtyp *)calloc(1,sizeof(pthtyp));
if (!pth->wofb) return 1;
if (gloadtile_art(dapic, dapal, dameth, pth->wofb, 1)) return 1;
fullbrightloadingpass = 2;
pth->ofb = (pthtyp *)calloc(1,sizeof(pthtyp)); pth->ofb = (pthtyp *)calloc(1,sizeof(pthtyp));
if (!pth->ofb) return 1; if (!pth->ofb) return 1;
if (gloadtile_art(dapic, dapal, dameth, pth->ofb, 1)) return 1; if (gloadtile_art(dapic, dapal, dameth, pth->ofb, 1)) return 1;
@ -1443,10 +1424,7 @@ void drawpoly (double *dpx, double *dpy, long n, long method)
if (indrawroomsandmasks) if (indrawroomsandmasks)
{ {
if (!fullbrightdrawingpass) if (!fullbrightdrawingpass)
{
pth = pth->wofb;
fullbrightdrawingpass = 1; fullbrightdrawingpass = 1;
}
else if (fullbrightdrawingpass == 2) else if (fullbrightdrawingpass == 2)
pth = pth->ofb; pth = pth->ofb;
} }