Skip to content

Commit

Permalink
Merge pull request #129 from sreich/notes-outline
Browse files Browse the repository at this point in the history
Add rectangular outline to notes (work version).
  • Loading branch information
kosua20 authored Aug 1, 2023
2 parents a4f705e + 6cf0e26 commit 1ff3785
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions resources/shaders/notes.frag
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,23 @@ void main(){
if( radiusPosition > 1.0){
discard;
}

// Fragment color.
int cid = int(In.channel);
fragColor.rgb = colorScale * mix(baseColor[cid], minorColor[cid], In.isMinor);

if( radiusPosition > 0.8){
fragColor.rgb *= 1.05;
}

if( radiusPosition > 0.4){
//outer border
fragColor.rgb *= 1.5;
} else {
//inner
fragColor.rgb *= 0.8;
}

float distFromBottom = horizontalMode ? normalizedCoord.x : normalizedCoord.y;
float fadeOutFinal = min(fadeOut, 0.9999);
distFromBottom = max(distFromBottom - fadeOutFinal, 0.0) / (1.0 - fadeOutFinal);
float alpha = 1.0 - distFromBottom;

fragColor.a = alpha;
}

0 comments on commit 1ff3785

Please sign in to comment.