OpenGL: fix GPU_SHADER_TEXT on non-Mac

Developed on Mac and committed quickly.. oops
This commit is contained in:
Mike Erwin
2016-09-20 16:12:50 +02:00
parent 42ad5952ff
commit d3365c5c72
2 changed files with 18 additions and 7 deletions

View File

@@ -1,14 +1,21 @@
flat varying vec4 color;
noperspective varying vec2 texcoord;
#if __VERSION__ == 120
flat varying vec4 color;
noperspective varying vec2 texcoord;
#define fragColor gl_FragColor
#else
flat in vec4 color;
noperspective in vec2 texcoord;
out vec4 fragColor;
#endif
uniform sampler2D glyph;
void main()
{
// input color replaces texture color
gl_FragColor.rgb = color.rgb;
fragColor.rgb = color.rgb;
// modulate input alpha & texture alpha
gl_FragColor.a = color.a * texture2D(glyph, texcoord).a;
fragColor.a = color.a * texture2D(glyph, texcoord).a;
}

View File

@@ -1,11 +1,15 @@
// TODO(merwin):
// - use modern GLSL
// - uniform color, not per vertex
// - generic attrib inputs (2D pos, tex coord)
flat varying vec4 color;
noperspective varying vec2 texcoord;
#if __VERSION__ == 120
flat varying vec4 color;
noperspective varying vec2 texcoord;
#else
flat out vec4 color;
noperspective out vec2 texcoord;
#endif
void main()
{