mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-04 10:40:09 -06:00
Fixed bloom. Improved performance.
This commit is contained in:
@@ -30,21 +30,24 @@ layout(location = 1) out vec4 gPosition;
|
||||
layout(location = 2) out vec4 gNormal;
|
||||
layout(location = 3) out vec4 filterBuffer;
|
||||
|
||||
uniform bool automaticBloom;
|
||||
uniform float bloom_thresh_min;
|
||||
uniform float bloom_thresh_max;
|
||||
|
||||
void main() {
|
||||
Fragment f = getFragment();
|
||||
_out_color_ = f.color;
|
||||
gPosition = f.gPosition;
|
||||
gNormal = f.gNormal;
|
||||
|
||||
bool automaticBloom = false;
|
||||
if (automaticBloom) {
|
||||
// Extract luminance
|
||||
float Y = dot(f.color.rgb, vec3(0.299, 0.587, 0.144));
|
||||
|
||||
// Apply Bloom on the bloom threshold range values
|
||||
//vec4 bColor = f.color * 4.0 * smoothstep(bloom_thresh_min, bloom_thresh_max, Y);
|
||||
//filterBuffer = bColor
|
||||
filterBuffer = vec4(f.filterFlag);
|
||||
vec3 bColor = f.color.rgb * 4.0 * smoothstep(bloom_thresh_min, bloom_thresh_max, Y);
|
||||
|
||||
filterBuffer = vec4(bColor, f.color.a);
|
||||
} else {
|
||||
if (f.filterFlag == 1)
|
||||
filterBuffer = f.color;
|
||||
|
||||
Reference in New Issue
Block a user