Created
February 8, 2018 00:24
-
-
Save ayamflow/f028819d1e585874e49728d0fc51ca30 to your computer and use it in GitHub Desktop.
Layer 2 textures on top of each other 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
// https://stackoverflow.com/questions/24480901/libgdx-overlay-texture-above-another-texture-using-shader | |
vec4 layer(vec4 foreground, vec4 background) { | |
return foreground * foreground.a + background * (1.0 - foreground.a); | |
} | |
#pragma glslify: export(layer); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment