From f861f18a3fdb3fd0615d5ba80d5693447cc58759 Mon Sep 17 00:00:00 2001 From: cholleme <> Date: Sun, 16 Feb 2003 20:08:54 +0000 Subject: [PATCH] Misc fixes in the shaders --- gl_bumpgf.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/gl_bumpgf.c b/gl_bumpgf.c index d2e05b6..bdf7225 100644 --- a/gl_bumpgf.c +++ b/gl_bumpgf.c @@ -429,7 +429,7 @@ void GF3_SetupSimpleStage(stage_t *s) { GF3_SetupTcMod(&s->tcmods[i]); } - if (s->src_blend > 0) { + if (s->src_blend > -1) { glBlendFunc(s->src_blend, s->dst_blend); glEnable(GL_BLEND); } @@ -562,6 +562,11 @@ void GF3_drawTriangleListBase (vertexdef_t *verts, int *indecies, int numIndecie glTexCoordPointer(2, GL_FLOAT, verts->texcoordstride, verts->texcoords); glEnableClientState(GL_TEXTURE_COORD_ARRAY); + if (!shader->cull) { + glDisable(GL_CULL_FACE); + //Con_Printf("Cullstuff %s\n",shader->name); + } + for (i=0; inumstages; i++) { GF3_SetupSimpleStage(&shader->stages[i]); glDrawElements(GL_TRIANGLES,numIndecies,GL_UNSIGNED_INT,indecies); @@ -569,7 +574,7 @@ void GF3_drawTriangleListBase (vertexdef_t *verts, int *indecies, int numIndecie } glMatrixMode(GL_MODELVIEW); - if (verts->colors) { + if (verts->colors && (shader->flags & SURF_PPLIGHT)) { glColorPointer(3, GL_UNSIGNED_BYTE, verts->colorstride, verts->colors); glEnableClientState(GL_COLOR_ARRAY); @@ -601,16 +606,22 @@ void GF3_drawTriangleListBase (vertexdef_t *verts, int *indecies, int numIndecie glDrawElements(GL_TRIANGLES,numIndecies,GL_UNSIGNED_INT,indecies); glDisableClientState(GL_COLOR_ARRAY); - } else { + } else if (shader->flags & SURF_PPLIGHT) { glColor3f(0,0,0); glDisable(GL_TEXTURE_2D); glDrawElements(GL_TRIANGLES,numIndecies,GL_UNSIGNED_INT,indecies); glEnable(GL_TEXTURE_2D); } + if (!shader->cull) { + glEnable(GL_CULL_FACE); + //Con_Printf("Cullstuff %s\n",shader->name); + } + glDisableClientState(GL_TEXTURE_COORD_ARRAY); glDisableClientState(GL_VERTEX_ARRAY); glDisable(GL_BLEND); + glDisable(GL_ALPHA_TEST); } /*************************