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)
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;
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);
/**
* 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
*