Can anyone provide me working code to use OpenGL shaders?
All I get is errors like that, even with simplest samples and there is no ‘j’ symbol in my shader code
:display:gsg:glgsg(error): An error occurred while compiling shader!
Vertex shader failed to compile with the following errors:
ERROR: 0:1: error(#132) Syntax error: 'j' parse error
ERROR: error(#273) 1 compilation errors. No code generated
:display:gsg:glgsg(error): at 413 of c:\panda3d-1.7.0\panda\src\glstuff\glShader
Context_src.cxx : GL error 1281
That syntax error makes me think of the two hidden bytes that many Microsoft editors like to write at the beginning of a document to indicate the character encoding convention. Since this is a Microsoft-only convention, you don’t see these bytes when you load the file with another Microsoft editor, but they cause problems when you load them in another tool (for instance, the shader compiler).
Do the files you create on Linux, and copy unchanged to Windows, work there?
displaygsg_glgsg(error): An error occurred ...
vertex shader failed to compile with the following errors:
ERROR: compilation errors. No code generated.
ERROR: 0:1: 'defined' : syntax error parse error
ERROR: compilation errors. No code generated.
The short answer is, this is now fixed in CVS, so you can download and compile your own version of Panda with the fix; or you can wait for the 1.7.1 which will include the fix.