Having a few problems compiling shaders. For one, multiplying two mat4 matricies does not seem to work at all.
layout(location = 0) in vec3 vertexPosition_modelspace;
uniform mat4 M;
uniform mat4 V;
...
vec3 vertexPosition_cameraspace = ( V * M * vec4(vertexPosition_modelspace,1)).xyz;
This code will work sometimes, but after a few similar calculations it will not compile.
layout(location = 0) in vec3 vertexPosition_modelspace;
uniform mat4 MV;
...
vec3 vertexPosition_cameraspace = ( MV * vec4(vertexPosition_modelspace,1)).xyz;
This is the vertex shader that works in Windows, with just the '#version 310 es' switched in.
#version 310 es
layout(location = 0) in vec3 vertexPosition_modelspace;
layout(location = 1) in vec3 colourRGB;
layout(location = 2) in vec3 vertexNormal_modelspace;
out vec3 RGB;
out vec3 Position_worldspace;
out vec3 Normal_cameraspace;
out vec3 EyeDirection_cameraspace;
out vec3 LightDirection_cameraspace;
uniform mat4 MVP;
uniform mat4 M;
uniform mat4 V;
uniform vec3 LightPosition_worldspace;
void main()
{
gl_Position = MVP * vec4(vertexPosition_modelspace,1);
Normal_cameraspace = (V * M * vec4(vertexNormal_modelspace,0)).xyz;
Position_worldspace = (M * vec4(vertexPosition_modelspace,1)).xyz;
vec3 vertexPosition_cameraspace = ( V * M * vec4(vertexPosition_modelspace,1)).xyz;
EyeDirection_cameraspace = vec3(0,0,0) - vertexPosition_cameraspace;
vec3 LightPosition_cameraspace = ( V * vec4(LightPosition_worldspace,1)).xyz;
LightDirection_cameraspace = LightPosition_cameraspace + EyeDirection_cameraspace;
RGB = colourRGB;
}