Files
MapLibreParticleLab/shaders/drawable.collision_box.fragment.glsl
Bart Louwers c79b6dcf52 Add end-of-file-fixer pre-commit hook (#3176)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-01-24 20:43:50 +01:00

21 lines
399 B
GLSL

in float v_placed;
in float v_notUsed;
void main() {
float alpha = 0.5;
// Red = collision, hide label
fragColor = vec4(1.0, 0.0, 0.0, 1.0) * alpha;
// Blue = no collision, label is showing
if (v_placed > 0.5) {
fragColor = vec4(0.0, 0.0, 1.0, 0.5) * alpha;
}
if (v_notUsed > 0.5) {
// This box not used, fade it out
fragColor *= .1;
}
}