2022-03-08 08:13:53 +00:00
|
|
|
package funkin.shaderslmfao;
|
2021-12-08 03:34:01 +00:00
|
|
|
|
|
|
|
import flixel.system.FlxAssets.FlxShader;
|
|
|
|
import flixel.util.FlxColor;
|
|
|
|
|
|
|
|
class PureColor extends FlxShader
|
|
|
|
{
|
2023-01-23 03:25:45 +00:00
|
|
|
public var col(default, set):FlxColor;
|
|
|
|
public var colorSet(default, set):Bool;
|
2021-12-08 03:34:01 +00:00
|
|
|
|
2023-01-23 03:25:45 +00:00
|
|
|
function set_colorSet(bol:Bool):Bool
|
|
|
|
{
|
|
|
|
colSet.value = [bol];
|
2021-12-08 03:34:01 +00:00
|
|
|
|
2023-01-23 03:25:45 +00:00
|
|
|
return bol;
|
|
|
|
}
|
2021-12-08 03:34:01 +00:00
|
|
|
|
2023-01-23 03:25:45 +00:00
|
|
|
function set_col(val:FlxColor):FlxColor
|
|
|
|
{
|
|
|
|
funnyColor.value = [val.red, val.green, val.blue, val.alpha];
|
2021-12-08 03:34:01 +00:00
|
|
|
|
2023-01-23 03:25:45 +00:00
|
|
|
return val;
|
|
|
|
}
|
2021-12-08 03:34:01 +00:00
|
|
|
|
2023-01-23 03:25:45 +00:00
|
|
|
@:glFragmentSource('
|
2021-12-08 03:34:01 +00:00
|
|
|
#pragma header
|
|
|
|
|
|
|
|
uniform vec4 funnyColor;
|
|
|
|
uniform bool colSet;
|
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
|
|
|
vec4 color = flixel_texture2D(bitmap, openfl_TextureCoordv);
|
|
|
|
|
|
|
|
if (color.a > 0.0 && colSet)
|
|
|
|
color = vec4(funnyColor.r, funnyColor.g, funnyColor.b, color.a);
|
|
|
|
|
|
|
|
gl_FragColor = color;
|
|
|
|
}
|
|
|
|
')
|
2023-01-23 03:25:45 +00:00
|
|
|
public function new(colr:FlxColor)
|
|
|
|
{
|
|
|
|
super();
|
2021-12-08 03:34:01 +00:00
|
|
|
|
2023-01-23 03:25:45 +00:00
|
|
|
this.col = colr;
|
|
|
|
this.colorSet = false;
|
|
|
|
}
|
2021-12-08 03:34:01 +00:00
|
|
|
}
|