console_with_bg.fs 364 B

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