I have a simple OpenGL 3.3 fragment shader written in GLSL. Essentially, I'm evaluating sin(x)
for moderately large x (between 10,000 and 2,000,000), something like this:
#version 330
out vec4 fColor;
void main() {
fColor = vec4(sin(gl_FragCoord.x * gl_FragCoord.y));
}
It works fine on my NVidia graphics card, but on my Intel HD4000 the sine only returns four different values (+/- 1.0 and around +/- 0.3) above an input of about 10,000.
System: Windows 64bit, (Intel) driver version 15.28.20.64.3347.
My questions: is this a bug? or is it part of the vendors freedom to implement the sine this way?