99// as published by the Free Software Foundation; either version 2
1010// of the License, or (at your option) any later version.
1111
12- const float a = 0.123 ; // empirical constant
13-
1412const float degree_per_px = 0.01 ; // higher value causes blinking due to optimizations in the psf_glow()
15- const float max_square_size = 256.0 ; // px
16- const float max_irradiation = pow ((degree_per_px * max_square_size / a), 2.0 ) / (2.0 * 3.141592653 );
13+ const float max_square_size = 512.0 ; // px
14+ const float glow_scale = 0.123 ; // empirical constant, deg (not to change)
15+ const float max_irradiation = pow ((degree_per_px * max_square_size / glow_scale), 2.0 ) / (2.0 * 3.141592653 );
1716
1817varying vec3 v_color;
1918varying float max_theta;
@@ -25,7 +24,7 @@ attribute float in_PointSize;
2524
2625const float color_saturation_limit = 0.1 ; // the ratio of the minimum color component to the maximum
2726
28- // ! Normalizes the color by its green value and corrects extreme saturation
27+ // Normalizes the color by its green value and corrects extreme saturation
2928vec3 green_normalization(vec3 color)
3029{
3130 // color /= max(color.r, max(color.g, color.b)); // we do this in XYZRGBConverter::convertUnnormalized()
@@ -54,8 +53,8 @@ void main(void)
5453 else
5554 {
5655 // Bright light source (glow mode)
57- float irradiation = atan (in_PointSize / max_irradiation) * max_irradiation; // dimmed brightness
58- max_theta = 0.123 * sqrt (irradiation); // emperical glow radius
56+ float irradiation = atan (in_PointSize / max_irradiation) * max_irradiation; // dimming
57+ max_theta = glow_scale * sqrt (irradiation);
5958 float half_sq = max_theta / degree_per_px;
6059 pointSize = 2.0 * half_sq - 1.0 ;
6160 v_color = color;
0 commit comments