C ++ OpenGL Fading Error Version - GLSL x Not Supported [Ubuntu 16.04]

I am currently working on a project using OpenGL on Ubuntu 16.04 and am facing a serious problem. At the moment, I have no idea what to do, because it seems to me that I tried everything to fix it.

For some reason, my shader just does not compile and returns the following error:

Failed to compile vertex shader! 0:1(10): error: GLSL 4.50 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.00 ES, 3.00 ES, 3.10 ES, and 3.20 ES` 

I adjusted the version in the shader file with no luck. #version 450 core , etc., but I get the same result.

For reference, here is the output of sudo glxinfo | grep "OpenGL" sudo glxinfo | grep "OpenGL" :

 OpenGL vendor string: Intel Open Source Technology Center OpenGL renderer string: Mesa DRI Intel(R) HD Graphics 520 (Skylake GT2) OpenGL core profile version string: 4.5 (Core Profile) Mesa 13.1.0-devel OpenGL core profile shading language version string: 4.50 OpenGL core profile context flags: (none) OpenGL core profile profile mask: core profile OpenGL core profile extensions: OpenGL version string: 3.0 Mesa 13.1.0-devel OpenGL shading language version string: 1.30 OpenGL context flags: (none) OpenGL extensions: OpenGL ES profile version string: OpenGL ES 3.2 Mesa 13.1.0-devel OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20 OpenGL ES profile extensions: 

Exiting glxinfo shows that OpenGL Core 4.5 is installed, so why is this not supported?

I also tried to find the current version of OpenGL used in the project: std::cout << "OpenGL version: " << glGetString(GL_VERSION) << std::endl; which results in an empty return.

I have spent 10 hours on this single question so far, so any help is appreciated!

Edit: Is there a way to force the / Ubuntu project to use OpenGL rather than GLSL, i.e. completely remove GLSL (this part)?

 OpenGL ES profile version string: OpenGL ES 3.2 Mesa 13.1.0-devel OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20 OpenGL ES profile extensions: 
+5
source share
5 answers

For everyone experiencing the same problems, this was the solution that worked for me:

 glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4); glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0); glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); 
+7
source

It looks like you are not explicitly setting the context of the main profile. The glxinfo output shows that compatibility profile contexts (OpenGL-3.0 did not have “compatibility” profiles, but this is a point of contention for this) are not supported:

This tells you that the base profile is supported up to version v4.5:

 OpenGL core profile version string: 4.5 (Core Profile) Mesa 13.1.0-devel OpenGL core profile shading language version string: 4.50 OpenGL core profile profile mask: core profile 

... and this tells you that the highest version, which is not explicitly indicated by the kernel, will be OpenGL-3.0:

 OpenGL version string: 3.0 Mesa 13.1.0-devel OpenGL shading language version string: 1.30 

So, request a kernel profile or accept that you are stuck in GL-3.0 and below.


Just for comparison, here's how he looks for an OpenGL implementation (NVidia) that supports OpenGL-4.x even outside the main profile:

 OpenGL core profile version string: 4.4.0 NVIDIA 367.27 OpenGL core profile shading language version string: 4.40 NVIDIA via Cg compiler OpenGL core profile context flags: (none) OpenGL core profile profile mask: core profile OpenGL version string: 4.5.0 NVIDIA 367.27 OpenGL shading language version string: 4.50 NVIDIA 
+3
source

If you intend to use the capabilities of 4.5, you need a basic profile and is supported in your system in accordance with this output line

 OpenGL core profile version string: 4.5 (Core Profile) Mesa 13.1.0-devel 

Another output line

 OpenGL version string: 3.0 Mesa 13.1.0-devel 

doesn't mean you have two different openGL drivers, but you can afford OpenGL 3.0 peaks without a main profile.

To use the capabilities of the main profile, be sure to enable it, and also compile the shaders using the correct preprocessor directive.

 // Example using glut for context initialization glutInitContextVersion(4, 5); glutInitContextProfile(GLUT_CORE_PROFILE); glutInit(&argc, argv); // Shaders #version 450 ... 
0
source

Try the following code in your shader:

"#version 320 es

medium accuracy p float;

... your code "

-1
source

GLSL is the shader language used by OpenGL, although both version numbers do not always match. From your point of view, it looks like you are using an Intel GPU chip. The driver for this microprocessor is through Mesa, which, as far as I know, does not yet support OpenGL 4.

If you have an Nvidia card, you can install the proprietary NVidia driver, which supports the latest version of OpenGL. Otherwise, you will need to change the shaders to use an older version of the language.

-2
source

Source: https://habr.com/ru/post/1259670/


All Articles