2

I am using Go and the go-gl package. My setup seems to be correct as everything else works (window creation, vertex buffers, etc). The problem is:-

I have created 4 shaders (2 vertex and 2 fragment) for 2 different triangles.

Vertex Shader:-

#version 330 core
layout(location = 0) in vec4 position;

void main() {
    gl_Position = position;
}

Fragment Shader:-

#version 330 core
layout(location = 0) out vec4 color;

void main() {
    color = vec4(1.0, 0.0, 0.0, 1.0);
}

These two shaders decribe the first triangle which is red. The second triangle has the exactly same vertex shader and fragment shader except that it is green in color.

When I run the code I get the following as output:- My OpenGL window

This is my terminal with all the logs and errors:- My Terminal

Two things are very weird:-

  • The error is received when compiling vertex shader. I have two vertex shaders both exactly same but only one fails to compile.
  • It tells that error is with 1.0 in my code but I don't have that in my code at all.
Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189
Shardul Nalegave
  • 419
  • 9
  • 16

0 Answers0