diff options
author | taw27 <taw27@84d2e878-0bd5-11dd-ad15-13eda11d74c5> | 2008-08-10 19:14:40 +0000 |
---|---|---|
committer | taw27 <taw27@84d2e878-0bd5-11dd-ad15-13eda11d74c5> | 2008-08-10 19:14:40 +0000 |
commit | 9836d52cebef33002b8cea7d2e15d4e0da043e76 (patch) | |
tree | be29c88526015ce27b8c480b4ce79c2b5a038ab2 /src/render.c | |
parent | 98315c0a86e2d8157e3aec73d532bb4c87860ed2 (diff) |
Process texture and Ks components from OBJ files
git-svn-id: svn://cook.msm.cam.ac.uk:745/thrust3d/thrust3d@246 84d2e878-0bd5-11dd-ad15-13eda11d74c5
Diffstat (limited to 'src/render.c')
-rw-r--r-- | src/render.c | 15 |
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); |