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
1 changed files with 13 additions and 1 deletions

View File

@ -102,6 +102,9 @@ in vec2 _uv;
out vec3 _out_color;
// global config, keep it constant
const float fake_halation_strenth = 1.0;
void main() {
vec3 color = texture(color_tex, _uv).rgb;
@ -114,7 +117,16 @@ void main() {
//step(vec3(0.0), color)
//);
_out_color = max(min(color, vec3(0.0)), color - vec3(1.0));
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));
} 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);
}
})")
}