2022-03-08 08:13:53 +00:00
|
|
|
package funkin.shaderslmfao;
|
2021-08-27 06:42:23 +00:00
|
|
|
|
|
|
|
import flixel.system.FlxAssets.FlxShader;
|
|
|
|
|
|
|
|
class MultiplyShader extends FlxShader
|
|
|
|
{
|
2023-01-23 03:25:45 +00:00
|
|
|
@:glFragmentSource('
|
2021-08-27 06:42:23 +00:00
|
|
|
#pragma header
|
|
|
|
uniform sampler2D funnyImage;
|
|
|
|
uniform vec4 uBlendColor;
|
|
|
|
|
|
|
|
vec4 blendMultiply(vec4 base, vec4 blend)
|
|
|
|
{
|
|
|
|
return base * blend;
|
|
|
|
}
|
|
|
|
|
|
|
|
vec4 blendMultiply(vec4 base, vec4 blend, float opacity)
|
|
|
|
{
|
|
|
|
return (blendMultiply(base, blend) * opacity + base * (1.0 - opacity));
|
|
|
|
}
|
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
|
|
|
vec4 base = texture2D(bitmap, openfl_TextureCoordv);
|
|
|
|
gl_FragColor = blendMultiply(base, uBlendColor, uBlendColor.a);
|
|
|
|
}')
|
2023-01-23 03:25:45 +00:00
|
|
|
public function new()
|
|
|
|
{
|
|
|
|
super();
|
|
|
|
}
|
2022-03-08 08:13:53 +00:00
|
|
|
}
|