mirror of
				https://github.com/Swordfish90/cool-retro-term.git
				synced 2025-10-31 15:12:28 +00:00 
			
		
		
		
	Fix issues between colors and bloom.
This commit is contained in:
		| @@ -246,6 +246,10 @@ Item{ | |||||||
|             "uniform lowp sampler2D blurredSource;" |             "uniform lowp sampler2D blurredSource;" | ||||||
|             : "") + |             : "") + | ||||||
|  |  | ||||||
|  |             "float rgb2grey(vec3 v){ | ||||||
|  |                 return dot(v, vec3(0.21, 0.72, 0.04)); | ||||||
|  |             }" + | ||||||
|  |  | ||||||
|             "void main() {" + |             "void main() {" + | ||||||
|                 "vec2 coords = qt_TexCoord0;" + |                 "vec2 coords = qt_TexCoord0;" + | ||||||
|                 (mScanlines != shadersettings.no_rasterization ? " |                 (mScanlines != shadersettings.no_rasterization ? " | ||||||
| @@ -255,7 +259,7 @@ Item{ | |||||||
|                 : "") + |                 : "") + | ||||||
|                 "coords = coords + delta;" + |                 "coords = coords + delta;" + | ||||||
|                 "vec4 vcolor = texture2D(source, coords) * 256.0; |                 "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 ? |                 (mBlur !== 0 ? | ||||||
|                     "vec4 blurredVcolor = texture2D(blurredSource, coords) * 256.0;" + |                     "vec4 blurredVcolor = texture2D(blurredSource, coords) * 256.0;" + | ||||||
|                     "float blurredSourceColor = texture2D(blurredSource, coords).a * 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; |                 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() {" + |         "void main() {" + | ||||||
|             "vec2 cc = vec2(0.5) - qt_TexCoord0;" + |             "vec2 cc = vec2(0.5) - qt_TexCoord0;" + | ||||||
| @@ -197,16 +200,22 @@ ShaderEffect { | |||||||
|                 ) + |                 ) + | ||||||
|  |  | ||||||
|                 "vec4 finalBackColor = mix(background_color, mixedColor, realBackColor.a);" + |                 "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;" + |                 "color += texture2D(source, txt_coords).a;" + | ||||||
|                 "vec3 finalColor = mix(background_color, font_color, color).rgb;" |                 "vec3 finalColor = mix(background_color, font_color, color).rgb;" | ||||||
|             ) + |             ) + | ||||||
|  |  | ||||||
|             "finalColor *= texture2D(rasterizationSource, coords).a;" + |             "finalColor *= texture2D(rasterizationSource, coords).a;" + | ||||||
|  |  | ||||||
|             (bloom !== 0 ? " |             (bloom !== 0 ? | ||||||
|                 finalColor += font_color.rgb *" +  |                 "vec3 bloomColor = texture2D(bloomSource, coords).rgb;" + | ||||||
|                 "dot(texture2D(bloomSource, coords).rgb, vec3(0.299, 0.587, 0.114)) *" + str(bloom) + ";" : "") + |                 (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 ? " |             (brightness_flickering !== 0 ? " | ||||||
|                 finalColor *= brightness;" : "") + |                 finalColor *= brightness;" : "") + | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user