PDA

View Full Version : glsl error C0502: syntax error at token "gl_FragColor"



reader1
03-09-2015, 11:21 PM
error C0502: syntax error at token "gl_FragColor"
what's matter?

reader1
03-09-2015, 11:29 PM
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"

GClements
03-10-2015, 04:50 AM
original version requres 400, I change out into gl_FragColor in order to meet v2.1.


gl_FragColor vec4 FragColor;

get warning and error, error C0502: syntax error at token "gl_FragColor"

A user-defined output would be declared with


out vec4 FragColor;

The built-in output gl_FragColor doesn't need to be declared.

reader1
03-10-2015, 05:09 AM
A user-defined output would be declared with


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.