• Create Account

### #ActualAshaman73

Posted 21 January 2013 - 08:09 AM

In general, ATI and NVIDIA will handle not clearly defined glsl code differently. Nvidia is known for more lax handling of glsl syntax, whereas ATI often requires strict one. Best to compile and run your GLSL code as often as possible on both platforms to detect errors early enough.

Just guessing, but I believe, that  the pow implementation is more picky on nvidia (per definition, the behaviour of pow(x,y) is undefined if x<0 or x=0 and y=0). Therefore I would put the pow function into the if-clause:


if (SpecularFactor > 0)
{
SpecularFactor = pow(SpecularFactor, specularPower);
SpecularColor = _light.colour.rgb * specularIntensity * SpecularFactor;
}



### #2Ashaman73

Posted 21 January 2013 - 08:08 AM

In general, ATI and NVIDIA will handle not defined glsl code differently. Nvidia is known for more lax handling of glsl syntax, whereas ATI requires strict one. Best to compile and run your GLSL code as often as possible on both platforms to detect errors early enough.


Just guessing, but I believe, that  the pow implementation is more picky on nvidia (per definition, the behaviour of pow(x,y) is undefined if x<0 or x=0 and y=0). Therefore I would put the pow function into the if-clause:


if (SpecularFactor > 0)
{
SpecularFactor = pow(SpecularFactor, specularPower);
SpecularColor = _light.colour.rgb * specularIntensity * SpecularFactor;
}



### #1Ashaman73

Posted 21 January 2013 - 08:05 AM

Just guessing, but I believe, that  the pow implementation is more picky on nvidia (per definition, the behaviour of pow(x,y) is undefined if x<0 or x=0 and y=0). Therefore I would put the pow function into the if-clause:


if (SpecularFactor > 0)
{
SpecularFactor = pow(SpecularFactor, specularPower);
SpecularColor = _light.colour.rgb * specularIntensity * SpecularFactor;
}


PARTNERS