Lookup-Texture instead of pow causes strange gfx errors

Hello!

I’m trying to set up simple phong shading with diffuse and specular term.
Everthing looks nice and correct as long as I use pow(specular, exp) to calculate the specularvalue.
Screenshot

When using a texture as lookup table for specularity I get the same results with some strange sideeffects:

Dull spot where the brightest pixels should be:
Screenshot

Strange grey lines next to the real specular highlights:
Screenshot

Heres the lookup texture I use:
Specmap
Every exponent is stored in 5 lines in the texture to prevent the filter from fetching texels that don’t belong to the exponent the shader wants.
The values are calculated with a simple for-loop:

 
for(uint x = 0; x < width; ++x)
{
	double p = pow( (float)x / (float)width, power) * 255.0;
	line[x] = (uchar)p;
}
 

Heres the list of things I already tried which didn’t work:
o Enabling / Disabling Mipmaps
o Different wrapmodes CLAMP_TO_EDGE, CLAMP, REPEAT
o Different filtermodes (LINEAR, NEAREST)

My GLSL-shaders (comments are in german, but you are familiar with phong, right? :wink: ):
Vertexshader
Pixelshader

I added some if- and else-statements to doublecheck the shaderoutput:

color.rgb = vec3( texture2D(t_spec, vec2(specular,u_specular_exp)) );
if(color.r > 0.75)
{
	color.rgb = vec3(1.0, 0.0, 0.0);		
}
else
{
	if(specular >= 0.99)
		color.rgb = vec3(0.0, 1.0, 0.0);
}

The result:
Screenshot

This tells me that the specular term is calculated correctly (the place where the dull spot is, is colored green) but the values from the texture are smaller than 0.75. :stuck_out_tongue:

So the texture seems to be the problem, but it looks correct to me.
I tested the output by setting the S-coordinate to zero and slowly increased it up to 1.0.
As expected the color-values became bigger, no darker zones like in the dull spot.

I’m really confused.
What is this? A driver bug?
:stuck_out_tongue:

PS:
Geforce 6800 GT
1.5.2 NVIDIA 66.29 (Linux)

Ok, seems to be a driver bug.
The cards interpolates between the first and last pixel column.
When the first column is painted white all highlights are ok.

Can anyone from nvidia tell me what this is all about?
Is my card broken?