Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Forcing a certain GLSL specification  (Read 1532 times)

0 Members and 1 Guest are viewing this topic.

pdinklag

  • Sr. Member
  • ****
  • Posts: 330
  • JSFML Developer
    • View Profile
    • JSFML Website
Forcing a certain GLSL specification
« 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.
JSFML - The Java binding to SFML.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Forcing a certain GLSL specification
« Reply #1 on: January 31, 2012, 10:59:45 pm »
I've never heard about such a feature, I don't know if it's possible.
Laurent Gomila - SFML developer

Lynix

  • Sr. Member
  • ****
  • Posts: 403
    • View Profile
Forcing a certain GLSL specification
« Reply #2 on: February 01, 2012, 12:03:55 am »
"#version 110" ?

pdinklag

  • Sr. Member
  • ****
  • Posts: 330
  • JSFML Developer
    • View Profile
    • JSFML Website
Forcing a certain GLSL specification
« Reply #3 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!
JSFML - The Java binding to SFML.