aboutsummaryrefslogtreecommitdiff
path: root/src/render.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/render.c')
-rw-r--r--src/render.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/render.c b/src/render.c
index a51e093..2a81d8d 100644
--- a/src/render.c
+++ b/src/render.c
@@ -269,8 +269,19 @@ static int render_model_instance_draw(ModelInstance *instance, Uint32 t, RenderC
/* Set specular colour and shininess if required */
if ( p->attribs & ATTRIB_SHINY ) {
- GLfloat white[] = {1.0, 1.0, 1.0, 1.0};
- glMaterialfv(GL_FRONT, GL_SPECULAR, white);
+ GLfloat spec[4];
+ if ( p->attribs & ATTRIB_COLSPEC ) {
+ spec[0] = p->colspec;
+ spec[1] = p->colspec;
+ spec[2] = p->colspec;
+ spec[3] = 1.0;
+ } else {
+ spec[0] = 1.0;
+ spec[1] = 1.0;
+ spec[2] = 1.0;
+ spec[3] = 1.0;
+ }
+ glMaterialfv(GL_FRONT, GL_SPECULAR, spec);
glMaterialf(GL_FRONT, GL_SHININESS, p->shininess);
shaderutils_setunf(r->lighting_program, "shininess", p->shininess);
shaderutils_setunf(r->fill_program, "shininess", p->shininess);