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: getting uniform variable location

  1. #1
    Junior Member Newbie
    Join Date
    Jan 2004
    Posts
    17

    getting uniform variable location

    every time i call glGetUniformLocation() it returns -1

    the program runs fine but i cant change any of the uniform variables

    they are declared like this:

    uniform sampler2D textures;
    uniform int numTextures;

    any ideas

  2. #2
    Intern Contributor
    Join Date
    Mar 2004
    Posts
    52

    Re: getting uniform variable location

    Can you post the part of your code where you are calling this? Usually a -1 means that the uniform variable is not found in the specified program object, or that it starts with a reserved prefix gl_*.

  3. #3
    Intern Newbie
    Join Date
    Nov 2002
    Location
    Denmark
    Posts
    48

    Re: getting uniform variable location

    are you using your variables?

    This is from the spec:

    "A uniform is considered “active” if it is determined by the compiler
    and linker that the uniform will actually be accessed when the executable code is
    executed."

    any unactive variable will probably return -1.

Posting Permissions

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