1
0
mirror of https://github.com/Swordfish90/cool-retro-term.git synced 2025-01-18 12:15:27 +00:00

Use offline saturation color. Better and a little bit faster.

This commit is contained in:
Filippo Scognamiglio 2014-08-06 19:07:30 +02:00
parent f4771d4f37
commit 7f5a47f8a4
2 changed files with 4 additions and 8 deletions

View File

@ -59,8 +59,9 @@ Item{
property string _background_color: "#000000"
property string _font_color: "#ff8100"
property color font_color: mix(strToColor(_font_color), strToColor(_background_color), 0.7 + (contrast * 0.3))
property color background_color: mix(strToColor(_background_color), strToColor(_font_color), 0.7 + (contrast * 0.3))
property string saturated_color: mix(strToColor("#FFFFFF"), strToColor(_font_color), saturation_color)
property color font_color: mix(strToColor(saturated_color), strToColor(_background_color), 0.7 + (contrast * 0.3))
property color background_color: mix(strToColor(_background_color), strToColor(saturated_color), 0.7 + (contrast * 0.3))
property real noise_strength: 0.1
property real screen_distortion: 0.1

View File

@ -192,12 +192,7 @@ ShaderEffect {
(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 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;"