1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2025-01-26 22:56:48 +00:00

color tint for angle mask shader

This commit is contained in:
FabsTheFabs 2024-08-30 01:03:11 +01:00
parent de03da7e6f
commit 0c809c828e

View file

@ -1,12 +1,25 @@
package funkin.graphics.shaders; package funkin.graphics.shaders;
import flixel.system.FlxAssets.FlxShader; import flixel.system.FlxAssets.FlxShader;
import flixel.util.FlxColor;
class AngleMask extends FlxShader class AngleMask extends FlxShader
{ {
public var extraColor(default, set):FlxColor = 0xFFFFFFFF;
function set_extraColor(value:FlxColor):FlxColor
{
extraTint.value = [value.redFloat, value.greenFloat, value.blueFloat];
this.extraColor = value;
return this.extraColor;
}
@:glFragmentSource(' @:glFragmentSource('
#pragma header #pragma header
uniform vec3 extraTint;
uniform vec2 endPosition; uniform vec2 endPosition;
vec2 hash22(vec2 p) { vec2 hash22(vec2 p) {
vec3 p3 = fract(vec3(p.xyx) * vec3(.1031, .1030, .0973)); vec3 p3 = fract(vec3(p.xyx) * vec3(.1031, .1030, .0973));
@ -69,6 +82,7 @@ class AngleMask extends FlxShader
void main() { void main() {
vec4 col = antialias(openfl_TextureCoordv); vec4 col = antialias(openfl_TextureCoordv);
col.xyz = col.xyz * extraTint.xyz;
// col.xyz = gamma(col.xyz); // col.xyz = gamma(col.xyz);
gl_FragColor = col; gl_FragColor = col;
}') }')
@ -77,5 +91,6 @@ class AngleMask extends FlxShader
super(); super();
endPosition.value = [90, 100]; // 100 AS DEFAULT WORKS NICELY FOR FREEPLAY? endPosition.value = [90, 100]; // 100 AS DEFAULT WORKS NICELY FOR FREEPLAY?
extraTint.value = [1, 1, 1];
} }
} }