Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 5 of 5

Thread: picking a glsl version

  1. #1
    Junior Member Newbie
    Join Date
    Sep 2017
    Posts
    3

    picking a glsl version

    Hello!

    I am working on an opengl game for Windows. Recently I made an open beta and got some feedback (and crash reports) on it.

    My biggest problem is compiling shaders. Previously I was not specifiying any glsl version (not using version pragma) and it was causing problems when I do non-standard things. I have a very forgiving compiler for glsl but as far as I can see most people don't

    Then I picked #version 450, fixed all errors and sent it to beta. The first I crash got was

    Version number not supported by GL2

    Then I reduced my version 150 and it worked fine for that reporter. However after that I received this one from another person:

    version '150' is not supported

    I reduced it to 110 now. But I don't know if what I am doing is correct or sane. 150 is already 8 years old, and now I am pushing it to 110.

    Should I do that? Is there any problems with using lower versions of glsl? I am not doing anything fancy in my shaders so I don't think I need the features of newer versions.

    Or maybe I shouldn't use version pragma at all. I can enable version 110 while developing, compile my shaders for version 110, and then comment out version pragmas and hope that whatever version my players has enough for it.

  2. #2
    Senior Member OpenGL Lord
    Join Date
    May 2009
    Posts
    5,932
    You pick the GLSL version for the version of OpenGL that is your minimum supported version. If your minimum supported GL version is 2.1, then your GLSL version should be 1.10. If your minimum supported version is GL 4.1, then your GLSL version should be 4.10.

  3. #3
    Junior Member Newbie
    Join Date
    Sep 2017
    Posts
    3
    Quote Originally Posted by Alfonse Reinheart View Post
    You pick the GLSL version for the version of OpenGL that is your minimum supported version. If your minimum supported GL version is 2.1, then your GLSL version should be 1.10. If your minimum supported version is GL 4.1, then your GLSL version should be 4.10.
    Hmm, my opengl version is 3.2 and I was using #version 150 but I still received this error:

    ERROR: 0:1: '' : version '150' is not supported

    I am using SDL to create my windows and this means I am using 3.2 right? Or is this just a hint for sdl?


    SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
    SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 2);

  4. #4
    Member Regular Contributor
    Join Date
    Jul 2012
    Posts
    425
    Quote Originally Posted by shultays View Post
    Hmm, my opengl version is 3.2 and I was using #version 150 but I still received this error:

    ERROR: 0:1: '' : version '150' is not supported
    From what you said in your first topic, we can suppose that this error comes from a particular user, not yourself.

    You should check the OpenGL version as soon as your context is created. Just report an error and close your program if the current OpenGL version is less than 3.2. People who don't have the required hardware/drivers will not be able to launch your game, and this is the best that you can do.

  5. #5
    Junior Member Newbie
    Join Date
    Sep 2017
    Posts
    3
    Quote Originally Posted by Silence View Post
    From what you said in your first topic, we can suppose that this error comes from a particular user, not yourself.

    You should check the OpenGL version as soon as your context is created. Just report an error and close your program if the current OpenGL version is less than 3.2. People who don't have the required hardware/drivers will not be able to launch your game, and this is the best that you can do.
    OK then, thanks for answers!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •