diff --git a/cogl/cogl-material-opengl.c b/cogl/cogl-material-opengl.c index d00d17e65..d1e52f204 100644 --- a/cogl/cogl-material-opengl.c +++ b/cogl/cogl-material-opengl.c @@ -507,14 +507,12 @@ _cogl_material_flush_color_blend_alpha_depth_state ( CoglMaterialLightingState *lighting_state = &authority->big_state->lighting_state; - /* FIXME - we only need to set these if lighting is enabled... */ - GLfloat shininess = lighting_state->shininess * 128.0f; - GE (glMaterialfv (GL_FRONT_AND_BACK, GL_AMBIENT, lighting_state->ambient)); GE (glMaterialfv (GL_FRONT_AND_BACK, GL_DIFFUSE, lighting_state->diffuse)); GE (glMaterialfv (GL_FRONT_AND_BACK, GL_SPECULAR, lighting_state->specular)); GE (glMaterialfv (GL_FRONT_AND_BACK, GL_EMISSION, lighting_state->emission)); - GE (glMaterialfv (GL_FRONT_AND_BACK, GL_SHININESS, &shininess)); + GE (glMaterialfv (GL_FRONT_AND_BACK, GL_SHININESS, + &lighting_state->shininess)); } if (materials_difference & COGL_MATERIAL_STATE_BLEND) diff --git a/cogl/cogl-material.c b/cogl/cogl-material.c index 981837228..c5896252d 100644 --- a/cogl/cogl-material.c +++ b/cogl/cogl-material.c @@ -239,6 +239,8 @@ _cogl_material_init_default_material (void) lighting_state->emission[2] = 0; lighting_state->emission[3] = 1.0; + lighting_state->shininess = 0.0f; + /* Use the same defaults as the GL spec... */ alpha_state->alpha_func = COGL_MATERIAL_ALPHA_FUNC_ALWAYS; alpha_state->alpha_func_reference = 0.0; @@ -3620,7 +3622,7 @@ cogl_material_set_shininess (CoglMaterial *material, g_return_if_fail (cogl_is_material (material)); - if (shininess < 0.0 || shininess > 1.0) + if (shininess < 0.0) { g_warning ("Out of range shininess %f supplied for material\n", shininess); diff --git a/cogl/cogl-material.h b/cogl/cogl-material.h index b72ca3273..989c8cedc 100644 --- a/cogl/cogl-material.h +++ b/cogl/cogl-material.h @@ -387,11 +387,12 @@ cogl_material_get_specular (CoglMaterial *material, /** * cogl_material_set_shininess: * @material: A #CoglMaterial object - * @shininess: The desired shininess; range: [0.0, 1.0] + * @shininess: The desired shininess; must be >= 0.0 * - * Sets the materials shininess, in the standard OpenGL lighting model, - * which determines how specular highlights are calculated. A higher - * @shininess will produce smaller brigher highlights. + * Sets the shininess of the material, in the standard OpenGL lighting + * model, which determines the size of the specular highlights. A + * higher @shininess will produce smaller highlights which makes the + * object appear more shiny. * * The default value is 0.0 *