I'm using OpenGL shader builder v2.2.2 and took sample code from book. For vertex shader
#version 140
uniform float CoolestTemp;
uniform float TempRange;
uniform mat4 MVPMatrix;
in vec4 mcVertex;
in float VertexTemp;
out float Temperature;
void main() {
Temperature = (VertexTemp - CoolestTemp) / TempRange;
gl_Position = MVPMatrix * mcVertex;
}
And for fragment shader
#version 140
uniform vec3 CoolestColor;
uniform vec3 HottestColor;
in float Temperature;
out vec4 FragmentColor;
void main()
{
vec3 color = mix(CoolestColor, HottestColor, Temperature);
FragmentColor = vec4(color, 1.0);
}
My problem is to execute this code because version 140 and 320 is not supported. Then I tryed to remove versions, compiler said "Invalid qualifiers 'in' in global variable context" and same for 'out', then tried to replace in/out to 'varying' but in fragment shader "Left-hand-side of assignment must not be read-only" error appears. For vertex shader have warning about varying fields will not read in next stages. How can I figure out it to adapt an old-styled code to new? So I'm absolutely new to GLSL