outline shader in progress

This commit is contained in:
Cameron Taylor 2021-03-23 18:43:08 -04:00
parent cafc047da7
commit 03cc7d9099
5 changed files with 32 additions and 3 deletions

Binary file not shown.

View File

@ -41,4 +41,5 @@ shoutouts to mason--for da homies
bonk--get in the discord call
carpal tunnel--game design
downscroll--i dont know what that is
warning--choking hazard
warning--choking hazard
devin chat--what an honorable man

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;
}
*/
}
')