Skip to content

Instantly share code, notes, and snippets.

@dsheeler
Created February 14, 2023 03:37
Show Gist options
  • Save dsheeler/c4f002158ace517f5ecebd6865dcb717 to your computer and use it in GitHub Desktop.
Save dsheeler/c4f002158ace517f5ecebd6865dcb717 to your computer and use it in GitHub Desktop.
Only black transparent in glsl?
uniform sampler2D tex;
uniform float red;
uniform float green;
uniform float blue;
uniform float blend;
void main() {
vec4 s = texture2D(tex, cogl_tex_coord_in[0].st);
vec4 dst = vec4(red, green, blue, blend);
cogl_color_out = vec4(mix(s.rgb, dst.rgb * s.a, blend), s.a);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment