add (very) fake halation to the bloom extraction shader

This commit is contained in:
Green Sky 2023-10-31 17:16:06 +01:00
parent 9b173c64a6
commit df949a5afc
No known key found for this signature in database

View File

@ -102,6 +102,9 @@ in vec2 _uv;
out vec3 _out_color; out vec3 _out_color;
// global config, keep it constant
const float fake_halation_strenth = 1.0;
void main() { void main() {
vec3 color = texture(color_tex, _uv).rgb; vec3 color = texture(color_tex, _uv).rgb;
@ -114,7 +117,16 @@ void main() {
//step(vec3(0.0), color) //step(vec3(0.0), color)
//); //);
const vec3 fake_halation_base = vec3(0.03, 0.01, 0.0) * vec3(fake_halation_strenth);
const vec3 fake_halation_extraction_offset = vec3(1.0) - fake_halation_base;
const vec3 fake_halation_bloom_fact = vec3(1.0) + fake_halation_base;
if (fake_halation_strenth <= 0.001) {
_out_color = max(min(color, vec3(0.0)), color - vec3(1.0)); _out_color = max(min(color, vec3(0.0)), color - vec3(1.0));
} else {
_out_color = max(min(color, vec3(0.0)), color - fake_halation_extraction_offset) * fake_halation_bloom_fact;
//_out_color = max(min(color, vec3(0.0)), color - vec3(0.95, 0.97, 1.0)) * vec3(1.10, 1.05, 1.0);
}
})") })")
} }