mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-26 22:31:05 +00:00
More of my experimental GL lighting tweaks.
This commit is contained in:
parent
9cd16b8dfd
commit
1fe06c326b
2 changed files with 11 additions and 3 deletions
|
@ -592,8 +592,8 @@ R_DrawAliasModel (entity_t *e)
|
||||||
qfglLightfv (gl_light, GL_DIFFUSE, color);
|
qfglLightfv (gl_light, GL_DIFFUSE, color);
|
||||||
qfglLightfv (gl_light, GL_SPECULAR, color);
|
qfglLightfv (gl_light, GL_SPECULAR, color);
|
||||||
qfglLightf (gl_light, GL_QUADRATIC_ATTENUATION,
|
qfglLightf (gl_light, GL_QUADRATIC_ATTENUATION,
|
||||||
5.0 / (l->radius * l->radius));
|
1.0 / (l->radius * l->radius));
|
||||||
qfglLightf (gl_light, GL_CONSTANT_ATTENUATION, 0.5);
|
// qfglLightf (gl_light, GL_CONSTANT_ATTENUATION, 0.5);
|
||||||
used_lights++;
|
used_lights++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -430,6 +430,7 @@ CheckVertexArraySize (void)
|
||||||
static void
|
static void
|
||||||
CheckLights (void)
|
CheckLights (void)
|
||||||
{
|
{
|
||||||
|
int i;
|
||||||
float dark[4] = {0.0, 0.0, 0.0, 1.0},
|
float dark[4] = {0.0, 0.0, 0.0, 1.0},
|
||||||
// light[4] = {1.0, 1.0, 1.0, 1.0},
|
// light[4] = {1.0, 1.0, 1.0, 1.0},
|
||||||
specular[4] = {0.6, 0.6, 0.6, 1.0};
|
specular[4] = {0.6, 0.6, 0.6, 1.0};
|
||||||
|
@ -442,8 +443,15 @@ CheckLights (void)
|
||||||
qfglLightModelf (GL_LIGHT_MODEL_TWO_SIDE, 0.0);
|
qfglLightModelf (GL_LIGHT_MODEL_TWO_SIDE, 0.0);
|
||||||
// Set up material defaults
|
// Set up material defaults
|
||||||
qfglMaterialf (GL_FRONT, GL_SHININESS, 1.0);
|
qfglMaterialf (GL_FRONT, GL_SHININESS, 1.0);
|
||||||
// qfglMaterialfv (GL_FRONT, GL_AMBIENT_AND_DIFFUSE, light);
|
|
||||||
qfglMaterialfv (GL_FRONT, GL_SPECULAR, specular);
|
qfglMaterialfv (GL_FRONT, GL_SPECULAR, specular);
|
||||||
|
// qfglMaterialfv (GL_FRONT, GL_AMBIENT_AND_DIFFUSE, light);
|
||||||
|
|
||||||
|
for (i = 0; i < gl_max_lights; i++) {
|
||||||
|
qfglEnable (GL_LIGHT0 + i);
|
||||||
|
qfglLightf (GL_LIGHT0 + i, GL_CONSTANT_ATTENUATION, 0.0);
|
||||||
|
qfglDisable (GL_LIGHT0 + i);
|
||||||
|
}
|
||||||
|
|
||||||
qfglDisable (GL_LIGHTING);
|
qfglDisable (GL_LIGHTING);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue