Misc fixes in the shaders
This commit is contained in:
parent
9c1be217f9
commit
f861f18a3f
1 changed files with 14 additions and 3 deletions
17
gl_bumpgf.c
17
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; i<shader->numstages; 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);
|
||||
}
|
||||
|
||||
/*************************
|
||||
|
|
Loading…
Reference in a new issue