mirror of
https://github.com/MadeOfJelly/MushMachine.git
synced 2024-12-05 03:33:27 +01:00
add (very) fake halation to the bloom extraction shader
This commit is contained in:
parent
9b173c64a6
commit
df949a5afc
@ -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)
|
||||||
//);
|
//);
|
||||||
|
|
||||||
_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);
|
||||||
|
}
|
||||||
})")
|
})")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user