Quote: "Can anyone cast some light on this"
I got the pun
Had a quick look.
You asked for specular hightlights so if you replace your calculations with the lines below they look okay, but ...well the rest ...seems do be a bit off
float intensity = max(0.0, dot(lightDirection, wNormal));
vec3 viewLightDir = normalize(view + lightDirection);
float rawSpecular = pow(max(0.0, dot(wNormal, viewLightDir)), specularPower);
specular += rawSpecular * intensity * specularLevel * lightColour[i] * attenuation;
vec3 lightDirection = (wPos - lightPosition[i].xyz);
Here you calculate the light
position from the lights point of view, you want it to be from the fragments point of view so switch the variables .
Nitpicking but it makes things much easier for later, for example you don't need to negate the normalized light
Position then, also I like you variable syntax
If you want to match your attenuation to AGK's... this is how it's calculated
float attenuation = max(0.0, 1.0 - dot(lightDirection,lightDirection)/(lightPosition[i].w*lightPosition[i].w));
And please turn down your specular values
SetShaderConstantByName( 1, "specularPower", 10.0, 0.0, 0.0, 0.0 )
SetShaderConstantByName( 1, "specularLevel", 0.02, 0.0, 0.0, 0.0 )
Still something wrong but not much... I guess I leave the rest for you
Quote: "When I try to compile, I had an error ...getwindowwidth is not a recognized function or command"
Got the same today
make sure you run the right version, this command was added lately.
For me it was just that I still had the .agk files linked to an older version of AGK.