opengl-playground/shaders/textured-rectangle-fragment.glsl

14 lines
316 B
Plaintext
Raw Permalink Normal View History

2020-03-18 22:42:04 +01:00
#version 330 core
out vec4 fragmentColor;
2020-03-23 17:26:32 +01:00
in vec2 textureCoord;
uniform vec4 base_color;
uniform sampler2D uni_texture;
2020-03-18 22:42:04 +01:00
void main()
{
2020-03-23 17:26:32 +01:00
vec4 temp_color = texture(uni_texture, textureCoord);
fragmentColor = temp_color * (1 - base_color.a) + base_color * base_color.a;
//fragmentColor = vec4(1.0, 0.0, 0.0, 0.0);
2020-03-18 22:42:04 +01:00
}