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

CPU isn’t relevant; what graphics cards do these machines have?

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:


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)

Thanks for the reply.

Here is the output i got on two machines

  1. on windows 7 on core i5 - M560 CPU
    “Intel”
    “Intel® 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® 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.

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).

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.