views:

78

answers:

1

I've noticed that my GLSL shaders are not compilable when the GLSL version is lower than 130.

What are the most critical elements for having a backward compatible shader source? I don't want to have a full backward compatibility, but I'd like to understand the main guidelines for having simple (forward compatible) shaders running on GPU with GLSL lower than 130.

Of course the problem could be solved with the preprocessor

#if __VERSION__ < 130
#define VERTEX_IN attribute
#else
#define VERTER_IN in
#endif

But there probably many issues that I ignore.

Thank you

A: 
  • put #version 110 or #version 120 as the first line of your shaders
  • test them into the ShaderAnalyst from ATI
  • test your code on a LOT of actual graphic cards from different vendors
ponce