2014-12-18 16:09:14 -05:00
|
|
|
#ifdef Use_Bindless_Texture
|
2014-08-18 11:49:44 -04:00
|
|
|
layout(bindless_sampler) uniform sampler2D tex;
|
|
|
|
#else
|
2014-01-20 15:42:38 -05:00
|
|
|
uniform sampler2D tex;
|
2014-08-18 11:49:44 -04:00
|
|
|
#endif
|
2014-01-20 15:42:38 -05:00
|
|
|
|
|
|
|
in vec2 uv;
|
2014-03-18 20:25:44 -04:00
|
|
|
in vec4 color;
|
2014-01-20 15:42:38 -05:00
|
|
|
out vec4 FragColor;
|
2014-02-28 11:29:05 -05:00
|
|
|
|
2014-01-20 15:42:38 -05:00
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
2014-06-25 08:53:49 -04:00
|
|
|
vec4 Color = texture(tex, uv);
|
2014-12-18 16:09:14 -05:00
|
|
|
#ifdef Use_Bindless_Texture
|
2014-08-18 11:49:44 -04:00
|
|
|
Color.xyz = pow(Color.xyz, vec3(2.2));
|
|
|
|
#endif
|
2014-06-25 08:53:49 -04:00
|
|
|
Color.xyz *= pow(color.xyz, vec3(2.2));
|
|
|
|
Color.a *= color.a;
|
2014-04-03 08:46:35 -04:00
|
|
|
// Premultiply alpha
|
|
|
|
FragColor = vec4(Color.rgb * Color.a, Color.a);
|
2014-01-20 15:42:38 -05:00
|
|
|
}
|