mirror of
https://github.com/Swordfish90/cool-retro-term.git
synced 2025-01-31 02:01:19 +00:00
Fix issues between colors and motion blur.
This commit is contained in:
parent
876e6079d4
commit
4b4fabaee3
@ -255,16 +255,18 @@ 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 = vcolor.r * 0.21 + vcolor.g * 0.72 + vcolor.b * 0.04;" +
|
||||
(mBlur !== 0 ?
|
||||
"vec4 blurredVcolor = texture2D(blurredSource, coords) * 256.0;" +
|
||||
"float blurredSourceColor = texture2D(blurredSource, coords).a * 256.0;" +
|
||||
"blurredSourceColor = blurredSourceColor - blurredSourceColor * " + (1.0 - motionBlurCoefficient) * fpsAttenuation+ ";" +
|
||||
"vcolor = step(1.0, color) * vcolor + step(color, 1.0) * blurredVcolor;" +
|
||||
"color = step(1.0, color) * color + step(color, 1.0) * blurredSourceColor;"
|
||||
: "") +
|
||||
|
||||
|
||||
"gl_FragColor = texture2D(source, coords);" +
|
||||
"gl_FragColor.a = color / 256.0;" +
|
||||
"gl_FragColor = floor(vcolor) / 256.0;" +
|
||||
"gl_FragColor.a = floor(color) / 256.0;" +
|
||||
"}"
|
||||
|
||||
onStatusChanged: if (log) console.log(log) //Print warning messages
|
||||
|
@ -191,7 +191,8 @@ ShaderEffect {
|
||||
"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 * satured_font_color, "+ str(chroma_color) +");"
|
||||
:
|
||||
"vec4 mixedColor = mix(font_color, realBackColor * font_color, "+ str(chroma_color) +");"
|
||||
) +
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user