Ich schaffe Kontext von:Fehler beim Kompilieren Shadern GLSL 3.30
new sf::Window(sf::VideoMode(800, 600), "OpenGL",
sf::Style::Default,
sf::ContextSettings(24, 8, 0, 3, 3, sf::ContextSettings::Core)));
ich Erweiterungen von glLoadGen für OpenGL 3.3 Kernprofil mit einer Erweiterung EXT_texture_compression_s3tc
geladen. Wenn ich Shader bin Kompilieren:
#version 330 core
layout (location = 0) in vec3 vertPos;
layout (location = 5) uniform mat4 modelMat;
layout (location = 6) uniform mat4 viewMat;
layout (location = 7) uniform mat4 projectionMat;
out vec4 fragColor;
void main()
{
gl_Position = projectionMat * viewMat * modelMat * vec4(vertPos, 1.0);
fragColor = vec4(0.5, 0.5, 0.5, 1.0);
}
``
#version 330 core
in vec4 fragColor;
out vec4 outColor;
void main()
{
outColor = fragColor;
}
ich Fehler string:
ERROR: Shader compilation error at shader: "media/shaders/shader.vs.glsl"
0:7(1): error: uniform explicit location requires GL_ARB_explicit_uniform_location and either GL_ARB_explicit_attrib_location or GLSL 3.30.
0:8(1): error: uniform explicit location requires GL_ARB_explicit_uniform_location and either GL_ARB_explicit_attrib_location or GLSL 3.30.
0:9(1): error: uniform explicit location requires GL_ARB_explicit_uniform_location and either GL_ARB_explicit_attrib_location or GLSL 3.30.
aber ich habe OpenGL 3.3 (so GLSL 3.30). glxinfo
druckt:
Extended renderer info (GLX_MESA_query_renderer):
Vendor: X.Org (0x1002)
Device: AMD JUNIPER (DRM 2.43.0, LLVM 3.8.0) (0x68be)
Version: 11.2.0
Accelerated: yes
Video memory: 512MB
Unified memory: no
Preferred profile: core (0x1)
Max core profile version: 3.3
Max compat profile version: 3.0
Max GLES1 profile version: 1.1
Max GLES[23] profile version: 3.0
OpenGL vendor string: X.Org
OpenGL renderer string: Gallium 0.4 on AMD JUNIPER (DRM 2.43.0, LLVM 3.8.0)
OpenGL core profile version string: 3.3 (Core Profile) Mesa 11.2.0
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
So greife ich kann GLSL 3.30 sein.
Ist die Erweiterung 'GL_ARB_explicit_uniform_location' tatsächlich vorhanden? Aus dem Wortlaut der Fehlermeldung gehe ich davon aus, dass es auch dann noch glsl 3.30 geben muss. –
Es ist verfügbar, aber die Nachricht sagt 'oder GLSL 3.30' und ich habe' OpenGL Core Profil Shading Sprache Version String: 3.30', so dass das Programm funktionieren sollte. – bajos