I encounter some difficulties on drawing in color and mapping texture. If I only draw line in different color or map texture to the rectangle, it is ok. However, when I combine these two into one scene; that's drawing in color and mapping texture in the same scene, it fails.
I think the problem is in shader script. There is an attribute called “gl_FragColor” and I can set it to gl_FragColor = vec4(vColor.rgb * lightWeighting, vColor.a); to draw in color and set it to gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.s, vTextureCoord.t)); to map texture.
However, when I draw in color and map texture in the same scene, I fails to set this gl_FragColor.
Can anyone help me to solve the problem? How to set the gl_FragColor correctly?