2023-09-15 03:37:07 -05:00
|
|
|
@vs vs
|
|
|
|
in vec2 vertex;
|
|
|
|
in vec2 uv;
|
2023-10-26 11:48:02 -05:00
|
|
|
in vec4 vc;
|
2023-09-15 03:37:07 -05:00
|
|
|
|
|
|
|
out vec2 texcoords;
|
|
|
|
out vec4 fcolor;
|
|
|
|
|
|
|
|
uniform vs_p { mat4 proj; };
|
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
2023-10-26 11:48:02 -05:00
|
|
|
fcolor = vc;
|
2023-09-15 03:37:07 -05:00
|
|
|
texcoords = uv;
|
|
|
|
gl_Position = proj * vec4(vertex, 0.0, 1.0);
|
|
|
|
}
|
|
|
|
@end
|
|
|
|
|
|
|
|
@fs fs
|
|
|
|
in vec2 texcoords;
|
|
|
|
in vec4 fcolor;
|
|
|
|
out vec4 color;
|
|
|
|
|
|
|
|
uniform texture2D image;
|
|
|
|
uniform sampler smp;
|
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
2023-10-10 17:37:58 -05:00
|
|
|
color = texture(sampler2D(image,smp), texcoords);
|
2023-10-26 11:48:02 -05:00
|
|
|
|
2023-09-15 03:37:07 -05:00
|
|
|
if (color.a <= 0.1f)
|
|
|
|
discard;
|
2023-10-26 11:48:02 -05:00
|
|
|
|
|
|
|
color = mix(color, fcolor, 0.01);
|
2023-09-15 03:37:07 -05:00
|
|
|
}
|
|
|
|
@end
|
|
|
|
|
|
|
|
@program sprite vs fs
|