Results 1 to 4 of 4

Thread: glsl error C0502: syntax error at token "gl_FragColor"

  1. #1
    Senior Member Regular Contributor
    Join Date
    Mar 2015
    Posts
    296

    Post glsl error C0502: syntax error at token "gl_FragColor"

    error C0502: syntax error at token "gl_FragColor"
    what's matter?

  2. #2
    Senior Member Regular Contributor
    Join Date
    Mar 2015
    Posts
    296
    original version requres 400, I change out into gl_FragColor in order to meet v2.1.
    gl_FragColor vec4 FragColor;

    void main()
    {
    FragColor = vec4(Color,1.0);
    }
    get warning and error, error C0502: syntax error at token "gl_FragColor"

  3. #3
    Senior Member OpenGL Guru
    Join Date
    Jun 2013
    Posts
    3,103
    Quote Originally Posted by reader1 View Post
    original version requres 400, I change out into gl_FragColor in order to meet v2.1.
    Code :
    gl_FragColor vec4 FragColor;
    get warning and error, error C0502: syntax error at token "gl_FragColor"
    A user-defined output would be declared with
    Code :
    out vec4 FragColor;
    The built-in output gl_FragColor doesn't need to be declared.

  4. #4
    Senior Member Regular Contributor
    Join Date
    Mar 2015
    Posts
    296
    Quote Originally Posted by GClements View Post
    A user-defined output would be declared with
    Code :
    out vec4 FragColor;
    The built-in output gl_FragColor doesn't need to be declared.
    Thank you. the problem has been solved by update driver to v3.3.
    All is working well now.
    However, would you pls show me when I change "in" into "attribute", there is no problem, while gl_fragcolor is matter.

Similar Threads

  1. where has built-in variable "gl_FragColor" gone in OpenGL 4.4?
    By zzzhhh in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 06-08-2014, 09:27 AM
  2. egl gles2 "function is no-op" "Mesa: User error"
    By unixmania in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 09-17-2013, 05:30 AM
  3. LINK : fatal error LNK1104: cannot open file "glut32.lib"
    By erinshek_91 in forum OpenGL: General
    Replies: 0
    Last Post: 07-10-2013, 07:45 PM
  4. Replies: 2
    Last Post: 01-09-2012, 05:44 AM
  5. Replies: 0
    Last Post: 10-24-2011, 12:22 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
  •  
Proudly hosted by Digital Ocean