I am looking at http://www.swiftless.com/tutorials/glsl/3_glcolor.html which has the following code snippet:
void main() {
// Set the output color of our current pixel
gl_FragColor = gl_Color;}
I tried to use gl_Color on my WebGL. I got an error that gl_Color is undeclared identifier.
What did I do wrong?
Thanks in advance for your help.
WebGL uses Open GL ES 2.0 as its base, therefore you should be using GLSL ES 1.0 for the shaders. GLSL ES does not have a gl_Color, and therefore you will have to rewrite this shader.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With