Open ivanperez-keera opened 5 years ago
I think it has to do with "OpenGL shading language version string: 1.30", but my shader programs have the version string set to "#version 450", as seen here: vertex program and here fragment program. Since the shader is rather basic, I do not think it really needs to be "#version 450" as it is now...
Have you tried lowering the shader program version string? What happens if you change it to "#version 130"?
If I make that just 130 in both files, I get:
e1337: user error (compile log: 0:3(1): error: syntax error, unexpected NEW_IDENTIFIER
I cannot run the thing with make, by the way. I'm compiling with cabal (old building style) and running directly from the sandbox.
I'll give a stab at it when I have a moment...
I think it does not like layout(location = 0) in vec4 vPosition;
I assume this is not supported by GLSL version 130, so it fails. I do not know what would be version 130 equivalent to do the same thing... Do you have any OpenGL hurus around to ask about it?
A quick search brought this: GLSL - Equivalent Of “layout (location = 1)” In #version 130
Do you have any OpenGL hurus around to ask about it?
I do not, no.
A quick search brought this: GLSL - Equivalent Of “layout (location = 1)” In #version 130
I'm not experienced enough in OpenGL to even understand how to use this without a substantial amount of tinkering. What would I need to change, and where?
By the way, on my machine, supported versions are:
1.10, 1.20, 1.30, 1.00 ES, 3.00 ES, 3.10 ES, and 3.20 ES
So, we may not have to go as far back as 1.30 for everything (I guess 3.20 ES is newer than 1.30).
If I use #version 320 es
, the error messages I get are:
0:22(1): error: No precision specified in this scope for type `vec4'
0:24(1): error: No precision specified in this scope for type `float'
0:28(2): error: No precision specified in this scope for type `vec3'
0:29(2): error: No precision specified in this scope for type `float'
0:30(2): error: No precision specified in this scope for type `vec2'
0:31(2): error: No precision specified in this scope for type `vec2'
0:35(2): error: No precision specified in this scope for type `float'
0:36(2): error: No precision specified in this scope for type `float'
0:37(2): error: No precision specified in this scope for type `vec2'
0:40(2): error: No precision specified in this scope for type `vec2'
0:41(2): error: No precision specified in this scope for type `float'
0:42(2): error: No precision specified in this scope for type `vec2'
0:58(2): error: No precision specified in this scope for type `float'
0:64(2): error: No precision specified in this scope for type `vec3'
By adding:
precision highp float;
to both the shader.frag
and shader.vert
files, as well as changing the version number for the languages used, I was able to run the example!!!
Do you want me to send you a PR?
Sounds good, Ivan!
Yes, please do.
Btw, are you, by chance, running a GLES device? Could you describe the hardware that you are running this on? I would like to get an idea what I should anticipate.
Thanks, Vlad
So, I managed to compile it, but I get this when I run it:
I'm on linux, with a MacBookAir. The OpenGL-related outputs to glxinfo are:
I had a very similar case on a different and newer Mac using OSX.