how would i go about changing the bar() function to make the bar smaller in vertical size? the reason i'm asking is i'm trying out some designs for foobar with this component and it would look much less blockier if the bar was a little smaller vertically.
i tried hacking the default effect a little to no avail...
The following code may be acceptable and will available for use in the default effect in next release. Tweak the last two parameters to the function to indicate from what amplitude the bar should start fading and which amplitude it's fully gone. For fun, also try reversing the order of them, which would give a bar that's hollow towards zero.
float4 fade_bar( float pos, float2 tc, float4 fg, float4 bg, float width, bool show, float vert_from, float vert_to )
{
float dist = abs(pos - tc.x);
float vertical = smoothstep(vert_from, vert_to, abs(tc.y));
float4 c = show
? lerp(fg, bg, max(vertical, smoothstep(0, width, dist)))
: bg;
return c;
}
For example, to fade from solid at amplitude 0.3 to 0.8: c0 = faded_bar(cursorPos, input.tc, selectionColor, c0, positionWidth, cursorVisible, 0.3, 0.8);