private void applyLightingContribution(int vIndex, float[] contribution) {
    float[] v = vertices[vIndex];

    v[R] = clamp(v[ER] + v[AR] * contribution[LIGHT_AMBIENT_R] + v[DR] * contribution[LIGHT_DIFFUSE_R]);
    v[G] = clamp(v[EG] + v[AG] * contribution[LIGHT_AMBIENT_G] + v[DG] * contribution[LIGHT_DIFFUSE_G]);
    v[B] = clamp(v[EB] + v[AB] * contribution[LIGHT_AMBIENT_B] + v[DB] * contribution[LIGHT_DIFFUSE_B]);
    v[A] = clamp(v[DA]);

    v[SPR] = clamp(v[SPR] * contribution[LIGHT_SPECULAR_R]);
    v[SPG] = clamp(v[SPG] * contribution[LIGHT_SPECULAR_G]);
    v[SPB] = clamp(v[SPB] * contribution[LIGHT_SPECULAR_B]);
    //v[SPA] = min(1, v[SPA]);

    v[BEEN_LIT] = 1;
  }