1

I was making a shader with GLSL so I could apply texture arrays to a cube when I ran into an issue. The issue was that layout wasn't supported in the version I was using. Easy fix, use a later version, but the problem with that was that I don't have support for later versions that support layout. I was wondering, is it possible to get support for later versions of GLSL, and if so, how would I do such a thing?

This is my current GLSL code for applying textures Vertex Shader:

#version 130
layout (location = 0) in vec3 aPos;
layout (location = 1) in vec3 aColor;
layout (location = 2) in vec2 aTexCoord;

out vec3 ourColor;
out vec2 TexCoord;

void main() {
    gl_Position = vec4(aPos, 1.0);
    ourColor = aColor;
    TexCoord = aTexCoord;
}

Fragment Shader:

#version 130
out vec4 FragColor;

in vec3 ourColor;
in vec2 TexCoord;

uniform sampler2DArray texture;
uniform index;

void main()
{
    FragColor = texture(texture, vec3(TexCoord, index));
}

Result of running:

print(glGetString(GL_VENDOR))
print(glGetString(GL_RENDERER))
print(glGetString(GL_VERSION))
print(glGetString(GL_SHADING_LANGUAGE_VERSION))

Intel Open Source Technology Center

Mesa DRI Intel(R) Sandybridge Mobile

3.0 Mesa 18.3.6

1.30

User-92
  • 374
  • 3
  • 13

0 Answers0