# Documents/Illumination/Tutorial 13.xml

- ~~vec4~~ specularShininess;

+ float specularShininess;

const int NUMBER_OF_SPHERES = 4;

<emphasis>contains</emphasis> an array. We bind all of the materials to the

shader, and let the shader pick which one it wants as needed. The source code to do

this is pretty straightforward.</para>

- <para>Notice that the material <varname>specularShininess</varname> became a

- <type>vec4</type> instead of a simple <type>float</type>. This is due to an

- unfortunate bug in ATI's OpenGL implementation.</para>

<para>As for how the material selection happens, that's simple. In our case, we use the

primitive identifier. The <varname>gl_PrimitiveID</varname> value written from the

vertex shader is used to index into the <varname>Mtl.material[]</varname>

# Tut 13 Impostors/data/GeomImpostor.frag

-~~ vec4~~ specularShininess;~~ //ATI Array Bug fix. Not really a vec4.~~

+ float specularShininess;

const int NUMBER_OF_SPHERES = 4;

vec3 halfAngle = normalize(lightDir + viewDirection);

float angleNormalHalf = acos(dot(halfAngle, surfaceNormal));

- float exponent = angleNormalHalf / material.specularShininess~~.x; //ATI Array Bug fix. Not really a vec4.~~

+ float exponent = angleNormalHalf / material.specularShininess;

exponent = -(exponent * exponent);

float gaussianTerm = exp(exponent);