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: OpenGL fragment shader not working on core i5 laptop on windows7

  1. #1
    Newbie Newbie
    Join Date
    Nov 2013
    Posts
    2

    OpenGL fragment shader not working on core i5 laptop on windows7

    Hi all,
    I am new to OpenGL development. I am trying to work with some sample examples of OpenGL.
    In one example, i am trying to change colour of triangle through fragment shader but it is not reflecting in final output.

    I have tested same program on two machines with following configurations:
    1) windows 7 on core i5 CPU-- not working
    2) windows 7 on core i5-2540M CPU -- working

    Both machines are having same OpenGL libraries installed.

    Following is the fragment shader:
    #version 330 core
    out vec4 fColor;
    void
    main()
    {
    fColor = vec4(1.0, 0.5, 0.5,1.0f);
    }

    By default i get white triangle, so when i try to change it through fragment shader,it doesn't reflect.

    please let me know, if any one of you have faced similar issue.

    Thanks

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Jan 2007
    Posts
    1,135
    CPU isn't relevant; what graphics cards do these machines have?

  3. #3
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    3,123
    Quote Originally Posted by mhagain View Post
    CPU isn't relevant...
    True, unless he's running on the integrated GPU (the i5-2540M has an HD Graphics 3000 GPU).

    sunitchanan, let's see the output of:

    Code :
    glGetString( GL_VENDOR )
    glGetString( GL_RENDERER )
    glGetString( GL_VERSION   )
    glGetString ( GL_SHADING_LANGUAGE_VERSION )

    on those two machines (note: each returns a string). Also, which Core i5 is the first system? Not all i5's have on-board GPUs (List of Intel Core i5 microprocessors)

  4. #4
    Newbie Newbie
    Join Date
    Nov 2013
    Posts
    2
    Thanks for the reply.

    Here is the output i got on two machines
    1) on windows 7 on core i5 - M560 CPU
    "Intel"
    "Intel(R) HD Graphics"
    "2.1.0 - Build 8.15.10.2827"
    "1.20 - Intel Build 8.15.10.2827"

    2)on windows 7 on core i5-2540M CPU
    "Intel"
    "Intel(R) HD Graphics 3000"
    "3.1.0 - Build 9.17.10.2817"
    "1.40 - Intel Build 9.17.10.2817"

    Please note that i am facing issue on first machine(core i5- M560) with respect to shaders.

  5. #5
    Senior Member OpenGL Pro
    Join Date
    Jan 2007
    Posts
    1,135
    OK, your first machine only supports GLSL 120 and your second GLSL 140, but you're requesting support for 330 in your shader - which is why it doesn't work. It shouldn't work on the second one either, but we can probably put that down to driver weirdness.

    You're should bump your OpenGL usage down to GL2.1 and GLSL 120 if you want it to work on both, as the hardware on the first machine just isn't capable of higher (and this is a hardware limitation, nothing to do with software).

Posting Permissions

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