From edbc16417df50f7f56c151b7fea0b68815806361 Mon Sep 17 00:00:00 2001 From: Hleb Valoshka <375gnu@gmail.com> Date: Mon, 15 Mar 2021 00:13:15 +0200 Subject: [PATCH] wip --- shaders/star_new_frag.glsl | 2 +- shaders/star_new_vert.glsl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/shaders/star_new_frag.glsl b/shaders/star_new_frag.glsl index de7b1d4b9..632b58dd9 100644 --- a/shaders/star_new_frag.glsl +++ b/shaders/star_new_frag.glsl @@ -31,5 +31,5 @@ void main() float spikes = (max(0.0, 1.0 - abs(offset.x + offset.y)) + max(0.0, 1.0 - abs(offset.x - offset.y))) * diffSpikeBrightness; b += glareBrightness / (glareFalloff * pow(r2, 1.5) + 1.0) * (spikes + 0.5); #endif - gl_FragColor = vec4(linearToSRGB(b * exposure * color.rgb * brightness * 5.0), 1.0); + gl_FragColor = vec4(linearToSRGB(b * min(500.0, exposure) * color.rgb * brightness * 5.0), 1.0); } diff --git a/shaders/star_new_vert.glsl b/shaders/star_new_vert.glsl index 73318eb2a..8c17838a2 100644 --- a/shaders/star_new_vert.glsl +++ b/shaders/star_new_vert.glsl @@ -32,7 +32,7 @@ void main() vec2 devicePosition = projectedPosition.xy / projectedPosition.w; pointCenter = (devicePosition * 0.5 + vec2(0.5, 0.5)) * viewportSize + viewportCoord; color = in_Color; - float b = pow(2.512, min(-3.5, -appMag * magScale)); + float b = pow(2.512, -appMag * magScale); float r2 = -log(thresholdBrightness / (exposure * b)) * 2.0 * sigma2; float rGlare2 = (exposure * glareBrightness * b / thresholdBrightness - 1.0) / glareFalloff; gl_PointSize = 2.0 * sqrt(max(r2, rGlare2));