Fragment Shader fails to compile

Started by jeussa, December 26, 2015, 20:40:20

Previous topic - Next topic

jeussa

Hi dere all,

about a week ago I got a new computer, however on this new computer whenever I attempt to start my java project using LWJGL the fragment shader fails to compile. Yet this exact same code is working on both my old laptop and my tablet (windows tablet)

- FragmentShader: http://pastebin.com/shejTaBt
- Console-Error: http://pastebin.com/jphsf9L6

Any ideas as to what might be causing the issue?


Cornix

I know from personal experience that some drivers are more relaxed when it comes to compiling shader source codes. My shaders used to compile on some hardware but not on others and I later found out this was due to a bug in my shader code. However, some drivers accepted the code even if it was technically incorrect; they compiled it the way I wanted it to be. Other drivers were more strict and failed to compile the code.

Check your shader code over and make sure that everything is correct according to the GLSL reference book. It might be that you do something that appears correct but is actually incorrect syntax. It might also be that the driver you use for your current hardware has a bug. Check if you have the latest driver installed.

jeussa

Thanks for the help! The issue was that apparently my drive does not support the texture() method, and instead requires texture2D() to be used.

I do however get a different issue right now.
While the environment should look like http://i.imgur.com/3A2LOSi.jpg
this is what I see http://i.imgur.com/EqKowxb.jpg

Hydroque

Convert texture() to texture2D() and disable all lighting effects. Tell me if this fixes anything.
Try changing the name of texture to see if there is any variable collision because it is defined as texture. I don't know for sure, but this could be a weird situation.