Shader problem when switching computer

Hello!

I got this really weird problem that I am searching a solution for. You see, I have created a glsl shader to handle simple shadowmaps. This project was created on a computer that uses a GTX 260. Recently I transferred my project to my home computer and it seems that the shader doesn’t load at all; however, I won’t get any compile errors.

And yes, I am pretty sure that it worked on the other computer before transfer (but I am starting to get curious ofc ^^). What I have done is to try to track down the problem as far as possible, and right now I think that it is something wrong with the glsl program linking. This is what I use:

GLint link_status;
glGetObjectParameterivARB(m_shadowShader.m_shadowShaderId, GL_OBJECT_LINK_STATUS_ARB, &link_status);
assert(1 == link_status);

I get an error and the program terminates. If I try to get the location of some uniforms (after the linking) I will get some strange values returned, like

m_shadowShader.m_numlightsUniform = glGetUniformLocationARB(m_shadowShader.m_shadowShaderId, "NumLights");

will return 4294967295, which doesn’t seem right.

Do you know if this might be a driver bug or something? I can’t really think of anything else. I tried to create a simple color shader and I still got the linking error.

Would be really greatful for any suggestions :biggrin-new:

Current GPU: GeForce 8800 GTS 512

Ok, got a little bit closer to the root of the problem (I guess), but it’s not solved yet. Apprently (after using gdebugger) this seems to be the error in the fragment shader:
Sampler needs to be a uniform (global or parameter to main)
Well, i am using sampler2D s, but they are uniforms that I pass values to in the program.
Anyone who has encountered this problem before?

[QUOTE=OpenCoffee;1254831]If I try to get the location of some uniforms (after the linking) I will get some strange values returned, like

m_shadowShader.m_numlightsUniform = glGetUniformLocationARB(m_shadowShader.m_shadowShaderId, "NumLights");

will return 4294967295, which doesn’t seem right.[/QUOTE]
4294967295 is 232-1, i.e. what you get if you store -1 in an 32-bit unsigned integer variable. glGetUniformLocation() returns -1 if the name doesn’t refer to an active uniform variable.

If linking fails, use glGetInfoLogARB() to retrieve error messages (or do everyone a favour and use the OpenGL 2.0 shader API rather than ARB_shader_objects).

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