Created
February 14, 2023 03:37
-
-
Save dsheeler/c4f002158ace517f5ecebd6865dcb717 to your computer and use it in GitHub Desktop.
Only black transparent in glsl?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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