While I was releasing the Julia’s Fractal demo, I tested it on NVIDIA and ATI (as usual before releasing a demo). And as usual, a new difference appeared in the way the GLSL is supported on ATI and on NVIDIA. On NVIDIA the following is line is ok but produces an error on ATI (Catalyst 8.1):
gl_FragColor = texture1D(tex, (float)(i == max_i ? 0 : i) / 100);
To be ATI Radeon-compliant, this instruction must be split in two:
if( i == max_i ) { gl_FragColor = texture1D(tex, 0.0); } else { gl_FragColor = texture1D(tex, i/100.0); }
I can’t immagine a world with more than two major graphics cards manufacturers. But if such a world exists, I stop 3d programming… Fortunately, NVIDIA accepts ATI GLSL syntax so there is only one code at the end. Conlusion: always check your GLSL shaders on ATI and NVIDIA before releasing a demo…