mirror of
https://github.com/Swordfish90/cool-retro-term.git
synced 2025-01-18 12:15:27 +00:00
Fix issues between colors and bloom.
This commit is contained in:
parent
a7210c69ed
commit
1902e34d04
@ -246,6 +246,10 @@ Item{
|
||||
"uniform lowp sampler2D blurredSource;"
|
||||
: "") +
|
||||
|
||||
"float rgb2grey(vec3 v){
|
||||
return dot(v, vec3(0.21, 0.72, 0.04));
|
||||
}" +
|
||||
|
||||
"void main() {" +
|
||||
"vec2 coords = qt_TexCoord0;" +
|
||||
(mScanlines != shadersettings.no_rasterization ? "
|
||||
@ -255,7 +259,7 @@ Item{
|
||||
: "") +
|
||||
"coords = coords + delta;" +
|
||||
"vec4 vcolor = texture2D(source, coords) * 256.0;
|
||||
float color = vcolor.r * 0.21 + vcolor.g * 0.72 + vcolor.b * 0.04;" +
|
||||
float color = rgb2grey(vcolor);" +
|
||||
(mBlur !== 0 ?
|
||||
"vec4 blurredVcolor = texture2D(blurredSource, coords) * 256.0;" +
|
||||
"float blurredSourceColor = texture2D(blurredSource, coords).a * 256.0;" +
|
||||
|
@ -146,6 +146,9 @@ ShaderEffect {
|
||||
return fract(smoothstep(-0.2, 0.0, coords.y - 3.0 * fract(time * 0.0001))) * glowing_line_strength;
|
||||
}" : "") +
|
||||
|
||||
"float rgb2grey(vec3 v){
|
||||
return dot(v, vec3(0.21, 0.72, 0.04));
|
||||
}" +
|
||||
|
||||
"void main() {" +
|
||||
"vec2 cc = vec2(0.5) - qt_TexCoord0;" +
|
||||
@ -187,26 +190,32 @@ ShaderEffect {
|
||||
(glowing_line_strength !== 0 ? "
|
||||
color += randomPass(coords) * glowing_line_strength;" : "") +
|
||||
|
||||
(chroma_color !== 0 ?
|
||||
(chroma_color !== 0 ?
|
||||
"vec4 realBackColor = texture2D(source, txt_coords);" +
|
||||
(saturation_color !== 0 ?
|
||||
"vec4 satured_font_color = mix(font_color, vec4(1) , "+ str(saturation_color) + ");" +
|
||||
"vec4 mixedColor = mix(font_color, realBackColor * satured_font_color, "+ str(chroma_color) +");"
|
||||
:
|
||||
"vec4 mixedColor = mix(font_color, realBackColor * font_color, "+ str(chroma_color) +");"
|
||||
) +
|
||||
|
||||
) +
|
||||
|
||||
"vec4 finalBackColor = mix(background_color, mixedColor, realBackColor.a);" +
|
||||
"vec3 finalColor = mix(finalBackColor, font_color, color).rgb;" :
|
||||
"vec3 finalColor = mix(finalBackColor, font_color, color).rgb;"
|
||||
:
|
||||
"color += texture2D(source, txt_coords).a;" +
|
||||
"vec3 finalColor = mix(background_color, font_color, color).rgb;"
|
||||
) +
|
||||
|
||||
"finalColor *= texture2D(rasterizationSource, coords).a;" +
|
||||
|
||||
(bloom !== 0 ? "
|
||||
finalColor += font_color.rgb *" +
|
||||
"dot(texture2D(bloomSource, coords).rgb, vec3(0.299, 0.587, 0.114)) *" + str(bloom) + ";" : "") +
|
||||
(bloom !== 0 ?
|
||||
"vec3 bloomColor = texture2D(bloomSource, coords).rgb;" +
|
||||
(chroma_color !== 0 ?
|
||||
"bloomColor = font_color.rgb * mix(vec3(rgb2grey(bloomColor)), bloomColor, "+str(chroma_color)+");"
|
||||
:
|
||||
"bloomColor = font_color.rgb * rgb2grey(bloomColor);") +
|
||||
"finalColor += bloomColor * "+str(bloom)+";"
|
||||
: "") +
|
||||
|
||||
(brightness_flickering !== 0 ? "
|
||||
finalColor *= brightness;" : "") +
|
||||
|
Loading…
x
Reference in New Issue
Block a user