You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
756 B
33 lines
756 B
#version 150
|
|
|
|
uniform sampler2DRect tex0;
|
|
|
|
in vec2 tex_c;
|
|
|
|
out vec4 outputColor;
|
|
|
|
void main()
|
|
{
|
|
// Convert normalized coordinates to pixel coordinates
|
|
vec2 texCoord = tex_c * vec2(1920.0/2.0, 960.0);
|
|
vec4 texColor = texture(tex0, texCoord);
|
|
|
|
if (texColor.a < 0.1) {
|
|
discard;
|
|
}
|
|
vec3 color = texColor.rgb;
|
|
color = vec3(dot(color, vec3(0.299, 0.587, 0.114)));
|
|
outputColor = vec4(color, texColor.a);
|
|
// vec4 texColor = texture(tex0, tex_c);
|
|
|
|
|
|
//Discard fragments with alpha below a threshold
|
|
// if (texColor.a < 0.1) {
|
|
// discard;
|
|
// }
|
|
|
|
// vec3 color = texColor.rgb;
|
|
// color = vec3(dot(color, vec3(0.299, 0.587, 0.114)));
|
|
|
|
// outputColor = vec4(color, texColor.a);
|
|
}
|
|
|