1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2024-12-28 15:57:42 +00:00

outline shader in progress

This commit is contained in:
Cameron Taylor 2021-03-23 18:43:08 -04:00
parent dd49ae7990
commit 9397334792
2 changed files with 30 additions and 2 deletions

View file

@ -1,7 +1,10 @@
package;
import flixel.FlxG;
import flixel.addons.effects.chainable.FlxEffectSprite;
import flixel.addons.effects.chainable.FlxOutlineEffect;
import flixel.group.FlxGroup.FlxTypedGroup;
import flixel.util.FlxColor;
import shaderslmfao.ColorSwap;
class ColorpickSubstate extends MusicBeatSubstate
@ -24,6 +27,14 @@ class ColorpickSubstate extends MusicBeatSubstate
note.x = (100 * i) + i;
note.screenCenter(Y);
var _effectSpr:FlxEffectSprite = new FlxEffectSprite(note, [new FlxOutlineEffect(FlxOutlineMode.FAST, FlxColor.WHITE, 4, 1)]);
add(_effectSpr);
_effectSpr.y = 0;
_effectSpr.x = i * 80;
_effectSpr.antialiasing = true;
_effectSpr.setGraphicSize(Std.int(_effectSpr.width * 0.7));
_effectSpr.updateHitbox();
grpNotes.add(note);
}
}

View file

@ -53,6 +53,9 @@ class ColorSwapShader extends FlxShader
uniform float uTime;
uniform float money;
const float offset = 1.0 / 128.0;
vec3 normalizeColor(vec3 color)
{
return vec3(
@ -93,8 +96,22 @@ class ColorSwapShader extends FlxShader
// money += swagColor[0];
color = vec4(hsv2rgb(vec3(swagColor[0], swagColor[1], swagColor[2])), swagColor[3]);
gl_FragColor = color;
/*
if (color.a > 0.5)
gl_FragColor = color;
else
{
float a = flixel_texture2D(bitmap, vec2(openfl_TextureCoordv + offset, openfl_TextureCoordv.y)).a +
flixel_texture2D(bitmap, vec2(openfl_TextureCoordv, openfl_TextureCoordv.y - offset)).a +
flixel_texture2D(bitmap, vec2(openfl_TextureCoordv - offset, openfl_TextureCoordv.y)).a +
flixel_texture2D(bitmap, vec2(openfl_TextureCoordv, openfl_TextureCoordv.y + offset)).a;
if (color.a < 1.0 && a > 0.0)
gl_FragColor = vec4(0.0, 0.0, 0.0, 0.8);
else
gl_FragColor = color;
}
*/
}
')