Don't mirror stuff when drawing the shadow maps and don't cast shadows on models for now.

git-svn-id: https://svn.eduke32.com/eduke32@1272 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
plagman 2009-03-27 11:39:10 +00:00
parent 5a843f0fd1
commit 1d2a7c2982

View file

@ -835,7 +835,7 @@ void polymer_drawsprite(int32_t snum)
bglTranslatef((float)(-xoff), (float)(yoff), 0.0f); bglTranslatef((float)(-xoff), (float)(yoff), 0.0f);
bglScalef((float)(xsize), (float)(ysize), 1.0f); bglScalef((float)(xsize), (float)(ysize), 1.0f);
bglPolygonOffset(0.0f, 0.0f); // bglPolygonOffset(0.0f, 0.0f);
break; break;
case 1: case 1:
ang = (float)((tspr->ang + 1024) & 2047) / (2048.0f / 360.0f); ang = (float)((tspr->ang + 1024) & 2047) / (2048.0f / 360.0f);
@ -846,8 +846,8 @@ void polymer_drawsprite(int32_t snum)
bglScalef((float)(xsize), (float)(ysize), 1.0f); bglScalef((float)(xsize), (float)(ysize), 1.0f);
prsectors[tspr->sectnum]->wallsproffset += 0.5f; prsectors[tspr->sectnum]->wallsproffset += 0.5f;
bglPolygonOffset(-prsectors[tspr->sectnum]->wallsproffset, /* bglPolygonOffset(-prsectors[tspr->sectnum]->wallsproffset,
-prsectors[tspr->sectnum]->wallsproffset); -prsectors[tspr->sectnum]->wallsproffset);*/
break; break;
case 2: case 2:
ang = (float)((tspr->ang + 1024) & 2047) / (2048.0f / 360.0f); ang = (float)((tspr->ang + 1024) & 2047) / (2048.0f / 360.0f);
@ -860,8 +860,8 @@ void polymer_drawsprite(int32_t snum)
inbuffer = horizsprite; inbuffer = horizsprite;
prsectors[tspr->sectnum]->floorsproffset += 0.5f; prsectors[tspr->sectnum]->floorsproffset += 0.5f;
bglPolygonOffset(-prsectors[tspr->sectnum]->floorsproffset, /* bglPolygonOffset(-prsectors[tspr->sectnum]->floorsproffset,
-prsectors[tspr->sectnum]->floorsproffset); -prsectors[tspr->sectnum]->floorsproffset);*/
break; break;
} }
@ -1286,9 +1286,11 @@ static void polymer_displayrooms(int16_t dacursectnum)
cosviewingrangeglobalang = mulscale16(cosglobalang,viewingrange); cosviewingrangeglobalang = mulscale16(cosglobalang,viewingrange);
sinviewingrangeglobalang = mulscale16(singlobalang,viewingrange); sinviewingrangeglobalang = mulscale16(singlobalang,viewingrange);
display_mirror = 1; if (mirrors[depth - 1].plane)
display_mirror = 1;
polymer_animatesprites(); polymer_animatesprites();
display_mirror = 0; if (mirrors[depth - 1].plane)
display_mirror = 0;
bglDisable(GL_CULL_FACE); bglDisable(GL_CULL_FACE);
drawmasks(); drawmasks();
@ -2688,7 +2690,7 @@ static void polymer_drawmdsprite(spritetype *tspr)
float sradius, lradius; float sradius, lradius;
char modellights[PR_MAXLIGHTS]; char modellights[PR_MAXLIGHTS];
char modellightcount; char modellightcount;
int32_t oldoverridematerial;
m = (md3model_t*)models[tile2model[Ptile2tile(tspr->picnum,sprite[tspr->owner].pal)].modelid]; m = (md3model_t*)models[tile2model[Ptile2tile(tspr->picnum,sprite[tspr->owner].pal)].modelid];
updateanimation((md2model_t *)m,tspr); updateanimation((md2model_t *)m,tspr);
@ -2706,6 +2708,9 @@ static void polymer_drawmdsprite(spritetype *tspr)
if (((tspr->cstat>>4) & 3) == 2) if (((tspr->cstat>>4) & 3) == 2)
ang -= 90.0f; ang -= 90.0f;
oldoverridematerial = overridematerial;
overridematerial &= ~prprogrambits[PR_BIT_SHADOW_MAP].bit;
bglMatrixMode(GL_MODELVIEW); bglMatrixMode(GL_MODELVIEW);
bglPushMatrix(); bglPushMatrix();
scale = (1.0/4.0); scale = (1.0/4.0);
@ -2960,6 +2965,8 @@ static void polymer_drawmdsprite(spritetype *tspr)
bglPopMatrix(); bglPopMatrix();
overridematerial = oldoverridematerial;
globalnoeffect=0; globalnoeffect=0;
} }
@ -3650,7 +3657,7 @@ static void polymer_prepareshadows(void)
overridematerial |= prprogrambits[PR_BIT_DIFFUSE_MAP].bit; overridematerial |= prprogrambits[PR_BIT_DIFFUSE_MAP].bit;
// to force sprite drawing // to force sprite drawing
depth++; mirrors[depth++].plane = NULL;
polymer_displayrooms(prlights[i].sector); polymer_displayrooms(prlights[i].sector);
depth--; depth--;