SFML community forums

Help => Graphics => Topic started by: pdinklag on January 31, 2012, 09:08:09 pm

Title: Forcing a certain GLSL specification
Post by: pdinklag on January 31, 2012, 09:08:09 pm
Is it possible to somehow tell the GPU to compile GLSL programs following a certain specification? Let's say my GPU supports the latest GLSL, but I want to make sure my shader program is compatible to GLSL 1.10 (OpenGL 2.0) to avoid problems like this one: http://www.sfml-dev.org/forum/viewtopic.php?t=6930 .

If so, I believe the sf::Shader class (or, depending on how it'd work, the sf::ContextSettings class) should support that feature. I can tell for sure that setting the OpenGL major and minor versions in the context settings does not influence the GLSL specification used for compiling.
Title: Forcing a certain GLSL specification
Post by: Laurent on January 31, 2012, 10:59:45 pm
I've never heard about such a feature, I don't know if it's possible.
Title: Forcing a certain GLSL specification
Post by: Lynix on February 01, 2012, 12:03:55 am
"#version 110" ?
Title: Forcing a certain GLSL specification
Post by: pdinklag on February 01, 2012, 07:41:10 am
That is, a comment in the first line of the shader itself? I believe I had read about such a feature once, thanks for reminding. :)

EDIT: Yes, that's it! Thanks!