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

Thread: frag shader compile error

  1. #1
    Intern Newbie
    Join Date
    Nov 2010
    Posts
    40

    frag shader compile error

    Hello,

    I have a simple frag shader that is not compiling on OS X. It says it does not know 'fragColor', but that is built-in, isn't it? I use it in all my other frag shaders but this one is giving me this error. Anyone know why that might happen?

    Thanks
    Bob

    Frag Shader compile log:
    ERROR: 0:9: Use of undeclared identifier 'fragColor'


    Failed to compile frag shader:
    #version 150
    //
    // ShadowMapping
    //


    void main()
    {
    fragColor = vec4(1.0);
    }


  2. #2

  3. #3
    Intern Newbie
    Join Date
    Nov 2010
    Posts
    40
    Actually, past a certain version of GLSL, you have to define it yourself, like this:

    out vec4 fragColor;

  4. #4
    Member Regular Contributor Nowhere-01's Avatar
    Join Date
    Feb 2011
    Location
    Novosibirsk
    Posts
    251
    i am well aware of that, but you were talking about built in variable, which is gl_FragColor, not fragColor. and there's no declaration of fragColor in supplied shader code, so i assumed a typo. but yes gl_FragColor is deprecated since GLSL 1.2
    Last edited by Nowhere-01; 02-22-2013 at 02:38 PM.

Posting Permissions

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