1 #version 330 core
2 out vec4 FragColor;
3
4 in vec3 ourColor;
5 in vec2 TexCoord;
6 in vec3 ourBackground;
7
8 // texture sampler
9 uniform sampler2D texture1;
10
11 void main()
12 {
13 vec4 original = texture(texture1, TexCoord);
14 vec4 fg = original.r > 0.1f || original.g > 0.1f || original.b > 0.1f ? original * vec4(ourColor, 1.f) : vec4(ourBackground, 1.f);
15 FragColor = fg;
16 }