1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2024-12-27 23:46:45 +00:00

blend lol

This commit is contained in:
Cameron Taylor 2021-08-27 13:55:18 -04:00
parent 5baae3ad58
commit d1871761d9

View file

@ -35,7 +35,11 @@ class OverlayBlend extends FlxShader
vec4 blendOverlay(vec4 base, vec4 blend)
{
return mix(1.0 - 2.0 * (1.0 - base) * (1.0 - blend), 2.0 * base * blend, step(base, vec4(0.5)));
vec4 mixed = mix(1.0 - 2.0 * (1.0 - base) * (1.0 - blend), 2.0 * base * blend, step(base, vec4(0.5)));
// mixed = mix(mixed, blend, base.a); // proper alpha mixing
return mixed;
}
void main()
@ -48,7 +52,7 @@ class OverlayBlend extends FlxShader
vec4 gf = flixel_texture2D(funnyShit, openfl_TextureCoordv.xy + vec2(0.1, 0.2));
vec4 mixedCol = blendOverlay(gf, color);
vec4 mixedCol = blendOverlay(color, gf);
gl_FragColor = mixedCol;
}