OpenGL: fix GPU_SHADER_TEXT on non-Mac
Developed on Mac and committed quickly.. oops
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user