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 3 of 3

Thread: Shader problem when switching computer

  1. #1
    Junior Member Newbie
    Join Date
    Jul 2012
    Posts
    3

    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:

    Code :
    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

    Code :
    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

    Current GPU: GeForce 8800 GTS 512

  2. #2
    Junior Member Newbie
    Join Date
    Jul 2012
    Posts
    3
    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?

  3. #3
    Member Regular Contributor
    Join Date
    Jun 2013
    Posts
    491
    Quote Originally Posted by OpenCoffee View Post
    If I try to get the location of some uniforms (after the linking) I will get some strange values returned, like

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

    will return 4294967295, which doesnít seem right.
    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).

Posting Permissions

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