1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2024-11-05 06:14:36 +00:00
Funkin/source/OverlayShader.hx
Cameron Taylor b07372aa8e CHARTS
2020-12-26 21:46:22 -05:00

34 lines
666 B
Haxe

package;
import flixel.system.FlxAssets.FlxShader;
class OverlayShader extends FlxShader
{
@:glFragmentSource('
#pragma header
uniform vec4 uBlendColor;
vec3 blendLighten(base:Vec3, blend:Vec3) : Vec3 {
return mix(
1.0 - 2.0 * (1.0 - base) * (1.0 - blend),
2.0 * base * blend,
step( base, vec3(0.5) )
);
}
vec4 blendLighten(vec4 base, vec4 blend, float opacity)
{
return (blendLighten(base, blend) * opacity + base * (1.0 - opacity));
}
void main()
{
vec4 base = texture2D(bitmap, openfl_TextureCoordv);
gl_FragColor = blendLighten(base, uBlendColor, uBlendColor.a);
}')
public function new()
{
super();
}
}