// This is a common technique for modulating brightness.
// You can use abs() to determine the distance between two
// values. The further away this point is from an exact
// point, the more we decrease its brightness
float bv = max(0, 100 - abs(p.x - xPos.getValuef()));
// This is a common technique for modulating brightness.
// You can use abs() to determine the distance between two
// values. The further away this point is from an exact
// point, the more we decrease its brightness
float bv = max(0, 100 - abs(p.x - xPos.getValuef()));